mfr*_*.23 7 linux compiling kernel
我正在尝试从 Fedora 发行版中的源代码安装 Linux 内核 (3.8.1)。内核是香草内核。我密切关注内核的构建说明,即:
make menuconfig
make
sudo make modules_install install
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Run Code Online (Sandbox Code Playgroud)
里面的一切/boot似乎都很好。我可以看到新编译的内核的System.map, initramfs, 和vmlinuz。该vmlinuz链接指向vmlinuz-3.8.1。安装了多个其他内核,包括一个 Ubuntu 内核。grub2 可以识别所有这些,我可以引导到其中的每一个。
当我重新启动时,我将所有内核视为菜单项并选择 3.8.1。
然后我看到这个消息:
early console in decompress_kernel
decompressing Linux... parsing ELF ... done
Booting the kernel.
[1.687084] systemd [1]:failed to mount /dev:no such device
[1.687524] systemd [1]:failed to mount /dev:no such device
Run Code Online (Sandbox Code Playgroud)
解决方案:
所有三个发布的回复都提供了解决方案。CONFIG_DEVTMPFS 实际上是导致问题的原因。我将工作内核的 /boot/config-... 作为 .config 复制到源代码树的根目录中,并执行了构建内核的标准命令,也如上所示。
您需要使用以下选项配置内核:
Linux kernel >= 3.0
CONFIG_DEVTMPFS
CONFIG_CGROUPS (it's OK to disable all controllers)
CONFIG_INOTIFY_USER
CONFIG_SIGNALFD
CONFIG_TIMERFD
CONFIG_EPOLL
CONFIG_NET
CONFIG_SYSFS
CONFIG_PROC_FS
CONFIG_FHANDLE (libudev, mount and bind mount handling)
Linux kernel >= 3.8 for Smack support
Udev will fail to work with the legacy layout:
CONFIG_SYSFS_DEPRECATED=n
Legacy hotplug slows down the system and confuses udev:
CONFIG_UEVENT_HELPER_PATH=""
Userspace firmware loading is deprecated, will go away, and
sometimes causes problems:
CONFIG_FW_LOADER_USER_HELPER=n
Some udev rules and virtualization detection relies on it:
CONFIG_DMIID
Support for some SCSI devices serial number retrieval, to
create additional symlinks in /dev/disk/ and /dev/tape:
CONFIG_BLK_DEV_BSG
Optional but strongly recommended:
CONFIG_IPV6
CONFIG_AUTOFS4_FS
CONFIG_TMPFS_POSIX_ACL
CONFIG_TMPFS_XATTR
CONFIG_SECCOMP
For systemd-bootchart, several proc debug interfaces are required:
CONFIG_SCHEDSTATS
CONFIG_SCHED_DEBUG
For UEFI systems:
CONFIG_EFI_VARS
CONFIG_EFI_PARTITION
Note that kernel auditing is broken when used with systemd's
container code. When using systemd in conjunction with
containers, please make sure to either turn off auditing at
runtime using the kernel command line option "audit=0", or
turn it off at kernel compile time using:
CONFIG_AUDIT=n
Run Code Online (Sandbox Code Playgroud)