Changeset 3512

Show
Ignore:
Timestamp:
10/02/07 12:33:03 (1 year ago)
Author:
manuel
Message:

Small changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jhalfs/branches/experimental/LFS/master.sh

    r3496 r3512  
    33# $Id$ 
    44 
    5 ################################### 
    6 ###         FUNCTIONS           ### 
    7 ################################### 
    8  
    9  
    10 ############################################################# 
     5######################################### 
     6### LFS MAKEFILE GENERATION FUNCTIONS ### 
     7######################################### 
    118 
    129 
     
    6158 
    6259  chapter4=" 04_02-creatingtoolsdir 04_03-addinguser 04_04-settingenvironment" 
     60  PREV=04_04-settingenvironment 
    6361} 
    6462 
    6563 
    66  
    67 #----------------------------# 
    68 chapter5_Makefiles() { 
     64#----------------------------# 
     65chapter5_Makefiles() {       # 
    6966#----------------------------# 
    7067  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5     ( LUSER ) ${R_arrow}" 
     
    8279    esac 
    8380 
    84     # First append each name of the script files to a list (this will become 
    85     # the names of the targets in the Makefile 
    86     # DO NOT append the changingowner script, it need be run as root. 
    87     # A hack is necessary: create script in chap5 BUT run as a dependency for 
    88     # SUDO target 
     81    # Append the script name to the chapter dependencies list 
     82    # The changingowner script need be run as root into the SUDO target 
    8983    case "${this_script}" in 
    9084      *changingowner) runasroot="$runasroot ${this_script}" ;; 
    9185                   *) chapter5="$chapter5 ${this_script}" ;; 
    9286    esac 
    93  
    94     # Set the dependency for the first target. 
    95     if [ -z $PREV ] ; then PREV=04_04-settingenvironment ; fi 
    9687 
    9788    #--------------------------------------------------------------------# 
     
    110101    esac 
    111102 
    112     # Include a touch of the target name so make can check 
    113     # if it's already been made. 
     103    # Write the target entry footer. 
    114104    wrt_touch 
    115105    # 
     
    125115 
    126116#----------------------------# 
    127 chapter6_Makefiles() { 
     117chapter6_Makefiles() {       # 
    128118#----------------------------# 
    129119 
     
    152142    this_script=`basename $file` 
    153143 
    154     # We'll run the chroot commands differently than the others, so skip them in the 
    155     # dependencies and target creation. 
    156     # Skip also linux-headers in iterative builds. 
     144    # Chroot commands are set as envars in the Makefile header. 
     145    # Skip linux-headers in iterative builds. 
    157146    case "${this_script}" in 
    158147      *chroot)      continue ;; 
     
    172161    fi 
    173162 
    174     # Append each name of the script files to a list (this will become 
    175     # the names of the targets in the Makefile) 
    176     # The kernfs script must be run as part of SUDO target. 
     163    # Append the script name to the chapter dependencies list 
     164    # The kernfs script need be run as root into the SUDO target 
    177165    case "${this_script}" in 
    178166      *kernfs) runasroot="$runasroot ${this_script}" ;; 
     
    194182    fi 
    195183 
    196     # In the mount of kernel filesystems we need to set LFS 
    197     # and not to use chroot. 
     184    # Run the script. 
     185    # The kernfs script must be run as root. 
    198186    case "${this_script}" in 
    199187      *kernfs)  wrt_RunAsRoot "$file" ;; 
     
    206194    fi 
    207195 
    208     # Include a touch of the target name so make can check 
    209     # if it's already been made. 
     196    # Write the target entry footer. 
    210197    wrt_touch 
    211198    # 
     
    221208} 
    222209 
    223 #----------------------------# 
    224 chapter78_Makefiles() { 
     210 
     211#----------------------------# 
     212chapter78_Makefiles() {      # 
    225213#----------------------------# 
    226214  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8   ( BOOT ) ${R_arrow}" 
     
    235223    case ${this_script} in 
    236224      *grub)    continue ;; 
    237       *fstab)   [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;; 
    238       *kernel)  [[ -z ${CONFIG} ]] && continue 
     225      *fstab)   [[ -n "${FSTAB}" ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;; 
     226      *kernel)  [[ -z "${CONFIG}" ]] && continue 
    239227                cp ${CONFIG} $BUILDDIR/sources/kernel-config  ;; 
    240228    esac 
    241229 
    242     # First append each name of the script files to a list (this will become 
    243     # the names of the targets in the Makefile 
     230    # If building a package, grab the phase name to be used with INSTALL_LOG 
     231    name=`grep "^PKG_PHASE=" ${file} | sed -e 's@PKG_PHASE=@@'` 
     232 
     233    # Append the script name to the chapter dependencies list 
    244234    chapter78="$chapter78 ${this_script}" 
    245235 
     
    252242    wrt_target "${this_script}" "$PREV" 
    253243 
    254     # For bootscripts and kernel, start INSTALL_LOG if requested 
    255     case "${this_script}" in 
    256       *bootscripts | *kernel ) if [ "${INSTALL_LOG}" = "y" ] ; then 
    257                                  wrt_TouchTimestamp 
    258                                fi ;; 
    259     esac 
    260  
    261       # Check if we have a real /etc/fstab file 
     244    # Touch timestamp file if installed files logs will be created. 
     245    if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then 
     246      wrt_TouchTimestamp 
     247    fi 
     248 
     249    # Check if we have a real /etc/fstab file and run the scripts 
    262250    case "${this_script}" in 
    263251      *fstab) if [[ -n $FSTAB ]]; then 
     
    269257    esac 
    270258 
    271     case "${this_script}" in 
    272       *bootscripts)  if [ "${INSTALL_LOG}" = "y" ] ; then 
    273                        wrt_LogNewFiles "lfs-bootscripts" 
    274                      fi ;; 
    275       *kernel)       if [ "${INSTALL_LOG}" = "y" ] ; then 
    276                        wrt_LogNewFiles "linux" 
    277                      fi ;; 
    278     esac 
    279  
    280     # Include a touch of the target name so make can check 
    281     # if it's already been made. 
     259    # Write installed files log 
     260    if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then 
     261      wrt_LogNewFiles "$name" 
     262    fi 
     263 
     264    # Write the target entry footer. 
    282265    wrt_touch 
    283266    # 
     
    291274 
    292275} 
    293  
    294276 
    295277