[91ff6a9] | 1 | #!/bin/bash
|
---|
[877cc6a] | 2 | # $Id$
|
---|
| 3 |
|
---|
[045b2dc] | 4 |
|
---|
| 5 | orphan_scripts="" # 2 scripts do not fit BOOT_Makefiles LUSER environment
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | #--------------------------------------#
|
---|
| 9 | host_prep_Makefiles() { #
|
---|
| 10 | #--------------------------------------#
|
---|
[e2ec07a] | 11 | local CLFS_HOST
|
---|
[877cc6a] | 12 |
|
---|
[045b2dc] | 13 | echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files ( SETUP ) ${R_arrow}"
|
---|
[877cc6a] | 14 |
|
---|
| 15 | # defined here, only for ease of reading
|
---|
[ff4d1ab] | 16 | CLFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
|
---|
[877cc6a] | 17 | (
|
---|
| 18 | cat << EOF
|
---|
| 19 | 023-creatingtoolsdir:
|
---|
| 20 | @\$(call echo_message, Building)
|
---|
[e314f7e] | 21 | @mkdir \$(MOUNT_PT)/tools && \\
|
---|
| 22 | rm -f /tools && \\
|
---|
[dbcdfd7] | 23 | ln -s \$(MOUNT_PT)/tools /
|
---|
| 24 | @\$(call housekeeping)
|
---|
[877cc6a] | 25 |
|
---|
| 26 | 024-creatingcrossdir: 023-creatingtoolsdir
|
---|
[9ae0875] | 27 | @\$(call echo_message, Building)
|
---|
[877cc6a] | 28 | @mkdir -v \$(MOUNT_PT)/cross-tools && \\
|
---|
[e314f7e] | 29 | rm -f /cross-tools && \\
|
---|
[dbcdfd7] | 30 | ln -s \$(MOUNT_PT)/cross-tools /
|
---|
| 31 | @\$(call housekeeping)
|
---|
[877cc6a] | 32 |
|
---|
| 33 | 025-addinguser: 024-creatingcrossdir
|
---|
| 34 | @\$(call echo_message, Building)
|
---|
[962793a] | 35 | @if [ ! -d \$(LUSER_HOME) ]; then \\
|
---|
[6ad5a2f] | 36 | groupadd \$(LGROUP); \\
|
---|
| 37 | useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
|
---|
[877cc6a] | 38 | else \\
|
---|
[6ad5a2f] | 39 | touch luser-exist; \\
|
---|
[877cc6a] | 40 | fi;
|
---|
[9ae0875] | 41 | @chown \$(LUSER) \$(MOUNT_PT)/tools && \\
|
---|
[6ad5a2f] | 42 | chown \$(LUSER) \$(MOUNT_PT)/cross-tools && \\
|
---|
[9ae0875] | 43 | chmod -R a+wt \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
|
---|
[dbcdfd7] | 44 | chmod a+wt \$(SRCSDIR)
|
---|
| 45 | @\$(call housekeeping)
|
---|
[877cc6a] | 46 |
|
---|
| 47 | 026-settingenvironment: 025-addinguser
|
---|
| 48 | @\$(call echo_message, Building)
|
---|
[962793a] | 49 | @if [ -f \$(LUSER_HOME)/.bashrc -a ! -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
|
---|
| 50 | mv \$(LUSER_HOME)/.bashrc \$(LUSER_HOME)/.bashrc.XXX; \\
|
---|
[877cc6a] | 51 | fi;
|
---|
[962793a] | 52 | @if [ -f \$(LUSER_HOME)/.bash_profile -a ! -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
|
---|
| 53 | mv \$(LUSER_HOME)/.bash_profile \$(LUSER_HOME)/.bash_profile.XXX; \\
|
---|
[877cc6a] | 54 | fi;
|
---|
[962793a] | 55 | @echo "set +h" > \$(LUSER_HOME)/.bashrc && \\
|
---|
| 56 | echo "umask 022" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 57 | echo "CLFS=\$(MOUNT_PT)" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 58 | echo "LC_ALL=POSIX" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 59 | echo "PATH=/cross-tools/bin:/bin:/usr/bin" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 60 | echo "export CLFS LC_ALL PATH" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 61 | echo "" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 62 | echo "unset CFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 63 | echo "unset CXXFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 64 | echo "" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 65 | echo "export CLFS_HOST=\"${CLFS_HOST}\"" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 66 | echo "export CLFS_TARGET=\"${TARGET}\"" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 67 | echo "export CLFS_TARGET32=\"${TARGET32}\"" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
| 68 | echo "source $JHALFSDIR/envars" >> \$(LUSER_HOME)/.bashrc
|
---|
| 69 | @chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bashrc && \\
|
---|
[877cc6a] | 70 | touch envars && \\
|
---|
[045b2dc] | 71 | chmod -R a+wt \$(MOUNT_PT) && \\
|
---|
[dbcdfd7] | 72 | chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT)
|
---|
| 73 | @\$(call housekeeping)
|
---|
[877cc6a] | 74 | EOF
|
---|
| 75 | ) >> $MKFILE.tmp
|
---|
[045b2dc] | 76 | host_prep=" 023-creatingtoolsdir 024-creatingcrossdir 026-settingenvironment"
|
---|
[877cc6a] | 77 |
|
---|
| 78 | }
|
---|
| 79 |
|
---|
[045b2dc] | 80 | #--------------------------------------#
|
---|
| 81 | cross_tools_Makefiles() { #
|
---|
| 82 | #--------------------------------------#
|
---|
| 83 | echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools ( LUSER ) ${R_arrow}"
|
---|
[877cc6a] | 84 |
|
---|
| 85 | for file in cross-tools/* ; do
|
---|
| 86 | # Keep the script file name
|
---|
| 87 | this_script=`basename $file`
|
---|
| 88 | #
|
---|
| 89 | # Skip this script...
|
---|
| 90 | case $this_script in
|
---|
| 91 | *cflags* | *variables* ) # work done in host_prep_Makefiles
|
---|
| 92 | continue; ;;
|
---|
| 93 | *) ;;
|
---|
| 94 | esac
|
---|
| 95 | #
|
---|
| 96 | # Set the dependency for the first target.
|
---|
| 97 | if [ -z $PREV ] ; then PREV=026-settingenvironment ; fi
|
---|
| 98 |
|
---|
| 99 | # First append each name of the script files to a list (this will become
|
---|
| 100 | # the names of the targets in the Makefile
|
---|
| 101 | cross_tools="$cross_tools $this_script"
|
---|
| 102 |
|
---|
| 103 | # Grab the name of the target (minus the -headers or -cross in the case of gcc
|
---|
| 104 | # and binutils in chapter 5)
|
---|
| 105 | name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
|
---|
| 106 | -e 's@-static@@' \
|
---|
| 107 | -e 's@-final@@' \
|
---|
[480295c] | 108 | -e 's@-64@@' \
|
---|
[877cc6a] | 109 | -e 's@-n32@@'`
|
---|
[a160d86] | 110 | pkg_tarball=$(get_package_tarball_name $name)
|
---|
[877cc6a] | 111 |
|
---|
| 112 | #--------------------------------------------------------------------#
|
---|
| 113 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
| 114 | #--------------------------------------------------------------------#
|
---|
| 115 | #
|
---|
| 116 | # Drop in the name of the target on a new line, and the previous target
|
---|
| 117 | # as a dependency. Also call the echo_message function.
|
---|
[045b2dc] | 118 | LUSER_wrt_target "${this_script}" "$PREV"
|
---|
[877cc6a] | 119 | #
|
---|
[a160d86] | 120 | # If $pkg_tarball isn't empty, we've got a package...
|
---|
[877cc6a] | 121 | #
|
---|
[045b2dc] | 122 | [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
|
---|
[ce262a7] | 123 | [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = 3 ]] && wrt_makeflags "${name}"
|
---|
[877cc6a] | 124 | #
|
---|
[045b2dc] | 125 | LUSER_wrt_RunAsUser "${file}"
|
---|
[877cc6a] | 126 | #
|
---|
[045b2dc] | 127 | [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
|
---|
[877cc6a] | 128 | #
|
---|
| 129 | # Include a touch of the target name so make can check if it's already been made.
|
---|
[93f38e7] | 130 | wrt_touch
|
---|
[877cc6a] | 131 | #
|
---|
| 132 | #--------------------------------------------------------------------#
|
---|
| 133 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
| 134 | #--------------------------------------------------------------------#
|
---|
| 135 | #
|
---|
| 136 | # Keep the script file name for Makefile dependencies.
|
---|
| 137 | PREV=$this_script
|
---|
| 138 |
|
---|
| 139 | done # for file in ....
|
---|
| 140 | }
|
---|
| 141 |
|
---|
[045b2dc] | 142 | #--------------------------------------#
|
---|
| 143 | temptools_Makefiles() { #
|
---|
| 144 | #--------------------------------------#
|
---|
| 145 | echo "${tab_}${GREEN}Processing... ${L_arrow}temp system ( LUSER ) ${R_arrow}"
|
---|
[877cc6a] | 146 |
|
---|
| 147 | for file in temp-system/* ; do
|
---|
| 148 | # Keep the script file name
|
---|
| 149 | this_script=`basename $file`
|
---|
[6f2cd96] | 150 | #
|
---|
| 151 | # Deal with any odd scripts..
|
---|
| 152 | case $this_script in
|
---|
| 153 | *choose) # The choose script will fail if you cannot enter the new environment
|
---|
| 154 | # If the 'boot' build method was chosen don't run the script
|
---|
| 155 | [[ $METHOD = "boot" ]] && continue; ;;
|
---|
| 156 | *) ;;
|
---|
| 157 | esac
|
---|
[e2ec07a] | 158 |
|
---|
[877cc6a] | 159 | #
|
---|
| 160 | # First append each name of the script files to a list (this will become
|
---|
| 161 | # the names of the targets in the Makefile
|
---|
| 162 | temptools="$temptools $this_script"
|
---|
| 163 |
|
---|
| 164 | #
|
---|
| 165 | # Grab the name of the target, strip id number, XXX-script
|
---|
| 166 | name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
|
---|
| 167 | #
|
---|
[a160d86] | 168 | pkg_tarball=$(get_package_tarball_name $name)
|
---|
[877cc6a] | 169 |
|
---|
| 170 | #--------------------------------------------------------------------#
|
---|
| 171 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
| 172 | #--------------------------------------------------------------------#
|
---|
| 173 | #
|
---|
| 174 | # Drop in the name of the target on a new line, and the previous target
|
---|
| 175 | # as a dependency. Also call the echo_message function.
|
---|
[045b2dc] | 176 | LUSER_wrt_target "${this_script}" "$PREV"
|
---|
[877cc6a] | 177 | #
|
---|
[a160d86] | 178 | # If $pkg_tarball isn't empty, we've got a package...
|
---|
[877cc6a] | 179 | # Insert instructions for unpacking the package and to set the PKGDIR variable.
|
---|
| 180 | #
|
---|
[045b2dc] | 181 | [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
|
---|
[ce262a7] | 182 | [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
[877cc6a] | 183 | #
|
---|
[045b2dc] | 184 | LUSER_wrt_RunAsUser "${file}"
|
---|
[877cc6a] | 185 | #
|
---|
[045b2dc] | 186 | [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
|
---|
[877cc6a] | 187 | #
|
---|
| 188 | # Include a touch of the target name so make can check if it's already been made.
|
---|
[93f38e7] | 189 | wrt_touch
|
---|
[877cc6a] | 190 | #
|
---|
| 191 | #--------------------------------------------------------------------#
|
---|
| 192 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
| 193 | #--------------------------------------------------------------------#
|
---|
| 194 | #
|
---|
| 195 | # Keep the script file name for Makefile dependencies.
|
---|
| 196 | PREV=$this_script
|
---|
| 197 | done # for file in ....
|
---|
| 198 | }
|
---|
| 199 |
|
---|
| 200 |
|
---|
[045b2dc] | 201 | #--------------------------------------#
|
---|
| 202 | chroot_Makefiles() { #
|
---|
| 203 | #--------------------------------------#
|
---|
| 204 | echo "${tab_}${GREEN}Processing... ${L_arrow}tmptools CHROOT ( CHROOT ) ${R_arrow}"
|
---|
[877cc6a] | 205 |
|
---|
[045b2dc] | 206 | for file in chroot/* ; do
|
---|
[877cc6a] | 207 | # Keep the script file name
|
---|
| 208 | this_script=`basename $file`
|
---|
[045b2dc] | 209 | #
|
---|
| 210 | # Skipping scripts is done now and not included in the build tree.
|
---|
[877cc6a] | 211 | case $this_script in
|
---|
[045b2dc] | 212 | *chroot*) continue ;;
|
---|
[877cc6a] | 213 | esac
|
---|
[045b2dc] | 214 |
|
---|
[877cc6a] | 215 | #
|
---|
| 216 | # First append each name of the script files to a list (this will become
|
---|
| 217 | # the names of the targets in the Makefile
|
---|
[045b2dc] | 218 | case "${this_script}" in
|
---|
| 219 | *kernfs) orphan_scripts="${orphan_scripts} ${this_script}" ;;
|
---|
| 220 | *) chroottools="$chroottools $this_script" ;;
|
---|
[877cc6a] | 221 | esac
|
---|
[045b2dc] | 222 |
|
---|
| 223 | # Grab the name of the target, strip id number, XXX-script
|
---|
| 224 | name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
|
---|
| 225 |
|
---|
[a160d86] | 226 | pkg_tarball=$(get_package_tarball_name $name)
|
---|
| 227 |
|
---|
[045b2dc] | 228 | # This is very ugly:: util-linux is in /chroot but must be run under LUSER
|
---|
[608fbe1] | 229 | # Same for e2fsprogs (in CLFS 1.1.0)
|
---|
[045b2dc] | 230 | # .. Customized makefile entry
|
---|
| 231 | case "${this_script}" in
|
---|
| 232 | *util-linux)
|
---|
| 233 | LUSER_wrt_target "${this_script}" "$PREV"
|
---|
| 234 | LUSER_wrt_unpack "$pkg_tarball"
|
---|
[ce262a7] | 235 | [[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
[045b2dc] | 236 | LUSER_wrt_RunAsUser "${file}"
|
---|
| 237 | LUSER_RemoveBuildDirs "${name}"
|
---|
| 238 | wrt_touch
|
---|
[480295c] | 239 | temptools="$temptools $this_script"
|
---|
| 240 | continue ;;
|
---|
[608fbe1] | 241 | *util-linux-ng)
|
---|
| 242 | LUSER_wrt_target "${this_script}" "$PREV"
|
---|
| 243 | LUSER_wrt_unpack "$pkg_tarball"
|
---|
[ce262a7] | 244 | [[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
[608fbe1] | 245 | LUSER_wrt_RunAsUser "${file}"
|
---|
| 246 | LUSER_RemoveBuildDirs "${name}"
|
---|
| 247 | wrt_touch
|
---|
| 248 | temptools="$temptools $this_script"
|
---|
| 249 | continue ;;
|
---|
| 250 | *util-linux-libs)
|
---|
| 251 | LUSER_wrt_target "${this_script}" "$PREV"
|
---|
| 252 | LUSER_wrt_unpack "$pkg_tarball"
|
---|
[ce262a7] | 253 | [[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
[608fbe1] | 254 | LUSER_wrt_RunAsUser "${file}"
|
---|
| 255 | LUSER_RemoveBuildDirs "${name}"
|
---|
| 256 | wrt_touch
|
---|
| 257 | temptools="$temptools $this_script"
|
---|
| 258 | continue ;;
|
---|
| 259 | *e2fsprogs)
|
---|
| 260 | LUSER_wrt_target "${this_script}" "$PREV"
|
---|
| 261 | LUSER_wrt_unpack "$pkg_tarball"
|
---|
[ce262a7] | 262 | [[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
[608fbe1] | 263 | LUSER_wrt_RunAsUser "${file}"
|
---|
| 264 | LUSER_RemoveBuildDirs "${name}"
|
---|
| 265 | wrt_touch
|
---|
| 266 | temptools="$temptools $this_script"
|
---|
| 267 | continue ;;
|
---|
| 268 | *e2fsprogs-libs)
|
---|
| 269 | LUSER_wrt_target "${this_script}" "$PREV"
|
---|
| 270 | LUSER_wrt_unpack "$pkg_tarball"
|
---|
[ce262a7] | 271 | [[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
[608fbe1] | 272 | LUSER_wrt_RunAsUser "${file}"
|
---|
| 273 | LUSER_RemoveBuildDirs "${name}"
|
---|
| 274 | wrt_touch
|
---|
| 275 | temptools="$temptools $this_script"
|
---|
| 276 | continue ;;
|
---|
[045b2dc] | 277 | esac
|
---|
| 278 |
|
---|
| 279 |
|
---|
[877cc6a] | 280 | #--------------------------------------------------------------------#
|
---|
| 281 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
| 282 | #--------------------------------------------------------------------#
|
---|
| 283 | #
|
---|
| 284 | # Drop in the name of the target on a new line, and the previous target
|
---|
| 285 | # as a dependency. Also call the echo_message function.
|
---|
[045b2dc] | 286 | CHROOT_wrt_target "${this_script}" "$PREV"
|
---|
[877cc6a] | 287 | #
|
---|
[a160d86] | 288 | # If $pkg_tarball isn't empty, we've got a package...
|
---|
[877cc6a] | 289 | # Insert instructions for unpacking the package and changing directories
|
---|
| 290 | #
|
---|
[045b2dc] | 291 | if [ "$pkg_tarball" != "" ] ; then
|
---|
[8f2c086] | 292 | CHROOT_Unpack "$pkg_tarball"
|
---|
[ce262a7] | 293 | [[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
[045b2dc] | 294 | fi
|
---|
[877cc6a] | 295 | #
|
---|
| 296 | # Select a script execution method
|
---|
| 297 | case $this_script in
|
---|
[8f2c086] | 298 | *kernfs) wrt_RunAsRoot "${file}" ;;
|
---|
[045b2dc] | 299 | *) CHROOT_wrt_RunAsRoot "${file}" ;;
|
---|
[877cc6a] | 300 | esac
|
---|
| 301 | #
|
---|
[045b2dc] | 302 | # Housekeeping...remove the build directory(ies), except if the package build fails.
|
---|
| 303 | [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
|
---|
[877cc6a] | 304 | #
|
---|
| 305 | # Include a touch of the target name so make can check if it's already been made.
|
---|
[93f38e7] | 306 | wrt_touch
|
---|
[877cc6a] | 307 | #
|
---|
| 308 | #--------------------------------------------------------------------#
|
---|
| 309 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
| 310 | #--------------------------------------------------------------------#
|
---|
| 311 | #
|
---|
| 312 | # Keep the script file name for Makefile dependencies.
|
---|
| 313 | PREV=$this_script
|
---|
| 314 |
|
---|
[045b2dc] | 315 | done # for file in...
|
---|
[877cc6a] | 316 | }
|
---|
| 317 |
|
---|
| 318 |
|
---|
[045b2dc] | 319 | #--------------------------------------#
|
---|
| 320 | boot_Makefiles() { #
|
---|
| 321 | #--------------------------------------#
|
---|
[877cc6a] | 322 |
|
---|
[045b2dc] | 323 | echo "${tab_}${GREEN}Processing... ${L_arrow}tmptools BOOT ( LUSER ) ${R_arrow}"
|
---|
| 324 | #
|
---|
| 325 | # Create a target bootable partition containing a compile environment. Later
|
---|
| 326 | # on we boot into this environment and contine the build.
|
---|
| 327 | #
|
---|
| 328 | for file in boot/* ; do
|
---|
[877cc6a] | 329 | # Keep the script file name
|
---|
| 330 | this_script=`basename $file`
|
---|
[045b2dc] | 331 |
|
---|
| 332 | # A little housekeeping on the scripts
|
---|
[877cc6a] | 333 | case $this_script in
|
---|
[f940c29] | 334 | *grub | *aboot | *colo | *silo | *arcload | *lilo | *introduction ) continue ;;
|
---|
[045b2dc] | 335 | *whatnext*) continue ;;
|
---|
| 336 | *fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
|
---|
| 337 | *kernel) # if there is no kernel config file do not build the kernel
|
---|
| 338 | [[ -z $CONFIG ]] && continue
|
---|
| 339 | # Copy the config file to /sources with a standardized name
|
---|
| 340 | cp $BOOT_CONFIG $BUILDDIR/sources/bootkernel-config
|
---|
| 341 | ;;
|
---|
[877cc6a] | 342 | esac
|
---|
| 343 | #
|
---|
| 344 | # First append each name of the script files to a list (this will become
|
---|
| 345 | # the names of the targets in the Makefile
|
---|
[045b2dc] | 346 | case "${this_script}" in
|
---|
| 347 | *changingowner) orphan_scripts="${orphan_scripts} ${this_script}" ;;
|
---|
| 348 | *devices) orphan_scripts="${orphan_scripts} ${this_script}" ;;
|
---|
| 349 | *) boottools="$boottools $this_script" ;;
|
---|
| 350 | esac
|
---|
| 351 | #
|
---|
| 352 | # Grab the name of the target, strip id number and misc words.
|
---|
| 353 | case $this_script in
|
---|
| 354 | *kernel) name=linux ;;
|
---|
| 355 | *bootscripts) name="bootscripts-cross-lfs" ;;
|
---|
| 356 | *udev-rules) name="udev-cross-lfs" ;;
|
---|
| 357 | *grub-build) name=grub ;;
|
---|
| 358 | *-aboot-build) name=aboot ;;
|
---|
| 359 | *yaboot-build) name=yaboot ;;
|
---|
| 360 | *colo-build) name=colo ;;
|
---|
| 361 | *silo-build) name=silo ;;
|
---|
| 362 | *arcload-build) name=arcload ;;
|
---|
| 363 | *lilo-build) name=lilo ;;
|
---|
| 364 | *) name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-build@@' ` ;;
|
---|
| 365 | esac
|
---|
| 366 | # Identify the unique version naming scheme for the clfs bootscripts..(bad boys)
|
---|
[a160d86] | 367 | pkg_tarball=$(get_package_tarball_name $name)
|
---|
[877cc6a] | 368 |
|
---|
| 369 | #--------------------------------------------------------------------#
|
---|
| 370 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
| 371 | #--------------------------------------------------------------------#
|
---|
| 372 | #
|
---|
| 373 | # Drop in the name of the target on a new line, and the previous target
|
---|
| 374 | # as a dependency. Also call the echo_message function.
|
---|
[045b2dc] | 375 | LUSER_wrt_target "${this_script}" "$PREV"
|
---|
[877cc6a] | 376 | #
|
---|
[a160d86] | 377 | # If $pkg_tarball isn't empty, we've got a package...
|
---|
[877cc6a] | 378 | # Insert instructions for unpacking the package and changing directories
|
---|
| 379 | #
|
---|
[045b2dc] | 380 | [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
|
---|
[ce262a7] | 381 | [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
[877cc6a] | 382 | #
|
---|
| 383 | # Select a script execution method
|
---|
| 384 | case $this_script in
|
---|
[045b2dc] | 385 | # The following 2 scripts are defined in the /boot directory but need
|
---|
| 386 | # to be run as a root user. Set them up here but run them in another phase
|
---|
[8f2c086] | 387 | *changingowner*) wrt_RunAsRoot "${file}" ;;
|
---|
| 388 | *devices*) wrt_RunAsRoot "${file}" ;;
|
---|
[045b2dc] | 389 | *fstab*) if [[ -n "$FSTAB" ]]; then
|
---|
| 390 | LUSER_wrt_CopyFstab
|
---|
| 391 | else
|
---|
| 392 | LUSER_wrt_RunAsUser "${file}"
|
---|
| 393 | fi
|
---|
| 394 | ;;
|
---|
| 395 | *) LUSER_wrt_RunAsUser "${file}" ;;
|
---|
[877cc6a] | 396 | esac
|
---|
| 397 | #
|
---|
[045b2dc] | 398 | # Housekeeping...remove any build directory(ies) except if the package build fails.
|
---|
| 399 | [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
|
---|
[877cc6a] | 400 | #
|
---|
| 401 | # Include a touch of the target name so make can check if it's already been made.
|
---|
[93f38e7] | 402 | wrt_touch
|
---|
[877cc6a] | 403 | #
|
---|
| 404 | #--------------------------------------------------------------------#
|
---|
| 405 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
| 406 | #--------------------------------------------------------------------#
|
---|
| 407 | #
|
---|
| 408 | # Keep the script file name for Makefile dependencies.
|
---|
| 409 | PREV=$this_script
|
---|
| 410 |
|
---|
[045b2dc] | 411 | done
|
---|
[877cc6a] | 412 | }
|
---|
| 413 |
|
---|
| 414 |
|
---|
[045b2dc] | 415 | #--------------------------------------#
|
---|
[d55a1a1] | 416 | testsuite_tools_Makefiles() { #
|
---|
[045b2dc] | 417 | #--------------------------------------#
|
---|
[877cc6a] | 418 |
|
---|
[d55a1a1] | 419 | if [[ "${METHOD}" = "chroot" ]]; then
|
---|
| 420 | echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) testsuite tools ( CHROOT ) ${R_arrow}"
|
---|
| 421 | else
|
---|
| 422 | echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) testsuite tools ( ROOT ) ${R_arrow}"
|
---|
[010627d] | 423 | PREV=""
|
---|
[d55a1a1] | 424 | fi
|
---|
[877cc6a] | 425 |
|
---|
| 426 | for file in testsuite-tools/* ; do
|
---|
| 427 | # Keep the script file name
|
---|
| 428 | this_script=`basename $file`
|
---|
| 429 |
|
---|
| 430 | # First append each name of the script files to a list (this will become
|
---|
| 431 | # the names of the targets in the Makefile
|
---|
| 432 | testsuitetools="$testsuitetools $this_script"
|
---|
| 433 |
|
---|
| 434 | # Grab the name of the target, strip id number, XXX-script
|
---|
| 435 | name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'\
|
---|
| 436 | -e 's@-64bit@@' \
|
---|
| 437 | -e 's@-64@@' \
|
---|
| 438 | -e 's@64@@' \
|
---|
| 439 | -e 's@n32@@'`
|
---|
| 440 |
|
---|
[a160d86] | 441 | pkg_tarball=$(get_package_tarball_name $name)
|
---|
[877cc6a] | 442 |
|
---|
| 443 | #--------------------------------------------------------------------#
|
---|
| 444 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
| 445 | #--------------------------------------------------------------------#
|
---|
| 446 | #
|
---|
| 447 | # Drop in the name of the target on a new line, and the previous target
|
---|
| 448 | # as a dependency. Also call the echo_message function.
|
---|
[ca6b261] | 449 | CHROOT_wrt_target "${this_script}" "$PREV"
|
---|
[877cc6a] | 450 | #
|
---|
[ca6b261] | 451 | CHROOT_Unpack "$pkg_tarball"
|
---|
[ce262a7] | 452 | [[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
[877cc6a] | 453 | #
|
---|
[ca6b261] | 454 | CHROOT_wrt_RunAsRoot "${file}"
|
---|
[877cc6a] | 455 | #
|
---|
[ca6b261] | 456 | CHROOT_wrt_RemoveBuildDirs "${name}"
|
---|
[877cc6a] | 457 | #
|
---|
| 458 | # Include a touch of the target name so make can check if it's already been made.
|
---|
[93f38e7] | 459 | wrt_touch
|
---|
[877cc6a] | 460 | #
|
---|
| 461 | #--------------------------------------------------------------------#
|
---|
| 462 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
| 463 | #--------------------------------------------------------------------#
|
---|
| 464 | #
|
---|
| 465 | # Keep the script file name for Makefile dependencies.
|
---|
| 466 | PREV=$this_script
|
---|
| 467 |
|
---|
| 468 | done
|
---|
| 469 | }
|
---|
| 470 |
|
---|
| 471 |
|
---|
[045b2dc] | 472 | #--------------------------------------#
|
---|
[d55a1a1] | 473 | final_system_Makefiles() { #
|
---|
[045b2dc] | 474 | #--------------------------------------#
|
---|
[45f82718] | 475 | # Set envars and scripts for iteration targets
|
---|
| 476 | if [[ -z "$1" ]] ; then
|
---|
| 477 | local N=""
|
---|
[d55a1a1] | 478 | # In boot method the makesys phase was initiated in testsuite_tools_makefile
|
---|
| 479 | [[ "${METHOD}" = "boot" ]] && [[ "$TEST" = 0 ]] && PREV=""
|
---|
[45f82718] | 480 | else
|
---|
| 481 | local N=-build_$1
|
---|
| 482 | local basicsystem=""
|
---|
| 483 | mkdir final-system$N
|
---|
| 484 | cp final-system/* final-system$N
|
---|
| 485 | for script in final-system$N/* ; do
|
---|
| 486 | # Overwrite existing symlinks, files, and dirs
|
---|
| 487 | sed -e 's/ln -sv/&f/g' \
|
---|
| 488 | -e 's/mv -v/&f/g' \
|
---|
| 489 | -e 's/mkdir -v/&p/g' -i ${script}
|
---|
[10c8b78] | 490 | # Rename the scripts
|
---|
| 491 | mv ${script} ${script}$N
|
---|
[45f82718] | 492 | done
|
---|
[a5f52ba] | 493 | # Remove Bzip2 binaries before make install (CLFS-1.0 compatibility)
|
---|
[10c8b78] | 494 | sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i final-system$N/*-bzip2$N
|
---|
[45f82718] | 495 | # Delete *old Readline libraries just after make install
|
---|
[10c8b78] | 496 | sed -e 's@make install@&\nrm -v /lib/lib{history,readline}*old@' -i final-system$N/*-readline$N
|
---|
[45f82718] | 497 | fi
|
---|
| 498 |
|
---|
[d55a1a1] | 499 | if [[ "${METHOD}" = "chroot" ]]; then
|
---|
| 500 | echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) final system$N ( CHROOT ) ${R_arrow}"
|
---|
| 501 | else
|
---|
| 502 | echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) final system$N ( ROOT ) ${R_arrow}"
|
---|
| 503 | fi
|
---|
[877cc6a] | 504 |
|
---|
[45f82718] | 505 | for file in final-system$N/* ; do
|
---|
[877cc6a] | 506 | # Keep the script file name
|
---|
| 507 | this_script=`basename $file`
|
---|
| 508 |
|
---|
[45f82718] | 509 | # Test if the stripping phase must be skipped.
|
---|
| 510 | # Skip alsp temp-perl for iterative runs
|
---|
[877cc6a] | 511 | case $this_script in
|
---|
[401f81e] | 512 | *stripping*) [[ "$STRIP" = "n" ]] && continue ;;
|
---|
[45f82718] | 513 | *temp-perl*) [[ -n "$N" ]] && continue ;;
|
---|
[877cc6a] | 514 | esac
|
---|
| 515 |
|
---|
| 516 | # Grab the name of the target, strip id number, XXX-script
|
---|
| 517 | name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
|
---|
| 518 | -e 's@temp-@@' \
|
---|
| 519 | -e 's@-64bit@@' \
|
---|
| 520 | -e 's@-64@@' \
|
---|
| 521 | -e 's@64@@' \
|
---|
[10c8b78] | 522 | -e 's@n32@@' \
|
---|
| 523 | -e 's,'$N',,'`
|
---|
[877cc6a] | 524 |
|
---|
[45f82718] | 525 | # Find the version of the command files, if it corresponds with the building of
|
---|
| 526 | # a specific package. We need this here to can skip scripts not needed for
|
---|
| 527 | # iterations rebuilds
|
---|
[a160d86] | 528 | pkg_tarball=$(get_package_tarball_name $name)
|
---|
[9d9ecf7] | 529 |
|
---|
[a160d86] | 530 | if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
|
---|
[45f82718] | 531 | case "${this_script}" in
|
---|
| 532 | *stripping*) ;;
|
---|
| 533 | *) continue ;;
|
---|
| 534 | esac
|
---|
| 535 | fi
|
---|
| 536 |
|
---|
| 537 | # Append each name of the script files to a list (this will become
|
---|
| 538 | # the names of the targets in the Makefile
|
---|
[10c8b78] | 539 | basicsystem="$basicsystem ${this_script}"
|
---|
[45f82718] | 540 |
|
---|
[877cc6a] | 541 | #--------------------------------------------------------------------#
|
---|
| 542 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
| 543 | #--------------------------------------------------------------------#
|
---|
| 544 | #
|
---|
| 545 | # Drop in the name of the target on a new line, and the previous target
|
---|
| 546 | # as a dependency. Also call the echo_message function.
|
---|
[10c8b78] | 547 | CHROOT_wrt_target "${this_script}" "$PREV"
|
---|
[877cc6a] | 548 |
|
---|
[a160d86] | 549 | # If $pkg_tarball isn't empty, we've got a package...
|
---|
| 550 | if [ "$pkg_tarball" != "" ] ; then
|
---|
[f546320] | 551 | # Touch timestamp file if installed files logs will be created.
|
---|
| 552 | # But only for the firt build when running iterative builds.
|
---|
| 553 | if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
|
---|
| 554 | CHROOT_wrt_TouchTimestamp
|
---|
| 555 | fi
|
---|
[045b2dc] | 556 | CHROOT_Unpack "$pkg_tarball"
|
---|
[a229600] | 557 | # If the testsuites must be run, initialize the log file
|
---|
| 558 | case $name in
|
---|
[608fbe1] | 559 | binutils | gcc | glibc | eglibc )
|
---|
[10c8b78] | 560 | [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
|
---|
[a229600] | 561 | ;;
|
---|
| 562 | * )
|
---|
[10c8b78] | 563 | [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}"
|
---|
[a229600] | 564 | ;;
|
---|
| 565 | esac
|
---|
| 566 | # If using optimizations, write the instructions
|
---|
[1b65a84] | 567 | [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
[877cc6a] | 568 | fi
|
---|
| 569 | #
|
---|
[045b2dc] | 570 | CHROOT_wrt_RunAsRoot "${file}"
|
---|
[877cc6a] | 571 | #
|
---|
[f546320] | 572 | # Write installed files log and remove the build directory(ies)
|
---|
| 573 | # except if the package build fails.
|
---|
| 574 | if [ "$pkg_tarball" != "" ] ; then
|
---|
| 575 | CHROOT_wrt_RemoveBuildDirs "$name"
|
---|
| 576 | if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
|
---|
| 577 | CHROOT_wrt_LogNewFiles "$name"
|
---|
| 578 | fi
|
---|
| 579 | fi
|
---|
[877cc6a] | 580 | #
|
---|
[f546320] | 581 | # Include a touch of the target name so make can check
|
---|
| 582 | # if it's already been made.
|
---|
[93f38e7] | 583 | wrt_touch
|
---|
[877cc6a] | 584 | #
|
---|
| 585 | #--------------------------------------------------------------------#
|
---|
| 586 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
| 587 | #--------------------------------------------------------------------#
|
---|
| 588 | #
|
---|
| 589 | # Keep the script file name for Makefile dependencies.
|
---|
[10c8b78] | 590 | PREV=${this_script}
|
---|
[45f82718] | 591 | # Set system_build envar for iteration targets
|
---|
| 592 | system_build=$basicsystem
|
---|
[877cc6a] | 593 | done # for file in final-system/* ...
|
---|
| 594 | }
|
---|
| 595 |
|
---|
[045b2dc] | 596 | #--------------------------------------#
|
---|
[d55a1a1] | 597 | bootscripts_Makefiles() { #
|
---|
[045b2dc] | 598 | #--------------------------------------#
|
---|
[d55a1a1] | 599 |
|
---|
| 600 | if [[ "${METHOD}" = "chroot" ]]; then
|
---|
| 601 | echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) bootscripts ( CHROOT ) ${R_arrow}"
|
---|
[45f82718] | 602 | else
|
---|
[d55a1a1] | 603 | echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) bootscripts ( ROOT ) ${R_arrow}"
|
---|
[45f82718] | 604 | fi
|
---|
[877cc6a] | 605 |
|
---|
| 606 | for file in bootscripts/* ; do
|
---|
| 607 | # Keep the script file name
|
---|
| 608 | this_script=`basename $file`
|
---|
| 609 |
|
---|
| 610 | case $this_script in
|
---|
| 611 | *udev) continue ;; # This is not a script but a commentary, we want udev-rules
|
---|
| 612 | *console*) continue ;; # Use the files that came with the bootscripts
|
---|
| 613 | *) ;;
|
---|
| 614 | esac
|
---|
| 615 |
|
---|
| 616 | # First append each name of the script files to a list (this will become
|
---|
| 617 | # the names of the targets in the Makefile
|
---|
| 618 | bootscripttools="$bootscripttools $this_script"
|
---|
| 619 |
|
---|
| 620 | # Grab the name of the target, strip id number, XXX-script
|
---|
| 621 | name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'\
|
---|
| 622 | -e 's@-64bit@@' \
|
---|
| 623 | -e 's@-64@@' \
|
---|
| 624 | -e 's@64@@' \
|
---|
| 625 | -e 's@n32@@'`
|
---|
| 626 | case $name in
|
---|
[c044e3c] | 627 | *bootscripts*) name=bootscripts-cross-lfs ;;
|
---|
[877cc6a] | 628 | *udev-rules) name=udev-cross-lfs ;;
|
---|
| 629 | esac
|
---|
[c044e3c] | 630 |
|
---|
[a160d86] | 631 | pkg_tarball=$(get_package_tarball_name $name)
|
---|
[877cc6a] | 632 |
|
---|
| 633 | #--------------------------------------------------------------------#
|
---|
| 634 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
| 635 | #--------------------------------------------------------------------#
|
---|
| 636 | #
|
---|
| 637 | # Drop in the name of the target on a new line, and the previous target
|
---|
| 638 | # as a dependency. Also call the echo_message function.
|
---|
[045b2dc] | 639 | CHROOT_wrt_target "${this_script}" "$PREV"
|
---|
[877cc6a] | 640 | #
|
---|
[a160d86] | 641 | # If $pkg_tarball isn't empty, we've got a package...
|
---|
[877cc6a] | 642 | #
|
---|
[f546320] | 643 | if [ "$pkg_tarball" != "" ] ; then
|
---|
| 644 | if [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
| 645 | CHROOT_wrt_LogNewFiles "$name"
|
---|
| 646 | fi
|
---|
| 647 | CHROOT_Unpack "$pkg_tarball"
|
---|
| 648 | fi
|
---|
[877cc6a] | 649 | #
|
---|
[045b2dc] | 650 | CHROOT_wrt_RunAsRoot "${file}"
|
---|
[877cc6a] | 651 | #
|
---|
[f546320] | 652 | # Write installed files log and remove the build directory(ies)
|
---|
| 653 | # except if the package build fails.
|
---|
| 654 | if [ "$pkg_tarball" != "" ] ; then
|
---|
| 655 | CHROOT_wrt_RemoveBuildDirs "$name"
|
---|
| 656 | if [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
| 657 | CHROOT_wrt_LogNewFiles "$name"
|
---|
| 658 | fi
|
---|
| 659 | fi
|
---|
[877cc6a] | 660 | #
|
---|
| 661 | # Include a touch of the target name so make can check if it's already been made.
|
---|
[93f38e7] | 662 | wrt_touch
|
---|
[877cc6a] | 663 | #
|
---|
| 664 | #--------------------------------------------------------------------#
|
---|
| 665 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
| 666 | #--------------------------------------------------------------------#
|
---|
| 667 | #
|
---|
| 668 | # Keep the script file name for Makefile dependencies.
|
---|
| 669 | PREV=$this_script
|
---|
| 670 |
|
---|
| 671 | done # for file in bootscripts/* ...
|
---|
| 672 | }
|
---|
| 673 |
|
---|
[608fbe1] | 674 | #--------------------------------------#
|
---|
| 675 | network_Makefiles() { #
|
---|
| 676 | #--------------------------------------#
|
---|
| 677 |
|
---|
| 678 | if [[ "${METHOD}" = "chroot" ]]; then
|
---|
| 679 | echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) network ( CHROOT ) ${R_arrow}"
|
---|
| 680 | else
|
---|
| 681 | echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) network ( ROOT ) ${R_arrow}"
|
---|
| 682 | fi
|
---|
| 683 |
|
---|
| 684 | for file in network/* ; do
|
---|
| 685 | # Keep the script file name
|
---|
| 686 | this_script=`basename $file`
|
---|
| 687 |
|
---|
| 688 | case $this_script in
|
---|
| 689 | *choose) continue ;; # This is not a script but a commentary.
|
---|
| 690 | *dhcp) continue ;; # Assume static networking.
|
---|
| 691 | *dhcpcd) continue ;; # Assume static networking.
|
---|
| 692 | *) ;;
|
---|
| 693 | esac
|
---|
| 694 |
|
---|
| 695 | # First append each name of the script files to a list (this will become
|
---|
| 696 | # the names of the targets in the Makefile
|
---|
| 697 | networktools="$networktools $this_script"
|
---|
| 698 |
|
---|
| 699 | # Grab the name of the target, strip id number, XXX-script
|
---|
| 700 | name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'\
|
---|
| 701 | -e 's@-64bit@@' \
|
---|
| 702 | -e 's@-64@@' \
|
---|
| 703 | -e 's@64@@' \
|
---|
| 704 | -e 's@n32@@'`
|
---|
| 705 | case $name in
|
---|
| 706 | *network*) name=network-cross-lfs ;;
|
---|
| 707 | esac
|
---|
| 708 |
|
---|
| 709 | pkg_tarball=$(get_package_tarball_name $name)
|
---|
| 710 |
|
---|
| 711 | #--------------------------------------------------------------------#
|
---|
| 712 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
| 713 | #--------------------------------------------------------------------#
|
---|
| 714 | #
|
---|
| 715 | # Drop in the name of the target on a new line, and the previous target
|
---|
| 716 | # as a dependency. Also call the echo_message function.
|
---|
| 717 | CHROOT_wrt_target "${this_script}" "$PREV"
|
---|
| 718 | #
|
---|
| 719 | # If $pkg_tarball isn't empty, we've got a package...
|
---|
| 720 | #
|
---|
| 721 | if [ "$pkg_tarball" != "" ] ; then
|
---|
| 722 | if [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
| 723 | CHROOT_wrt_LogNewFiles "$name"
|
---|
| 724 | fi
|
---|
| 725 | CHROOT_Unpack "$pkg_tarball"
|
---|
| 726 | fi
|
---|
| 727 | #
|
---|
| 728 | CHROOT_wrt_RunAsRoot "${file}"
|
---|
| 729 | #
|
---|
| 730 | # Write installed files log and remove the build directory(ies)
|
---|
| 731 | # except if the package build fails.
|
---|
| 732 | if [ "$pkg_tarball" != "" ] ; then
|
---|
| 733 | CHROOT_wrt_RemoveBuildDirs "$name"
|
---|
| 734 | if [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
| 735 | CHROOT_wrt_LogNewFiles "$name"
|
---|
| 736 | fi
|
---|
| 737 | fi
|
---|
| 738 | #
|
---|
| 739 | # Include a touch of the target name so make can check if it's already been made.
|
---|
| 740 | wrt_touch
|
---|
| 741 | #
|
---|
| 742 | #--------------------------------------------------------------------#
|
---|
| 743 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
| 744 | #--------------------------------------------------------------------#
|
---|
| 745 | #
|
---|
| 746 | # Keep the script file name for Makefile dependencies.
|
---|
| 747 | PREV=$this_script
|
---|
| 748 |
|
---|
| 749 | done # for file in network/* ...
|
---|
| 750 | }
|
---|
| 751 |
|
---|
[045b2dc] | 752 | #--------------------------------------#
|
---|
[d55a1a1] | 753 | bootable_Makefiles() { #
|
---|
[045b2dc] | 754 | #--------------------------------------#
|
---|
[877cc6a] | 755 |
|
---|
[d55a1a1] | 756 | if [[ "${METHOD}" = "chroot" ]]; then
|
---|
| 757 | echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) make bootable ( CHROOT ) ${R_arrow}"
|
---|
| 758 | else
|
---|
| 759 | echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) make bootable ( ROOT ) ${R_arrow}"
|
---|
| 760 | fi
|
---|
[877cc6a] | 761 |
|
---|
| 762 |
|
---|
[936efa8] | 763 | for file in bootable/* ; do
|
---|
[877cc6a] | 764 | # Keep the script file name
|
---|
| 765 | this_script=`basename $file`
|
---|
| 766 |
|
---|
| 767 | # A little housekeeping on the scripts
|
---|
| 768 | case $this_script in
|
---|
| 769 | *grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* ) continue ;;
|
---|
[045b2dc] | 770 | *fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
|
---|
[877cc6a] | 771 | *kernel) # if there is no kernel config file do not build the kernel
|
---|
| 772 | [[ -z $CONFIG ]] && continue
|
---|
| 773 | # Copy the config file to /sources with a standardized name
|
---|
| 774 | cp $CONFIG $BUILDDIR/sources/kernel-config
|
---|
| 775 | ;;
|
---|
| 776 | esac
|
---|
| 777 | #
|
---|
| 778 | # First append each name of the script files to a list (this will become
|
---|
| 779 | # the names of the targets in the Makefile
|
---|
| 780 | bootabletools="$bootabletools $this_script"
|
---|
| 781 | #
|
---|
| 782 | # Grab the name of the target, strip id number and misc words.
|
---|
| 783 | name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-build@@' `
|
---|
| 784 | case $this_script in
|
---|
| 785 | *kernel*) name=linux
|
---|
| 786 | ;;
|
---|
| 787 | esac
|
---|
[a160d86] | 788 |
|
---|
| 789 | pkg_tarball=$(get_package_tarball_name $name)
|
---|
[877cc6a] | 790 |
|
---|
| 791 | #--------------------------------------------------------------------#
|
---|
| 792 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
| 793 | #--------------------------------------------------------------------#
|
---|
| 794 | #
|
---|
| 795 | # Drop in the name of the target on a new line, and the previous target
|
---|
| 796 | # as a dependency. Also call the echo_message function.
|
---|
[045b2dc] | 797 | CHROOT_wrt_target "${this_script}" "$PREV"
|
---|
[877cc6a] | 798 | #
|
---|
[a160d86] | 799 | # If $pkg_tarball isn't empty, we've got a package...
|
---|
[877cc6a] | 800 | # Insert instructions for unpacking the package and changing directories
|
---|
| 801 | #
|
---|
[f546320] | 802 | if [ "$pkg_tarball" != "" ] ; then
|
---|
| 803 | if [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
| 804 | CHROOT_wrt_LogNewFiles "$name"
|
---|
| 805 | fi
|
---|
| 806 | CHROOT_Unpack "$pkg_tarball"
|
---|
| 807 | fi
|
---|
[877cc6a] | 808 | #
|
---|
| 809 | # Select a script execution method
|
---|
| 810 | case $this_script in
|
---|
[045b2dc] | 811 | *fstab*) if [[ -n "$FSTAB" ]]; then
|
---|
| 812 | CHROOT_wrt_CopyFstab
|
---|
| 813 | else
|
---|
| 814 | CHROOT_wrt_RunAsRoot "${file}"
|
---|
| 815 | fi
|
---|
| 816 | ;;
|
---|
| 817 | *) CHROOT_wrt_RunAsRoot "${file}"
|
---|
| 818 | ;;
|
---|
[877cc6a] | 819 | esac
|
---|
| 820 | #
|
---|
[f546320] | 821 | # Write installed files log and remove the build directory(ies)
|
---|
| 822 | # except if the package build fails.
|
---|
| 823 | if [ "$pkg_tarball" != "" ] ; then
|
---|
| 824 | CHROOT_wrt_RemoveBuildDirs "$name"
|
---|
| 825 | if [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
| 826 | CHROOT_wrt_LogNewFiles "$name"
|
---|
| 827 | fi
|
---|
| 828 | fi
|
---|
[877cc6a] | 829 | #
|
---|
| 830 | # Include a touch of the target name so make can check if it's already been made.
|
---|
[93f38e7] | 831 | wrt_touch
|
---|
[877cc6a] | 832 | #
|
---|
| 833 | #--------------------------------------------------------------------#
|
---|
| 834 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
| 835 | #--------------------------------------------------------------------#
|
---|
| 836 | #
|
---|
| 837 | # Keep the script file name for Makefile dependencies.
|
---|
| 838 | PREV=$this_script
|
---|
| 839 |
|
---|
| 840 | done
|
---|
| 841 |
|
---|
| 842 | }
|
---|
| 843 |
|
---|
| 844 |
|
---|
[045b2dc] | 845 | #--------------------------------------#
|
---|
| 846 | build_Makefile() { # Construct a Makefile from the book scripts
|
---|
| 847 | #--------------------------------------#
|
---|
| 848 |
|
---|
| 849 | echo "...Creating Makefile... ${BOLD}START${OFF}"
|
---|
[877cc6a] | 850 |
|
---|
| 851 | cd $JHALFSDIR/${PROGNAME}-commands
|
---|
[730436a] | 852 | # Start with clean files
|
---|
[045b2dc] | 853 | >$MKFILE
|
---|
[877cc6a] | 854 | >$MKFILE.tmp
|
---|
| 855 |
|
---|
[d55a1a1] | 856 | method_cmds=${METHOD}_Makefiles
|
---|
[045b2dc] | 857 |
|
---|
| 858 | host_prep_Makefiles # mk_SETUP (SETUP) $host_prep
|
---|
| 859 | cross_tools_Makefiles # mk_CROSS (LUSER) $cross_tools
|
---|
| 860 | temptools_Makefiles # mk_TEMP (LUSER) $temptools
|
---|
| 861 | $method_cmds # mk_SYSTOOLS (CHROOT) $chroottools/$boottools
|
---|
| 862 | if [[ ! $TEST = "0" ]]; then
|
---|
[d55a1a1] | 863 | testsuite_tools_Makefiles # mk_SYSTOOLS (CHROOT) $testsuitetools
|
---|
[877cc6a] | 864 | fi
|
---|
[d55a1a1] | 865 | final_system_Makefiles # mk_FINAL (CHROOT) $basicsystem
|
---|
[045b2dc] | 866 | # Add the iterations targets, if needed
|
---|
| 867 | [[ "$COMPARE" = "y" ]] && wrt_compare_targets
|
---|
[d55a1a1] | 868 | bootscripts_Makefiles # mk_BOOTSCRIPT (CHROOT) $bootscripttools
|
---|
[608fbe1] | 869 | if [ -d network ]; then
|
---|
| 870 | network_Makefiles # If present, process network setup.
|
---|
| 871 | fi
|
---|
[d55a1a1] | 872 | bootable_Makefiles # mk_BOOTABLE (CHROOT) $bootabletools
|
---|
[877cc6a] | 873 |
|
---|
[3e7ceed] | 874 | # Add the CUSTOM_TOOLS targets, if needed
|
---|
| 875 | [[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
|
---|
[c10570d] | 876 | # Add the BLFS_TOOL targets, if needed
|
---|
| 877 | [[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
|
---|
| 878 |
|
---|
[877cc6a] | 879 | # Add a header, some variables and include the function file
|
---|
| 880 | # to the top of the real Makefile.
|
---|
[195ed9f] | 881 | wrt_Makefile_header
|
---|
[877cc6a] | 882 |
|
---|
| 883 | # Add chroot commands
|
---|
| 884 | if [ "$METHOD" = "chroot" ] ; then
|
---|
[6ad5a2f] | 885 | CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
|
---|
[15c9e72] | 886 | chroot=`cat chroot/???-chroot | \
|
---|
[6ad5a2f] | 887 | sed -e "s@chroot@$CHROOT_LOC@" \
|
---|
[830f28d] | 888 | -e '/#!\/bin\/bash/d' \
|
---|
[6ad5a2f] | 889 | -e '/^export/d' \
|
---|
| 890 | -e '/^logout/d' \
|
---|
| 891 | -e 's@ \\\@ @g' | \
|
---|
| 892 | tr -d '\n' | \
|
---|
| 893 | sed -e 's/ */ /g' \
|
---|
| 894 | -e 's|\\$|&&|g' \
|
---|
| 895 | -e 's|exit||g' \
|
---|
| 896 | -e 's|$| -c|' \
|
---|
[f4d9a48] | 897 | -e 's|"$${CLFS}"|$(MOUNT_PT)|'\
|
---|
[f3a7f3b] | 898 | -e 's|set -e||' \
|
---|
| 899 | -e 's|set +h||'`
|
---|
[877cc6a] | 900 | echo -e "CHROOT1= $chroot\n" >> $MKFILE
|
---|
| 901 | fi
|
---|
| 902 |
|
---|
[045b2dc] | 903 | ################## CHROOT ####################
|
---|
| 904 |
|
---|
[877cc6a] | 905 | if [[ "${METHOD}" = "chroot" ]]; then
|
---|
| 906 | (
|
---|
[045b2dc] | 907 | cat << EOF
|
---|
[877cc6a] | 908 |
|
---|
[3e7ceed] | 909 | all: ck_UID mk_SETUP mk_CROSS mk_SUDO mk_SYSTOOLS create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL
|
---|
[045b2dc] | 910 | @sudo make do-housekeeping
|
---|
[936efa8] | 911 | @echo "$VERSION - jhalfs build" > clfs-release && \\
|
---|
| 912 | sudo mv clfs-release \$(MOUNT_PT)/etc
|
---|
[045b2dc] | 913 | @\$(call echo_finished,$VERSION)
|
---|
[a160d86] | 914 |
|
---|
[045b2dc] | 915 | ck_UID:
|
---|
| 916 | @if [ \`id -u\` = "0" ]; then \\
|
---|
| 917 | echo "+--------------------------------------------------+"; \\
|
---|
| 918 | echo "|You cannot run this makefile from the root account|"; \\
|
---|
| 919 | echo "+--------------------------------------------------+"; \\
|
---|
| 920 | exit 1; \\
|
---|
| 921 | fi
|
---|
| 922 |
|
---|
| 923 | #---------------AS ROOT
|
---|
| 924 | mk_SETUP:
|
---|
| 925 | @\$(call echo_SU_request)
|
---|
[7a43320] | 926 | @sudo make BREAKPOINT=\$(BREAKPOINT) SETUP
|
---|
[045b2dc] | 927 | @touch \$@
|
---|
| 928 |
|
---|
| 929 | #---------------AS LUSER
|
---|
| 930 | mk_CROSS: mk_SETUP
|
---|
| 931 | @\$(call echo_PHASE,Cross and Temporary Tools)
|
---|
[730436a] | 932 | @( \$(SU_LUSER) "make -C \$(MOUNT_PT)/\$(SCRIPT_ROOT) BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
|
---|
[045b2dc] | 933 | @sudo make restore-luser-env
|
---|
| 934 | @touch \$@
|
---|
| 935 |
|
---|
| 936 | mk_SUDO: mk_CROSS
|
---|
[7a43320] | 937 | @sudo make BREAKPOINT=\$(BREAKPOINT) SUDO
|
---|
[045b2dc] | 938 | @touch \$@
|
---|
| 939 |
|
---|
| 940 | #---------------CHROOT JAIL
|
---|
| 941 | mk_SYSTOOLS: mk_SUDO
|
---|
| 942 | @\$(call echo_CHROOT_request)
|
---|
| 943 | @\$(call echo_PHASE, CHROOT JAIL )
|
---|
[6c1b96b] | 944 | @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) PREP_CHROOT_JAIL")
|
---|
[7a43320] | 945 | @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CHROOT_JAIL")
|
---|
[045b2dc] | 946 | @touch \$@
|
---|
[877cc6a] | 947 |
|
---|
[3e7ceed] | 948 | mk_CUSTOM_TOOLS: create-sbu_du-report
|
---|
| 949 | @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
|
---|
[79da297] | 950 | \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
|
---|
[3e7ceed] | 951 | sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
|
---|
[7a43320] | 952 | (sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CUSTOM_TOOLS"); \\
|
---|
[3e7ceed] | 953 | fi;
|
---|
| 954 | @touch \$@
|
---|
| 955 |
|
---|
| 956 | mk_BLFS_TOOL: mk_CUSTOM_TOOLS
|
---|
[c10570d] | 957 | @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
|
---|
[79da297] | 958 | \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
|
---|
[c10570d] | 959 | sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
|
---|
[7a43320] | 960 | sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL"; \\
|
---|
[1838bc7] | 961 | fi;
|
---|
[c10570d] | 962 | @touch \$@
|
---|
[045b2dc] | 963 |
|
---|
[6c1b96b] | 964 | SETUP: $host_prep
|
---|
| 965 | AS_LUSER: $cross_tools $temptools
|
---|
| 966 | SUDO: $orphan_scripts
|
---|
| 967 | PREP_CHROOT_JAIL: SHELL=/tools/bin/bash
|
---|
| 968 | PREP_CHROOT_JAIL: ${chroottools}
|
---|
| 969 | CHROOT_JAIL: SHELL=/tools/bin/bash
|
---|
| 970 | CHROOT_JAIL: $testsuitetools $basicsystem $bootscripttools $bootabletools
|
---|
| 971 | CUSTOM_TOOLS: $custom_list
|
---|
| 972 | BLFS_TOOL: $blfs_tool
|
---|
[877cc6a] | 973 |
|
---|
[1838bc7] | 974 |
|
---|
| 975 | create-sbu_du-report: mk_SYSTOOLS
|
---|
| 976 | @\$(call echo_message, Building)
|
---|
| 977 | @if [ "\$(ADD_REPORT)" = "y" ]; then \\
|
---|
| 978 | ./create-sbu_du-report.sh logs $VERSION; \\
|
---|
| 979 | \$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report); \\
|
---|
| 980 | fi;
|
---|
| 981 | @touch \$@
|
---|
| 982 |
|
---|
[7d9a82d] | 983 | do-housekeeping:
|
---|
[4524fb2] | 984 | @-umount \$(MOUNT_PT)/dev/pts
|
---|
| 985 | @-umount \$(MOUNT_PT)/dev/shm
|
---|
| 986 | @-umount \$(MOUNT_PT)/dev
|
---|
| 987 | @-umount \$(MOUNT_PT)/sys
|
---|
| 988 | @-umount \$(MOUNT_PT)/proc
|
---|
[045b2dc] | 989 | @-rm /tools /cross-tools
|
---|
[6ad5a2f] | 990 | @-if [ ! -f luser-exist ]; then \\
|
---|
| 991 | userdel \$(LUSER); \\
|
---|
[962793a] | 992 | rm -rf \$(LUSER_HOME); \\
|
---|
[7d9a82d] | 993 | fi;
|
---|
| 994 |
|
---|
[877cc6a] | 995 | EOF
|
---|
| 996 | ) >> $MKFILE
|
---|
[045b2dc] | 997 |
|
---|
[877cc6a] | 998 | fi
|
---|
| 999 |
|
---|
[045b2dc] | 1000 | ################### BOOT #####################
|
---|
[877cc6a] | 1001 |
|
---|
| 1002 | if [[ "${METHOD}" = "boot" ]]; then
|
---|
| 1003 | (
|
---|
[045b2dc] | 1004 | cat << EOF
|
---|
[877cc6a] | 1005 |
|
---|
[045b2dc] | 1006 | all: ck_UID mk_SETUP mk_CROSS mk_SUDO
|
---|
| 1007 | @sudo make restore-luser-env
|
---|
| 1008 | @sudo make do-housekeeping
|
---|
[877cc6a] | 1009 | @\$(call echo_boot_finished,$VERSION)
|
---|
| 1010 |
|
---|
[3e7ceed] | 1011 | makesys: mk_FINAL mk_CUSTOM_TOOLS mk_BLFS_TOOL
|
---|
[936efa8] | 1012 | @echo "$VERSION - jhalfs build" > /etc/clfs-release
|
---|
[877cc6a] | 1013 | @\$(call echo_finished,$VERSION)
|
---|
| 1014 |
|
---|
| 1015 |
|
---|
[045b2dc] | 1016 | ck_UID:
|
---|
| 1017 | @if [ \`id -u\` = "0" ]; then \\
|
---|
| 1018 | echo "+--------------------------------------------------+"; \\
|
---|
| 1019 | echo "|You cannot run this makefile from the root account|"; \\
|
---|
| 1020 | echo "|However, if this is the boot environment |"; \\
|
---|
| 1021 | echo "| the command you are looking for is |"; \\
|
---|
| 1022 | echo "| make makesys |"; \\
|
---|
[730436a] | 1023 | echo "| to complete the build |"; \\
|
---|
[045b2dc] | 1024 | echo "+--------------------------------------------------+"; \\
|
---|
| 1025 | exit 1; \\
|
---|
| 1026 | fi
|
---|
[877cc6a] | 1027 |
|
---|
[045b2dc] | 1028 | #---------------AS ROOT
|
---|
[877cc6a] | 1029 |
|
---|
[045b2dc] | 1030 | mk_SETUP:
|
---|
| 1031 | @\$(call echo_SU_request)
|
---|
[7a43320] | 1032 | @sudo make BREAKPOINT=\$(BREAKPOINT) SETUP
|
---|
[045b2dc] | 1033 | @touch \$@
|
---|
| 1034 |
|
---|
| 1035 | #---------------AS LUSER
|
---|
[a160d86] | 1036 |
|
---|
[045b2dc] | 1037 | mk_CROSS: mk_SETUP
|
---|
| 1038 | @\$(call echo_PHASE,Cross Tool)
|
---|
[730436a] | 1039 | @( \$(SU_LUSER) "make -C \$(MOUNT_PT)/\$(SCRIPT_ROOT) BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
|
---|
[045b2dc] | 1040 | @touch \$@
|
---|
| 1041 |
|
---|
[c10570d] | 1042 | mk_SUDO: mk_CROSS
|
---|
[7a43320] | 1043 | @sudo make BREAKPOINT=\$(BREAKPOINT) SUDO
|
---|
[045b2dc] | 1044 | @touch \$@
|
---|
| 1045 |
|
---|
| 1046 | #---------------AS ROOT
|
---|
| 1047 |
|
---|
| 1048 | mk_FINAL:
|
---|
| 1049 | @\$(call echo_PHASE,Final System)
|
---|
[7a43320] | 1050 | @( source /root/.bash_profile && make BREAKPOINT=\$(BREAKPOINT) AS_ROOT )
|
---|
[045b2dc] | 1051 | @touch \$@
|
---|
| 1052 |
|
---|
[3e7ceed] | 1053 | mk_CUSTOM_TOOLS: mk_FINAL
|
---|
| 1054 | @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
|
---|
[79da297] | 1055 | \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
|
---|
[3bc6078] | 1056 | mkdir -p ${TRACKING_DIR}; \\
|
---|
[7a43320] | 1057 | ( source /root/.bash_profile && make BREAKPOINT=\$(BREAKPOINT) CUSTOM_TOOLS ); \\
|
---|
[3e7ceed] | 1058 | fi;
|
---|
| 1059 | @touch \$@
|
---|
| 1060 |
|
---|
| 1061 | mk_BLFS_TOOL: mk_CUSTOM_TOOLS
|
---|
[c10570d] | 1062 | @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
|
---|
[79da297] | 1063 | \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
|
---|
[3bc6078] | 1064 | mkdir -p $TRACKING_DIR; \\
|
---|
[7a43320] | 1065 | ( source /root/.bash_profile && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL ); \\
|
---|
[c10570d] | 1066 | fi
|
---|
| 1067 | @touch \$@
|
---|
| 1068 |
|
---|
[3e7ceed] | 1069 | SETUP: $host_prep
|
---|
| 1070 | AS_LUSER: $cross_tools $temptools ${boottools}
|
---|
| 1071 | SUDO: $orphan_scripts
|
---|
[aec4483] | 1072 | AS_ROOT: SHELL=/tools/bin/bash
|
---|
[3e7ceed] | 1073 | AS_ROOT: $testsuitetools $basicsystem $bootscripttools $bootabletools
|
---|
| 1074 | CUSTOM_TOOLS: $custom_list
|
---|
| 1075 | BLFS_TOOL: $blfs_tool
|
---|
[045b2dc] | 1076 |
|
---|
| 1077 | do-housekeeping:
|
---|
| 1078 | @-rm /tools /cross-tools
|
---|
| 1079 | @-if [ ! -f luser-exist ]; then \\
|
---|
[6ad5a2f] | 1080 | userdel \$(LUSER); \\
|
---|
[962793a] | 1081 | rm -rf \$(LUSER_HOME); \\
|
---|
[877cc6a] | 1082 | fi;
|
---|
| 1083 |
|
---|
[045b2dc] | 1084 | EOF
|
---|
| 1085 | ) >> $MKFILE
|
---|
| 1086 | fi
|
---|
| 1087 |
|
---|
| 1088 | (
|
---|
| 1089 | cat << EOF
|
---|
| 1090 |
|
---|
[6ad5a2f] | 1091 | restore-luser-env:
|
---|
[877cc6a] | 1092 | @\$(call echo_message, Building)
|
---|
[962793a] | 1093 | @if [ -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
|
---|
| 1094 | mv -f \$(LUSER_HOME)/.bashrc.XXX \$(LUSER_HOME)/.bashrc; \\
|
---|
[877cc6a] | 1095 | fi;
|
---|
[962793a] | 1096 | @if [ -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
|
---|
| 1097 | mv \$(LUSER_HOME)/.bash_profile.XXX \$(LUSER_HOME)/.bash_profile; \\
|
---|
[877cc6a] | 1098 | fi;
|
---|
[962793a] | 1099 | @chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bash* && \\
|
---|
[93f38e7] | 1100 | touch \$@ && \\
|
---|
| 1101 | echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
|
---|
| 1102 | echo --------------------------------------------------------------------------------\$(WHITE)
|
---|
[877cc6a] | 1103 |
|
---|
[045b2dc] | 1104 | ########################################################
|
---|
| 1105 |
|
---|
[7d9a82d] | 1106 |
|
---|
[877cc6a] | 1107 | EOF
|
---|
| 1108 | ) >> $MKFILE
|
---|
| 1109 |
|
---|
| 1110 | # Bring over the items from the Makefile.tmp
|
---|
| 1111 | cat $MKFILE.tmp >> $MKFILE
|
---|
| 1112 | rm $MKFILE.tmp
|
---|
| 1113 |
|
---|
[045b2dc] | 1114 | echo "Creating Makefile... ${BOLD}DONE${OFF}"
|
---|
[877cc6a] | 1115 | }
|
---|