How to create an initrd image on OpenSuSE linux?

27,477

Solution 1

You should be using mkinitramfs, not mkinitrd. The actual initrd format is obsolete and initramfs is used instead these days, even though it is still called an initrd. Better yet, just use update-initramfs. Also you need to run make modules_install to install the modules.

Solution 2

With OpenSUSE, you can use

yast2 sysconfig

fill in 'INITRD_MODULES' with module you need and apply.

Share:
27,477

Related videos on Youtube

Aquarius_Girl
Author by

Aquarius_Girl

Arts and Crafts.stackexchange.com is in public beta now. Join us!

Updated on September 18, 2022

Comments

  • Aquarius_Girl
    Aquarius_Girl over 1 year
    /usr/src/linux-3.2.1 # make install
    scripts/kconfig/conf --silentoldconfig Kconfig
    sh /usr/src/linux-3.2.1/arch/x86/boot/install.sh 3.2.1-12-desktop arch/x86/boot/bzImage \
                    System.map "/boot"
    You may need to create an initial ramdisk now.
    

    --

    /boot # mkinitrd initrd-3.2.1-12-desktop.img 3.2.1-12-desktop
    
    Kernel image:   /boot/vmlinuz-2.6.34-12-desktop
    Initrd image:   /boot/initrd-2.6.34-12-desktop
    Kernel Modules: <not available>
    Could not find map initrd-3.2.1-12-desktop.img/boot/System.map, please specify a correct file with -M.
    There was an error generating the initrd (9)
    

    See the error during mkinitrd command. What's the point that I am missing?
    What does this mean? Kernel Modules: <not available>

    OpenSuse 11.3 64 bit

    EDIT1:

    I did "make modules".
    I copied the System.map file from the /usr/src/linux-3.2.1 directory to /boot, now running initrd command gives the following error:

    linux-dopx:/boot # mkinitrd initrd-3.2.1.img 3.2.1-desktop
    
    Kernel image:   /boot/vmlinuz-2.6.34-12-desktop
    Initrd image:   /boot/initrd-2.6.34-12-desktop
    Kernel Modules: <not available>
    Could not find map initrd-3.2.1.img/boot/System.map, please specify a correct file with -M.
    
    Kernel image:   /boot/vmlinuz-3.2.1-12-desktop
    Initrd image:   /boot/initrd-3.2.1-12-desktop
    Kernel Modules: <not available>
    Could not find map initrd-3.2.1.img/boot/System.map, please specify a correct file with -M.
    
    Kernel image:   /boot/vmlinuz-3.2.1-12-desktop.old
    Initrd image:   /boot/initrd-3.2.1-12-desktop.old
    Kernel Modules: <not available>
    Could not find map initrd-3.2.1.img/boot/System.map, please specify a correct file with -M.
    There was an error generating the initrd (9)
    
    • bsd
      bsd about 12 years
      Which distro? And the comment does say MAY, using Gentoo I don't bother with making an initrd, they're not necessary.
    • Aquarius_Girl
      Aquarius_Girl about 12 years
      @bdowning sorry, have edited it. :)
  • Nikhil Mulley
    Nikhil Mulley about 12 years
    btw, I will carve out a seperate question for difference between initrd and initramfs, it will make a good Q&A :-)
  • Aquarius_Girl
    Aquarius_Girl about 12 years
    mkinitramfs gives command not found on Suse.
  • psusi
    psusi about 12 years
    @AnishaKaul, I guess Suse has a different tool for building it. Debian based distributions use the initramfs-tools package.
  • Aquarius_Girl
    Aquarius_Girl about 12 years
    SOLVED: The reason for these errors was that I was trying to make an initrd image before running make modules_install. So, now I ran make modules_install and initrd image got automatically created in /boot.
  • Aquarius_Girl
    Aquarius_Girl about 12 years
    CONCLUSION: On Kernel 3 onwards we don't have to create an initrd image, it gets created automatically after make modules_install.
  • RMuesi
    RMuesi over 11 years
    @AnishaKaul, that is the expected behavior, as documented in the README file of the kernel sources.