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.

  1. mkinitrd and_put_here_name_of_kernel
  2. /sbin/mkinitrd -d /dev/sda1 will regenerate mkinitrd for ever kernel on that partition… Ups.

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

See “man 8 mkinitrd”:

       **-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.

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)

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.

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)