Changeset 4c62c61


Ignore:
Timestamp:
10/03/2005 10:00:09 PM (19 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
0.2, 1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
a6d9007
Parents:
7d98315
Message:

LOGDIR envar isn't needed in the Makefile.
All packages are unpacked, and the sources directories deleted, outside chroot.
Added echo_message to Chapter06 targets.
Fixed the 067-readjusting target creation.
Added -x tu the du command to skipp kernel filesystems (I think).
Sourced envars from inside the chroot command.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • functions

    r7d98315 r4c62c61  
    77
    88define echo_message
    9         @echo $(BRW)
    10         @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    11         @echo $(BRW)$(1) target $(BLUE)$@$(BRW)
    12         @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$(WHITE)
    13 endef
    14 
    15 define unpack-lfs
    16         @cd $(LFS)$(SRC) ; tar -xvjf $(1) > /tmp/unpacked
     9  @echo $(BRW)
     10  @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     11  @echo $(BRW)$(1) target $(BLUE)$@$(BRW)
     12  @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$(WHITE)
    1713endef
    1814
    1915define unpack
    20         @cd $(SRC) ; tar -xvf $(1) > /tmp/unpacked
     16        @cd $(LFS)$(SRC) ; tar -xvjf $(1) > /tmp/unpacked
    2117endef
  • jhalfs

    r7d98315 r4c62c61  
    144144if [ -z $BUILDDIR ] ; then BUILDDIR=/mnt/lfs ; fi
    145145JHALFSDIR=$BUILDDIR/jhalfs
    146 LOGDIR=/jhalfs/logs
     146LOGDIR=$JHALFSDIR/logs
    147147LOG=000-jhalfs.log
    148148MKFILE=$JHALFSDIR/Makefile
     
    186186    else
    187187      if [ $LFSVRS = development ] ; then
    188         svn co $SVN/LFS/trunk/BOOK lfs-$LFSVRS >>$BUILDDIR$LOGDIR/$LOG 2>&1
     188        svn co $SVN/LFS/trunk/BOOK lfs-$LFSVRS >>$LOGDIR/$LOG 2>&1
    189189      else
    190         svn co $SVN/LFS/branches/$LFSVRS/BOOK lfs-$LFSVRS >>$BUILDDIR$LOGDIR/$LOG 2>&1
     190        svn co $SVN/LFS/branches/$LFSVRS/BOOK lfs-$LFSVRS >>$LOGDIR/$LOG 2>&1
    191191      fi
    192192      echo -ne "done\n"
     
    211211  # Dump the commands in shell script form from the LFS book.
    212212  xsltproc --nonet --xinclude --stringparam testsuite $TEST -o ./commands/ \
    213   $XSL $BOOK/index.xml >>$BUILDDIR$LOGDIR/$LOG 2>&1
     213  $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
    214214
    215215  # Grab the patches and package names.
     
    345345      # Insert instructions for unpacking the package and to set
    346346      # the PKGDIR variable.
    347       echo -e "\t@\$(call unpack-lfs,$FILE)" >> $MKFILE.tmp
     347      echo -e "\t@\$(call unpack,$FILE)" >> $MKFILE.tmp
    348348      echo -e "\t@ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
    349349      echo -e "\tchown -R lfs \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
     
    352352    fi
    353353
    354     # Dump the path to the Binutils pass1 or TCL sources directory.
    355     if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then
     354    # Dump the path to the Binutils or TCL sources directory.
     355    if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" -o "$i" = "036-binutils-pass2" ] ; then
    356356      echo -e "\techo \"\$(LFS)\$(SRC)/\$\$ROOT\" > sources-dir" >> $MKFILE.tmp
    357 
    358     # Dump the path to the Binutils pass2 sources directory.
    359     elif [ "$i" = "036-binutils-pass2" ] ; then
    360       echo -e "\techo \"\$(SRC)/\$\$ROOT\" > sources-dir" >> $MKFILE.tmp
    361357
    362358    # For the Adjusting phase we must to cd to the binutils-build directory.
    363359    elif [ "$i" = "031-adjusting" ] ; then
    364       echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/binutils-build\" > envars && \\" >> $MKFILE.tmp
     360      echo -e "\t@echo \"PKGDIR=\$(LFS)\$(SRC)/binutils-build\" > envars && \\" >> $MKFILE.tmp
    365361      echo -e "\techo \"export PKGDIR\" >> envars" >> $MKFILE.tmp
    366362
     
    449445
    450446    # Drop in the name of the target on a new line, and the previous target
    451     # as a dependency.
     447    # as a dependency. Also call the echo_message function.
    452448    if echo $i | grep -q "chroot" ; then
    453449       continue
    454450    else
    455        echo -e "\n$i:  $PREV" >> $MKFILE.tmp
     451      echo -e "\n$i:  $PREV" >> $MKFILE.tmp
     452      echo -e "\t@\$(call echo_message, Building)" >> $MKFILE.tmp
    456453    fi
    457454
     
    468465      echo -e "\t@ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
    469466      echo -e "\techo \"PKGDIR=\$(SRC)/\$\$ROOT\" > envars && \\" >> $MKFILE.tmp
    470       echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
     467      echo -e "\techo \"export PKGDIR\" >> envars\\" >> $MKFILE.tmp
    471468    fi
    472469
    473470    # For the Re-Adjusting phase we must to cd to the binutils-build directory.
    474471    if [ "$i" = "067-readjusting" ] ; then
    475       echo -e "\techo \"PKGDIR=\$(SRC)/binutils-build\" > envars && \\" >> $MKFILE.tmp
     472      echo -e "\t@echo \"PKGDIR=\$(SRC)/binutils-build\" > envars && \\" >> $MKFILE.tmp
    476473      echo -e "\techo \"export PKGDIR\" >> envars" >> $MKFILE.tmp
    477 
    478     # Insert the script run
    479     # For the mount of kernel filesystems we need to set LFS.
    480     elif [ "$i" = "057-kernfs" ] ; then
    481       echo -e "\techo \"LFS=\$(LFS)\" > envars && \\" >> $MKFILE.tmp
     474    fi
     475
     476    # For the mount of kernel filesystems we need to set LFS and not to use
     477    # chroot.
     478    if [ "$i" = "057-kernfs" ] ; then
     479      echo -e "\t@echo \"LFS=\$(LFS)\" > envars && \\" >> $MKFILE.tmp
    482480      echo -e "\techo \"export LFS\" >> envars && \\" >> $MKFILE.tmp
    483481      # Insert date and disk usage at the top of the log file.
    484482      echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >logs/$i && \\" >> $MKFILE.tmp
     483      # Insert the script run
    485484      echo -e "\t. envars && commands/$file >>logs/$i 2>&1 && \\" >> $MKFILE.tmp
    486485      # Insert date and disk usage at the bottom of the log file.
    487486      echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\\\n\" >>logs/$i" >> $MKFILE.tmp
     487    # The rest of Chapter06 use CHROOT1 function
    488488    else
    489489      # Insert date and disk usage at the top of the log file.
    490       echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* /\`\\\n\" >logs/$i && \\" >> $MKFILE.tmp
    491       echo -e "\t. envars && \$(CHROOT1) 'cd /jhalfs && commands/$file >>logs/$i 2>&1' && \\" >> $MKFILE.tmp
     490      echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -skx --exclude=0??-* \$(LFS)\`\\\n\" >logs/$i && \\" >> $MKFILE.tmp
     491      # Insert the script run
     492      echo -e "\t\$(CHROOT1) 'cd /jhalfs && . envars && commands/$file >>logs/$i 2>&1' && \\" >> $MKFILE.tmp
    492493      # Insert date and disk usage at the bottom of the log file.
    493       echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -sk --exclude=0??-* /\`\\\n\" >>logs/$i" >> $MKFILE.tmp
     494      echo -e "\techo -e \"\\\n\`date\`\\\n\\\nKB: \`du -skx --exclude=0??-* \$(LFS)\`\\\n\" >>logs/$i" >> $MKFILE.tmp
    494495    fi
    495496
     
    497498    if [ "$vrs" != "" ] ; then
    498499      echo -e "\t@ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
    499       echo -e "\trm -r \$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
    500       echo -e "\tif [ -e \$(SRC)/$name-build ]; then \\" >> $MKFILE.tmp
    501       echo -e "\t\trm -r \$(SRC)/$name-build; \\" >> $MKFILE.tmp
     500      echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
     501      echo -e "\tif [ -e \$(LFS)\$(SRC)/$name-build ]; then \\" >> $MKFILE.tmp
     502      echo -e "\t\trm -r \$(LFS)\$(SRC)/$name-build; \\" >> $MKFILE.tmp
    502503      echo -e "\tfi;" >> $MKFILE.tmp
    503504    fi
     
    506507    if [ "$i" = "067-readjusting" ] ; then
    507508      echo -e "\t@rm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp
    508       echo -e "\trm -r \$(SRC)/binutils-build && \\" >> $MKFILE.tmp
     509      echo -e "\trm -r \$(LFS)\$(SRC)/binutils-build && \\" >> $MKFILE.tmp
    509510      echo -e "\trm sources-dir" >> $MKFILE.tmp
    510511    fi
     
    523524  # Add some variables and include the functions file
    524525  echo "SRC= /sources" >> $MKFILE
    525   echo "LFS= $BUILDDIR" >> $MKFILE
    526   echo -e "LOGDIR= $LOGDIR\n" >> $MKFILE
     526  echo -e "LFS= $BUILDDIR\n" >> $MKFILE
    527527  echo -e "include functions\n" >> $MKFILE
    528528
     
    541541  echo -e "\t@echo -e \"\\\n\\\tYour new LFS system has been successfully built\"\n" >> $MKFILE
    542542  echo -e "chapter4:  020-creatingtoolsdir 021-addinguser 022-settingenvironment\n" >> $MKFILE
    543   echo -e "chapter5:  chapter4 $chapter5\n" >> $MKFILE >> $MKFILE
     543  echo -e "chapter5:  chapter4 $chapter5\n" >> $MKFILE
    544544  echo -e "chapter6:  chapter5 $chapter6\n" >> $MKFILE
    545545
     
    620620fi
    621621
    622 if [ ! -d $BUILDDIR$LOGDIR ] ; then
    623   mkdir $BUILDDIR$LOGDIR
     622if [ ! -d $LOGDIR ] ; then
     623  mkdir $LOGDIR
    624624fi
    625625
    626 >$BUILDDIR$LOGDIR/$LOG
     626>$LOGDIR/$LOG
    627627
    628628if [ "$PWD" != "$JHALFSDIR" ] ; then
Note: See TracChangeset for help on using the changeset viewer.