Today I got a
systemd-242.0-3 update (plus some related). After installing that package, terminal shows initramfs is build from scratch. The output is like this:
:: Running post-transaction hooks... (1/9) Updating linux initcpios... ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default' -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img ==> Starting build: 5.0.9-arch1-1-ARCH -> Running build hook: [base] -> Running build hook: [udev] -> Running build hook: [autodetect] -> Running build hook: [modconf] -> Running build hook: [block] -> Running build hook: [filesystems] -> Running build hook: [keyboard] -> Running build hook: [fsck] ==> Generating module dependencies ==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img ==> Image generation successful
According to LFS:
At boot time, the boot loader loads the kernel and the initramfs image into memory and starts the kernel. The kernel checks for the presence of the initramfs and, if found, mounts it as / and runs /init. The init program is typically a shell script. Note that the boot process takes longer, possibly significantly longer, if an initramfs is used.
I open the
/boot/initramfs-linux.img with gzip and cpio tools and it contains whole
/usr/lib/systemd folder. Shouldn't it contain only the kernel? Why does systemd also present in initramfs? Will not it be faster to place kernel in RAM and loads systemd from disk?