#!/bin/sh umask 022 set -e if [ "$(id -u)" != "0" ]; then echo "Please run this script as root" 1>&2 exit 1 fi if [ ! "$rocket" ]; then echo 'Please set the $rocket variable' 1>&2 exit 1 fi mkdir -p "$rocket/dev" "$rocket/proc" "$rocket/sys" "$rocket/run" mount --bind /dev "$rocket/dev" mount -t devpts devpts "$rocket/dev/pts" mount -t proc proc "$rocket/proc" mount -t tmpfs tmpfs "$rocket/run" if [ -h "$rocket/dev/shm" ]; then mkdir -p "$rocket/$(readlink "$rocket/dev/shm")" fi chroot "$rocket" /tools/bin/env -i \ HOME=/root \ TERM="$TERM" \ PS1="(buildenv) \u:\w \$ " \ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/tools/bin \ MAKEFLAGS="$MAKEFLAGS" \ /tools/bin/ash -l