r2847 - in jhalfs/branches/experimental: . HLFS

georgeb at linuxfromscratch.org georgeb at linuxfromscratch.org
Thu Jul 27 20:55:41 PDT 2006


Author: georgeb
Date: 2006-07-27 21:55:40 -0600 (Thu, 27 Jul 2006)
New Revision: 2847

Modified:
   jhalfs/branches/experimental/Config.in
   jhalfs/branches/experimental/HLFS/master.sh
Log:
Tweaking the hlfs code.. stomping on bugs

Modified: jhalfs/branches/experimental/Config.in
===================================================================
--- jhalfs/branches/experimental/Config.in	2006-07-27 21:37:57 UTC (rev 2846)
+++ jhalfs/branches/experimental/Config.in	2006-07-28 03:55:40 UTC (rev 2847)
@@ -276,11 +276,18 @@
 			# has been supplied?
 
 	config	CONFIG_RUNMAKE
-		bool "Run the makefile"
+		bool	"Run the makefile"
 		default n
 		help
 			#--- Automatically run the makefile once it has been created
 
+	config	CONFIG_REBUILD
+		bool	"Rebuild files"
+		default	n
+		help
+			Clean the build directory before performing any other task. The directory
+			is cleaned only if it was populated by a previous JHALFS run.
+
 	config	CONFIG_STRIP
 		bool "Strip Installed Binaries/Libraries"
 		default y
@@ -387,7 +394,7 @@
 	   endchoice
 	   config	TEST
 		int
-		default	"0"	if !CONFIG_TEST
+		default	"0"	if !CONFIG_TESTS
 		default	"1"	if TST_1
 		default	"2"	if TST_2
 		default	"3"	if TST_3
@@ -432,9 +439,6 @@
 		default	"letter"	if PAGE_LETTER
 		default	"A4"		if PAGE_A4
 
-
-
-
 	config BUILDDIR
 		string "Build Directory"
 		default "/mnt/build_dir"
@@ -524,3 +528,7 @@
 		default	0	if !CONFIG_FARCE
 		default	1	if  CONFIG_FARCE
 
+	config	CLEAN
+		int
+		default	0	if !CONFIG_REBUILD
+		default	1	if  CONFIG_REBUILD

Modified: jhalfs/branches/experimental/HLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/HLFS/master.sh	2006-07-27 21:37:57 UTC (rev 2846)
+++ jhalfs/branches/experimental/HLFS/master.sh	2006-07-28 03:55:40 UTC (rev 2847)
@@ -43,6 +43,22 @@
 ) >> $MKFILE.tmp
 }
 
+#----------------------------------#
+wrt_RunAsRoot() {                  # Some scripts must be run as root..
+#----------------------------------#
+  local user_ACCT=$(echo $1 | tr [a-z] [A-Z])
+  local this_script=$2
+  local file=$3
+
+(
+cat << EOF
+	@( time { export ${user_ACCT}=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
+	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/$this_script
+EOF
+) >> $MKFILE.tmp
+}
+
+
 #----------------------------#
 process_toolchain() {        # embryo,cocoon and butterfly need special handling
 #----------------------------#
@@ -58,43 +74,40 @@
   wrt_Unpack_SetOwner "hlfs" "$pkg_tarball" 1
   pkg_tarball=$(get_package_tarball_name "gcc-g++")
   wrt_Unpack_SetOwner "hlfs" "$pkg_tarball" 1
+
+  case ${toolchain} in
+    *butterfly*)
+      [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
 (
 cat << EOF
+	@echo "export PKGDIR=\$(SRC)" > envars
+EOF
+) >> $MKFILE.tmp
+      wrt_run_as_chroot1 "$toolchain" "$this_script"
+      ;;
+    *)
+(
+cat << EOF
 	@echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)" > envars
 EOF
 ) >> $MKFILE.tmp
-  if [[ ${toolchain} = "butterfly-toolchain" ]]; then
-    [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
-    wrt_run_as_chroot1 "$toolchain" "$this_script"
-  else
-    wrt_ExecuteAsUser "hlfs" "$toolchain" "$this_script"
-  fi
+      wrt_ExecuteAsUser "hlfs" "$toolchain" "$this_script"
+      ;;
+  esac
 
   pkg_tarball=$(get_package_tarball_name "binutils")
   wrt_remove_existing_dirs  "$pkg_tarball"
   pkg_tarball=$(get_package_tarball_name "gcc-core")
   wrt_remove_existing_dirs  "$pkg_tarball"
-
+  #
   # Manually remove the toolchain directories..
   tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's at -toolchain@@'`
-  case $tc_phase in 
-    embryo | cocoon)  # toolchain phase
 (
 cat << EOF
 	@rm -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-toolchain && \\
 	rm  -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-build
 EOF
 ) >> $MKFILE.tmp
-    ;;    
-    butterfly )	# system phase
-(
-cat << EOF
-	@rm -r \$(SRC)/butterfly-toolchain && \\
-	rm -r \$(SRC)/butterfly-build
-EOF
-) >> $MKFILE.tmp
-    ;;
-  esac
 
 }
 
@@ -376,7 +389,7 @@
     # In the mount of kernel filesystems we need to set LFS and not to use chroot.
     case "${this_script}" in
       *kernfs*)
-        wrt_run_as_root "${this_script}" "${file}"
+        wrt_RunAsRoot "hlfs" "${this_script}" "${file}"
         ;;
       *)   # The rest of Chapter06
         wrt_run_as_chroot1 "${this_script}" "${file}"
@@ -421,7 +434,6 @@
     case $this_script in
       *usage)   continue  ;; # Contains example commands
       *grub)    continue  ;;
-      *reboot)  continue  ;;
       *console) continue  ;; # Use the file generated by lfs-bootscripts
 
       *kernel)




More information about the alfs-log mailing list