r3521 - jhalfs/trunk/LFS

georgeb at linuxfromscratch.org georgeb at linuxfromscratch.org
Tue Oct 21 14:29:13 PDT 2008


Author: georgeb
Date: 2008-10-21 15:29:13 -0600 (Tue, 21 Oct 2008)
New Revision: 3521

Modified:
   jhalfs/trunk/LFS/master.sh
Log:
LFS only:: Added ability to enter chroot using makefile. (code:Bruce Dubbs)

Modified: jhalfs/trunk/LFS/master.sh
===================================================================
--- jhalfs/trunk/LFS/master.sh	2008-10-21 21:24:25 UTC (rev 3520)
+++ jhalfs/trunk/LFS/master.sh	2008-10-21 21:29:13 UTC (rev 3521)
@@ -437,6 +437,14 @@
 	  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,7 +486,27 @@
 	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
 SUDO:         $runasroot




More information about the alfs-log mailing list