Changeset 3512
- Timestamp:
- 10/02/07 12:33:03 (1 year ago)
- Files:
-
- jhalfs/branches/experimental/LFS/master.sh (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
jhalfs/branches/experimental/LFS/master.sh
r3496 r3512 3 3 # $Id$ 4 4 5 ################################### 6 ### FUNCTIONS ### 7 ################################### 8 9 10 ############################################################# 5 ######################################### 6 ### LFS MAKEFILE GENERATION FUNCTIONS ### 7 ######################################### 11 8 12 9 … … 61 58 62 59 chapter4=" 04_02-creatingtoolsdir 04_03-addinguser 04_04-settingenvironment" 60 PREV=04_04-settingenvironment 63 61 } 64 62 65 63 66 67 #----------------------------# 68 chapter5_Makefiles() { 64 #----------------------------# 65 chapter5_Makefiles() { # 69 66 #----------------------------# 70 67 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5 ( LUSER ) ${R_arrow}" … … 82 79 esac 83 80 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 89 83 case "${this_script}" in 90 84 *changingowner) runasroot="$runasroot ${this_script}" ;; 91 85 *) chapter5="$chapter5 ${this_script}" ;; 92 86 esac 93 94 # Set the dependency for the first target.95 if [ -z $PREV ] ; then PREV=04_04-settingenvironment ; fi96 87 97 88 #--------------------------------------------------------------------# … … 110 101 esac 111 102 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. 114 104 wrt_touch 115 105 # … … 125 115 126 116 #----------------------------# 127 chapter6_Makefiles() { 117 chapter6_Makefiles() { # 128 118 #----------------------------# 129 119 … … 152 142 this_script=`basename $file` 153 143 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. 157 146 case "${this_script}" in 158 147 *chroot) continue ;; … … 172 161 fi 173 162 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 177 165 case "${this_script}" in 178 166 *kernfs) runasroot="$runasroot ${this_script}" ;; … … 194 182 fi 195 183 196 # In the mount of kernel filesystems we need to set LFS197 # and not to use chroot.184 # Run the script. 185 # The kernfs script must be run as root. 198 186 case "${this_script}" in 199 187 *kernfs) wrt_RunAsRoot "$file" ;; … … 206 194 fi 207 195 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. 210 197 wrt_touch 211 198 # … … 221 208 } 222 209 223 #----------------------------# 224 chapter78_Makefiles() { 210 211 #----------------------------# 212 chapter78_Makefiles() { # 225 213 #----------------------------# 226 214 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8 ( BOOT ) ${R_arrow}" … … 235 223 case ${this_script} in 236 224 *grub) continue ;; 237 *fstab) [[ ! -z ${FSTAB}]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;238 *kernel) [[ -z ${CONFIG}]] && continue225 *fstab) [[ -n "${FSTAB}" ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;; 226 *kernel) [[ -z "${CONFIG}" ]] && continue 239 227 cp ${CONFIG} $BUILDDIR/sources/kernel-config ;; 240 228 esac 241 229 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 244 234 chapter78="$chapter78 ${this_script}" 245 235 … … 252 242 wrt_target "${this_script}" "$PREV" 253 243 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 262 250 case "${this_script}" in 263 251 *fstab) if [[ -n $FSTAB ]]; then … … 269 257 esac 270 258 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. 282 265 wrt_touch 283 266 # … … 291 274 292 275 } 293 294 276 295 277
