r3496 - in jhalfs/branches/experimental: LFS common common/libs

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Thu Sep 27 13:41:58 PDT 2007


Author: manuel
Date: 2007-09-27 14:41:58 -0600 (Thu, 27 Sep 2007)
New Revision: 3496

Modified:
   jhalfs/branches/experimental/LFS/master.sh
   jhalfs/branches/experimental/common/libs/func_wrt_Makefile
   jhalfs/branches/experimental/common/makefile-functions
Log:
Makefile envars and fuctions revised.

Modified: jhalfs/branches/experimental/LFS/master.sh
===================================================================
--- jhalfs/branches/experimental/LFS/master.sh	2007-09-27 19:26:14 UTC (rev 3495)
+++ jhalfs/branches/experimental/LFS/master.sh	2007-09-27 20:41:58 UTC (rev 3496)
@@ -100,13 +100,13 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    LUSER_wrt_target "${this_script}" "$PREV"
+    wrt_target "${this_script}" "$PREV"
 
     # Run the script.
     # The changingowner script must be run as root.
     case "${this_script}" in
       *changingowner)  wrt_RunAsRoot "$file" ;;
-      *)               LUSER_wrt_RunAsUser "$file" ;;
+      *)               wrt_RunScript "$file" ;;
     esac
 
     # Include a touch of the target name so make can check
@@ -185,29 +185,24 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    # In the mount of kernel filesystems we need to set LFS
-    # and not to use chroot.
-    case "${this_script}" in
-      *kernfs)  LUSER_wrt_target  "${this_script}" "$PREV" ;;
-      *)        CHROOT_wrt_target "${this_script}" "$PREV" ;;
-    esac
+    wrt_target  "${this_script}" "$PREV"
 
     # Touch timestamp file if installed files logs will be created.
     # But only for the firt build when running iterative builds.
     if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
-      CHROOT_wrt_TouchTimestamp
+      wrt_TouchTimestamp
     fi
 
     # In the mount of kernel filesystems we need to set LFS
     # and not to use chroot.
     case "${this_script}" in
-      *kernfs)  wrt_RunAsRoot  "$file" ;;
-      *)        CHROOT_wrt_RunAsRoot "$file" ;;
+      *kernfs)  wrt_RunAsRoot "$file" ;;
+      *)        wrt_RunScript "$file" ;;
     esac
 
     # Write installed files log
     if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
-      CHROOT_wrt_LogNewFiles "$name"
+      wrt_LogNewFiles "$name"
     fi
 
     # Include a touch of the target name so make can check
@@ -254,33 +249,31 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    CHROOT_wrt_target "${this_script}" "$PREV"
+    wrt_target "${this_script}" "$PREV"
 
     # For bootscripts and kernel, start INSTALL_LOG if requested
     case "${this_script}" in
       *bootscripts | *kernel ) if [ "${INSTALL_LOG}" = "y" ] ; then
-                                  CHROOT_wrt_TouchTimestamp
-                                fi ;;
+                                 wrt_TouchTimestamp
+                               fi ;;
     esac
 
       # Check if we have a real /etc/fstab file
     case "${this_script}" in
       *fstab) if [[ -n $FSTAB ]]; then
-                CHROOT_wrt_CopyFstab
+                wrt_CopyFstab
               else
-                CHROOT_wrt_RunAsRoot "$file"
-              fi
-        ;;
-      *)        CHROOT_wrt_RunAsRoot "$file"
-        ;;
+                wrt_RunScript "$file"
+              fi ;;
+           *) wrt_RunScript "$file" ;;
     esac
 
     case "${this_script}" in
       *bootscripts)  if [ "${INSTALL_LOG}" = "y" ] ; then
-                       CHROOT_wrt_LogNewFiles "lfs-bootscripts"
+                       wrt_LogNewFiles "lfs-bootscripts"
                      fi ;;
       *kernel)       if [ "${INSTALL_LOG}" = "y" ] ; then
-                       CHROOT_wrt_LogNewFiles "linux"
+                       wrt_LogNewFiles "linux"
                      fi ;;
     esac
 

Modified: jhalfs/branches/experimental/common/libs/func_wrt_Makefile
===================================================================
--- jhalfs/branches/experimental/common/libs/func_wrt_Makefile	2007-09-27 19:26:14 UTC (rev 3495)
+++ jhalfs/branches/experimental/common/libs/func_wrt_Makefile	2007-09-27 20:41:58 UTC (rev 3496)
@@ -17,26 +17,18 @@
 
 SHELL = /bin/bash
 
-SRC            = /sources
 MOUNT_PT       = $BUILDDIR
+SCRIPT_ROOT    = $SCRIPT_ROOT
+CMDSDIR        = $PROGNAME-commands
+SRC            = /sources
+SRCSDIR        = \$(MOUNT_PT)\$(SRC)
+FILELOGDIR     = /\$(SCRIPT_ROOT)/$FILELOGDIRBASE
+
 LUSER          = $LUSER
 LGROUP         = $LGROUP
 LHOME          = $LHOME
-SCRIPT_ROOT    = $SCRIPT_ROOT
-
-BASEDIR        = \$(MOUNT_PT)
-SRCSDIR        = \$(BASEDIR)/sources
-CMDSDIR        = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
-LOGDIR         = \$(BASEDIR)/\$(SCRIPT_ROOT)/$LOGDIRBASE
-TESTLOGDIR     = \$(BASEDIR)/\$(SCRIPT_ROOT)/$TESTLOGDIRBASE
-
-crCMDSDIR      = /\$(SCRIPT_ROOT)/$PROGNAME-commands
-crLOGDIR       = /\$(SCRIPT_ROOT)/$LOGDIRBASE
-crTESTLOGDIR   = /\$(SCRIPT_ROOT)/$TESTLOGDIRBASE
-crFILELOGDIR   = /\$(SCRIPT_ROOT)/$FILELOGDIRBASE
-
-SU_LUSER       = su - \$(LUSER) -c
 LUSER_HOME     = \$(LHOME)/\$(LUSER)
+SU_LUSER       = su - \$(LUSER) -c
 
 ADD_REPORT       = $REPORT
 ADD_CUSTOM_TOOLS = $CUSTOM_TOOLS
@@ -57,7 +49,7 @@
 #==== TARGET HEADER ====
 
 #----------------------------------#
-LUSER_wrt_target() {               # Create target
+wrt_target() {                     # Create target
 #----------------------------------#
   local i=$1
   local PREV=$2
@@ -71,28 +63,13 @@
 ) >> $MKFILE.tmp
 }
 
-#----------------------------------#
-CHROOT_wrt_target() {              #
-#----------------------------------#
-  local i=$1
-  local PREV=$2
-(
-cat << EOF
-
-$i:  $PREV
-	@\$(call echo_message, Building)
-	@export BASHBIN=\$(SHELL) && \$(SHELL) progress_bar.sh \$@ \$\$PPID &
-EOF
-) >> $MKFILE.tmp
-}
-
 #=======================
 
 
-#======== RUN AS =======
+#======== RUN THE SCRIPT =======
 
 #----------------------------------#
-wrt_RunAsRoot() {                  # Some scripts must be run as root..
+wrt_RunAsRoot() {                  # Some not-chroot scripts must be run as root..
 #----------------------------------#
   local MOUNT_ENV
   local file=$1
@@ -108,13 +85,13 @@
 
 (
 cat << EOF
-	@export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/`dirname $file`/\$@ > $LOGDIRBASE/\$@ 2>&1
+	@export ${MOUNT_ENV}=\$(MOUNT_PT) && \$(CMDSDIR)/`dirname $file`/\$@ > $LOGDIRBASE/\$@ 2>&1
 EOF
 ) >> $MKFILE.tmp
 }
 
 #----------------------------------#
-LUSER_wrt_RunAsUser() {            #
+wrt_RunScript() {                  #
 #----------------------------------#
   local file=$1
 
@@ -125,25 +102,13 @@
 ) >> $MKFILE.tmp
 }
 
-#----------------------------------#
-CHROOT_wrt_RunAsRoot() {           #
-#----------------------------------#
-  local file=$1
-(
-cat << EOF
-	@\$(crCMDSDIR)/`dirname $file`/\$@ > $LOGDIRBASE/\$@ 2>&1
-EOF
-) >> $MKFILE.tmp
-
-}
-
 #=======================
 
 
 #====== COPY FSTAB =====
 
 #----------------------------------#
-LUSER_wrt_CopyFstab() {            #
+LUSER_wrt_CopyFstab() {            # Needed for CLFS Sysroot and Embedded
 #----------------------------------#
 (
 cat << EOF
@@ -153,7 +118,7 @@
 }
 
 #----------------------------------#
-CHROOT_wrt_CopyFstab() {           #
+wrt_CopyFstab() {                  #
 #----------------------------------#
 (
 cat << EOF
@@ -168,7 +133,7 @@
 #==== INSTALLED FILES LOGS ====
 
 #----------------------------------#
-LUSER_wrt_TouchTimestamp() {       #
+LUSER_wrt_TouchTimestamp() {       # Needed for CLFS Sysroot and Embedded
 #----------------------------------#
 (
 cat << EOF
@@ -178,7 +143,7 @@
 }
 
 #----------------------------------#
-CHROOT_wrt_TouchTimestamp() {      #
+wrt_TouchTimestamp() {             #
 #----------------------------------#
 (
 cat << EOF
@@ -188,7 +153,7 @@
 }
 
 #----------------------------------#
-LUSER_wrt_LogNewFiles() {          #
+LUSER_wrt_LogNewFiles() {          # Needed for CLFS Sysroot and Embedded
 #----------------------------------#
   local name=$1
 (
@@ -199,7 +164,7 @@
 }
 
 #----------------------------------#
-CHROOT_wrt_LogNewFiles() {         #
+wrt_LogNewFiles() {                #
 #----------------------------------#
   local name=$1
 (

Modified: jhalfs/branches/experimental/common/makefile-functions
===================================================================
--- jhalfs/branches/experimental/common/makefile-functions	2007-09-27 19:26:14 UTC (rev 3495)
+++ jhalfs/branches/experimental/common/makefile-functions	2007-09-27 20:41:58 UTC (rev 3496)
@@ -83,13 +83,13 @@
 define log_new_files
   @find / -xdev ! -path "/$(SCRIPT_ROOT)/*" ! -path "/tmp/*" ! -path "$(SRC)/*" \
   -newer $(SRC)/timestamp-marker -not -type d \
-  -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(crFILELOGDIR)/$(1)
+  -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(FILELOGDIR)/$(1)
 endef
 
 define log_new_files_LUSER
-  @find $(BASEDIR) -xdev ! -path "$(BASEDIR)/$(SCRIPT_ROOT)/*" ! -path "$(BASEDIR)/tmp/*" ! -path "$(SRCSDIR)/*" \
+  @find $(MOUNT_PT) -xdev ! -path "$(MOUNT_PT)/$(SCRIPT_ROOT)/*" ! -path "$(MOUNT_PT)/tmp/*" ! -path "$(SRCSDIR)/*" \
   -newer $(SRCSDIR)/timestamp-marker -not -type d \
-  -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(BASEDIR)$(crFILELOGDIR)/$(1)
+  -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(MOUNT_PT)$(FILELOGDIR)/$(1)
 endef
 
 #=======================
@@ -101,8 +101,9 @@
   echo ; \
   echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created ; \
   echo ; \
-  echo $(WHITE)Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE) ; \
-  echo file to $(BOLD)manuel at linuxfromscratch.org$(WHITE) ; \
+  echo $(WHITE)If this is a development book build, please send the ; \
+  echo $(BOLD)$(MOUNT_PT)/$(SCRIPT_ROOT)/$(1)$(WHITE) file to ; \
+  echo $(BOLD)manuel at linuxfromscratch.org$(WHITE) ; \
   echo ; \
   echo That will help us to keep more accurate SBU and ; \
   echo disk usage values into the book. Thanks. ; \
@@ -167,7 +168,7 @@
   @echo  1.If it is necessary, transfer the newly created partition to the target machine
   @echo  2.Boot the new partition.
   @echo  3.Once you are logged in issue the following commands
-  @echo  $(tab_) $(BOLD)cd /jhalfs
+  @echo  $(tab_) $(BOLD)cd /$(SCRIPT_ROOT)
   @echo  $(tab_) $(BOLD)make makesys
   @echo  The build process should resume. Follow any instructions that appear.
   @echo --------------------------------------------------------------------------------




More information about the alfs-log mailing list