Changeset 50fb011 for CLFS2


Ignore:
Timestamp:
08/30/2006 02:01:04 AM (18 years ago)
Author:
George Boudreau <georgeb@…>
Branches:
experimental
Children:
08a4953
Parents:
01b6d52
Message:

First commit of changes to makefile generation. Makefile now does recursive calls to itself for the different phases..SETUP,LUSER,CHROOT,ROOT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLFS2/master.sh

    r01b6d52 r50fb011  
    1212  local   CLFS_HOST
    1313
    14   echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files${R_arrow}"
     14  echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files ( SETUP ) ${R_arrow}"
    1515
    1616  # defined here, only for ease of reading
     
    3636                touch luser-exist; \\
    3737        fi;
    38         @chown \$(LUSER) \$(MOUNT_PT) && \\
     38        @chown -R \$(LUSER) \$(MOUNT_PT) && \\
    3939        chown \$(LUSER) \$(MOUNT_PT)/sources
    4040        @touch \$@ && \\
     
    6565        echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc
    6666        @chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
    67         touch envars
     67        touch envars && \\
     68        chown \$(LUSER):\$(LGROUP) envars
    6869        @touch \$@ && \\
    6970        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     
    123124EOF
    124125) >> $MKFILE.tmp
     126
     127  host_prep=" 023-creatingtoolsdir 025-addinguser 026-settingenvironment 027-create-directories 028-creating-sysfile"
    125128}
    126129
     
    129132cross_tools_Makefiles() {     #
    130133#-----------------------------#
    131   echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools${R_arrow}"
     134  echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools     ( LUSER ) ${R_arrow}"
    132135
    133136  for file in cross-tools/* ; do
     
    176179    # Drop in the name of the target on a new line, and the previous target
    177180    # as a dependency. Also call the echo_message function.
    178     wrt_target "${this_script}" "$PREV"
     181    LUSER_wrt_target "${this_script}" "$PREV"
    179182    #
    180183    # If $pkg_tarball isn't empty, we've got a package...
    181184    if [ "$pkg_tarball" != "" ] ; then
    182        wrt_unpack "$pkg_tarball"
     185       LUSER_wrt_unpack "$pkg_tarball"
    183186       # If using optimizations, write the instructions
    184187       [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    185188    fi
    186189    #
    187     wrt_RunAsUser "${this_script}" "${file}"
    188     #
    189     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     190    LUSER_wrt_RunAsUser "${file}"
     191    #
     192    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
    190193    #
    191194    # Include a touch of the target name so make can check if it's already been made.
     
    207210final_system_Makefiles() {    #
    208211#-----------------------------#
    209   echo "${tab_}${GREEN}Processing... ${L_arrow}final system${R_arrow}"
     212  echo "${tab_}${GREEN}Processing... ${L_arrow}final system    ( LUSER ) ${R_arrow}"
    210213
    211214  for file in final-system/* ; do
     
    241244    # Drop in the name of the target on a new line, and the previous target
    242245    # as a dependency. Also call the echo_message function.
    243     wrt_target "${this_script}" "$PREV"
     246    LUSER_wrt_target "${this_script}" "$PREV"
    244247    #
    245248    # If $pkg_tarball isn't empty, we've got a package...
    246249    if [ "$pkg_tarball" != "" ] ; then
    247       wrt_unpack "$pkg_tarball"
     250      LUSER_wrt_unpack "$pkg_tarball"
    248251      # If using optimizations, write the instructions
    249252      [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    250253    fi
    251254    #
    252     wrt_RunAsUser "${this_script}" "${file}"
    253     #
    254     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     255    LUSER_wrt_RunAsUser "${file}"
     256    #
     257    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
    255258    #
    256259    # Include a touch of the target name so make can check if it's already been made.
     
    271274bootscripts_Makefiles() {     #
    272275#-----------------------------#
    273     echo "${tab_}${GREEN}Processing... ${L_arrow}bootscripts${R_arrow}"
     276  echo "${tab_}${GREEN}Processing... ${L_arrow}bootscripts     ( LUSER ) ${R_arrow}"
    274277
    275278  for file in bootscripts/* ; do
     
    307310    # Drop in the name of the target on a new line, and the previous target
    308311    # as a dependency. Also call the echo_message function.
    309     wrt_target "${this_script}" "$PREV"
     312    LUSER_wrt_target "${this_script}" "$PREV"
    310313    #
    311314    # If $pkg_tarball isn't empty, we've got a package...
    312     [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
    313     #
    314     wrt_RunAsUser "${this_script}" "${file}"
    315     #
    316     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     315    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
     316    #
     317    LUSER_wrt_RunAsUser "${file}"
     318    #
     319    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
    317320    #
    318321    # Include a touch of the target name so make can check if it's already been made.
     
    334337bootable_Makefiles() {        #
    335338#-----------------------------#
    336   echo "${tab_}${GREEN}Processing... ${L_arrow}make bootable${R_arrow}"
     339  echo "${tab_}${GREEN}Processing... ${L_arrow}make bootable   ( LUSER ) ${R_arrow}"
    337340
    338341  for file in bootable/* ; do
     
    343346    case $this_script in
    344347      *grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* )  continue ;;
     348      *fstab)  [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
    345349      *kernel) # if there is no kernel config file do not build the kernel
    346350               [[ -z $CONFIG ]] && continue
     
    352356    # First append each name of the script files to a list (this will become
    353357    # the names of the targets in the Makefile
    354     bootable="$bootable $this_script"
     358    # NOTE: new makfile format forces the last script, *chowning, into a separate
     359    #  phase.
     360    case ${this_script} in
     361      *chowning) chowning=${this_script}   ;;
     362              *) bootable="$bootable $this_script"  ;;     
     363    esac
    355364    #
    356365    # Grab the name of the target, strip id number and misc words.
     
    369378    # Drop in the name of the target on a new line, and the previous target
    370379    # as a dependency. Also call the echo_message function.
    371     wrt_target "${this_script}" "$PREV"
     380    LUSER_wrt_target "${this_script}" "$PREV"
    372381    #
    373382    # If $pkg_tarball isn't empty, we've got a package...
    374     [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
     383    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
    375384    #
    376385    # Select a script execution method
    377386    case $this_script in
    378387      *fstab*)  if [[ -n "$FSTAB" ]]; then
    379                   wrt_copy_fstab "${this_script}"
     388                  LUSER_wrt_CopyFstab
    380389                else
    381                   wrt_RunAsUser "${this_script}" "${file}"
     390                  LUSER_wrt_RunAsUser "${file}"
    382391                fi
    383392          ;;
    384393      *chowning)  wrt_RunAsRoot "${this_script}" "${file}"
    385394          ;;
    386               *)  wrt_RunAsUser "${this_script}" "${file}"
     395              *)  LUSER_wrt_RunAsUser "${file}"
    387396          ;;
    388397    esac
    389398    #
    390399    # Housekeeping...remove any build directory(ies) except if the package build fails.
    391     [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     400    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
    392401    #
    393402    # Include a touch of the target name so make can check if it's already been made.
     
    455464  # as a dependency.
    456465(
    457         cat << EOF
    458 all:  chapter2 chapter3 chapter4 chapter5 chapter6 restore-luser-env do-housekeeping
     466cat << EOF
     467
     468all:    mk_SETUP mk_LUSER mk_ROOT
    459469        @\$(call echo_finished,$VERSION)
    460470
    461 chapter2:  023-creatingtoolsdir 025-addinguser 026-settingenvironment 027-create-directories 028-creating-sysfile
    462 
    463 chapter3:  chapter2 $cross_tools
    464 
    465 chapter4:  chapter3 $basicsystem
    466 
    467 chapter5:  chapter4 $bootscripttools
    468 
    469 chapter6:  chapter5 $bootable
     471mk_SETUP:
     472        @\$(call echo_SU_request)
     473        @sudo make SETUP
     474        @touch \$@
     475       
     476mk_LUSER: mk_SETUP
     477        @\$(call echo_SULUSER_request)
     478        @( \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make LUSER" )
     479        @touch \$@
     480
     481mk_ROOT:
     482        @sudo make ROOT
     483        @touch \$@
     484
     485SETUP:  $host_prep
     486
     487LUSER:  $cross_tools $basicsystem $bootscripttools $bootable
     488
     489ROOT:   $chowning
    470490
    471491clean-all:  clean
Note: See TracChangeset for help on using the changeset viewer.