]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Prevent unnecessary installation of bash if bash. Same goes for dash.
authorAndreas Thienemann <andreas@bawue.net>
Tue, 26 May 2009 16:06:56 +0000 (18:06 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 26 May 2009 16:06:56 +0000 (18:06 +0200)
modules.d/00dash/install
modules.d/99base/install

index 5bf7ae649da53e180289eabba90c1e3a12473747..0b344cad25709f1b29618b18de9c4f4778ac4b17 100755 (executable)
@@ -1,3 +1,6 @@
 #!/bin/bash
+# If another shell is already installed, do not use dash
+[ -x "${initdir}/bin/sh" ] && return
+
 # Prefer dash as /bin/sh if it is available.
 inst /bin/dash && ln -sf dash "${initdir}/bin/sh"
index ce1e2f92cae70be4aa04ceed6249c9a85c17d4f0..a99f6abf24e318a574ef02a97db889ea00aa36fe 100755 (executable)
@@ -1,6 +1,9 @@
 #!/bin/bash
-dracut_install mount mknod mkdir modprobe pidof sleep chroot echo sed bash ls flock 
-[ -e "${initdir}/bin/sh" ] || (ln -s bash "${initdir}/bin/sh" || :)
+dracut_install mount mknod mkdir modprobe pidof sleep chroot echo sed ls flock 
+if [ ! -e "${initdir}/bin/sh" ]; then
+    dracut_install bash
+    (ln -s bash "${initdir}/bin/sh" || :)
+fi
 # install our scripts and hooks
 inst "$moddir/init" "/init"
 # Bail out if switch_root does not exist