Changeset 65d83a6
- Timestamp:
- 05/03/2006 07:35:01 PM (18 years ago)
- Branches:
- experimental
- Children:
- 17c7894
- Parents:
- 3e7af38
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
LFS/master.sh
r3e7af38 r65d83a6 162 162 # Remove Bzip2 binaries before make install 163 163 sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i chapter06$N/*-bzip2 164 # Fix how Module-Init-Tools do the install target165 sed -e 's@make install@make INSTALL=install install@' -i chapter06$N/*-module-init-tools166 # Delete *old Readline libraries just after make install167 sed -e 's@make install@&\nrm -v /lib/lib{history,readline}*old@' -i chapter06$N/*-readline168 164 # Let some Udev pre-installation commands to fail 169 165 sed -e 's@/lib/udev/devices/fd@& || true@' \ -
README
r3e7af38 r65d83a6 76 76 Q. "It doesn't work" 77 77 A. Yes it does.. 78 78 79 Q. "How do I specify the build location" 80 A. The original LFS document worked against the well know location /mnt/lfs. 81 This script automates the build of all of the LFS series of books and uses 82 a generic location $BUILDDIR with a default value a /mnt/build_dir. 83 You may change this value to suit your needs. 84 85 The layout below $BUILDDIR is as follows. 86 $BUILDDIR/ 87 jhalfs (makefile,cmd scripts,logs..etc) 88 sources (where packages reside 89 temptools (temporary bootstrap system 90 cross-tools (CLFS only) 91 ... 92 FHS dir structure 93 ... 94 79 95 Q. "What is the function of the SRC_ARCHIVE variable 80 96 A. When then symlinked master.sh runs it creates a local copy of the … … 84 100 If the files are not found in SRC_ARCHIVE _and_ you have write priv to 85 101 the directory any downloaded files will be mirrored there. 86 102 103 Q. "How do I set the SRC_ARCHIVE location" 104 A. The best way to set the value of SRC_ARCHIVE is 105 export SRC_ARCHIVE=/wherever/you/store/downloaded/packages 106 OR 107 you can change the setting in .common/config. 108 87 109 Q. "Why have 2 copies of the files." 88 110 A. The package files must be visible during the chroot phase and this is a -
common/common-functions
r3e7af38 r65d83a6 25 25 declare -r nl_=$'\n' 26 26 27 declare -r DD_BORDER="${BOLD} ${WHITE}==============================================================================${OFF}"28 declare -r SD_BORDER="${BOLD} ${WHITE}------------------------------------------------------------------------------${OFF}"29 declare -r STAR_BORDER="${BOLD} ${WHITE}******************************************************************************${OFF}"27 declare -r DD_BORDER="${BOLD}==============================================================================${OFF}" 28 declare -r SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}" 29 declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}" 30 30 31 31 # bold yellow > < pair … … 54 54 use DIR directory for building ${BOLD}$(echo $PROGNAME | tr [a-z] [A-Z])${OFF}; all files jhalfs-X produces 55 55 will be in the directory DIR/jhalfs. 56 The current setting for BUILDDIR is "$BUILDDIR" 56 57 57 58 ${BOLD} -G, --get-packages${OFF} … … 245 246 246 247 247 # =============================#248 wrt_unpack3() { #249 # =============================#248 #----------------------------------# 249 wrt_unpack3() { # 250 #----------------------------------# 250 251 local FILE=$1 251 252 ( … … 301 302 302 303 303 # =============================#304 wrt_run_as_root2() { #305 # =============================#304 #----------------------------------# 305 wrt_run_as_root2() { # 306 #----------------------------------# 306 307 local this_script=$1 307 308 local file=$2 … … 400 401 401 402 #----------------------------------# 402 wrt_report() { #403 wrt_report() { # 403 404 #----------------------------------# 404 405 ( … … 418 419 419 420 #----------------------------# 420 run_make() { 421 run_make() { # 421 422 #----------------------------# 422 423 # Test if make must be run. … … 438 439 439 440 #----------------------------# 440 clean_builddir() { 441 clean_builddir() { # 441 442 #----------------------------# 442 443 # Test if the clean must be done. … … 465 466 466 467 #----------------------------# 467 get_book() { 468 get_book() { # 468 469 #----------------------------# 469 470 cd $JHALFSDIR … … 488 489 if [ -d ${PROGNAME}-$LFSVRS ] ; then 489 490 cd ${PROGNAME}-$LFSVRS 490 if LC_ALL=C svn up | grep -q At && test -d $JHALFSDIR/ commands && \491 test -f $JHALFSDIR/packages && test -f $JHALFSDIR/patches; then491 if LC_ALL=C svn up | grep -q At && test -d $JHALFSDIR/${PROGNAME}-commands && \ 492 test -f $JHALFSDIR/packages ; then 492 493 echo -ne "done\n" 493 494 # Set the canonical book version … … 628 629 } 629 630 630 631 631 #----------------------------# 632 632 get_sources() { # Download file, write name to MISSING_FILES.DMP if an error 633 633 #----------------------------# 634 634 local saveIFS=$IFS 635 local IFS line URL1 URL2 FILE MD5 636 637 # Test if the packages must be downloaded 638 if [ "$GETPKG" = "1" ] ; then 639 640 [[ ! -d $BUILDDIR/sources ]] && mkdir $BUILDDIR/sources 641 cd $BUILDDIR/sources 642 [[ -f MD5SUMS ]] && rm MD5SUMS 643 [[ -f MD5SUMS-$VERSION ]] && rm MD5SUMS-$VERSION 644 [[ -f MISSING_FILES.DMP ]] && rm MISSING_FILES.DMP 645 [[ -f urls.lst ]] && rm urls.lst 635 local IFS line URL1 URL2 FILE MD5 HAVEMD5 fromARCHIVE 636 637 # Test if the packages must be downloaded 638 [ ! "$GETPKG" = "1" ] && return 639 640 gs_wrt_message(){ 641 echo "${RED}$1${OFF}" 642 echo "$1" >> MISSING_FILES.DMP 643 } 644 # Housekeeping 645 [[ ! -d $BUILDDIR/sources ]] && mkdir $BUILDDIR/sources 646 cd $BUILDDIR/sources 647 [[ -f MD5SUMS ]] && rm MD5SUMS 648 [[ -f MD5SUMS-$VERSION ]] && rm MD5SUMS-$VERSION 649 [[ -f MISSING_FILES.DMP ]] && rm MISSING_FILES.DMP 650 [[ -f urls.lst ]] && rm urls.lst 646 651 647 652 # Download a fresh MD5SUMS file 648 653 wget $SERVER/pub/lfs/conglomeration/MD5SUMS 649 654 650 655 # Generate URLs file 651 652 653 654 655 656 create_urls 657 658 IFS=$'\x0A' # Modify the 'internal field separator' to break on 'LF' only 659 for line in `cat urls.lst`; do 660 IFS=$saveIFS # Restore the system defaults 656 661 657 662 # Skip some packages if they aren't needed 658 663 case $line in 659 664 */tcl* | */expect* | */dejagnu* | */tree* | */gcc-testsuite* ) 660 665 [[ "$TEST" = "0" ]] && continue … … 663 668 [[ "$VIMLANG" = "0" ]] && continue 664 669 ;; 665 esac 666 667 URL1=`echo $line | cut -d" " -f1` # Upstream URL 668 URL2=`echo $line | cut -d" " -f2` # Fallback URL 669 FILE=`basename $URL2` # File name 670 671 # If the file exists in the archive copy it to the $BUILDDIR/sources dir 672 # MD5SUM is assumed to be correct from previous download 673 if [ ! -z ${SRC_ARCHIVE} ] && 674 [ -d ${SRC_ARCHIVE} ] && 675 [ -f ${SRC_ARCHIVE}/$FILE ]; then 676 cp ${SRC_ARCHIVE}/$FILE . 677 echo "$FILE: -- copied from $SRC_ARCHIVE" 670 esac 671 672 # Locations 673 URL1=`echo $line | cut -d" " -f2` # Preferred URL 674 URL2=`echo $line | cut -d" " -f1` # Fallback Upstream URL 675 FILE=`basename $URL2` # File name 676 677 # Find the md5 sum for this package. 678 set +e 679 HAVEMD5=1 # Always assume we have a MD5SUM 680 MD5=`grep " $FILE" MD5SUMS` 681 if [ $? -ne 0 ]; then 682 set -e 683 gs_wrt_message "$FILE not found in MD5SUMS" 684 # IMPORTANT:: There is no MD5SUM for this file. 685 HAVEMD5=0 686 fi 687 688 set -e 689 # If the file exists in the archive copy it to the 690 # $BUILDDIR/sources dir. MD5SUM will be validated later. 691 if [ ! -z ${SRC_ARCHIVE} ] && 692 [ -d ${SRC_ARCHIVE} ] && 693 [ -f ${SRC_ARCHIVE}/$FILE ]; then 694 cp ${SRC_ARCHIVE}/$FILE . 695 echo "$FILE: -- copied from $SRC_ARCHIVE" 696 fromARCHIVE=1 697 else 698 echo "${BOLD}${YELLOW}$FILE: not found in ${SRC_ARCHIVE}${OFF}" 699 fromARCHIVE=0 700 # If the file does not exist in /sources download a fresh one 701 if [ ! -f $FILE ] ; then 702 if ! wget $URL1 && ! wget $URL2 ; then 703 gs_wrt_message "$FILE not found in the SRC_ARCHIVE or on any server..SKIPPING" 704 continue 705 fi 678 706 fi 679 680 # Find the md5 sum for this package. 681 set +e 682 MD5=`grep " $FILE" MD5SUMS` 683 if [ $? -ne 0 ]; then 684 set -e 685 echo "${RED}$FILE not found in MD5SUMS${OFF}" 686 echo "$FILE not found in MD5SUMS" >> MISSING_FILES.DMP 707 fi 708 709 # Is there a MD5SUM to validate the file against. 710 if [[ "$HAVEMD5" = "1" ]] ; then 711 # IF the md5sum does not match the existing files 712 if ! echo "$MD5" | md5sum -c - >/dev/null ; then 713 [[ $fromARCHIVE = "1" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match SRC_ARCHIVE copy${OFF}" 714 [[ $fromARCHIVE = "0" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match REMOTE copy${OFF}" 715 # Remove the old file and download a new one 716 rm -fv $FILE 717 # Force generation of MD5SUM and storage in SRC_ARCHIVE 718 fromARCHIVE=0; HAVEMD5=0 719 # Try and retrieve the file 720 if ! wget -N $URL1 && ! wget -N $URL2 ; then 721 gs_wrt_message "$FILE not found on the servers.. SKIPPING" 722 continue 723 fi 687 724 fi 688 set -e 689 690 if [ ! -f $FILE ] ; then 691 wget $URL1 || wget $URL2 692 elif ! echo "$MD5" | md5sum -c - >/dev/null 2>/dev/null ; then 693 wget -N $URL1 || wget -N $URL2 694 fi 695 696 if ! echo "$MD5" | md5sum -c - ; then 697 echo "${RED}$FILE not match MD5SUMS value${OFF}" 698 echo "$FILE not match MD5SUMS value" >> MISSING_FILES.DMP 699 fi 700 echo `grep "$MD5" MD5SUMS` >> MD5SUMS-$VERSION 701 702 # Copy the freshly downloaded file 703 # to the source archive. 704 if [ ! -z ${SRC_ARCHIVE} ] && 705 [ -d ${SRC_ARCHIVE} ] && 706 [ -w ${SRC_ARCHIVE} ] && 707 [ ! -f ${SRC_ARCHIVE}/$FILE ] ; then 708 echo "Store file:<$FILE> in package archive" 709 cp -v $FILE ${SRC_ARCHIVE} 710 fi 711 712 done 713 714 if [[ -s MISSING_FILES.DMP ]]; then 715 echo -e "\n\n${tab_}${RED} One or more files were not retrieved or have a bad MD5SUMS chechsum.\n${tab_} Check ${L_arrow}$BUILDDIR/sources/MISSING_FILES.DMP${R_arrow} for names ${OFF}\n\n" 716 fi 717 725 fi 726 727 # Validate the MD5SUM one last time 728 if [[ "$HAVEMD5" = "1" ]] && ! echo "$MD5" | md5sum -c - >/dev/null ; then 729 gs_wrt_message "$FILE does not match MD5SUMS value" 730 fi 731 732 # Generate a fresh MD5SUM for this file 733 if [[ "$HAVEMD5" = "0" ]] ; then 734 echo "${BOLD}${YELLOW}Generating a new MD5SUM for ${OFF}$FILE" 735 echo "NEW MD5SUM $(md5sum $FILE)" >> MISSING_FILES.DMP 736 fi 737 738 # Good or bad we write the original md5sum to a file 739 echo "$MD5" >> MD5SUMS-$VERSION 740 741 # Copy the freshly downloaded file 742 # to the source archive. 743 if [ ! -z ${SRC_ARCHIVE} ] && 744 [ -d ${SRC_ARCHIVE} ] && 745 [ -w ${SRC_ARCHIVE} ] && 746 [ "$fromARCHIVE" = "0" ] ; then 747 echo "Storing file:<$FILE> in the package archive" 748 cp -f $FILE ${SRC_ARCHIVE} 749 fi 750 751 done 752 753 if [[ -s MISSING_FILES.DMP ]]; then 754 echo -e "\n\n${tab_}${RED} One or more files were not retrieved or have a bad MD5SUMS chechsum.\n${tab_} Check ${L_arrow}$BUILDDIR/sources/MISSING_FILES.DMP${R_arrow} for names ${OFF}\n" 755 # Do not allow the automatic exection of the Makefile. 756 echo "${tab_}${BOLD}${RED}*** ${YELLOW}Automatic execution of the generated makefile has been inhibited. ${RED}***${OFF}${nl_}" 757 RUNMAKE=0 718 758 fi 719 759 } -
common/config
r3e7af38 r65d83a6 53 53 54 54 #--- set default timezone. 55 TIMEZONE= America/Toronto55 TIMEZONE=GMT 56 56 57 57 #--- install the optional vim-lang package 0(no)/1(yes) -
common/create-sbu_du-report.sh
r3e7af38 r65d83a6 15 15 echo -e "\nLooks like $LOGSDIR isn't a jhalfs logs directory.\n" && exit 16 16 17 # If this script is run manually, the book version may be unknow 17 # If this script is run manually, the book version may be unknown 18 18 [[ -z "$VERSION" ]] && VERSION=unknown 19 19 … … 75 75 76 76 #Start disk usage calculation 77 # Disk usage before unpack the package77 # Disk usage before unpacking the package 78 78 DU1=`grep "^KB: " $log | head -n1 | cut -f1 | sed -e 's/KB: //'` 79 79 DU1MB=`echo "scale=2; $DU1 / 1024" | bc` 80 # Disk usage before delet e sourcesand build dirs80 # Disk usage before deleting the source and build dirs 81 81 DU2=`grep "^KB: " $log | tail -n1 | cut -f1 | sed -e 's/KB: //'` 82 82 DU2MB=`echo "scale=2; $DU2 / 1024" | bc` … … 109 109 110 110 # Dump disk usage values 111 echo -e "\nDisk usage before unpack the package:\t\t\t$DU1 KB or $DU1MB MB" >> "$REPORT"112 echo -e "Disk usage before delet e sourcesand build dirs:\t$DU2 KB or $DU2MB MB" >> "$REPORT"111 echo -e "\nDisk usage before unpacking the package:\t\t\t$DU1 KB or $DU1MB MB" >> "$REPORT" 112 echo -e "Disk usage before deleting the source and build dirs:\t$DU2 KB or $DU2MB MB" >> "$REPORT" 113 113 echo -e "Required space to build the package:\t\t\t$REQUIRED1 KB or $REQUIRED2 MB\n" >> "$REPORT" 114 114 -
common/func_compare.sh
r3e7af38 r65d83a6 109 109 cat << EOF 110 110 @pushd logs 1> /dev/null && \\ 111 rm $ITERATION && \\ 111 112 mkdir $ITERATION && \\ 112 113 mv ${LOGS} $ITERATION && \\ -
common/func_validate_configs.sh
r3e7af38 r65d83a6 256 256 done 257 257 set -e 258 echo "$ tab_***${BOLD}${GREEN} ${PARAM_GROUP%%_*T} config parameters look good${OFF} ***"258 echo "${nl_}***${BOLD}${GREEN} ${PARAM_GROUP%%_*T} config parameters look good${OFF} ***${nl_}" 259 259 } -
common/urls.xsl
r3e7af38 r65d83a6 23 23 or not(ancestor::varlistentry[@condition])) and 24 24 (contains(@url, '.tar.') or contains(@url, '.tgz') 25 or contains(@url, '.patch') or contains(@url, '.rules')) and25 or contains(@url, '.patch')) and 26 26 not(ancestor-or-self::*/@condition = 'pdf')"> 27 27 <!-- Extract the package name --> -
master.sh
r3e7af38 r65d83a6 72 72 [[ $VERBOSITY > 0 ]] && echo "OK" 73 73 # 74 [[ $VERBOSITY > 0 ]] && echo " ---------------${nl_}"74 [[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}" 75 75 76 76 … … 93 93 [[ $? > 0 ]] && echo " function module did not load.." && exit 2 94 94 [[ $VERBOSITY > 0 ]] && echo "OK" 95 [[ $VERBOSITY > 0 ]] && echo " ---------------${nl_}"95 [[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}" 96 96 97 97 … … 433 433 tarVer=`tar --version` 434 434 check_version "1.15.0" "${tarVer##* }" "TAR" 435 echo " ---------------${nl_}"435 echo "${SD_BORDER}${nl_}" 436 436 437 437 validate_config 438 echo " ---------------${nl_}"438 echo "${SD_BORDER}${nl_}" 439 439 440 440 echo -n "Are you happy with these settings? yes/no (no): " … … 444 444 exit 1 445 445 fi 446 echo "${nl_} ---------------${nl_}"446 echo "${nl_}${SD_BORDER}${nl_}" 447 447 448 448 # Prevents setting "-d /" by mistake. … … 496 496 497 497 get_book 498 echo " ---------------${nl_}"498 echo "${SD_BORDER}${nl_}" 499 499 500 500 build_Makefile 501 echo " ---------------${nl_}"501 echo "${SD_BORDER}${nl_}" 502 502 503 503 run_make
Note:
See TracChangeset
for help on using the changeset viewer.