seperate first time chroot and later chroot

This commit is contained in:
tux 2023-05-17 15:05:12 +02:00
parent 630393b898
commit 31fd5ab659
2 changed files with 23 additions and 1 deletions

View File

@ -21,7 +21,6 @@ fi
echo "Entering now the chroot environment, continue with chapter 7 p1:"
echo "bash chap7p1.sh"
chroot "$LFS" /usr/bin/env -i \
HOME=/root \
TERM="$TERM" \

23
re-chroot.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
source vars.sh
mount -v --bind /dev $LFS/dev &&
mount -v --bind /dev/pts $LFS/dev/pts &&
mount -vt proc proc $LFS/proc &&
mount -vt sysfs sysfs $LFS/sys &&
mount -vt tmpfs tmpfs $LFS/run &&
if [ -h $LFS/dev/shm ]; then
mkdir -pv $LFS/$(readlink $LFS/dev/shm)
else
mount -t tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm
fi
echo "Entering now the chroot environment"
chroot "$LFS" /usr/bin/env -i \
HOME=/root \
TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/usr/bin:/usr/sbin \
/bin/bash --login