Skip to content

feat: enhance CPIO compression selection - #428

Open
inode64 wants to merge 4 commits into
desultory:mainfrom
inode64:feat/compress2
Open

feat: enhance CPIO compression selection#428
inode64 wants to merge 4 commits into
desultory:mainfrom
inode64:feat/compress2

Conversation

@inode64

@inode64 inode64 commented May 12, 2026

Copy link
Copy Markdown
Contributor

Improve the logic for choosing the best compression system available in the Linux kernel, by analysing the kernel parameters CONFIG_RD_ZSTD (only when the zstandard module is installed in Python) and CONFIG_RD_XZ

Opinions and flow of the cpio_compression parameter:

true → xz, zstd, nocompression
xz → xz, zstd, nocompression
zstd → zstd, xz, nocompression
false → nocompression

Tests

  • select true, but no compression system in initrd
INSTALL /boot
 * Created temporary directory: /tmp/tmp.5ztm8Rqc4F
 * Created microcode archive at: /var/tmp/kernel-install.staging.IzpICz/microcode-amd
 * Cleaned up temporary directory: /tmp/tmp.5ztm8Rqc4F
iucode_tool: Writing selected microcodes to: /var/tmp/kernel-install.staging.IzpICz/microcode-intel
INFO     | Processing module: ugrd.base.base
INFO     | Processing module: ugrd.base.core
INFO     | Processing module: ugrd.fs.mounts
INFO     | Adding library path: /usr/lib64
INFO     | Setting initial binary search path: /usr/local/sbin, /usr/local/bin, /usr/bin, /opt/bin, /usr/lib/llvm/22/bin
INFO     | [ugrd.fs.mounts] Registered provided tag: mounts
INFO     | Processing module: ugrd.base.cmdline
INFO     | Processing module: ugrd.base.banner
INFO     | Processing module: ugrd.kmod.kmod
INFO     | Processing module: ugrd.kmod.standard_mask
INFO     | Processing module: ugrd.kmod.platform
INFO     | Processing module: ugrd.kmod.input
INFO     | Processing module: ugrd.fs.cpio
INFO     | Processing module: ugrd.base.checks
INFO     | [kernel_version] Setting from arguments: 6.18.26-gentoo
INFO     | [cpio_rotate] Setting from arguments: False
INFO     | [out_file] Setting from arguments: /var/tmp/kernel-install.staging.IzpICz/initrd
INFO     | Resolved out_dir to: /var/tmp/kernel-install.staging.IzpICz
INFO     | Loading config file: /etc/ugrd/config.toml
INFO     | Resolved out_dir to: /var/tmp/kernel-install.staging.IzpICz
INFO     | -- | Running ugrd v2.2.0
INFO     | -- | Running build tasks
INFO     | Detected init at: /usr/bin/init
INFO     | Source path for libgcc_s: /usr/lib/gcc/x86_64-pc-linux-gnu/15/libgcc_s.so.1
INFO     | Using default shell: /bin/sh
WARNING  | No device mapper name found for: md127
WARNING  | No device mapper name found for: md2
WARNING  | No device mapper name found for: md126
WARNING  | No device mapper name found for: md1
INFO     | Found virtual block devices: dm-1, dm-10, md127, dm-8, dm-6, dm-15, md2, dm-4, dm-13, dm-2, dm-11, dm-0, dm-9, md126, dm-7, dm-16, dm-5, dm-14, md1, dm-3, dm-12
INFO     | [/dev/mapper/sarin_raid1-boot] Auto-enabling kernel modules for device: dm_mod
INFO     | [/dev/mapper/sarin_raid1-boot] Autodetected mount type from device: ext4
INFO     | [root] Autodetected mount source: uuid=ec821fed-f16c-456e-a4df-3572568458df
INFO     | [/] Detected virtual block device: /dev/mapper/sarin_raid1-boot
INFO     | [/dev/md1] Auto-enabling kernel modules for device: md_mod
INFO     | Autodetected LVM mount, enabling the lvm module.
INFO     | Processing module: ugrd.fs.lvm
INFO     | [sarin_raid1-boot] LVM volume contianer uuid: qxAEp4-rNtg-XWEG-9pvO-GKfE-Mc2W-Hw0Dyf
INFO     | [/] Detected virtual block device: /dev/md1
INFO     | [/dev/nvme1n1p2] Auto-enabling kernel modules for device: nvme
INFO     | Autodetected MDRAID mount, enabling the mdraid module.
INFO     | Processing module: ugrd.fs.mdraid
INFO     | [md1] MDRAID level: raid1
INFO     | [sarin_raid1-boot] Autodetected device mapper container: md1
INFO     | [mounts] Updating mount: root
INFO     | Auto-enabling module: ext4
INFO     | Processing module: ugrd.fs.ext4
WARNING  | [get_kernel_version] Kernel version is already set, skipping.
INFO     | Autodetected kernel modules: dm_mod, md_mod, nvme, raid1, ccp, pcieportdrv, r8169, ahci, uhci_hcd, snd_hda_intel, pci_stub, iwlwifi, ohci_pci, ehci_pci, amdgpu, xhci_pci, igb
WARNING  | [/sys/class/regulator] Regulator path does not exist, skipping detection.
WARNING  | Unable to detect a keyboard with keyboard_key_threshold is set to: 25
WARNING  | Cleaning build directory: /tmp/initramfs_build
INFO     | Processing module: ugrd.kmod.novideo
INFO     | Processing module: ugrd.kmod.nosound
INFO     | Processing module: ugrd.kmod.nonetwork
WARNING  | CPIO compression fallback 'xz' is not available: kernel does not have CONFIG_RD_XZ enabled.
WARNING  | CPIO compression fallback 'zstd' is not available: kernel does not have CONFIG_RD_ZSTD enabled.
WARNING  | No supported CPIO compression available; building uncompressed initramfs.
INFO     | Selected CPIO compression: false
INFO     | Setting shebang to: #!/bin/sh -l
INFO     | Wrote file: /tmp/initramfs_build/etc/mdadm.conf
WARNING  | [pcieportdrv] Failed to process autodetected kernel module dependencies: [pcieportdrv] Modinfo returned no output and the alias name could no be resolved.
INFO     | [deploy_nodes] Skipping real device node creation with mknod, as make_nodes is not specified.
INFO     | Regenerating ld.so.cache
INFO     | Wrote file: /tmp/initramfs_build/etc/ld.so.conf
INFO     | Regenerating kernel module metadata files.
INFO     | -- | Generating init functions
INFO     | Init kernel modules: ccp
INFO     | Included kernel modules: i2c_algo_bit
WARNING  | Ignored kernel modules: i2c_piix4, k10temp, amdgpu, snd_hda_intel, iwlwifi, r8169, igb, pcieportdrv
INFO     | No initramfs fstab found, skipping mount_fstab. If non-root storage devices are not needed at boot, this is fine.
INFO     | Wrote file: /tmp/initramfs_build/etc/profile
INFO     | Included functions: check_var, setvar, readvar, wait_for_space, prompt_user, retry, klog, rd_log, edebug, einfo, ewarn, eerror, rd_fail, rd_restart, _find_init, mount_default_root, parse_cmdline_bool, parse_cmdline_str, mount_base, export_exports, parse_cmdline, print_banner, check_kver, load_modules, md_init, init_lvm, mount_root, ext4_fsck, do_switch_root
INFO     | Wrote file: /tmp/initramfs_build/init
INFO     | -- | Packing build
INFO     | No compression specified, writing uncompressed data.
INFO     | Wrote 19.67 MiB to: /var/tmp/kernel-install.staging.IzpICz/initrd
INFO     | -- | Running checks
  • select zstd, but no compression system in initrd
  INSTALL /boot
 * Created temporary directory: /tmp/tmp.S2MGsaEMJy
 * Created microcode archive at: /var/tmp/kernel-install.staging.1snvkx/microcode-amd
 * Cleaned up temporary directory: /tmp/tmp.S2MGsaEMJy
iucode_tool: Writing selected microcodes to: /var/tmp/kernel-install.staging.1snvkx/microcode-intel
INFO     | Processing module: ugrd.base.base
INFO     | Processing module: ugrd.base.core
INFO     | Processing module: ugrd.fs.mounts
INFO     | Adding library path: /usr/lib64
INFO     | Setting initial binary search path: /usr/local/sbin, /usr/local/bin, /usr/bin, /opt/bin, /usr/lib/llvm/22/bin
INFO     | [ugrd.fs.mounts] Registered provided tag: mounts
INFO     | Processing module: ugrd.base.cmdline
INFO     | Processing module: ugrd.base.banner
INFO     | Processing module: ugrd.kmod.kmod
INFO     | Processing module: ugrd.kmod.standard_mask
INFO     | Processing module: ugrd.kmod.platform
INFO     | Processing module: ugrd.kmod.input
INFO     | Processing module: ugrd.fs.cpio
INFO     | Processing module: ugrd.base.checks
INFO     | [kernel_version] Setting from arguments: 6.18.26-gentoo
INFO     | [cpio_rotate] Setting from arguments: False
INFO     | [out_file] Setting from arguments: /var/tmp/kernel-install.staging.1snvkx/initrd
INFO     | Resolved out_dir to: /var/tmp/kernel-install.staging.1snvkx
INFO     | Loading config file: /etc/ugrd/config.toml
INFO     | Resolved out_dir to: /var/tmp/kernel-install.staging.1snvkx
INFO     | -- | Running ugrd v2.2.0
INFO     | -- | Running build tasks
INFO     | Detected init at: /usr/bin/init
INFO     | Source path for libgcc_s: /usr/lib/gcc/x86_64-pc-linux-gnu/15/libgcc_s.so.1
INFO     | Using default shell: /bin/sh
WARNING  | No device mapper name found for: md127
WARNING  | No device mapper name found for: md2
WARNING  | No device mapper name found for: md126
WARNING  | No device mapper name found for: md1
INFO     | Found virtual block devices: dm-1, dm-10, md127, dm-8, dm-6, dm-15, md2, dm-4, dm-13, dm-2, dm-11, dm-0, dm-9, md126, dm-7, dm-16, dm-5, dm-14, md1, dm-3, dm-12
INFO     | [/dev/mapper/sarin_raid1-boot] Auto-enabling kernel modules for device: dm_mod
INFO     | [/dev/mapper/sarin_raid1-boot] Autodetected mount type from device: ext4
INFO     | [root] Autodetected mount source: uuid=ec821fed-f16c-456e-a4df-3572568458df
INFO     | [/] Detected virtual block device: /dev/mapper/sarin_raid1-boot
INFO     | [/dev/md1] Auto-enabling kernel modules for device: md_mod
INFO     | Autodetected LVM mount, enabling the lvm module.
INFO     | Processing module: ugrd.fs.lvm
INFO     | [sarin_raid1-boot] LVM volume contianer uuid: qxAEp4-rNtg-XWEG-9pvO-GKfE-Mc2W-Hw0Dyf
INFO     | [/] Detected virtual block device: /dev/md1
INFO     | [/dev/nvme1n1p2] Auto-enabling kernel modules for device: nvme
INFO     | Autodetected MDRAID mount, enabling the mdraid module.
INFO     | Processing module: ugrd.fs.mdraid
INFO     | [md1] MDRAID level: raid1
INFO     | [sarin_raid1-boot] Autodetected device mapper container: md1
INFO     | [mounts] Updating mount: root
INFO     | Auto-enabling module: ext4
INFO     | Processing module: ugrd.fs.ext4
WARNING  | [get_kernel_version] Kernel version is already set, skipping.
INFO     | Autodetected kernel modules: dm_mod, md_mod, nvme, raid1, uhci_hcd, amdgpu, igb, pci_stub, ehci_pci, pcieportdrv, ohci_pci, r8169, ahci, iwlwifi, xhci_pci, ccp, snd_hda_intel
WARNING  | [/sys/class/regulator] Regulator path does not exist, skipping detection.
WARNING  | Unable to detect a keyboard with keyboard_key_threshold is set to: 25
WARNING  | Cleaning build directory: /tmp/initramfs_build
INFO     | Processing module: ugrd.kmod.novideo
INFO     | Processing module: ugrd.kmod.nosound
INFO     | Processing module: ugrd.kmod.nonetwork
WARNING  | Requested CPIO compression 'zstd' is not available: kernel does not have CONFIG_RD_ZSTD enabled.
WARNING  | CPIO compression fallback 'xz' is not available: kernel does not have CONFIG_RD_XZ enabled.
WARNING  | Falling back to CPIO compression 'false' instead of 'zstd'.
INFO     | Selected CPIO compression: false
INFO     | Setting shebang to: #!/bin/sh -l
INFO     | Wrote file: /tmp/initramfs_build/etc/mdadm.conf
WARNING  | [pcieportdrv] Failed to process autodetected kernel module dependencies: [pcieportdrv] Modinfo returned no output and the alias name could no be resolved.
INFO     | [deploy_nodes] Skipping real device node creation with mknod, as make_nodes is not specified.
INFO     | Regenerating ld.so.cache
INFO     | Wrote file: /tmp/initramfs_build/etc/ld.so.conf
INFO     | Regenerating kernel module metadata files.
INFO     | -- | Generating init functions
INFO     | Init kernel modules: ccp
INFO     | Included kernel modules: i2c_algo_bit
WARNING  | Ignored kernel modules: i2c_piix4, k10temp, amdgpu, snd_hda_intel, iwlwifi, r8169, igb, pcieportdrv
INFO     | No initramfs fstab found, skipping mount_fstab. If non-root storage devices are not needed at boot, this is fine.
INFO     | Wrote file: /tmp/initramfs_build/etc/profile
INFO     | Included functions: check_var, setvar, readvar, wait_for_space, prompt_user, retry, klog, rd_log, edebug, einfo, ewarn, eerror, rd_fail, rd_restart, _find_init, mount_default_root, parse_cmdline_bool, parse_cmdline_str, mount_base, export_exports, parse_cmdline, print_banner, check_kver, load_modules, md_init, init_lvm, mount_root, ext4_fsck, do_switch_root
INFO     | Wrote file: /tmp/initramfs_build/init
INFO     | -- | Packing build
INFO     | No compression specified, writing uncompressed data.
INFO     | Wrote 19.67 MiB to: /var/tmp/kernel-install.staging.1snvkx/initrd
INFO     | -- | Running checks
  • select false
  INSTALL /boot
 * Created temporary directory: /tmp/tmp.Nwgjm5WjSo
 * Created microcode archive at: /var/tmp/kernel-install.staging.pq6D0Z/microcode-amd
 * Cleaned up temporary directory: /tmp/tmp.Nwgjm5WjSo
iucode_tool: Writing selected microcodes to: /var/tmp/kernel-install.staging.pq6D0Z/microcode-intel
INFO     | Processing module: ugrd.base.base
INFO     | Processing module: ugrd.base.core
INFO     | Processing module: ugrd.fs.mounts
INFO     | Adding library path: /usr/lib64
INFO     | Setting initial binary search path: /usr/local/sbin, /usr/local/bin, /usr/bin, /opt/bin, /usr/lib/llvm/22/bin
INFO     | [ugrd.fs.mounts] Registered provided tag: mounts
INFO     | Processing module: ugrd.base.cmdline
INFO     | Processing module: ugrd.base.banner
INFO     | Processing module: ugrd.kmod.kmod
INFO     | Processing module: ugrd.kmod.standard_mask
INFO     | Processing module: ugrd.kmod.platform
INFO     | Processing module: ugrd.kmod.input
INFO     | Processing module: ugrd.fs.cpio
INFO     | Processing module: ugrd.base.checks
INFO     | [kernel_version] Setting from arguments: 6.18.26-gentoo
INFO     | [cpio_rotate] Setting from arguments: False
INFO     | [out_file] Setting from arguments: /var/tmp/kernel-install.staging.pq6D0Z/initrd
INFO     | Resolved out_dir to: /var/tmp/kernel-install.staging.pq6D0Z
INFO     | Loading config file: /etc/ugrd/config.toml
INFO     | Resolved out_dir to: /var/tmp/kernel-install.staging.pq6D0Z
INFO     | -- | Running ugrd v2.2.0
INFO     | -- | Running build tasks
INFO     | Detected init at: /usr/bin/init
INFO     | Source path for libgcc_s: /usr/lib/gcc/x86_64-pc-linux-gnu/15/libgcc_s.so.1
INFO     | Using default shell: /bin/sh
WARNING  | No device mapper name found for: md127
WARNING  | No device mapper name found for: md2
WARNING  | No device mapper name found for: md126
WARNING  | No device mapper name found for: md1
INFO     | Found virtual block devices: dm-1, dm-10, md127, dm-8, dm-6, dm-15, md2, dm-4, dm-13, dm-2, dm-11, dm-0, dm-9, md126, dm-7, dm-16, dm-5, dm-14, md1, dm-3, dm-12
INFO     | [/dev/mapper/sarin_raid1-boot] Auto-enabling kernel modules for device: dm_mod
INFO     | [/dev/mapper/sarin_raid1-boot] Autodetected mount type from device: ext4
INFO     | [root] Autodetected mount source: uuid=ec821fed-f16c-456e-a4df-3572568458df
INFO     | [/] Detected virtual block device: /dev/mapper/sarin_raid1-boot
INFO     | [/dev/md1] Auto-enabling kernel modules for device: md_mod
INFO     | Autodetected LVM mount, enabling the lvm module.
INFO     | Processing module: ugrd.fs.lvm
INFO     | [sarin_raid1-boot] LVM volume contianer uuid: qxAEp4-rNtg-XWEG-9pvO-GKfE-Mc2W-Hw0Dyf
INFO     | [/] Detected virtual block device: /dev/md1
INFO     | [/dev/nvme1n1p2] Auto-enabling kernel modules for device: nvme
INFO     | Autodetected MDRAID mount, enabling the mdraid module.
INFO     | Processing module: ugrd.fs.mdraid
INFO     | [md1] MDRAID level: raid1
INFO     | [sarin_raid1-boot] Autodetected device mapper container: md1
INFO     | [mounts] Updating mount: root
INFO     | Auto-enabling module: ext4
INFO     | Processing module: ugrd.fs.ext4
WARNING  | [get_kernel_version] Kernel version is already set, skipping.
INFO     | Autodetected kernel modules: dm_mod, md_mod, nvme, raid1, ehci_pci, ccp, r8169, ahci, pcieportdrv, iwlwifi, uhci_hcd, pci_stub, xhci_pci, ohci_pci, snd_hda_intel, igb, amdgpu
WARNING  | [/sys/class/regulator] Regulator path does not exist, skipping detection.
WARNING  | Unable to detect a keyboard with keyboard_key_threshold is set to: 25
WARNING  | Cleaning build directory: /tmp/initramfs_build
INFO     | Processing module: ugrd.kmod.novideo
INFO     | Processing module: ugrd.kmod.nosound
INFO     | Processing module: ugrd.kmod.nonetwork
INFO     | Selected CPIO compression: false
INFO     | Setting shebang to: #!/bin/sh -l
INFO     | Wrote file: /tmp/initramfs_build/etc/mdadm.conf
WARNING  | [pcieportdrv] Failed to process autodetected kernel module dependencies: [pcieportdrv] Modinfo returned no output and the alias name could no be resolved.
INFO     | [deploy_nodes] Skipping real device node creation with mknod, as make_nodes is not specified.
INFO     | Regenerating ld.so.cache
INFO     | Wrote file: /tmp/initramfs_build/etc/ld.so.conf
INFO     | Regenerating kernel module metadata files.
INFO     | -- | Generating init functions
INFO     | Init kernel modules: ccp
INFO     | Included kernel modules: i2c_algo_bit
WARNING  | Ignored kernel modules: k10temp, i2c_piix4, amdgpu, snd_hda_intel, iwlwifi, r8169, igb, pcieportdrv
INFO     | No initramfs fstab found, skipping mount_fstab. If non-root storage devices are not needed at boot, this is fine.
INFO     | Wrote file: /tmp/initramfs_build/etc/profile
INFO     | Included functions: check_var, setvar, readvar, wait_for_space, prompt_user, retry, klog, rd_log, edebug, einfo, ewarn, eerror, rd_fail, rd_restart, _find_init, mount_default_root, parse_cmdline_bool, parse_cmdline_str, mount_base, export_exports, parse_cmdline, print_banner, check_kver, load_modules, md_init, init_lvm, mount_root, ext4_fsck, do_switch_root
INFO     | Wrote file: /tmp/initramfs_build/init
INFO     | -- | Packing build
INFO     | No compression specified, writing uncompressed data.
INFO     | Wrote 19.67 MiB to: /var/tmp/kernel-install.staging.pq6D0Z/initrd
INFO     | -- | Running checks
  • select xz, but only zstd in the kernel and without zstandard
  INSTALL /boot
 * Created temporary directory: /tmp/tmp.nz3EQtZF8u
 * Created microcode archive at: /var/tmp/kernel-install.staging.JsxaiV/microcode-amd
 * Cleaned up temporary directory: /tmp/tmp.nz3EQtZF8u
iucode_tool: Writing selected microcodes to: /var/tmp/kernel-install.staging.JsxaiV/microcode-intel
INFO     | Processing module: ugrd.base.base
INFO     | Processing module: ugrd.base.core
INFO     | Processing module: ugrd.fs.mounts
INFO     | Adding library path: /usr/lib64
INFO     | Setting initial binary search path: /usr/local/sbin, /usr/local/bin, /usr/bin, /opt/bin, /usr/lib/llvm/22/bin
INFO     | [ugrd.fs.mounts] Registered provided tag: mounts
INFO     | Processing module: ugrd.base.cmdline
INFO     | Processing module: ugrd.base.banner
INFO     | Processing module: ugrd.kmod.kmod
INFO     | Processing module: ugrd.kmod.standard_mask
INFO     | Processing module: ugrd.kmod.platform
INFO     | Processing module: ugrd.kmod.input
INFO     | Processing module: ugrd.fs.cpio
INFO     | Processing module: ugrd.base.checks
INFO     | [kernel_version] Setting from arguments: 6.18.26-gentoo
INFO     | [cpio_rotate] Setting from arguments: False
INFO     | [out_file] Setting from arguments: /var/tmp/kernel-install.staging.JsxaiV/initrd
INFO     | Resolved out_dir to: /var/tmp/kernel-install.staging.JsxaiV
INFO     | Loading config file: /etc/ugrd/config.toml
INFO     | Resolved out_dir to: /var/tmp/kernel-install.staging.JsxaiV
INFO     | -- | Running ugrd v2.2.0
INFO     | -- | Running build tasks
INFO     | Detected init at: /usr/bin/init
INFO     | Source path for libgcc_s: /usr/lib/gcc/x86_64-pc-linux-gnu/15/libgcc_s.so.1
INFO     | Using default shell: /bin/sh
WARNING  | No device mapper name found for: md127
WARNING  | No device mapper name found for: md2
WARNING  | No device mapper name found for: md126
WARNING  | No device mapper name found for: md1
INFO     | Found virtual block devices: dm-1, dm-10, md127, dm-8, dm-6, dm-15, md2, dm-4, dm-13, dm-2, dm-11, dm-0, dm-9, md126, dm-7, dm-16, dm-5, dm-14, md1, dm-3, dm-12
INFO     | [/dev/mapper/sarin_raid1-boot] Auto-enabling kernel modules for device: dm_mod
INFO     | [/dev/mapper/sarin_raid1-boot] Autodetected mount type from device: ext4
INFO     | [root] Autodetected mount source: uuid=ec821fed-f16c-456e-a4df-3572568458df
INFO     | [/] Detected virtual block device: /dev/mapper/sarin_raid1-boot
INFO     | [/dev/md1] Auto-enabling kernel modules for device: md_mod
INFO     | Autodetected LVM mount, enabling the lvm module.
INFO     | Processing module: ugrd.fs.lvm
INFO     | [sarin_raid1-boot] LVM volume contianer uuid: qxAEp4-rNtg-XWEG-9pvO-GKfE-Mc2W-Hw0Dyf
INFO     | [/] Detected virtual block device: /dev/md1
INFO     | [/dev/nvme1n1p2] Auto-enabling kernel modules for device: nvme
INFO     | Autodetected MDRAID mount, enabling the mdraid module.
INFO     | Processing module: ugrd.fs.mdraid
INFO     | [md1] MDRAID level: raid1
INFO     | [sarin_raid1-boot] Autodetected device mapper container: md1
INFO     | [mounts] Updating mount: root
INFO     | Auto-enabling module: ext4
INFO     | Processing module: ugrd.fs.ext4
WARNING  | [get_kernel_version] Kernel version is already set, skipping.
INFO     | Autodetected kernel modules: dm_mod, md_mod, nvme, raid1, ccp, uhci_hcd, pcieportdrv, ohci_pci, snd_hda_intel, amdgpu, iwlwifi, xhci_pci, pci_stub, ahci, ehci_pci, r8169, igb
WARNING  | [/sys/class/regulator] Regulator path does not exist, skipping detection.
WARNING  | Unable to detect a keyboard with keyboard_key_threshold is set to: 25
WARNING  | Cleaning build directory: /tmp/initramfs_build
INFO     | Processing module: ugrd.kmod.novideo
INFO     | Processing module: ugrd.kmod.nosound
INFO     | Processing module: ugrd.kmod.nonetwork
WARNING  | Requested CPIO compression 'xz' is not available: kernel does not have CONFIG_RD_XZ enabled.
WARNING  | Falling back to CPIO compression 'zstd' instead of 'xz'.
INFO     | Selected CPIO compression: zstd
INFO     | Setting shebang to: #!/bin/sh -l
INFO     | Wrote file: /tmp/initramfs_build/etc/mdadm.conf
WARNING  | [pcieportdrv] Failed to process autodetected kernel module dependencies: [pcieportdrv] Modinfo returned no output and the alias name could no be resolved.
INFO     | [deploy_nodes] Skipping real device node creation with mknod, as make_nodes is not specified.
INFO     | Regenerating ld.so.cache
INFO     | Wrote file: /tmp/initramfs_build/etc/ld.so.conf
INFO     | Regenerating kernel module metadata files.
INFO     | -- | Generating init functions
INFO     | Init kernel modules: ccp
INFO     | Included kernel modules: i2c_algo_bit
WARNING  | Ignored kernel modules: k10temp, i2c_piix4, amdgpu, snd_hda_intel, iwlwifi, r8169, igb, pcieportdrv
INFO     | No initramfs fstab found, skipping mount_fstab. If non-root storage devices are not needed at boot, this is fine.
INFO     | Wrote file: /tmp/initramfs_build/etc/profile
INFO     | Included functions: check_var, setvar, readvar, wait_for_space, prompt_user, retry, klog, rd_log, edebug, einfo, ewarn, eerror, rd_fail, rd_restart, _find_init, mount_default_root, parse_cmdline_bool, parse_cmdline_str, mount_base, export_exports, parse_cmdline, print_banner, check_kver, load_modules, md_init, init_lvm, mount_root, ext4_fsck, do_switch_root
INFO     | Wrote file: /tmp/initramfs_build/init
INFO     | -- | Packing build
INFO     | [ZSTD] Compressing the CPIO data, original size: 19.67 MiB
INFO     | Wrote 7.68 MiB to: /var/tmp/kernel-install.staging.JsxaiV/initrd
INFO     | -- | Running checks
  • select xz, but only zstd in the kernel and without zstandard
  INSTALL /boot
 * Created temporary directory: /tmp/tmp.Ckf8lYL1LO
 * Created microcode archive at: /var/tmp/kernel-install.staging.nYlqT5/microcode-amd
 * Cleaned up temporary directory: /tmp/tmp.Ckf8lYL1LO
iucode_tool: Writing selected microcodes to: /var/tmp/kernel-install.staging.nYlqT5/microcode-intel
INFO     | Processing module: ugrd.base.base
INFO     | Processing module: ugrd.base.core
INFO     | Processing module: ugrd.fs.mounts
INFO     | Adding library path: /usr/lib64
INFO     | Setting initial binary search path: /usr/local/sbin, /usr/local/bin, /usr/bin, /opt/bin, /usr/lib/llvm/22/bin
INFO     | [ugrd.fs.mounts] Registered provided tag: mounts
INFO     | Processing module: ugrd.base.cmdline
INFO     | Processing module: ugrd.base.banner
INFO     | Processing module: ugrd.kmod.kmod
INFO     | Processing module: ugrd.kmod.standard_mask
INFO     | Processing module: ugrd.kmod.platform
INFO     | Processing module: ugrd.kmod.input
INFO     | Processing module: ugrd.fs.cpio
INFO     | Processing module: ugrd.base.checks
INFO     | [kernel_version] Setting from arguments: 6.18.26-gentoo
INFO     | [cpio_rotate] Setting from arguments: False
INFO     | [out_file] Setting from arguments: /var/tmp/kernel-install.staging.nYlqT5/initrd
INFO     | Resolved out_dir to: /var/tmp/kernel-install.staging.nYlqT5
INFO     | Loading config file: /etc/ugrd/config.toml
INFO     | Resolved out_dir to: /var/tmp/kernel-install.staging.nYlqT5
INFO     | -- | Running ugrd v2.2.0
INFO     | -- | Running build tasks
INFO     | Detected init at: /usr/bin/init
INFO     | Source path for libgcc_s: /usr/lib/gcc/x86_64-pc-linux-gnu/15/libgcc_s.so.1
INFO     | Using default shell: /bin/sh
WARNING  | No device mapper name found for: md127
WARNING  | No device mapper name found for: md2
WARNING  | No device mapper name found for: md126
WARNING  | No device mapper name found for: md1
INFO     | Found virtual block devices: dm-1, dm-10, md127, dm-8, dm-6, dm-15, md2, dm-4, dm-13, dm-2, dm-11, dm-0, dm-9, md126, dm-7, dm-16, dm-5, dm-14, md1, dm-3, dm-12
INFO     | [/dev/mapper/sarin_raid1-boot] Auto-enabling kernel modules for device: dm_mod
INFO     | [/dev/mapper/sarin_raid1-boot] Autodetected mount type from device: ext4
INFO     | [root] Autodetected mount source: uuid=ec821fed-f16c-456e-a4df-3572568458df
INFO     | [/] Detected virtual block device: /dev/mapper/sarin_raid1-boot
INFO     | [/dev/md1] Auto-enabling kernel modules for device: md_mod
INFO     | Autodetected LVM mount, enabling the lvm module.
INFO     | Processing module: ugrd.fs.lvm
INFO     | [sarin_raid1-boot] LVM volume contianer uuid: qxAEp4-rNtg-XWEG-9pvO-GKfE-Mc2W-Hw0Dyf
INFO     | [/] Detected virtual block device: /dev/md1
INFO     | [/dev/nvme1n1p2] Auto-enabling kernel modules for device: nvme
INFO     | Autodetected MDRAID mount, enabling the mdraid module.
INFO     | Processing module: ugrd.fs.mdraid
INFO     | [md1] MDRAID level: raid1
INFO     | [sarin_raid1-boot] Autodetected device mapper container: md1
INFO     | [mounts] Updating mount: root
INFO     | Auto-enabling module: ext4
INFO     | Processing module: ugrd.fs.ext4
WARNING  | [get_kernel_version] Kernel version is already set, skipping.
INFO     | Autodetected kernel modules: dm_mod, md_mod, nvme, raid1, ohci_pci, uhci_hcd, snd_hda_intel, ehci_pci, pci_stub, ccp, pcieportdrv, r8169, igb, iwlwifi, ahci, amdgpu, xhci_pci
WARNING  | [/sys/class/regulator] Regulator path does not exist, skipping detection.
WARNING  | Unable to detect a keyboard with keyboard_key_threshold is set to: 25
WARNING  | Cleaning build directory: /tmp/initramfs_build
INFO     | Processing module: ugrd.kmod.novideo
INFO     | Processing module: ugrd.kmod.nosound
INFO     | Processing module: ugrd.kmod.nonetwork
WARNING  | Requested CPIO compression 'xz' is not available: kernel does not have CONFIG_RD_XZ enabled.
WARNING  | CPIO compression fallback 'zstd' is not available: Python module 'zstandard' is not installed.
WARNING  | Falling back to CPIO compression 'false' instead of 'xz'.
INFO     | Selected CPIO compression: false
INFO     | Setting shebang to: #!/bin/sh -l
INFO     | Wrote file: /tmp/initramfs_build/etc/mdadm.conf
WARNING  | [pcieportdrv] Failed to process autodetected kernel module dependencies: [pcieportdrv] Modinfo returned no output and the alias name could no be resolved.
INFO     | [deploy_nodes] Skipping real device node creation with mknod, as make_nodes is not specified.
INFO     | Regenerating ld.so.cache
INFO     | Wrote file: /tmp/initramfs_build/etc/ld.so.conf
INFO     | Regenerating kernel module metadata files.
INFO     | -- | Generating init functions
INFO     | Init kernel modules: ccp
INFO     | Included kernel modules: i2c_algo_bit
WARNING  | Ignored kernel modules: k10temp, i2c_piix4, amdgpu, snd_hda_intel, iwlwifi, r8169, igb, pcieportdrv
INFO     | No initramfs fstab found, skipping mount_fstab. If non-root storage devices are not needed at boot, this is fine.
INFO     | Wrote file: /tmp/initramfs_build/etc/profile
INFO     | Included functions: check_var, setvar, readvar, wait_for_space, prompt_user, retry, klog, rd_log, edebug, einfo, ewarn, eerror, rd_fail, rd_restart, _find_init, mount_default_root, parse_cmdline_bool, parse_cmdline_str, mount_base, export_exports, parse_cmdline, print_banner, check_kver, load_modules, md_init, init_lvm, mount_root, ext4_fsck, do_switch_root
INFO     | Wrote file: /tmp/initramfs_build/init
INFO     | -- | Packing build
INFO     | No compression specified, writing uncompressed data.
INFO     | Wrote 19.67 MiB to: /var/tmp/kernel-install.staging.nYlqT5/initrd
INFO     | -- | Running checks

@desultory

desultory commented May 12, 2026

Copy link
Copy Markdown
Owner

checking the actual kernel config is something i've wanted to do for a while, but the main issue is the fact that this is hard to reliably find across distros. It's not too bad on gentoo, but outside of gentoo, a lot of distros don't even provide the .config file, and your only option is reading /proc/config which won't tell you about the target kernel.

I'm gonna need to think about this set of changes for a while, because I don't want to rush this kind of functionality.

I think it would be best for the kernel .config reading code to possibly be in the kmod category, maybe a new module just called "config" (ugrd.kmod.config). this category was somewhat intentionally called "kmod" because ugrd should generally be working with kmods and not doing "kernel build" steps like genkernel or similar, but I don't see a great reason to make a new "kernel" category or make this specific to compression settings.

there are a lot of other interesting checks you can do with this, and it's really important for users using no kmods (where modinfo/builtin modules can't be determined)

I'm also not opposed to ugrd warning users about things like the efifb module missing and things of that nature, I think there are a lot of ways this could help sanity check custom kernels in addition to just making the process smoother

@desultory

desultory commented May 12, 2026

Copy link
Copy Markdown
Owner

I may update the dev manual a bit, but there are a few style things that are admittedly inconsistent currently and I'd like to make it clear what sort of style I'm trying to move towards.

It's a small thing, but I'd like to use fstrings wherever possible, and if some variable is mentioned, ideally it's at the end of a line or within brackets and colored (so users can easily distinguish the info unique to their error)

I made a PR here, feel free to add some input if you have ideas about style/standards
#429

@desultory

desultory commented May 30, 2026

Copy link
Copy Markdown
Owner

I think this looks good, but would you mind rebasing this so each commit is for the particular set of changes it applies to? The fstring stuff could probably just be edited into past commits instead of being added later

it may make more sense to have a separate PR to add the kconfig reading stuff first, then make one to use that for CPIO detection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants