source: jhalfs@ a41ce58

0.2 1.0 2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since a41ce58 was a41ce58, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Setting the PAGE envar needed build Groff.
Added --page_size switch to can change the PAGE value.

  • Property mode set to 100755
File size: 18.7 KB
Line 
1#!/bin/sh
2
3version="
4jhalfs development
5
6Originally written by Jeremy Huntwork.
7Maintained by Manuel Canales Esparcia.
8
9This program is published under the \
10Gnu General Public License, Version 2.
11"
12
13usage="\
14Usage: $0 [OPTION]
15
16Options:
17 -h, --help print this help, then exit
18
19 -V, --version print version number, then exit
20
21 -d --directory DIR use DIR directory for building LFS; all files
22 jhalfs produces will be in the directory
23 DIR/jhalfs
24
25 -P, --get-packages download the packages and patches
26
27 -D, --download-client CLIENT use CLIENT as the program for retrieving
28 packages (for use in conjunction with -P)
29
30 -W, --working-copy DIR use the local working copy placed in DIR
31 as the LFS book
32
33 -L, --LFS-version VER ckeckout VER version of the LFS book
34
35 -T, --testsuites add support to run the optional testsuites
36
37 -M, --run-make run make on the generated Makefile
38
39 --page_size PAGE set PAGE as the default page size (letter,
40 A4, or others). This setting is required to
41 build Groff. If no speciffied, \"letter\"
42 will be used.
43"
44
45help="\
46Try '$0 --help' for more information."
47
48exit_missing_arg="\
49echo \"Option '\$1' requires an argument\" >&2
50echo \"\$help\" >&2
51exit 1"
52
53no_dl_client="\
54echo \"Could not find a way to download the LFS sources.\" >&2
55echo \"Attempting to continue.\" >&2"
56
57while test $# -gt 0 ; do
58 case $1 in
59 --version | -V )
60 echo "$version"
61 exit 0
62 ;;
63
64 --help | -h )
65 echo "$usage"
66 exit 0
67 ;;
68
69 --LFS-version | -L )
70 test $# = 1 && eval "$exit_missing_arg"
71 shift
72 case $1 in
73 dev* | SVN | trunk )
74 LFSVRS=development
75 ;;
76 * )
77 echo "$1 is an unsupported version at this time."
78 exit 1
79 ;;
80 esac
81 shift
82 ;;
83
84 --directory | -d )
85 test $# = 1 && eval "$exit_missing_arg"
86 shift
87 BUILDDIR=$1
88 shift
89 ;;
90
91 --download-client | -D )
92 test $# = 1 && eval "$exit_missing_arg"
93 shift
94 DL=$1
95 shift
96 ;;
97
98 --working-copy | -W )
99 test $# = 1 && eval "$exit_missing_arg"
100 shift
101 WC=1
102 BOOK=$1
103 shift
104 ;;
105
106 --testsuites | -T )
107 TEST=1
108 shift
109 ;;
110
111 --get-packages | -P )
112 HPKG=1
113 shift
114 ;;
115
116 --run-make | -M )
117 RUNMAKE=1
118 shift
119 ;;
120
121 --page_size )
122 test $# = 1 && eval "$exit_missing_arg"
123 shift
124 PAGE=$1
125 shift
126 ;;
127
128 * )
129 echo "$usage"
130 exit 1
131 ;;
132 esac
133done
134
135# Test to make sure we're running the build as root
136
137if [ "$UID" != "0" ] ; then
138 echo "You must be logged in as root to successfully build LFS."
139 exit 1
140fi
141
142# Find the download client to use, if not already specified.
143
144if [ -z $DL ] ; then
145 if [ `type -p wget` ] ; then
146 DL=wget
147 elif [ `type -p curl` ] ; then
148 DL=curl
149 else
150 eval "$no_dl_client"
151 fi
152fi
153
154SVN="svn://svn.linuxfromscratch.org"
155HTTP=http://ftp.lfs-matrix.net/pub/lfs/lfs-packages/conglomeration
156if [ -z $BUILDDIR ] ; then BUILDDIR=/mnt/lfs ; fi
157JHALFSDIR=$BUILDDIR/jhalfs
158LOGDIR=$JHALFSDIR/logs
159LOG=000-jhalfs.log
160MKFILE=$JHALFSDIR/Makefile
161XSL=dump-lfs-scripts.xsl
162FNC=functions
163if [ -z $TEST ] ; then TEST=0 ; fi
164if [ -z $PAGE ] ; then PAGE=letter ; fi
165
166HEADER="# This file is automatically generated by jhalfs
167# DO NOT EDIT THIS FILE MANUALLY
168#
169# Generated on `date \"+%F %X %Z\"`"
170
171get_book() {
172 # Check for Subversion instead of just letting the script hit 'svn' and fail.
173 test `type -p svn` || eval "echo \"This feature requires Subversion.\"
174 exit 1"
175 cd $JHALFSDIR
176
177 # Test to make sure the LFS version is set
178 if [ -z $LFSVRS ] ; then LFSVRS=development ; fi
179
180 # Set the book's sources directory
181 if [ -z $BOOK ] ; then BOOK=lfs-$LFSVRS ; fi
182
183 if [ -z $WC ] ; then
184 echo -n "Downloading the LFS Book, version $LFSVRS... "
185
186 # Grab the LFS book fresh if it's missing, otherwise, update it from the
187 # repo. If we've already extracted the commands, move on to getting the
188 # sources.
189 if [ -d lfs-$LFSVRS ] ; then
190 cd lfs-$LFSVRS
191 if svn up | grep -q At && test -d $JHALFSDIR/commands && \
192 test -f $JHALFSDIR/packages && test -f $JHALFSDIR/patches ; then
193 echo -ne "done\n"
194 get_sources
195 else
196 echo -ne "done\n"
197 extract_commands
198 fi
199 else
200 if [ $LFSVRS = development ] ; then
201 svn co $SVN/LFS/trunk/BOOK lfs-$LFSVRS >>$LOGDIR/$LOG 2>&1
202 else
203 svn co $SVN/LFS/branches/$LFSVRS/BOOK lfs-$LFSVRS >>$LOGDIR/$LOG 2>&1
204 fi
205 echo -ne "done\n"
206 extract_commands
207 fi
208 else
209 echo -ne "Using $BOOK as book's sources ...\n"
210 extract_commands
211 fi
212}
213
214extract_commands() {
215 # Check for libxslt instead of just letting the script hit 'xsltproc' and fail.
216 test `type -p xsltproc` || eval "echo \"This feature requires libxslt.\"
217 exit 1"
218 cd $JHALFSDIR
219
220 # Start clean
221 if [ -d commands ] ; then rm -rf commands ; fi && mkdir commands
222 echo -n "Extracting commands... "
223
224 # Dump the commands in shell script form from the LFS book.
225 xsltproc --nonet --xinclude --stringparam testsuite $TEST -o ./commands/ \
226 $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
227
228 # Make the scripts executables.
229 chmod -R +x $JHALFSDIR/commands
230
231 # Grab the patches and package names.
232 cd $JHALFSDIR
233 for i in patches packages ; do rm -f $i ; done
234 grep "\-version" $BOOK/general.ent | sed -e 's@<!ENTITY @@' -e 's@">@"@' \
235 -e '/generic/d' >> packages
236 echo `grep "glibc" packages | sed 's@glibc@glibc-linuxthreads@'` >> packages
237 grep "ENTITY" $BOOK/patches.ent | sed -e 's/.* "//' -e 's/">//' >> patches
238
239 # Done. Moving on...
240 echo -ne "done\n"
241 get_sources
242}
243
244download() {
245 cd $BUILDDIR/sources
246
247 # Hackish fix for the bash-doc and glibc-linuxthreads packages that
248 # doesn't conform to norms in the URL scheme.
249 DIR=`echo $1 | sed -e 's@-doc@@' -e 's@-linuxthreads@@'`
250
251 # Find the md5 sum for this package.
252 if [ $2 != MD5SUMS ] ; then MD5=`grep " $2" MD5SUMS` ; fi
253
254 if [ ! -f $2 ] ; then
255 case $DL in
256 wget )
257 wget $HTTP/$DIR/$2
258 ;;
259 curl )
260 `curl -# $HTTP/$DIR/$2 -o $2`
261 ;;
262 * )
263 echo "$DL not supported at this time."
264 ;;
265 esac
266 elif ! echo "$MD5" | md5sum -c - >/dev/null 2>/dev/null ; then
267 case $DL in
268 wget )
269 wget -c $HTTP/$DIR/$2
270 ;;
271 curl )
272 `curl -# -C - $HTTP/$DIR/$2 -o $2`
273 ;;
274 * )
275 echo "$DL not supported at this time."
276 ;;
277 esac
278 fi
279 if [ $2 != MD5SUMS ] && ! echo "$MD5" | md5sum -c - ; then
280 exit 1
281 fi
282}
283
284get_sources() {
285
286 # Test if the packages must be downloaded
287 if [ "$HPKG" = "1" ] ; then
288
289 # This variable is necessary to make sure the `cat $JHALFSDIR/packages`
290 # separates each iteration by lines. It is necessary to have the second
291 # ' on the next line.
292 IFS='
293'
294
295 if [ ! -d $BUILDDIR/sources ] ; then mkdir $BUILDDIR/sources ; fi
296 cd $BUILDDIR/sources
297 if [ -f MD5SUMS ] ; then rm MD5SUMS ; fi
298
299 download "" MD5SUMS
300
301 # Iterate through each package and grab it, along with any patches it needs.
302 for i in `cat $JHALFSDIR/packages` ; do
303 PKG=`echo $i | sed 's/-version.*//'`
304
305 # Someone used some silly entities right next to the valid package entities.
306 if [ "$PKG" = "expect-lib" -o "$PKG" = "linux-dl" ] ; then continue ; fi
307
308 VRS=`echo $i | sed -e 's/.* //' -e 's/"//g'`
309 if [ "$PKG" = "tcl" ] ; then
310 FILE="$PKG$VRS-src.tar.bz2"
311 else
312 FILE="$PKG-$VRS.tar.bz2"
313 fi
314 download $PKG $FILE
315 for patch in `grep "$PKG-&$PKG" $JHALFSDIR/patches` ; do
316 PATCH=`echo $patch | sed 's@&'$PKG'-version;@'$VRS'@'`
317 download $PKG $PATCH
318 done
319 done
320 # Hardcoded Udev configuration file until find a better way
321 download udev udev-config-3.rules
322 fi
323}
324
325build_Makefile() {
326 echo -n "Creating Makefile... "
327 cd $JHALFSDIR/commands
328
329 # Start with a clean Makefile.tmp file
330 >$MKFILE.tmp
331
332 for file in chapter05/* ; do
333 # Keep the script file name
334 i=`basename $file`
335
336 # First append each name of the script files to a list (this will become
337 # the names of the targets in the Makefile
338 chapter5="$chapter5 $i"
339
340 # Grab the name of the target (minus the -pass1 or -pass2 in the case of gcc
341 # and binutils in chapter 5)
342 name=`echo $i | sed -e 's@[0-9]\{3\}-@@' -e 's@-pass[0-9]\{1\}@@'`
343
344 # Set the dependency for the first target.
345 if [ -z $PREV ] ; then PREV=022-settingenvironment ; fi
346
347 # Drop in the name of the target on a new line, and the previous target
348 # as a dependency. Also call the echo_message function.
349(
350 cat << EOF
351
352$i: $PREV
353 @\$(call echo_message, Building)
354EOF
355) >> $MKFILE.tmp
356
357 # Find the version of the command files, if it corresponds with the building of
358 # a specific package
359 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
360
361 # If $vrs isn't empty, we've got a package...
362 if [ "$vrs" != "" ] ; then
363 if [ "$name" = "tcl" ] ; then
364 FILE="$name$vrs-src.tar.bz2"
365 else
366 FILE="$name-$vrs.tar.bz2"
367 fi
368
369 # Insert instructions for unpacking the package and to set
370 # the PKGDIR variable.
371(
372 cat << EOF
373 @\$(call unpack,$FILE)
374 @ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\
375 chown -R lfs \$(LFS)\$(SRC)/\$\$ROOT && \\
376 echo "PKGDIR=\$(LFS)\$(SRC)/\$\$ROOT" > envars && \\
377 echo "export PKGDIR" >> envars && \\
378EOF
379) >> $MKFILE.tmp
380
381 fi
382
383 # Dump the path to the Binutils or TCL sources directory.
384 if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" -o "$i" = "036-binutils-pass2" ] ; then
385(
386 cat << EOF
387 echo "\$(LFS)\$(SRC)/\$\$ROOT" > sources-dir
388EOF
389) >> $MKFILE.tmp
390
391 # For the Adjusting phase we must to cd to the binutils-build directory.
392 elif [ "$i" = "031-adjusting" ] ; then
393(
394 cat << EOF
395 @echo "PKGDIR=\$(LFS)\$(SRC)/binutils-build" > envars && \\
396 echo "export PKGDIR" >> envars
397EOF
398) >> $MKFILE.tmp
399
400 # For the Expect build we need to set the TCLPATH envar.
401 elif [ "$i" = "033-expect" ] ; then
402(
403 cat << EOF
404 echo "TCLPATH=\`cat sources-dir\`" >> envars && \\
405 echo "export TCLPATH" >> envars
406EOF
407) >> $MKFILE.tmp
408
409 # Everything else, add a true statment so we don't confuse make
410 else
411(
412 cat << EOF
413 true
414EOF
415) >> $MKFILE.tmp
416 fi
417
418 # Insert date and disk usage at the top of the log file, the script run
419 # and date and disk usage again at the bottom of the log file.
420(
421 cat << EOF
422 @echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\n" >logs/$i && \\
423 su - lfs -c "source /home/lfs/.bashrc && $JHALFSDIR/commands/$file" >>logs/$i 2>&1 && \\
424 echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\n" >>logs/$i
425EOF
426) >> $MKFILE.tmp
427
428 # Remove the build directory(ies) even if the package build fails, except for
429 # Binutils and TCL. In that cases the sources directories are removed
430 # only if the build fails.
431 if [ "$vrs" != "" ] ; then
432 if [ "$i" != "027-binutils-pass1" ] && [ "$i" != "032-tcl" ] && [ "$i" != "036-binutils-pass2" ] ; then
433(
434 cat << EOF
435 @ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\
436 rm -r \$(LFS)\$(SRC)/\$\$ROOT && \\
437 if [ -e \$(LFS)\$(SRC)/$name-build ]; then \\
438 rm -r \$(LFS)\$(SRC)/$name-build; \\
439 fi;
440EOF
441) >> $MKFILE.tmp
442 fi
443 fi
444
445 # Remove the Binutils pass 1 sources after a successful Adjusting phase.
446 if [ "$i" = "031-adjusting" ] ; then
447(
448 cat << EOF
449 @rm -r \`cat sources-dir\` && \\
450 rm -r \$(LFS)\$(SRC)/binutils-build && \\
451 rm sources-dir
452EOF
453) >> $MKFILE.tmp
454 fi
455
456 # Remove the TCL sources after a successful Expect build.
457 if [ "$i" = "033-expect" ] ; then
458(
459 cat << EOF
460 @rm -r \`cat sources-dir\` && \\
461 rm sources-dir
462EOF
463) >> $MKFILE.tmp
464 fi
465
466 # Include a touch of the target name so make can check
467 # if it's already been made.
468(
469 cat << EOF
470 @touch \$@
471EOF
472) >> $MKFILE.tmp
473
474 # The next two "if" must be after the touch to can check if the sources
475 # directories should be retained or deleted.
476 if [ "$i" = "027-binutils-pass1" -o "$i" = "036-binutils-pass2" ] ; then
477(
478 cat << EOF
479 @if [ ! -e \$@ ] ; then \\
480 ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\
481 rm -r \$(LFS)\$(SRC)/\$\$ROOT && \\
482 rm -r \$(LFS)\$(SRC)/binutils-build; \\
483 fi;
484EOF
485) >> $MKFILE.tmp
486 fi
487
488 if [ "$i" = "032-tcl" ] ; then
489(
490 cat << EOF
491 @if [ ! -e \$@ ] ; then \\
492 ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\
493 rm -r \$(LFS)\$(SRC)/\$\$ROOT; \\
494 fi;
495EOF
496) >> $MKFILE.tmp
497 fi
498
499 # Keep the script file name for Makefile dependencies.
500 PREV=$i
501 done
502
503 for file in chapter06/* ; do
504 # Keep the script file name
505 i=`basename $file`
506
507 # We'll run the chroot commands differently than the others, so skip them in the
508 # dependencies and target creation.
509 if echo $i | grep -q "chroot" ; then
510 continue
511 fi
512
513 # First append each name of the script files to a list (this will become
514 # the names of the targets in the Makefile
515 chapter6="$chapter6 $i"
516
517 # Grab the name of the target
518 name=`echo $i | sed -e 's@[0-9]\{3\}-@@'`
519
520 # Set the dependency for the first target.
521 if [ -z $PREV ] ; then PREV=055-stripping ; fi
522
523 # Drop in the name of the target on a new line, and the previous target
524 # as a dependency. Also call the echo_message function.
525(
526 cat << EOF
527
528$i: $PREV
529 @\$(call echo_message, Building)
530EOF
531) >> $MKFILE.tmp
532
533 # Find the version of the command files, if it corresponds with the building of
534 # a specific package
535 vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
536
537 # If $vrs isn't empty, we've got a package...
538 # Insert instructions for unpacking the package and changing directories
539 if [ "$vrs" != "" ] ; then
540 FILE="$name-$vrs.tar.bz2"
541(
542 cat << EOF
543 @\$(call unpack,$FILE)
544 @ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\
545 echo "PKGDIR=\$(SRC)/\$\$ROOT" > envars && \\
546 echo "export PKGDIR" >> envars
547EOF
548) >> $MKFILE.tmp
549 fi
550
551 # For the Re-Adjusting phase we must to cd to the binutils-build directory.
552 if [ "$i" = "067-readjusting" ] ; then
553(
554 cat << EOF
555 @echo "PKGDIR=\$(SRC)/binutils-build" > envars && \\
556 echo "export PKGDIR" >> envars
557EOF
558) >> $MKFILE.tmp
559 fi
560
561 # For Groff we need to set PAGE envar.
562 if [ "$i" = "082-groff" ] ; then
563(
564 cat << EOF
565 @echo "PAGE=\$(PAGE)" >> envars && \\
566 echo "export PAGE" >> envars
567EOF
568) >> $MKFILE.tmp
569 fi
570
571 # In the mount of kernel filesystems we need to set LFS for CHROOT1
572 # and not to use chroot.
573 if [ "$i" = "057-kernfs" ] ; then
574(
575 cat << EOF
576 @echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\n" >logs/$i && \\
577 commands/$file >>logs/$i 2>&1 && \\
578 echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=0??-* \$(LFS)\`\n" >>logs/$i
579EOF
580) >> $MKFILE.tmp
581
582 # The rest of Chapter06
583 else
584(
585 cat << EOF
586 @echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=0??-* \$(LFS)\`\n" >logs/$i && \\
587 \$(CHROOT1) 'cd /jhalfs && source envars && /jhalfs/commands/$file >>/jhalfs/logs/$i 2>&1' && \\
588 echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=0??-* \$(LFS)\`\n" >>logs/$i
589EOF
590) >> $MKFILE.tmp
591
592 fi
593
594 # Remove the build directory(ies) even if the package build fails.
595 if [ "$vrs" != "" ] ; then
596(
597 cat << EOF
598 @ROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\
599 rm -r \$(LFS)\$(SRC)/\$\$ROOT && \\
600 if [ -e \$(LFS)\$(SRC)/$name-build ]; then \\
601 rm -r \$(LFS)\$(SRC)/$name-build; \\
602 fi;
603EOF
604) >> $MKFILE.tmp
605 fi
606
607 # Remove the Binutils pass 2 sources after a successful Re-Adjusting phase.
608 if [ "$i" = "067-readjusting" ] ; then
609(
610 cat << EOF
611 @rm -r \`cat sources-dir\` && \\
612 rm -r \$(LFS)\$(SRC)/binutils-build && \\
613 rm sources-dir
614EOF
615) >> $MKFILE.tmp
616 fi
617
618 # Include a touch of the target name so make can check
619 # if it's already been made.
620(
621 cat << EOF
622 @touch \$@
623EOF
624) >> $MKFILE.tmp
625
626 # Keep the script file name for Makefile dependencies.
627 PREV=$i
628 done
629
630 # Add a header, some variables and include the function file
631 # to the top of the real Makefile.
632(
633 cat << EOF
634$HEADER
635
636SRC= /sources
637LFS= $BUILDDIR
638PAGE= $PAGE
639
640include functions
641
642EOF
643) > $MKFILE
644
645
646 # Add chroot commands
647 i=1
648 for file in chapter06/*chroot* ; do
649 chroot=`cat $file | sed -e '/#!\/bin\/sh/d' -e 's@ \\\@ @g' | tr -d '\n' | sed \
650 -e 's/ */ /g' -e 's|\\$|&&|g' -e 's|&&exit||g' -e 's|$| -c|' -e 's|"$$LFS"|$(LFS)|'`
651 echo -e "CHROOT$i= $chroot\n" >> $MKFILE
652 i=`expr $i + 1`
653 done
654
655 # Drop in the main target 'all:' and the chapter targets with each sub-target
656 # as a dependency.
657(
658 cat << EOF
659all: chapter4 chapter5 chapter6
660 @echo -e "\n\tYour new LFS system has been successfully built"
661
662chapter4: 020-creatingtoolsdir 021-addinguser 022-settingenvironment
663
664chapter5: chapter4 $chapter5
665
666chapter6: chapter5 $chapter6
667
668clean-all: clean
669 rm -rf ./*
670
671clean: clean-chapter5 clean-chapter4
672
673clean-chapter4:
674 -userdel lfs
675 rm -rf /home/lfs
676 rm -rf \$(LFS)/tools
677 rm -f /tools
678 rm -f envars
679 rm -f 02* logs/02*.log
680
681clean-chapter5:
682 rm -rf \$(LFS)/tools/*
683 rm -f envars
684 rm -f $chapter5
685 cd logs && rm -f $chapter5 && cd ..
686
687020-creatingtoolsdir:
688 @\$(call echo_message, Building)
689 @mkdir -v \$(LFS)/tools && \\
690 ln -sv \$(LFS)/tools / && \\
691 touch \$@
692
693021-addinguser: 020-creatingtoolsdir
694 @\$(call echo_message, Building)
695 @groupadd lfs && \\
696 useradd -s /bin/bash -g lfs -m -k /dev/null lfs && \\
697 chown lfs \$(LFS)/tools && \\
698 chown lfs \$(LFS)/sources && \\
699 touch \$@
700
701022-settingenvironment: 021-addinguser
702 @\$(call echo_message, Building)
703 @echo "exec env -i HOME=\\\$\$HOME TERM=\\\$\$TERM PS1='\u:\w\$$ ' /bin/bash" > /home/lfs/.bash_profile && \\
704 echo "set +h" > /home/lfs/.bashrc && \\
705 echo "umask 022" >> /home/lfs/.bashrc && \\
706 echo "LFS=/mnt/lfs" >> /home/lfs/.bashrc && \\
707 echo "LC_ALL=POSIX" >> /home/lfs/.bashrc && \\
708 echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/lfs/.bashrc && \\
709 echo "export LFS LC_ALL PATH" >> /home/lfs/.bashrc && \\
710 echo ". $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\
711 chown lfs:lfs /home/lfs/.bash* && \\
712 touch envars && \\
713 touch \$@
714EOF
715) >> $MKFILE
716
717 # Bring over the items from the Makefile.tmp
718 cat $MKFILE.tmp >> $MKFILE
719 rm $MKFILE.tmp
720 echo -ne "done\n"
721}
722
723run_make() {
724 # Test if make must be run.
725 if [ "$RUNMAKE" = "1" ] ; then
726 # Build the system
727 if [ -e $MKFILE ] ; then
728 echo -ne "Building the LFS system...\n"
729 cd $JHALFSDIR && make
730 echo -ne "done\n"
731 fi
732 fi
733}
734
735if [ ! -d $JHALFSDIR ] ; then
736 mkdir -p $JHALFSDIR
737fi
738
739if [ ! -d $LOGDIR ] ; then
740 mkdir $LOGDIR
741fi
742
743>$LOGDIR/$LOG
744
745if [ "$PWD" != "$JHALFSDIR" ] ; then
746 cp $0 $XSL $FNC $JHALFSDIR/
747fi
748
749get_book
750build_Makefile
751run_make
Note: See TracBrowser for help on using the repository browser.