]> Untitled Git - hvlinux.git/commitdiff
-Ajouté fichier à chaque stage pour indiquer qu'il est complété.
authorgobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Sun, 13 Mar 2011 14:30:51 +0000 (14:30 +0000)
committergobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Sun, 13 Mar 2011 14:30:51 +0000 (14:30 +0000)
-Réglé problèmes avec Makefile pour les stages

Makefile
functions/main
stage0/create-version
stage0/hv-install-1
stage1/hv-install-1
stage1/post-install
stage2/hv-install-2
stage3/hv-install-1
stage4/hv-install-1
stage5/hv-install-1
stage6/hv-install-1

index 2b3202befd1436a24cde10549e21afab2b1f7207..933338df5d789bc55b3295742e7b8c73f87af722 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,9 +12,9 @@
 RUN_MODE := $(shell . functions/version && check_hvlinux_version)
 
 ifeq ($(RUN_MODE),HOST)
-  STAGES := "0 1"
+  STAGES := 0 1
 else ifeq ($(RUN_MODE),NATIVE)
-  STAGES := "2 3 4 5"
+  STAGES := 2 3 4 5
 else
   $(error Unable to determine run mode.)
 endif
@@ -27,7 +27,6 @@ ifeq ($(MAKECMDGOALS),test)
 endif
 
 all:
-       @echo "Stages: $(STAGES)"
        @for k in $(STAGES); do \
          make -C stage$${k} $(MAKECMDGOALS); \
         done
index 76aa3a057cf8d78ab20b16f2820b3e9466c26dfb..e0bd99e4cf3fe0894a0b0648151e502afc8e10a4 100644 (file)
@@ -1161,3 +1161,24 @@ print_status()
 
     echo
 }
+
+# This function will exit if the stage is already completed
+check_completed_stage()
+{
+    if [ -f ${LFS_LOG_DIR}/stage-completed ]; then
+        echo "${LFS_STAGE} completed"
+        exit 0
+    else
+        return 0
+    fi
+}
+
+write_completed_stage()
+{
+    touch ${LFS_LOG_DIR}/stage-completed
+}
+
+display_stage_build_stats()
+{
+    echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
+}
index 527e7ba9f23e25586e8b1ba089509d7c881a9534..6ebbff1aa1f9da49eded87c5aca6a5efd0b5527f 100644 (file)
@@ -6,24 +6,21 @@ create_hvlinux_version()
 {
     local CFG_DIR="../config"
 
-    if [ -f ${CFG_DIR}/${HV_VER_FILE} ]; then
-        echo "Version file already created"
-        return 0
-    fi
-
-    echo "Create new hvlinux-version file"
+    if [ ! -f ${CFG_DIR}/${HV_VER_FILE} ]; then
+        echo "Create new hvlinux-version file"
 
-    if [ ! -x /usr/bin/uuidgen ]; then
-        echo "Error, missing /usr/bin/uuidgen program"
-        exit 1
-    fi
+        if [ ! -x /usr/bin/uuidgen ]; then
+            echo "Error, missing /usr/bin/uuidgen program"
+            exit 1
+        fi
 
-    cat > ${CFG_DIR}/${HV_VER_FILE} <<EOF
+        cat > ${CFG_DIR}/${HV_VER_FILE} <<EOF
 # Do not edit this file.
 # This file is autogenerated by the HVLinux build system
 EOF
 
-    echo "HVUUID=$(uuidgen)" >> ${CFG_DIR}/${HV_VER_FILE}
+        echo "HVUUID=$(uuidgen)" >> ${CFG_DIR}/${HV_VER_FILE}
+    fi
 
     # Copy local file to destination LFS partition
     mkdir -pv ${LFS}/etc
index 8b69a4ab25dd9ef1d0a91596a302a1734f3a5175..72fb50be0fbbbf66b98a3627095a2b4e85017113 100755 (executable)
@@ -4,6 +4,9 @@ source ../functions/main
 
 init_log_file
 
+# This function will exit if the stage is already completed
+check_completed_stage
+
 rscr mult "Performing pre-install" pre-install
 rscr mult "Creating HVLinux version file" create-version
 
@@ -12,6 +15,7 @@ rscr mult "Creating HVLinux version file" create-version
 # directory of the user.
 su - lfs -c "cd ${PWD}; ./hv-install-2"
 
-echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
+write_completed_stage
+display_stage_build_stats
 
 exit 0
index a33015dbcff2a43a2e8cd7ed194a6e8a4dcb5dd2..0fe2837a74d3abb78128709d70e2aa76a075a6d8 100755 (executable)
@@ -4,6 +4,9 @@ source ../functions/main
 
 init_log_file
 
+# This function will exit if the stage is already completed
+check_completed_stage
+
 rscr mult "Performing pre-install" pre-install
 
 # Logging-in as 'lfs' user, and executing the hv-install-2 script. The
@@ -12,7 +15,7 @@ rscr mult "Performing pre-install" pre-install
 su - lfs -c "cd ${PWD}; ./hv-install-2"
 
 rscr mult "Performing post-install" post-install
-
-echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
+write_completed_stage
+display_stage_build_stats
 
 exit 0
index 5f4755b45609779f392329f7f0bf875c2cff7b04..e9c8eaa32bbbf71f19a716df1e767828e027e123 100755 (executable)
@@ -45,4 +45,6 @@ fi
 # Change the ownership for ${LFS} and its subdirectories
 chown -Rv root:root ${LFS}
 
+write_completed_stage
+
 exit $?
index 857afa36334935cf66a43e17a5f0f5e4bda7764c..1a78e4c0681e3a49d5d188db46a88ea88358cce1 100755 (executable)
@@ -68,4 +68,6 @@ echo "Stage2 successfully completed."
 echo "You must now compile a new kernel (go to /usr/src/linux)."
 echo "After that, you can reboot and try your new system."
 
+write_completed_stage
+
 exec /bin/bash --login
index f26a298b5380a44965b772736709492dcc8f5319..a1837beef112d042e345cb6162dce7b2680dc80a 100755 (executable)
@@ -119,6 +119,7 @@ ipkg -m noac ${LIBMNG}
 ipkg ${FREETYPE}
 ipkg ${FONTCONFIG}
 
-echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
+write_completed_stage
+display_stage_build_stats
 
 exit $?
index 37297bd52781b9c7c80dadb4a57d3a3df3b3cf9b..9ed64fd19386288912d6dd52632c3f98bd470170 100755 (executable)
@@ -119,4 +119,7 @@ ipkg ${PYTHON} "--enable-shared"
 ipkg -m acnb ${WINDOWMAKER}
 ipkg ${WINDOWMAKER_EXTRA}
 
+write_completed_stage
+display_stage_build_stats
+
 exit $?
index 55940a69659bb8ea639644bc0543d5f21eda6c6e..ed9878ac7c1adf067f454cd15b171eefe2ccee29 100755 (executable)
@@ -243,4 +243,7 @@ ipkg ${GEDA_GATTRIB}
 
 rscr mult  "Performing post-install" cis-post-install
 
+write_completed_stage
+display_stage_build_stats
+
 exit $?
index 84e42314ac897e5538f84f82cecd200a87915e5c..5fbdcda8afbc94fcc0cde1c4feb2ca8e6d274d11 100755 (executable)
@@ -107,4 +107,7 @@ ipkg ${ABIWORD}  "--disable-spellcheck"
 ipkg_gnome ${EVOLUTION} "--with-nss-includes=/usr/include/nss --with-nspr-includes=/usr/include/nspr --with-openldap=yes --with-krb5=/usr"
 ipkg_gnome ${EVOLUTION_EXCHANGE}
 
+write_completed_stage
+display_stage_build_stats
+
 exit $?