summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-12-28 19:22:09 +0000
committerThierry Vignaud <tv@mageia.org>2012-12-28 19:22:09 +0000
commite5e23d39061d2356c0e1da2134f5e665b2453fb1 (patch)
tree4efd9b1d2bc8027b0a5e05b902c4921d14645cb8
parentcbbe0b314216d254d2356beb1caab76c16ca2ed7 (diff)
downloaddrakx-e5e23d39061d2356c0e1da2134f5e665b2453fb1.tar
drakx-e5e23d39061d2356c0e1da2134f5e665b2453fb1.tar.gz
drakx-e5e23d39061d2356c0e1da2134f5e665b2453fb1.tar.bz2
drakx-e5e23d39061d2356c0e1da2134f5e665b2453fb1.tar.xz
drakx-e5e23d39061d2356c0e1da2134f5e665b2453fb1.zip
factorize
-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) {