4

I have a virtual machine with Ubuntu 14.04 in it. I recently built and installed linux-3.14.5 kernel on it, and tried to boot into it, but it drops me to BusyBox v1.21.1 built-in shell.

Here's what I did:

    wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.5.tar.xz 
    mkdir ~/linux 
    mv linux-3.14.5.tar.xz ~/linux 
    tar -xJf linux-3.14.5.tar.xz 
    mkdir linux-3.14.5 
    cd linux-3.14.5_src/ 
    make defconfig O=../linux-3.14.5
    make menuconfig O=../linux-3.14.5  /* i didn't change anything */
    make O=../linux-3.14.5
    cd ../linux-3.14.5
    sudo make install

I could see a file called initrd.img-3.14.5 in /boot alongside the intrd.img-3.13.0-24-generic (which i guess, is the kernel of Ubuntu 14.04).

There were also 2 files called vmlinuz-3.14.5 and vmlinuz-3.13.0-24-generic.

After that, ran

    sudo blkid

and got the following:

    /dev/sda1: UUID="92ec153c-cb92-4300-8d2a-f63b747ddd35" TYPE="ext4" 
    /dev/sda5: UUID="439a6423-28dc-4363-b47e-580f1e65e951" TYPE="swap"

I also ran

    sudo fdisk -l

which gave me

    Disk /dev/sda: 21.5 GB, 21474836480 bytes
    255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000268be

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048    39845887    19921920   83  Linux
    /dev/sda2        39847934    41940991     1046529    5  Extended
    /dev/sda5        39847936    41940991     1046528   82  Linux swap / Solaris

I checked the /boot/grub/grub.cfg file which had the following entry:

    menuentry 'Ubuntu, with Linux 3.13.0-24-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-24-generic-advanced-92ec153c-cb92-4300-8d2a-f63b747ddd35' {
            recordfail
            load_video
            gfxmode $linux_gfx_mode
            insmod gzio
            insmod part_msdos
            insmod ext2
            set root='hd0,msdos1'
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  92ec153c-cb92-4300-8d2a-f63b747ddd35
            else
              search --no-floppy --fs-uuid --set=root 92ec153c-cb92-4300-8d2a-f63b747ddd35
            fi
            echo    'Loading Linux 3.13.0-24-generic ...'
            linux   /boot/vmlinuz-3.13.0-24-generic root=UUID=92ec153c-cb92-4300-8d2a-f63b747ddd35 ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet
            echo    'Loading initial ramdisk ...'
            initrd  /boot/initrd.img-3.13.0-24-generic
    }

So, I went ahead and added the following lines to /etc/grub.d/40_custom ( i just changed lines 1, 14, 15 and 17)

    menuentry 'MyNewKernel' {
        recordfail
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  92ec153c-cb92-4300-8d2a-f63b747ddd35
        else
          search --no-floppy --fs-uuid --set=root 92ec153c-cb92-4300-8d2a-f63b747ddd35
        fi
        echo    'Loading My New Kernel ...'
        linux   /boot/vmlinuz-3.14.5 root=UUID=92ec153c-cb92-4300-8d2a-f63b747ddd35 ro recovery nomodeset find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.14.5
}

and ran

    sudo update-grub
    sudo reboot

Did not work! The error message said

    ALERT! /dev/disk/by-uuid/92ec153c-cb92-4300-8d2a-f63b747ddd35 does not exist.
    Dropping to a shell!

So I've tried to replace the UUID by /dev/sda1 resulting in the following file.

    menuentry 'MyNewKernel' {
            recordfail
            load_video
            insmod gzio
            insmod part_msdos
            insmod ext2
            set root='hd0,msdos1'
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  /dev/sda1
            else
              search --no-floppy --fs-uuid --set=root /dev/sda1
            fi
            echo    'Loading Linux 3.13.0-24-generic ...'
            linux   /boot/vmlinuz-3.14.5 root=/dev/sda1 ro recovery nomodeset find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US
            echo    'Loading initial ramdisk ...'
            initrd  /boot/initrd.img-3.14.5
    }

That did not work either, and gave me a very similar error message.

    ALERT! /dev/sda1 does not exist.
    Dropping to a shell!

I think I'm doing some stupid mistake, but I can't figure out what since this is my first time. I would appreciate any help.

Thanks for reading through the long post. Please let me know if you need any more information.

4
  • You are probably missing the kernel modules for your Disk controller. Is it using SATA or IDE? Try modprobe ahci and see if /dev/sda shows up. If so, you can just type exit and let the boot continue;
    – penguin359
    Jun 4, 2014 at 22:09
  • @penguin359 : Thanks for responding. I ran modprobe ahci and it returned nothing. Also, i am not sure how to check whether the disk controller uses SATA or IDE. How do I do that?
    – user288409
    Jun 4, 2014 at 22:52
  • modprobe won't return anything if it's successful, but it would have created devices under /dev for the SATA disks if it found them. All you have to do after modprobe is type exit if the correct devices were found. If you have IDE drives, you should try to modprobe ide-disk. You can safely modprobe both and one or the other will most likely create the appropriate /dev files. One modprobe is complete, try typing exit.
    – penguin359
    Jun 11, 2014 at 12:25
  • What are you using for host OS? Which VM hypervisor?
    – bsd
    Jun 11, 2014 at 15:46

1 Answer 1

3

You have missed two steps before the make install, which installs the required drivers. Before make install do make modules and make modules_install in that order. This installs drivers based on your .config files.

The error can also happen due to improper configuration in the .config file and hence some missing drivers. So here is a hackish way to do the kernel compilation. One of the best ways to get the right configuration is to copy a working configuration from the /boot directory to your .config in kernel source code folder. Your working kernel config file is

/boot/config-`uname -r`

Then do the compilation with make . make will prompt for some configurations, which are not in the .config file, because this .config file may be corresponds to an old kernel and does not have the some configurations in the new kernel you are trying to compile. Just type in Enter for the all the configuration prompts - which will select default configurations. Then do make modules, make modules_install and finally make install . This must solve your issues.

This way of compilation is not suitable for a professional, but will help newbies without much knowledge of different configuration options to get started with kernel compilation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .