Skip to content

Commit

Permalink
Do not build initrd for the debug kernel by default
Browse files Browse the repository at this point in the history
  • Loading branch information
themylogin committed Feb 10, 2025
1 parent d364b49 commit ed3e40c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scale_build/image/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,19 @@ def custom_rootfs_setup():
with open(os.path.join(CHROOT_BASEDIR, 'etc/default/zfs'), 'a') as f:
f.write('ZFS_INITRD_POST_MODPROBE_SLEEP=15')

run_in_chroot(['update-initramfs', '-k', 'all', '-u'])
for initrd in os.listdir(f"{CHROOT_BASEDIR}/boot"):
if initrd.startswith("initrd-") and "debug" in initrd:
os.unlink(f"{CHROOT_BASEDIR}/boot/{initrd}")

for kernel in os.listdir(f"{CHROOT_BASEDIR}/boot"):
if not kernel.startswith("vmlinuz-"):
continue

kernel_name = kernel.removeprefix("vmlinuz-")
if "debug" in kernel_name:
continue

run_in_chroot(['update-initramfs', '-k', kernel_name, '-u'])

# Generate native systemd unit files for SysV services that lack ones to prevent systemd-sysv-generator warnings
tmp_systemd = os.path.join(CHROOT_BASEDIR, 'tmp/systemd')
Expand Down

0 comments on commit ed3e40c

Please sign in to comment.