You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
709 B

5 years ago
#!/usr/bin/env sh
[ "$(id -u)" -ne "0" ] && echo 'MUST BE ROOT!' && exit 1
echo ':: MAKING CHROOT DIRECTORIES...'
for DIR in dev etc usr usr/bin usr/lib; do
mkdir -pv "${1}/${DIR}"
done
echo ':: MAKING COMPAT SYMLINKS...'
ln -sv usr/bin "${1}/bin"
ln -sv usr/bin "${1}/sbin"
ln -sv usr/lib "${1}/lib"
ln -sv usr/lib "${1}/lib64"
ln -sv lib "${1}/usr/lib64"
ln -sv sbin "${1}/usr/bin"
echo ':: GIVING ROOT OWNERSHIP OF CHROOT...'
chown -v root:root "${1}"
echo ':: MAKING /DEV/NULL...'
mknod -m 666 "${1}/dev/null" c 1 3
echo ':: MAKING MINIMUM /ETC ENTRIES...'
cp -av /etc/ld.so.cache "${1}/etc"
cp -av /etc/ld.so.conf "${1}/etc"
cp -av /etc/nsswitch.conf "${1}/etc"
ln -sv /etc/hosts "${1}/etc"