Skip to content

KernelModulesInitrd=false has no effect #4204

@bhush9

Description

@bhush9

mkosi commit the issue has been seen with

main

Used host distribution

Fedora 43

Used target distribution

Fedora 43

Linux kernel version used

6.18.13-arch1-1

CPU architectures issue was seen on

x86_64

Unexpected behaviour you saw

Despite having

KernelModulesInitrd=false

in the [Content] section, it seems mkosi-initrd creates kernel-initrd always,

➜ sudo find /mnt/test/boot
/mnt/test/boot
/mnt/test/boot/EFI
/mnt/test/boot/EFI/Linux
/mnt/test/boot/EFI/systemd
/mnt/test/boot/EFI/systemd/systemd-bootaa64.efi
/mnt/test/boot/EFI/BOOT
/mnt/test/boot/EFI/BOOT/BOOTAA64.EFI
/mnt/test/boot/fedora
/mnt/test/boot/fedora/6.18.13-200.fc43.aarch64
/mnt/test/boot/fedora/6.18.13-200.fc43.aarch64/vmlinuz
/mnt/test/boot/fedora/6.18.13-200.fc43.aarch64/kernel-modules.initrd
/mnt/test/boot/loader
/mnt/test/boot/loader/entries.srel
/mnt/test/boot/loader/entries
/mnt/test/boot/loader/entries/fedora-6.18.13-200.fc43.aarch64.conf
/mnt/test/boot/loader/keys
/mnt/test/boot/loader/loader.conf
/mnt/test/boot/symvers-6.18.13-200.fc43.aarch64.xz

Used mkosi config

[Distribution]
Distribution=fedora
Release=43
Architecture=arm64

[Output]
Format=disk
CompressOutput=no

[Content]
Initrds=
KernelModulesInitrd=false
Bootable=yes
Bootloader=systemd-boot
UnifiedKernelImages=false

Packages=
    @core
    kernel
    systemd-boot

mkosi output

...
>>> Running %posttrans scriptlet: systemd-resolved-0:258.5-1.fc43.aarch64
>>> Finished %posttrans scriptlet: systemd-resolved-0:258.5-1.fc43.aarch64
>>> Scriptlet output:
>>> '/etc/resolv.conf' -> '../run/systemd/resolve/stub-resolv.conf'
>>>
Complete!
‣  Running depmod for 6.18.13-200.fc43.aarch64
‣  Generating hardware database
‣  Installing systemd-boot…
Running in a chroot, enabling --graceful.
Created "/buildroot/efi/EFI".
Created "/buildroot/efi/EFI/systemd".
Created "/buildroot/efi/EFI/BOOT".
Created "/buildroot/efi/loader".
Created "/buildroot/efi/loader/keys".
Created "/buildroot/boot/loader/entries".
Created "/buildroot/boot/EFI".
Created "/buildroot/boot/EFI/Linux".
Copied "/buildroot/usr/lib/systemd/boot/efi/systemd-bootaa64.efi" to "/buildroot/efi/EFI/systemd/systemd-bootaa64.efi".
Copied "/buildroot/usr/lib/systemd/boot/efi/systemd-bootaa64.efi" to "/buildroot/efi/EFI/BOOT/BOOTAA64.EFI".
Random seed file /buildroot/efi/loader/random-seed successfully written (32 bytes).
‣  Generating system users
‣  Generating volatile files
‣  Applying presets…
Removed '/buildroot/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket'.
Removed '/buildroot/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket'.
Created symlink '/buildroot/etc/systemd/system/multi-user.target.wants/remote-cryptsetup.target''/usr/lib/systemd/system/remote-cryptsetup.target'.
Created symlink '/buildroot/etc/systemd/system/multi-user.target.wants/remote-integritysetup.target''/usr/lib/systemd/system/remote-integritysetup.target'.
Created symlink '/buildroot/etc/systemd/system/multi-user.target.wants/remote-veritysetup.target''/usr/lib/systemd/system/remote-veritysetup.target'.
Created symlink '/buildroot/etc/systemd/system/systemd-homed.service.wants/systemd-homed-activate.service''/usr/lib/systemd/system/systemd-homed-activate.service'.
Created symlink '/buildroot/etc/systemd/system/dbus-org.freedesktop.home1.service''/usr/lib/systemd/system/systemd-homed.service'.
Created symlink '/buildroot/etc/systemd/system/multi-user.target.wants/systemd-homed.service''/usr/lib/systemd/system/systemd-homed.service'.
Created symlink '/buildroot/etc/systemd/system/sysinit.target.wants/systemd-network-generator.service''/usr/lib/systemd/system/systemd-network-generator.service'.
Created symlink '/buildroot/etc/systemd/system/dbus-org.freedesktop.oom1.service''/usr/lib/systemd/system/systemd-oomd.service'.
Created symlink '/buildroot/etc/systemd/system/multi-user.target.wants/systemd-oomd.service''/usr/lib/systemd/system/systemd-oomd.service'.
Created symlink '/buildroot/etc/systemd/system/sockets.target.wants/systemd-oomd.socket''/usr/lib/systemd/system/systemd-oomd.socket'.
Created symlink '/buildroot/etc/systemd/system/sysinit.target.wants/systemd-pstore.service''/usr/lib/systemd/system/systemd-pstore.service'.
Created symlink '/buildroot/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket''/usr/lib/systemd/system/systemd-resolved-varlink.socket'.
Created symlink '/buildroot/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket''/usr/lib/systemd/system/systemd-resolved-monitor.socket'.
‣  Generating disk image
MountPoint= is not specified for any eligible partitions, not generating /etc/fstab
EncryptedVolume= is not specified for any eligible partitions, not generating /etc/crypttab
Pre-populating btrfs filesystem of partition 10-root.conf twice to calculate minimal partition size
Preparing to populate btrfs filesystem.
Ready to populate btrfs filesystem.
btrfs-progs v6.17.1
See https://btrfs.readthedocs.io for more information.

Rootdir from:       /var/tmp/.#repart2a3bf285a0c6fc10
  Compress:         no
  Shrink:           no
Label:              root-arm64
UUID:               acbb7983-e3ae-4709-ba2e-b9cf3ce2c93d
Node size:          16384
Sector size:        4096	(CPU page size: 4096)
Filesystem size:    1.00TiB
Block group profiles:
  Data:             single          976.00MiB
  Metadata:         DUP               1.00GiB
  System:           DUP               8.00MiB
SSD detected:       no
Zoned device:       no
Features:           extref, skinny-metadata, no-holes, free-space-tree
Checksum:           crc32c
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1     1.00TiB  /var/tmp/.#repart016cd1c3b125ef59

/var/tmp/.#repart016cd1c3b125ef59 successfully formatted as btrfs (label "root-arm64", uuid acbb7983-e3ae-4709-ba2e-b9cf3ce2c93d)
Minimal partition size of btrfs filesystem of partition 10-root.conf is 1.1G
btrfs-progs v6.17.1
See https://btrfs.readthedocs.io for more information.

Rootdir from:       /var/tmp/.#repart2a3bf285a0c6fc10
  Compress:         no
  Shrink:           no
Label:              root-arm64
UUID:               c51e2684-b2d2-4ffd-ae0b-6f7f86b4fe5d
Node size:          16384
Sector size:        4096	(CPU page size: 4096)
Filesystem size:    1.94GiB
Block group profiles:
  Data:             single          976.00MiB
  Metadata:         DUP              99.44MiB
  System:           DUP               8.00MiB
SSD detected:       no
Zoned device:       no
Features:           extref, skinny-metadata, no-holes, free-space-tree
Checksum:           crc32c
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1     1.94GiB  /var/tmp/.#repart016cd1c3b125ef59

/var/tmp/.#repart016cd1c3b125ef59 successfully formatted as btrfs (label "root-arm64", uuid c51e2684-b2d2-4ffd-ae0b-6f7f86b4fe5d)
Automatically determined minimal disk image size as 2.4G.
Sized '/work/var/tmp/mkosi-workspace-lq3v64wm/staging/image.raw' to 2.4G.
Applying changes to /work/var/tmp/mkosi-workspace-lq3v64wm/staging/image.raw.
Copying in '/var/tmp/.#repart016cd1c3b125ef59' (1.9G) on block level into future partition 1.
Copying in of '/var/tmp/.#repart016cd1c3b125ef59' on block level completed.
Syncing future partition 1 contents to disk.
Block level copying and synchronization of partition 1 complete in 8.282ms.
Adding new partition 1 to partition table.
Writing new partition table.
All done.
‣  Building kernel modules initrd
‣   Applying firmware include/exclude configuration
‣   Creating cpio archive /var/tmp/mkosi-workspace-lq3v64wm/kernel-modules-6.18.13-200.fc43.aarch64.initrd…
‣  Formatting ESP/XBOOTLDR partitions
Automatically determined minimal disk image size as 2.4G, current image size is 2.4G.
File '/work/var/tmp/mkosi-workspace-lq3v64wm/staging/image.raw' already is of requested size or larger, not growing. (2.4G >= 2.4G)
Applying changes to /work/var/tmp/mkosi-workspace-lq3v64wm/staging/image.raw.
Successfully wiped file system signatures from future partition 0.
Successfully discarded data from future partition 0.
Formatting future partition 0.
Preparing to populate vfat filesystem.
Ready to populate vfat filesystem.
mkfs.fat 4.2 (2021-01-31)
/var/tmp/repart-hiWKF4 successfully formatted as vfat (label "ESP", uuid 460d63b9)
Successfully formatted future partition 0.
Syncing future partition 0 contents to disk.
Adding new partition 0 to partition table.
Writing new partition table.
All done.
‣ Could not rename /var/tmp/mkosi-workspace-lq3v64wm/staging/image.raw to /opt/mecha/image.raw as they are located on different devices, falling back to copying
‣ Could not rename /var/tmp/mkosi-workspace-lq3v64wm/staging/image.vmlinuz to /opt/mecha/image.vmlinuz as they are located on different devices, falling back to copying
‣  /opt/mecha/image.raw size is 2.4G, consumes 881.7M.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions