Skip to content

Commit

Permalink
init: environment clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
tokiclover committed Jan 7, 2019
1 parent 12e4a56 commit b9a5a96
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion init
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,13 @@ level 4s
set >/environ
echo -e "$color_fg_grn>>>$color_rst Switching Root"
exec 3>&-
exec switch_root ${newroot:-/newroot} ${init:-/sbin/init}
while read _env; do
case "$_env" in
init=*) : ;;
[Cbcdefhiklmnrsz]*=*) unset "${_env%%=*}" ;;
esac
done </environ
exec switch_root /newroot ${init:-/sbin/init}

echo -e "$color_fg_red>>>$color_rst Failed to switch root!"
exec >${SHELL:-/bin/sh} -lim
Expand Down

0 comments on commit b9a5a96

Please sign in to comment.