Skip to content

Instantly share code, notes, and snippets.

Created April 29, 2013 09:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5480567 to your computer and use it in GitHub Desktop.
Save anonymous/5480567 to your computer and use it in GitHub Desktop.
set -x
mount -o remount,exec /run
R=/run/root
IPADDR=192.168.0.159/8
mkdir -p "$R/proc"
cp -r /bin /lib "$R"
cat > "$R/script" <<EOF
mount -t proc none /proc
brctl addbr br0
brctl addif br0 eth0
ifconfig br0 "$IPADDR"
ifconfig eth0 0.0.0.0
umount /proc
EOF
chroot "$R" busybox sh script
rm -r "$R/bin" "$R/lib"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment