Skip to content

Commit

Permalink
use util-linux's switch_root binary
Browse files Browse the repository at this point in the history
This is a much better solution than busybox's, as it will move our API
filesystems and /run for us.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
  • Loading branch information
falconindy committed Nov 15, 2011
1 parent 254c99b commit 4578e93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 1 addition & 8 deletions init
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@ if [ "${udevd_running}" -eq 1 ]; then
udevadm info --cleanup-db
fi

for d in proc sys dev run; do
if [ -d /new_root/${d} ]; then
mount --move /${d} /new_root/${d}
else
umount /${d}
fi
done
exec env -i TERM=$TERM /sbin/switch_root -c /dev/console /new_root ${init} "$@"
exec env -i "TERM=$TERM" /sbin/switch_root /new_root $init "$@"

# vim: set ft=sh ts=4 sw=4 et:
1 change: 1 addition & 0 deletions install/base
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ build() {
add_binary /sbin/modprobe
add_binary /sbin/blkid
add_binary /bin/mount
add_binary /sbin/switch_root

add_symlink "/etc/mtab" "/proc/self/mounts"

Expand Down

0 comments on commit 4578e93

Please sign in to comment.