Skip to content

Commit 4116ab7

Browse files
committed
fix: dracut move of initrd failure
dracut-ng introduced `protection of existing files again output errors`, making it incompatible with bind mounts (commit: 39a765d)
1 parent 9d5d658 commit 4116ab7

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

features/_pxe/image.pxe.tar.gz

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ echo "console=ttyS0 gl.live=1 gl.ovl=/:tmpfs" > cmdline
2727
touch tmp_initrd
2828
[[ ! -e "$chroot_dir/initrd" ]]
2929
touch "$chroot_dir/initrd"
30-
mount --bind tmp_initrd "$chroot_dir/initrd"
3130
[[ ! -e "$chroot_dir/root.squashfs" ]]
3231
touch "$chroot_dir/root.squashfs"
3332
mount --bind root.squashfs "$chroot_dir/root.squashfs"
@@ -50,8 +49,7 @@ chroot "$chroot_dir" env dracut \
5049

5150
umount -l "$chroot_dir/proc"
5251

53-
umount "$chroot_dir/initrd"
54-
rm "$chroot_dir/initrd"
52+
mv "$chroot_dir/initrd" tmp_initrd
5553
umount "$chroot_dir/root.squashfs"
5654
rm "$chroot_dir/root.squashfs"
5755

features/_usi/image.cc.tar

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ mount --bind "$erofs" "$rootfs/tmp/initrd.include/root.img"
5252
initrd="$(mktemp)"
5353

5454
touch "$rootfs/initrd"
55-
mount --bind "$initrd" "$rootfs/initrd"
56-
5755
kernel="$(find "$rootfs/boot/" -name 'vmlinuz-*' | sort -V | tail -n 1)"
5856

5957
chroot "$rootfs" dracut \
@@ -74,7 +72,7 @@ umount -l "$rootfs/proc"
7472
umount -R "$rootfs/dev"
7573
umount "$rootfs/tmp"
7674

77-
umount "$rootfs/initrd"
75+
mv "$rootfs/initrd" "$initrd"
7876

7977
case "$BUILDER_ARCH" in
8078
amd64)

0 commit comments

Comments
 (0)