Results 1 to 7 of 7

Thread: Trimming down initrd (to zero if possible) ?

  1. #1

    Default Trimming down initrd (to zero if possible) ?

    1) Can OpenSuSE work without initrd if / is on /dev/sda1 on ext4?
    2) How can I regenerate initrd with OpenSuSE defaults? (Every new kernel will have initrd with those, so I think that I will just go ahead with them)
    3) Anything else should I know about initrd?


    PS Sorry if that is X^Y thread about this topic. Can not find via google anything useful here.

  2. #2

    Default Re: Trimming down initrd (to zero if possible) ?

    Quote Originally Posted by przemo_li View Post
    1) Can OpenSuSE work without initrd if / is on /dev/sda1 on ext4?
    2) How can I regenerate initrd with OpenSuSE defaults? (Every new kernel will have initrd with those, so I think that I will just go ahead with them)
    3) Anything else should I know about initrd?
    2) mkinitrd and_put_here_name_of_kernel
    3) /sbin/mkinitrd -d /dev/sda1 will regenerate mkinitrd for ever kernel on that partition... Ups.

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,832

    Default Re: Trimming down initrd (to zero if possible) ?

    I assume that reading this: initrd - Wikipedia, the free encyclopedia could help you understand if a Linux systen can boot without initrd.
    Henk van Velden

  4. #4

    Default Re: Trimming down initrd (to zero if possible) ?

    Quote Originally Posted by przemo_li View Post
    2) mkinitrd and_put_here_name_of_kernel
    3) /sbin/mkinitrd -d /dev/sda1 will regenerate mkinitrd for ever kernel on that partition... Ups.
    See "man 8 mkinitrd":
    Code:
           -k kernel_list
               List of kernel images for which initrd files are created (relative
               to boot_dir), defaults to vmlinux on ppc/ppc64, image on s390/s390x
               and vmlinuz for everything else.

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Trimming down initrd (to zero if possible) ?

    On 2014-01-06 13:16, przemo li wrote:
    >
    > 1) Can OpenSuSE work without initrd if / is on /dev/sda1 on ext4?


    That's is very difficult to achieve. The distribution is designed to
    work with it, for several reasons. To undo those reasons you have to be
    an expert and fight it. Hard.

    You will hit many problems and probably bugs - but the moment the devs
    heard you remove initrd, they will stop listening and the bug will be
    closed as "wontfix". That's IMNSHO.

    Someone on the mail list is doing this. So you might ask her/him in that
    mail list. Or just pop the the same question as here. But first you must
    learn a lot about Linux...

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.3 x86_64 "Dartmouth" at Telcontar)

  6. #6
    Join Date
    Jun 2008
    Location
    Kansas City Area, Missouri, USA
    Posts
    7,236

    Default Re: Trimming down initrd (to zero if possible) ?

    On 01/06/2014 09:13 AM, Carlos E. R. wrote:
    > On 2014-01-06 13:16, przemo li wrote:
    >>
    >> 1) Can OpenSuSE work without initrd if / is on /dev/sda1 on ext4?

    >
    > That's is very difficult to achieve. The distribution is designed to
    > work with it, for several reasons. To undo those reasons you have to be
    > an expert and fight it. Hard.
    >
    > You will hit many problems and probably bugs - but the moment the devs
    > heard you remove initrd, they will stop listening and the bug will be
    > closed as "wontfix". That's IMNSHO.
    >
    > Someone on the mail list is doing this. So you might ask her/him in that
    > mail list. Or just pop the the same question as here. But first you must
    > learn a lot about Linux...


    To do this, you need to build your own kernel with *EVERY* driver that the
    system will need *before* the root file system (/) is mounted built into the
    kernel, not as a module. That list includes the file system, the disk drivers
    (there are several layers), any drivers needed for keyboard, the rudimentary
    graphics driver, and some that I have probably forgotten. The only way to be
    sure is to run the command 'make allyesconfig' before you build the kernel.

    It will be a lot of work, and as noted above, the devs won't help. Are you sure
    you really want to do that? If your reason is to save space in /boot, all you
    are doing is transferring code from initrd to the kernel image. Little or no
    space will be saved.



  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Trimming down initrd (to zero if possible) ?

    On 2014-01-06 18:36, Larry Finger wrote:

    > To do this, you need to build your own kernel with *EVERY* driver that
    > the system will need *before* the root file system (/) is mounted built
    > into the kernel, not as a module. That list includes the file system,
    > the disk drivers (there are several layers), any drivers needed for
    > keyboard, the rudimentary graphics driver, and some that I have probably
    > forgotten. The only way to be sure is to run the command 'make
    > allyesconfig' before you build the kernel.


    Correct.

    And do that for every kernel upgrade, so you can not do automatic upgrades.


    > It will be a lot of work, and as noted above, the devs won't help. Are
    > you sure you really want to do that? If your reason is to save space in
    > /boot, all you are doing is transferring code from initrd to the kernel
    > image. Little or no space will be saved.


    Right.


    And there are more things, not only kernel modules. There are some boot
    scripts, even copies of fstab, and copies of the fsck modules for
    checking the filesysytems prior to mounting them. Plus, to support
    things like having a separate partition for "/usr", programs and
    libraries have to be copied. Then there are the modules for graphical
    login, like plymouth...

    Many of these can be read from the root partition instead, mounted read
    only. But to do this, the boot process has to be modified.


    Me, with years of expertise, would have a hard time pulling this off.
    Not worth my effort.

    Possible? Yes, it is possible to do. Easy it ain't.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.3 x86_64 "Dartmouth" at Telcontar)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •