From: Harald Hoyer <harald.hoyer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Daniel Drake <dsd-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] Avoid use of "export -n"
Date: Wed, 21 Mar 2012 13:07:37 +0100 [thread overview]
Message-ID: <4F69C489.3050605@gmail.com> (raw)
In-Reply-To: <20120316211124.8FFC69D401E-k/4jFdqg8LLlyo9zxV8I99HuzzzSOjJt@public.gmane.org>
Am 16.03.2012 22:11, schrieb Daniel Drake:
> "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.
> ---
> modules.d/99base/init.sh | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
> index 5d51c9d..f599fae 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
pushed
prev parent reply other threads:[~2012-03-21 12:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-16 21:11 [PATCH] Avoid use of "export -n" Daniel Drake
[not found] ` <20120316211124.8FFC69D401E-k/4jFdqg8LLlyo9zxV8I99HuzzzSOjJt@public.gmane.org>
2012-03-21 12:07 ` Harald Hoyer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F69C489.3050605@gmail.com \
--to=harald.hoyer-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=dsd-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox