Skip to content

Commit ed3e40c

Browse files
committed
Do not build initrd for the debug kernel by default
1 parent d364b49 commit ed3e40c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

scale_build/image/update.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,19 @@ def custom_rootfs_setup():
175175
with open(os.path.join(CHROOT_BASEDIR, 'etc/default/zfs'), 'a') as f:
176176
f.write('ZFS_INITRD_POST_MODPROBE_SLEEP=15')
177177

178-
run_in_chroot(['update-initramfs', '-k', 'all', '-u'])
178+
for initrd in os.listdir(f"{CHROOT_BASEDIR}/boot"):
179+
if initrd.startswith("initrd-") and "debug" in initrd:
180+
os.unlink(f"{CHROOT_BASEDIR}/boot/{initrd}")
181+
182+
for kernel in os.listdir(f"{CHROOT_BASEDIR}/boot"):
183+
if not kernel.startswith("vmlinuz-"):
184+
continue
185+
186+
kernel_name = kernel.removeprefix("vmlinuz-")
187+
if "debug" in kernel_name:
188+
continue
189+
190+
run_in_chroot(['update-initramfs', '-k', kernel_name, '-u'])
179191

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

0 commit comments

Comments
 (0)