Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- trap umount_chroot HUP INT QUIT TERM SIGHUP SIGINT SIGQUIT SIGILL SIGABRT SIGKILL SIGTRAP SIGTERM SIGSTOP SIGSEGV
- mount_chroot() {
- echo "Mounting chroot..."
- mount -v --bind /dev $ROOTFS/dev
- mount -vt devpts devpts $ROOTFS/dev/pts -o gid=5,mode=620
- mount -vt proc proc $ROOTFS/proc
- mount -vt sysfs sysfs $ROOTFS/sys
- mount -vt tmpfs tmpfs $ROOTFS/run
- echo "Done mounting chroot."
- }
- umount_chroot() {
- echo "Unmounting chroot..."
- umount -v $ROOTFS/dev/pts
- umount -v $ROOTFS/dev
- umount -v $ROOTFS/run
- umount -v $ROOTFS/proc
- umount -v $ROOTFS/sys
- echo "Done unmounting chroot."
- }
- ROOTFS=$1
- chroot "$ROOTFS" /usr/bin/env -i \
- HOME=/ \
- TERM="$TERM" \
- LC_ALL=POSIX \
- MAKEFLAGS="-j2" \
- PS1='(bdk_chroot)$ ' \
- PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login +h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement