- Timestamp:
- 08/26/2006 10:48:19 AM (18 years ago)
- Branches:
- experimental
- Children:
- 3c96826
- Parents:
- ce6e009
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
master.sh
rce6e009 r1ad9211 40 40 fi 41 41 42 PROGNAME=$(basename $0) 43 COMMON_DIR="common" 44 PACKAGE_DIR=$(echo $PROGNAME | tr [a-z] [A-Z]) 45 MODULE=$PACKAGE_DIR/master.sh 46 MODULE_CONFIG=$PACKAGE_DIR/config 47 VERBOSITY=0 48 49 50 if [[ -e using_menuconfig ]]; then 51 [[ $VERBOSITY > 0 ]] && echo -n "Loading config params from <configuration>..." 52 source configuration 53 [[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1 54 [[ $VERBOSITY > 0 ]] && echo "OK" 55 56 #--- CONSTANTS 57 declare -r SVN="svn://svn.linuxfromscratch.org" 58 declare -r LOG=000-masterscript.log 59 # --- Server used if the file isn't found in SRC_ARCHIVE. 60 # As a last resort, the file will dowloaded from upstream, if possible. 61 SERVER=ftp://ftp.lfs-matrix.net 62 #--- Working directories 63 SCRIPT_ROOT=jhalfs 64 JHALFSDIR=$BUILDDIR/$SCRIPT_ROOT 65 LOGDIR=$JHALFSDIR/logs 66 TESTLOGDIR=$JHALFSDIR/test-logs 67 MKFILE=$JHALFSDIR/Makefile 68 #--- ICA report log directory 69 ICALOGDIR=$LOGDIR/ICA 70 #--- farce report log directory 71 FARCELOGDIR=$LOGDIR/farce 72 XSL=$PROGNAME.xsl 73 PKG_LST=unpacked 74 75 case $PROGNAME in 76 clfs2) LFSVRS=development; TREE=branches/clfs-2.0/BOOK ;; 77 *) LFSVRS=development; TREE=trunk/BOOK ;; 78 esac 79 80 if [[ ! -z ${BRANCH_ID} ]]; then 81 case $BRANCH_ID in 82 dev* | SVN | trunk ) 42 PROGNAME=$(basename $0) 43 COMMON_DIR="common" 44 PACKAGE_DIR=$(echo $PROGNAME | tr [a-z] [A-Z]) 45 MODULE=$PACKAGE_DIR/master.sh 46 VERBOSITY=1 47 48 49 [[ $VERBOSITY > 0 ]] && echo -n "Loading config params from <configuration>..." 50 source configuration 51 [[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1 52 [[ $VERBOSITY > 0 ]] && echo "OK" 53 54 #--- CONSTANTS 55 declare -r SVN="svn://svn.linuxfromscratch.org" 56 declare -r LOG=000-masterscript.log 57 # --- Server used if the file isn't found in SRC_ARCHIVE. 58 # As a last resort, the file will dowloaded from upstream, if possible. 59 SERVER=ftp://ftp.lfs-matrix.net 60 #--- Working directories 61 SCRIPT_ROOT=jhalfs 62 JHALFSDIR=$BUILDDIR/$SCRIPT_ROOT 63 LOGDIR=$JHALFSDIR/logs 64 TESTLOGDIR=$JHALFSDIR/test-logs 65 MKFILE=$JHALFSDIR/Makefile 66 #--- ICA report log directory 67 ICALOGDIR=$LOGDIR/ICA 68 #--- farce report log directory 69 FARCELOGDIR=$LOGDIR/farce 70 XSL=$PROGNAME.xsl 71 PKG_LST=unpacked 72 73 case $PROGNAME in 74 clfs2) LFSVRS=development; TREE=branches/clfs-2.0/BOOK ;; 75 *) LFSVRS=development; TREE=trunk/BOOK ;; 76 esac 77 78 if [[ ! -z ${BRANCH_ID} ]]; then 79 case $BRANCH_ID in 80 dev* | SVN | trunk ) 83 81 case $PROGNAME in 84 82 clfs2 ) TREE=branches/clfs-2.0/BOOK ;; … … 88 86 ;; 89 87 branch-* ) 90 91 88 LFSVRS=${BRANCH_ID} 89 TREE=branches/${BRANCH_ID#branch-}/BOOK 92 90 ;; 93 91 * ) 94 92 case $PROGNAME in 95 93 lfs | hlfs ) 96 94 LFSVRS=${BRANCH_ID} 97 95 TREE=tags/${BRANCH_ID}/BOOK 98 ;;96 ;; 99 97 clfs | clfs2 ) 100 101 102 ;;98 LFSVRS=${BRANCH_ID} 99 TREE=tags/${BRANCH_ID} 100 ;; 103 101 esac 104 102 ;; 105 esac 106 fi 107 # These are boolean vars generated from Config.in. 108 # ISSUE: If a boolean parameter is not set <true> that 109 # variable is not defined by the menu app. This can 110 # cause a headache if you are not careful. 111 # The following parameters MUST be created and have a 112 # default value. 113 RUNMAKE=${RUNMAKE:-n} 114 GETPKG=${GETPKG:-n} 115 GETKERNEL=${GETKERNEL:-n} 116 COMPARE=${COMPARE:-n} 117 RUN_FARCE=${RUN_FARCE:-n} 118 RUN_ICA=${RUN_ICA:-n} 119 BOMB_TEST=${BOMB_TEST:-n} 120 STRIP=${STRIP:=n} 121 REPORT=${REPORT:=n} 122 VIMLANG=${VIMLANG:-n} 123 KEYMAP=${KEYMAP:=none} 124 GRSECURITY_HOST=${GRSECURITY_HOST:-n} 125 126 else 127 # 128 [[ $VERBOSITY > 0 ]] && echo -n "Loading masterscript conf..." 129 source $COMMON_DIR/config 130 [[ $? > 0 ]] && echo "$COMMON_DIR/conf did not load.." && exit 131 [[ $VERBOSITY > 0 ]] && echo "OK" 132 # 133 [[ $VERBOSITY > 0 ]] && echo -n "Loading config module <$MODULE_CONFIG>..." 134 source $MODULE_CONFIG 135 [[ $? > 0 ]] && echo "$MODULE_CONFIG did not load.." && exit 1 136 [[ $VERBOSITY > 0 ]] && echo "OK" 137 # 138 fi 103 esac 104 fi 105 # These are boolean vars generated from Config.in. 106 # ISSUE: If a boolean parameter is not set <true> that 107 # variable is not defined by the menu app. This can 108 # cause a headache if you are not careful. 109 # The following parameters MUST be created and have a 110 # default value. 111 RUNMAKE=${RUNMAKE:-n} 112 GETPKG=${GETPKG:-n} 113 GETKERNEL=${GETKERNEL:-n} 114 COMPARE=${COMPARE:-n} 115 RUN_FARCE=${RUN_FARCE:-n} 116 RUN_ICA=${RUN_ICA:-n} 117 BOMB_TEST=${BOMB_TEST:-n} 118 STRIP=${STRIP:=n} 119 REPORT=${REPORT:=n} 120 VIMLANG=${VIMLANG:-n} 121 KEYMAP=${KEYMAP:=none} 122 GRSECURITY_HOST=${GRSECURITY_HOST:-n} 139 123 140 124 … … 155 139 # to a working doc.. set WC=1, else 'null' 156 140 #=========================================================== 157 WC=${BOOK:+ 1}141 WC=${BOOK:+y} 158 142 #=========================================================== 143 144 #=================================================== 145 # Set the document location... 146 #=================================================== 147 BOOK=${BOOK:=$PROGNAME-$LFSVRS} 148 #=================================================== 159 149 160 150 … … 175 165 ### MAIN ### 176 166 ################################### 177 178 # Evaluate any command line switches179 180 while test $# -gt 0 ; do181 case $1 in182 # Common options for {C,H}LFS books183 --book | -B )184 test $# = 1 && eval "$exit_missing_arg"185 shift186 case $1 in187 dev* | SVN | trunk )188 LFSVRS=development189 TREE=trunk/BOOK190 ;;191 branch-* )192 LFSVRS=$1193 TREE=branches/${1#branch-}/BOOK194 ;;195 * )196 case $PROGNAME in197 lfs | hlfs )198 LFSVRS=$1199 TREE=tags/$1/BOOK200 ;;201 clfs )202 LFSVRS=$1203 TREE=tags/$1204 ;;205 esac206 ;;207 esac208 ;;209 210 --directory | -D )211 test $# = 1 && eval "$exit_missing_arg"212 shift213 case $1 in214 -* )215 echo -e "\n$1 isn't a valid build directory."216 echo -e "Directory names can't start with - .\n"217 exit 1218 ;;219 * )220 BUILDDIR=$1221 JHALFSDIR=$BUILDDIR/${SCRIPT_ROOT}222 LOGDIR=$JHALFSDIR/logs223 TESTLOGDIR=$JHALFSDIR/test-logs224 MKFILE=$JHALFSDIR/Makefile225 ;;226 esac227 ;;228 229 --get-packages | -G ) GETPKG=y ;;230 231 --help | -h ) usage | more && exit ;;232 233 --optimize | -O )234 test $# = 1 && eval "$exit_missing_arg"235 shift236 case $1 in237 0 | 1 | 2 )238 OPTIMIZE=$1239 ;;240 * )241 echo -e "\n$1 isn't a valid optimize level value."242 echo -e "You must use 0, 1, or 2.\n"243 exit 1244 ;;245 esac246 ;;247 248 --testsuites | -T )249 test $# = 1 && eval "$exit_missing_arg"250 shift251 case $1 in252 0 | 1 | 2 | 3 )253 TEST=$1254 ;;255 * )256 echo -e "\n$1 isn't a valid testsuites level value."257 echo -e "You must to use 0, 1, 2, or 3.\n"258 exit 1259 ;;260 esac261 ;;262 263 --version | -V )264 echo "$version"265 exit 0266 ;;267 268 --working-copy | -W )269 test $# = 1 && eval "$exit_missing_arg"270 shift271 case $PROGNAME in # Poor checks. We should find better ones.272 lfs)273 if [ -d $1/chapter09 ] ; then274 WC=1275 BOOK=$1276 else277 echo -e "\nLooks like $1 isn't an LFS working copy."278 exit 1279 fi280 ;;281 clfs)282 if [ -d $1/cross-tools ] ; then283 WC=1284 BOOK=$1285 else286 echo -e "\nLooks like $1 isn't a CLFS working copy."287 exit 1288 fi289 ;;290 hlfs)291 if [ -f $1/template.xml ] ; then292 WC=1293 BOOK=$1294 else295 echo -e "\nLooks like $1 isn't an HLFS working copy."296 exit 1297 fi298 ;;299 esac300 ;;301 302 --comparison | -C )303 test $# = 1 && eval "$exit_missing_arg"304 shift305 case $1 in306 ICA) RUN_ICA=y; RUN_FARCE=n; COMPARE=y ;;307 farce) RUN_ICA=n; RUN_FARCE=y; COMPARE=y ;;308 both) RUN_ICA=y; RUN_FARCE=y; COMPARE=y ;;309 *)310 echo -e "\n$1 is an unknown analysis method."311 exit 1312 ;;313 esac314 ;;315 316 --fstab | -F )317 test $# = 1 && eval "$exit_missing_arg"318 shift319 if [ -f $1 ] ; then320 FSTAB=$1321 else322 echo -e "\nFile $1 not found. Verify your command line.\n"323 exit 1324 fi325 ;;326 327 --kernel-config | -K )328 test $# = 1 && eval "$exit_missing_arg"329 shift330 if [ -f $1 ] ; then331 CONFIG=$1332 else333 echo -e "\nFile $1 not found. Verify your command line.\n"334 exit 1335 fi336 ;;337 338 --run-make | -M ) RUNMAKE=y ;;339 340 --rebuild | -R ) CLEAN=y ;;341 342 # CLFS options343 --arch | -A )344 test $# = 1 && eval "$exit_missing_arg"345 shift346 case $PROGNAME in347 CLFS2)348 case $1 in349 arm) ARCH=arm; TARGET="arm-unknown-linux-gnu" ;;350 x86) ARCH=x86; TARGET="i686-pc-linux-gnu" ;;351 *) echo -e "\n$1 is an unknown or unsupported arch."; exit 1352 esac353 ;;354 CLFS)355 case $1 in356 arm ) ARCH=arm; TARGET="arm-unknown-linux-gnu" ;;357 x86 ) ARCH=x86; TARGET="i686-pc-linux-gnu" ;;358 i486 ) ARCH=x86; TARGET="i486-pc-linux-gnu" ;;359 i586 ) ARCH=x86; TARGET="i586-pc-linux-gnu" ;;360 ppc ) ARCH=ppc; TARGET="powerpc-unknown-linux-gnu" ;;361 mips ) ARCH=mips; TARGET="mips-unknown-linux-gnu" ;;362 mipsel ) ARCH=mips; TARGET="mipsel-unknown-linux-gnu" ;;363 sparc ) ARCH=sparc; TARGET="sparcv9-unknown-linux-gnu" ;;364 365 x86_64-64 ) ARCH=x86_64-64; TARGET="x86_64-unknown-linux-gnu" ;;366 mips64-64 ) ARCH=mips64-64; TARGET="mips-unknown-linux-gnu" ;;367 mipsel64-64 ) ARCH=mips64-64; TARGET="mipsel-unknown-linux-gnu" ;;368 sparc64-64 ) ARCH=sparc64-64; TARGET="sparc64-unknown-linux-gnu" ;;369 alpha ) ARCH=alpha; TARGET="alpha-unknown-linux-gnu" ;;370 371 x86_64 ) ARCH=x86_64; TARGET="x86_64-unknown-linux-gnu"; TARGET32="i686-pc-linux-gnu" ;;372 mips64 ) ARCH=mips64; TARGET="mips-unknown-linux-gnu"; TARGET32="mips-unknown-linux-gnu" ;;373 mipsel64 ) ARCH=mips64; TARGET="mipsel-unknown-linux-gnu"; TARGET32="mipsel-unknown-linux-gnu" ;;374 sparc64 ) ARCH=sparc64; TARGET="sparc64-unknown-linux-gnu"; TARGET32="sparcv9-unknown-linux-gnu" ;;375 ppc64 ) ARCH=ppc64; TARGET="powerpc64-unknown-linux-gnu"; TARGET32="powerpc-unknown-linux-gnu" ;;376 377 * ) echo -e "\n$1 is an unknown or unsupported arch."; exit 1 ;;378 esac379 ;;380 esac381 ;;382 383 --boot-config )384 test $# = 1 && eval "$exit_missing_arg"385 shift386 if [ -f $1 ] ; then387 BOOT_CONFIG=$1388 else389 echo -e "\nFile $1 not found. Verify your command line.\n"390 exit 1391 fi392 ;;393 394 --method )395 test $# = 1 && eval "$exit_missing_arg"396 shift397 case $1 in398 chroot | boot )399 METHOD=$1400 ;;401 * )402 echo -e "\n$1 isn't a valid build method."403 exit 1404 ;;405 esac406 ;;407 408 # HLFS options409 --model )410 test $# = 1 && eval "$exit_missing_arg"411 shift412 case $1 in413 glibc | uclibc )414 MODEL=$1415 ;;416 * )417 echo -e "\n$1 isn't a valid libc model."418 exit 1419 ;;420 esac421 ;;422 423 # Unknown options424 * ) usage ;;425 esac426 shift427 done428 429 430 #===================================================431 # Set the document location...432 # BOOK is either defined in433 # xxx.config434 # comand line435 # default436 # If set by conf file or cmd line leave it437 # alone otherwise load the default version438 #===================================================439 BOOK=${BOOK:=$PROGNAME-$LFSVRS}440 #===================================================441 442 167 443 168 # Check for minimum bash,tar,gcc and kernel versions … … 512 237 [[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR 513 238 # 514 if [[ "$PWD" != "$JHALFSDIR" ]]; then 515 cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/ 516 # 517 [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/ 518 # 519 if [[ "$COMPARE" = "y" ]]; then 520 mkdir -p $JHALFSDIR/extras 521 cp extras/* $JHALFSDIR/extras 522 fi 523 # 524 if [[ -n "$FILES" ]]; then 525 # pushd/popd necessary to deal with multiple files 526 pushd $PACKAGE_DIR 1> /dev/null 527 cp $FILES $JHALFSDIR/ 528 popd 1> /dev/null 529 fi 530 # 531 if [[ "$REPORT" = "y" ]]; then 532 cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/ 533 # After being sure that all looks sane, dump the settings to a file 534 # This file will be used to create the REPORT header 535 validate_config > $JHALFSDIR/jhalfs.config 536 fi 537 # 538 [[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/ 539 # 540 cp $COMMON_DIR/packages.xsl $JHALFSDIR/ 541 # 542 sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL} 543 export XSL=$JHALFSDIR/${XSL} 544 fi 239 cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/ 240 # 241 [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/ 242 # 243 if [[ "$COMPARE" = "y" ]]; then 244 mkdir -p $JHALFSDIR/extras 245 cp extras/* $JHALFSDIR/extras 246 fi 247 # 248 if [[ -n "$FILES" ]]; then 249 # pushd/popd necessary to deal with multiple files 250 pushd $PACKAGE_DIR 1> /dev/null 251 cp $FILES $JHALFSDIR/ 252 popd 1> /dev/null 253 fi 254 # 255 if [[ "$REPORT" = "y" ]]; then 256 cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/ 257 # After being sure that all looks sane, dump the settings to a file 258 # This file will be used to create the REPORT header 259 validate_config > $JHALFSDIR/jhalfs.config 260 fi 261 # 262 [[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/ 263 # 264 cp $COMMON_DIR/packages.xsl $JHALFSDIR/ 265 # 266 sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL} 267 export XSL=$JHALFSDIR/${XSL} 545 268 546 269 get_book
Note:
See TracChangeset
for help on using the changeset viewer.