我現在想用要執行某一腳本,但是用chroot之後不,後面的腳本就走不下去了,有誰能幫忙想個辦法?
我的腳本是:
if [ -r /mnt/lfs ]
then
source /mylfsshell/alfs_02.sh
else
echo "the directory is not exit! we will go on....."
sleep 1
cfdisk /dev/hda
mkswap /dev/hda1
mkfs.xfs -f /dev/hda5
export LFS=/mnt/lfs
mkdir -pv $LFS
mount /dev/hda5 $LFS
chmod -v a+wt /mnt/lfs
chown -v jhalfs /mnt/lfs
echo "we will setup the user jhalfs's password: "
sleep 2
passwd jhalfs
su -l jhalfs -c "
cd
cd jhalfs-2.3.1/
whoami
whoami
pwd
time make
"
mount --bind /dev /mnt/lfs/dev
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
#mount –vt devpts devpts $LFS/dev/pts
#mount –vt tmpfs shm $LFS/dev/shm
mkdir -v $LFS/mylfsshell
cp -fr $packagedir/* $shdir/* $LFS/mylfsshell
chmod 777 $LFS/mylfsshell/ -Rf
chroot "$LFS" /usr/bin/env -i \
HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/bin/bash --login
cp /mylfsshell/utf8-kernel-2.6.22.5-core-1.patch /sources
cp /mylfsshell/utf8-kernel-2.6.22.5-fonts-1.patch /sources
sh /mylfsshell/alfs_01.sh
#----------------finished---------------------
cp /mylfsshell/utf8-kernel-2.6.22.5-core-1.patch /sources
cp /mylfsshell/utf8-kernel-2.6.22.5-fonts-1.patch /sources
sh /mylfsshell/alfs_01.sh
後面這些就執行不了。
有沒什麼好的方法能讓chroot繼續執行,並且後面的命令不影響