From: Daniel Drake Date: Fri, 16 Mar 2012 21:11:24 +0000 (+0000) Subject: Avoid use of "export -n" X-Git-Tag: 018~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e25cf6edf94755219a822ebc0e108e13377cc27;p=thirdparty%2Fdracut.git Avoid use of "export -n" "export -n" is a bash extension, not part of POSIX, and is hence incompatible with the busybox shell. This was breaking boot when the busybox module was used. Reimplement the scope change in a few lines of standard shell code. --- diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh index fa712a749..84c13e037 100755 --- a/modules.d/99base/init.sh +++ b/modules.d/99base/init.sh @@ -263,8 +263,15 @@ else udevadm info --cleanup-db fi +# Retain the values of these variables but ensure that they are unexported +# This is a POSIX-compliant equivalent of bash's "export -n" +for var in root rflags fstype netroot NEWROOT; do + eval tmp=\$$var + unset $var + [ -n "$tmp" ] && eval $var=\"$tmp\" +done + export RD_TIMESTAMP -export -n root rflags fstype netroot NEWROOT set +x # Turn off debugging for this section # Clean up the environment for i in $(export -p); do