summaryrefslogtreecommitdiffstats
path: root/tools/drakx-in-chroot
diff options
context:
space:
mode:
Diffstat (limited to 'tools/drakx-in-chroot')
-rwxr-xr-xtools/drakx-in-chroot18
1 files changed, 7 insertions, 11 deletions
diff --git a/tools/drakx-in-chroot b/tools/drakx-in-chroot
index 2a4b525ff..a75699341 100755
--- a/tools/drakx-in-chroot
+++ b/tools/drakx-in-chroot
@@ -87,17 +87,13 @@ sys("$sudo mount -t sysfs none $SLASH_LOCATION/sys");
sys("$sudo mount -t debugfs none $SLASH_LOCATION/sys/kernel/debug");
sys("$sudo mount -t tmpfs none $SLASH_LOCATION/run");
-if (-d "/run/udev") {
- # Ensure we mount the udev run dir for various extra metadata from udevadm
- mkdir_p("$SLASH_LOCATION/run/udev");
- sys("$sudo mount -o bind /run/udev $SLASH_LOCATION/run/udev");
-}
-
-if (-d "/run/initramfs") {
- # If dracut has been used (and thus udev has yummy metadata) make sure
- # drakx knows about it when running in the chroot
- mkdir_p("$SLASH_LOCATION/run/initramfs");
- sys("$sudo mount -o bind /run/initramfs $SLASH_LOCATION/run/initramfs");
+# - Ensure we mount the udev run dir for various extra metadata from udevadm
+# - If dracut has been used (and thus udev has yummy metadata) make sure
+# drakx knows about it when running in the chroot
+foreach my $dir (qw(initramfs udev)) {
+ next if !-d "/run/$dir";
+ mkdir_p("$SLASH_LOCATION/run/$dir");
+ sys("$sudo mount -o bind /run/$dir $SLASH_LOCATION/run/$dir");
}
if ($disk_iso_repository) {