iglunix-autobuild/chroot_iglunix

46 lines
843 B
Bash
Executable file

#!/bin/bash
cd ./root
echo "Going to chroot, woot!"
mkdir proc
mkdir sys
mkdir dev
mkdir tmp
if true
then
sudo mount --bind /tmp tmp/
sudo mount -t proc /proc proc/
sudo mount -t sysfs /sys sys/
sudo mount --rbind /dev dev/
fi
if false; then
sudo chroot ./ /usr/bin/env -i \
HOME="/root" \
TERM="$TERM" \
PS1='chroot: ' \
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" \
/bin/bash -l +h
fi
if false; then
sudo chroot ./ /usr/bin/env -i \
/bin/bash source /etc/profile\
/bin/bash -l +h
fi
sudo chroot ./ /bin/bash -l
cd ..
sudo umount root/tmp/
sudo umount root/proc/
sudo umount root/sys/
sudo mount --make-rprivate root/dev/
sudo umount -l root/dev/