aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Boudreau <georgeb@linuxfromscratch.org>2008-10-21 21:29:13 +0000
committerGeorge Boudreau <georgeb@linuxfromscratch.org>2008-10-21 21:29:13 +0000
commit7c170663ed6457877cb48e4d3fb4aa1201465203 (patch)
tree562fe5ee23ffce31addf2c615d0a69ba56d1bf2d
parent15c9e722d518599b172b20b427a3de3c870d5e30 (diff)
LFS only:: Added ability to enter chroot using makefile. (code:Bruce Dubbs)
-rw-r--r--LFS/master.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/LFS/master.sh b/LFS/master.sh
index f3d28ad64a..e04e97bbbf 100644
--- a/LFS/master.sh
+++ b/LFS/master.sh
@@ -437,6 +437,14 @@ ck_UID:
exit 1; \\
fi
+ck_LFS:
+ @if [ \`echo \$(LFS)\`x = "x" ]; then \\
+ echo "--------------------------------------------------"; \\
+ echo "Enviroment variable LFS must be set"; \\
+ echo "--------------------------------------------------"; \\
+ exit 1; \
+ fi
+
mk_SETUP:
@\$(call echo_SU_request)
@sudo make BREAKPOINT=\$(BREAKPOINT) SETUP
@@ -478,6 +486,26 @@ mk_BLFS_TOOL: mk_CUSTOM_TOOLS
fi;
@touch \$@
+devices: ck_LFS ck_UID
+ sudo mount -v --bind /dev \$(LFS)/dev
+ sudo mount -vt devpts devpts \$(LFS)/dev/pts
+ sudo mount -vt tmpfs shm \$(LFS)/dev/shm
+ sudo mount -vt proc proc \$(LFS)/proc
+ sudo mount -vt sysfs sysfs \$(LFS)/sys
+
+teardown: ck_LFS
+ sudo umount -v \$(LFS)/sys
+ sudo umount -v \$(LFS)/proc
+ sudo umount -v \$(LFS)/dev/shm
+ sudo umount -v \$(LFS)/dev/pts
+ sudo umount -v \$(LFS)/dev
+
+chroot: devices
+ sudo /usr/sbin/chroot \$(LFS) /tools/bin/env -i \\
+ HOME=/root TERM=\$(TERM) PS1='\\u:\\w\\\$\$ ' \\
+ PATH=/bin:/usr/bin:/sbin:/usr/sbin \\
+ /tools/bin/bash --login
+ \$(MAKE) teardown
SETUP: $chapter4
LUSER: $chapter5