【问题标题】:Can't load self-compiled linux kernel无法加载自编译的linux内核
【发布时间】:2017-03-13 16:07:56
【问题描述】:

我从源代码编译了一个 linux 内核,版本是 4.8.5。编译期间一切正常,但我无法加载它。当被要求选择内核版本时,我选择了 4.8.5 后,它很快就遇到了麻烦,屏幕刚刚打印出来:

Loading linux 4.8.5...
error: kernel doesn't support EFI handover
Loading initial ramdisk
error: your need to load the kernel first
Press any key to continue

而我当前有效的内核版本是(来自uname -a):

Linux linux-8ckq 4.1.12-1-default #1 SMP PREEMPT Thu Oct 29 06:43:42 UTC 2015 (e24bad1) x86_64 x86_64 x86_64 GNU/Linux

效果很好。所以我知道新内核或我的配置或硬件一定有问题。而我的硬件信息是(来自lspci):

00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:01.1 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x8 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-LM (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d4)
00:1c.1 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #2 (rev d4)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation QM87 Express LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 04)
02:00.0 VGA compatible controller: NVIDIA Corporation GK208M [GeForce GT 730M] (rev a1)
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)
04:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b)

谁能告诉我如何解决这个问题。真的很感激。

【问题讨论】:

    标签: linux-kernel opensuse uefi


    【解决方案1】:

    您需要使用 EFI 切换支持来编译您的内核,参见例如this Gentoo wiki page.

    Power management and ACPI options --->
        [*] ACPI (Advanced Configuration and Power Interface) Support --->
    Processor type and features  --->
        [*] EFI runtime service support 
        [*]   EFI stub support
    Firmware Drivers  --->
       EFI (Extensible Firmware Interface) Support  --->
           <*> EFI Variable Support via sysfs
    

    【讨论】:

    • 似乎是一个正确的答案。我会试一试。非常感谢。
    • 我想再次感谢你,因为你提醒我我做错的是我使用'make deconfig'来生成不支持那些关于EFI的东西的.config文件。现在我只是从当前运行的内核中复制 .config 文件,它运行良好。也许“make defconfig”还不够。
    • “EFI Variable Support vis sysfs”是旧版本。 “文件系统”->“伪文件系统”->“EFI 变量文件系统”缺少纯 sysfs 接口的一些限制(如果可用,efivars 库将优先使用它)。
    猜你喜欢
    • 2020-04-10
    • 2017-03-09
    • 1970-01-01
    • 2020-03-27
    • 2016-05-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-03
    • 2012-01-02
    相关资源
    最近更新 更多