]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(base): do not require chroot inside initramfs
authorHenrik Gombos <henrik99999@gmail.com>
Mon, 21 Feb 2022 02:40:02 +0000 (21:40 -0500)
committerAntonio Álvarez Feijoo <antonio.feijoo@suse.com>
Mon, 5 Dec 2022 08:19:42 +0000 (09:19 +0100)
dracut can be invoked inside a chroot, but inside
the generated initramfs the chroot binary is not required.

add chroot to the generated initramfs if debug or selinux
dracut modules are enabled.

modules.d/95debug/module-setup.sh
modules.d/98selinux/module-setup.sh
modules.d/99base/module-setup.sh

index 2d6c59820a8b2ef6dda538b0a0da909dfce3f2fb..3124f1af33304aee5a6e9823756748bee886579d 100755 (executable)
@@ -14,7 +14,7 @@ depends() {
 # called by dracut
 install() {
     inst_multiple -o ls ps grep more cat rm strace free showmount df du lsblk \
-        ping netstat rpcinfo vi scp ping6 ssh find \
+        ping netstat rpcinfo vi scp ping6 ssh find chroot \
         tcpdump cp dd less hostname mkdir systemd-analyze \
         fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck
 
index b3f0fb6ab09fd67e6283a20c3f2e31a53eabf81f..3574b1221edcfba5ead3a98c9684034902a9ced5 100755 (executable)
@@ -13,5 +13,5 @@ depends() {
 # called by dracut
 install() {
     inst_hook pre-pivot 50 "$moddir/selinux-loadpolicy.sh"
-    inst_multiple setenforce
+    inst_multiple setenforce chroot
 }
index d5fb8bad6223b15b7328a8ca02a9b1a08c356e9f..54b0deb9147314bdc9cca69bf0b55f337f8c1705 100755 (executable)
@@ -13,7 +13,7 @@ depends() {
 
 # called by dracut
 install() {
-    inst_multiple mount mknod mkdir sleep chroot chown \
+    inst_multiple mount mknod mkdir sleep chown \
         sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink setsid \
         modprobe chmod tr