Changeset 3261fe7
- Timestamp:
- 03/29/2020 05:16:09 PM (5 years ago)
- Branches:
- ablfs-more, legacy, trunk
- Children:
- 04de9bc
- Parents:
- 4762fb9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LFS/master.sh
r4762fb9 r3261fe7 98 98 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5 ( LUSER ) ${R_arrow}" 99 99 100 # Initialize the Makefile target: it'll change during chapter 101 # For vanilla lfs, the "changingowner" script should be run as root. So 102 # it belongs to the "SUDO" target, with list in the "runasroot" variable. 103 # For new lfs, changingowner and kernfs are in "runsaroot", then the following, 104 # starting at creatingdirs, are in the "CHROOT" target, in variable "chapter6". 105 # Makefile_target records the variable, not really the target! 106 # We use a case statement on that variable, because instructions in the 107 # Makefile change according to the phase of the build (LUSER, SUDO, CHROOT). 108 Makefile_target=chapter5 109 110 # Start loop 100 111 for file in chapter05/* ; do 101 112 # Keep the script file name 102 113 this_script=`basename $file` 103 114 104 # If no testsuites are run, then TCL, Expect, DejaGNU and Check 105 # aren't needed (but building them does not hurt). 106 # Fix also locales creation when running chapter05 testsuites (ugly) 107 case "${this_script}" in 108 # *tcl) [[ "${TEST}" = "0" ]] && continue ;; 109 # *expect) [[ "${TEST}" = "0" ]] && continue ;; 110 # *dejagnu) [[ "${TEST}" = "0" ]] && continue ;; 111 # *check) [[ "${TEST}" = "0" ]] && continue ;; 112 # We now do that in LFS.xsl, because stripping.xml contains other cleaning 113 # instructions 114 # *stripping) [[ "${STRIP}" = "n" ]] && continue ;; 115 # Fix locales creation when running chapter05 testsuites (ugly) 116 case "${this_script}" in 115 117 *glibc) [[ "${TEST}" = "3" ]] && \ 116 118 sed -i 's@/usr/lib/locale@/tools/lib/locale@' $file ;; 117 119 esac 118 120 119 # First append each name of the script files to a list (this will become 120 # the names of the targets in the Makefile 121 # DO NOT append the changingowner script, it need be run as root. 122 # A hack is necessary: create script in chap5 BUT run as a dependency for 123 # SUDO target 124 case "${this_script}" in 125 *changingowner) runasroot="$runasroot ${this_script}" ;; 126 *) chapter5="$chapter5 ${this_script}" ;; 127 esac 121 # Append each name of the script files to a list that Makefile_target 122 # points to. But before that, change Makefile_target at the first script 123 # of each target. 124 case "${this_script}" in 125 *changingowner) Makefile_target=runasroot ;; 126 *creatingdirs ) Makefile_target=chapter6 ;; # only run for new lfs 127 esac 128 eval $Makefile_target=\"\$$Makefile_target ${this_script}\" 128 129 129 130 # Grab the name of the target (minus the -pass1 or -pass2 in the case of gcc … … 143 144 # Drop in the name of the target on a new line, and the previous target 144 145 # as a dependency. Also call the echo_message function. 145 LUSER_wrt_target "${this_script}" "$PREV" "$pkg_version" 146 case $Makefile_target in 147 chapter6) CHROOT_wrt_target "${this_script}" "$PREV" "$pkg_version" ;; 148 *) LUSER_wrt_target "${this_script}" "$PREV" "$pkg_version" ;; 149 esac 146 150 147 151 # If $pkg_tarball isn't empty, we've got a package... … … 149 153 # Always initialize the log file, since the test instructions may be 150 154 # "uncommented" by the user 151 LUSER_wrt_test_log "${this_script}" "$pkg_version" 155 case $Makefile_target in 156 chapter6) CHROOT_wrt_test_log "${this_script}" "$pkg_version" ;; 157 *) LUSER_wrt_test_log "${this_script}" "$pkg_version" ;; 158 esac 159 152 160 # If using optimizations, write the instructions 153 161 case "${OPTIMIZE}${this_script}${REALSBU}" in … … 161 169 # and date and disk usage again at the bottom of the log file. 162 170 # The changingowner script must be run as root. 163 case "${this_script}" in 164 *changingowner) wrt_RunAsRoot "$file" "$pkg_version" ;; 165 *) LUSER_wrt_RunAsUser "$file" "$pkg_version" ;; 171 case "${Makefile_target}" in 172 runasroot) wrt_RunAsRoot "$file" "$pkg_version" ;; 173 chapter5) LUSER_wrt_RunAsUser "$file" "$pkg_version" ;; 174 chapter6) CHROOT_wrt_RunAsRoot "$file" "$pkg_version" ;; 166 175 esac 167 176 … … 211 220 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N ( CHROOT ) ${R_arrow}" 212 221 222 # Initialize the Makefile target. In vanilla lfs, kernfs should be run as root, 223 # then the others are run in chroot. If in new lfs, we should start in chroot. 224 # this will be changed later because man-pages is the first script in 225 # chapter 6. Note that this Makefile_target business is not really needed here 226 # but we do it to have a similar structure to chapter 5 (we may merge all 227 # those functions at some point). 228 Makefile_target=runasroot 229 230 # Start loop 213 231 for file in chapter06$N/* ; do 214 232 # Keep the script file name … … 226 244 227 245 # Find the tarball corresponding to our script. 228 # If it doesn't , we skip it in iterations rebuilds (except stripping).246 # If it doesn't exist, we skip it in iterations rebuilds (except stripping). 229 247 pkg_tarball=$(sed -n 's/tar -xf \(.*\)/\1/p' $file) 230 248 pkg_version=$(sed -n 's/VERSION=\(.*\)/\1/p' $file) … … 241 259 # The kernfs script must be run as part of SUDO target. 242 260 case "${this_script}" in 243 *kernfs) runasroot="$runasroot ${this_script}" ;; 244 *) chapter6="$chapter6 ${this_script}" ;; 245 esac 261 *creatingdirs) Makefile_target=chapter6 ;; 262 *man-pages ) Makefile_target=chapter6 ;; 263 esac 264 eval $Makefile_target=\"\$$Makefile_target ${this_script}\" 246 265 247 266 #--------------------------------------------------------------------# … … 253 272 # In the mount of kernel filesystems we need to set LFS 254 273 # and not to use chroot. 255 case "${ this_script}" in256 *kernfs) LUSER_wrt_target "${this_script}" "$PREV" "$pkg_version" ;;257 *) CHROOT_wrt_target "${this_script}" "$PREV" "$pkg_version" ;;274 case "${Makefile_target}" in 275 runasroot) LUSER_wrt_target "${this_script}" "$PREV" "$pkg_version" ;; 276 *) CHROOT_wrt_target "${this_script}" "$PREV" "$pkg_version" ;; 258 277 esac 259 278 … … 266 285 CHROOT_wrt_TouchTimestamp 267 286 fi 268 # Always initialize the log file, so that the use may reinstate a287 # Always initialize the log file, so that the user may reinstate a 269 288 # commented out test 270 289 CHROOT_wrt_test_log "${this_script}" "$pkg_version" … … 275 294 # In the mount of kernel filesystems we need to set LFS 276 295 # and not to use chroot. 277 case "${ this_script}" in278 *kernfs) wrt_RunAsRoot "$file" "$pkg_version" ;;279 *) CHROOT_wrt_RunAsRoot "$file" "$pkg_version" ;;296 case "${Makefile_target}" in 297 runasroot) wrt_RunAsRoot "$file" "$pkg_version" ;; 298 *) CHROOT_wrt_RunAsRoot "$file" "$pkg_version" ;; 280 299 esac 281 300
Note:
See TracChangeset
for help on using the changeset viewer.