Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to install a Linux kernel (3.8.1) from source in a Fedora distribution. The kernel is a vanilla one. I follow the kernel's build instructions closely that is:

make menuconfig
make
sudo make modules_install install
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Everything in /boot seems fine. I can see System.map, initramfs, and vmlinuz for the newly compiled kernel. The vmlinuz link points to vmlinuz-3.8.1. There are multiple other kernels installed including an Ubuntu one. grub2 recognises all of them and I can boot to each one of them.

When I reboot I see all kernels as menu entries and choose 3.8.1.

Then I see this message:

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

Solution:

All three posted responses provide the solution. CONFIG_DEVTMPFS was in fact causing the issue. I copied a working kernel's /boot/config-… into the root of the source tree as .config and executed the standard commands for building the kernel also shown above.

share|improve this question

migrated from serverfault.com Feb 25 at 16:06

This question came from our site for professional system and network administrators.

1  
Why are you building such an old kernel, BTW? –  vonbrand Feb 25 at 16:24
    
It depends on one's own definition of old. I, for example, would consider v2.6 old :-). I am doing some tests on kernel data structures for research purposes. This version was at my hand's reach, but many others would do just fine. –  mfrank.23 Feb 26 at 18:34

3 Answers 3

up vote 2 down vote accepted

Easiest way to get a working kernel configuration is to just copy Fedora's .config over and then do a make oldconfig to configure it. The configuration is found at /boot/config-*

share|improve this answer

You need to configure your kernel with these options:

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
share|improve this answer

Looking at a similar issue on a custom system running systemd it seems this may be because "CONFIG_DEVTMPFS" is not selected in the kernel configuration (notice this is the first thing on sciurus's list of kernel requirements for running systemd).

To now figure out how to correct this, start make menuconfig and use the search feature (press /) to look for "DEVTMPFS". The first hit is:

Symbol: DEVTMPFS [=y]  
Type  : boolean  
Prompt: Maintain a devtmpfs filesystem to mount at /dev                                                  
  Location:                                            
    -> Device Drivers
(1)   -> Generic Driver Options   

Low and behold, there is such an option in Device Drivers->Generic Driver Options.

As vonbrand says, you are best off starting with a configuration that matches what you have now. This can probably be found gzipped as /proc/config.gz. Copy that out and gunzip -c config.gz > .config and use that file as the preliminary .config in your source tree (more detail in step #2 here).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.