source: LFS/master.sh@ 94744cd

2.4 ablfs-more legacy new_features trunk
Last change on this file since 94744cd was 532ede6, checked in by Pierre Labastie <pierre@…>, 11 years ago

Add network-scripts case in chapter 7 for systemd branch

  • Property mode set to 100644
File size: 20.4 KB
Line 
1#!/bin/bash
2
3# $Id$
4
5###################################
6### FUNCTIONS ###
7###################################
8
9
10#############################################################
11
12
13#----------------------------#
14chapter4_Makefiles() { #
15#----------------------------#
16 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter4 ( SETUP ) ${R_arrow}"
17
18# If $LUSER_HOME is already present in the host, we asume that the
19# lfs user and group are also presents in the host, and a backup
20# of their bash init files is made.
21(
22 cat << EOF
23020-creatingtoolsdir:
24 @\$(call echo_message, Building)
25 @mkdir \$(MOUNT_PT)/tools && \\
26 rm -f /tools && \\
27 ln -s \$(MOUNT_PT)/tools /
28 @\$(call housekeeping)
29
30021-addinguser: 020-creatingtoolsdir
31 @\$(call echo_message, Building)
32 @-if [ ! -d \$(LUSER_HOME) ]; then \\
33 groupadd \$(LGROUP); \\
34 useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
35 else \\
36 touch luser-exist; \\
37 fi;
38 @chown \$(LUSER) \$(MOUNT_PT)/tools && \\
39 chmod -R a+wt \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
40 chmod a+wt \$(SRCSDIR)
41 @\$(call housekeeping)
42
43022-settingenvironment: 021-addinguser
44 @\$(call echo_message, Building)
45 @if [ -f \$(LUSER_HOME)/.bashrc -a ! -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
46 mv \$(LUSER_HOME)/.bashrc \$(LUSER_HOME)/.bashrc.XXX; \\
47 fi;
48 @if [ -f \$(LUSER_HOME)/.bash_profile -a ! -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
49 mv \$(LUSER_HOME)/.bash_profile \$(LUSER_HOME)/.bash_profile.XXX; \\
50 fi;
51 @echo "set +h" > \$(LUSER_HOME)/.bashrc && \\
52 echo "umask 022" >> \$(LUSER_HOME)/.bashrc && \\
53 echo "LFS=\$(MOUNT_PT)" >> \$(LUSER_HOME)/.bashrc && \\
54 echo "LC_ALL=POSIX" >> \$(LUSER_HOME)/.bashrc && \\
55 echo "LFS_TGT=`uname -m`-lfs-linux-gnu" >> \$(LUSER_HOME)/.bashrc && \\
56 echo "PATH=/tools/bin:/bin:/usr/bin" >> \$(LUSER_HOME)/.bashrc && \\
57 echo "export LFS LC_ALL LFS_TGT PATH" >> \$(LUSER_HOME)/.bashrc && \\
58 echo "source $JHALFSDIR/envars" >> \$(LUSER_HOME)/.bashrc && \\
59 chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bashrc && \\
60 touch envars && \\
61 chown \$(LUSER) envars
62 @\$(call housekeeping)
63EOF
64) > $MKFILE.tmp
65
66 chapter4=" 020-creatingtoolsdir 021-addinguser 022-settingenvironment"
67}
68
69
70
71#----------------------------#
72chapter5_Makefiles() {
73#----------------------------#
74 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5 ( LUSER ) ${R_arrow}"
75
76 for file in chapter05/* ; do
77 # Keep the script file name
78 this_script=`basename $file`
79
80 # If no testsuites are run, then TCL, Expect, DejaGNU and Check
81 # aren't needed (but building them does not hurt).
82 # Fix also locales creation when running chapter05 testsuites (ugly)
83 case "${this_script}" in
84# *tcl) [[ "${TEST}" = "0" ]] && continue ;;
85# *expect) [[ "${TEST}" = "0" ]] && continue ;;
86# *dejagnu) [[ "${TEST}" = "0" ]] && continue ;;
87# *check) [[ "${TEST}" = "0" ]] && continue ;;
88 *stripping) [[ "${STRIP}" = "n" ]] && continue ;;
89 *glibc) [[ "${TEST}" = "3" ]] && \
90 sed -i 's@/usr/lib/locale@/tools/lib/locale@' $file ;;
91 esac
92
93 # First append each name of the script files to a list (this will become
94 # the names of the targets in the Makefile
95 # DO NOT append the changingowner script, it need be run as root.
96 # A hack is necessary: create script in chap5 BUT run as a dependency for
97 # SUDO target
98 case "${this_script}" in
99 *changingowner) runasroot="$runasroot ${this_script}" ;;
100 *) chapter5="$chapter5 ${this_script}" ;;
101 esac
102
103 # Grab the name of the target (minus the -pass1 or -pass2 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@-pass[0-9]\{1\}@@' \
107 -e 's@-libstdc++@@'`
108
109 # Set the dependency for the first target.
110 if [ -z $PREV ] ; then PREV=022-settingenvironment ; fi
111
112 #--------------------------------------------------------------------#
113 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
114 #--------------------------------------------------------------------#
115 #
116 # Find the name of the tarball and the version of the package
117 pkg_tarball=$(get_package_tarball_name $name)
118 pkg_version=$(get_package_version $pkg_tarball)
119
120 # Drop in the name of the target on a new line, and the previous target
121 # as a dependency. Also call the echo_message function.
122 LUSER_wrt_target "${this_script}" "$PREV" "$pkg_version"
123
124 # If $pkg_tarball isn't empty, we've got a package...
125 if [ "$pkg_tarball" != "" ] ; then
126 # Insert instructions for unpacking the package and to set the PKGDIR variable.
127 LUSER_wrt_unpack "$pkg_tarball"
128 # If the testsuites must be run, initialize the log file
129 [[ "$TEST" = "3" ]] && LUSER_wrt_test_log "${this_script}" "$pkg_version"
130 # If using optimizations, write the instructions
131 [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
132 fi
133
134 # Insert date and disk usage at the top of the log file, the script run
135 # and date and disk usage again at the bottom of the log file.
136 # The changingowner script must be run as root.
137 case "${this_script}" in
138 *changingowner) wrt_RunAsRoot "$file" "$pkg_version" ;;
139 *) LUSER_wrt_RunAsUser "$file" "$pkg_version" ;;
140 esac
141
142 # Remove the build directory(ies) except if the package build fails
143 # (so we can review config.cache, config.log, etc.)
144 if [ "$pkg_tarball" != "" ] ; then
145 case "${name}" in
146 *xz-utils) LUSER_RemoveBuildDirs "xz" ;;
147 *) LUSER_RemoveBuildDirs "$name" ;;
148 esac
149 fi
150
151 # Include a touch of the target name so make can check
152 # if it's already been made.
153 wrt_touch
154 #
155 #--------------------------------------------------------------------#
156 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
157 #--------------------------------------------------------------------#
158
159 # Keep the script file name for Makefile dependencies.
160 PREV=${this_script}
161 done # end for file in chapter05/*
162}
163
164
165#----------------------------#
166chapter6_Makefiles() {
167#----------------------------#
168
169 # Set envars and scripts for iteration targets
170 if [[ -z "$1" ]] ; then
171 local N=""
172 else
173 local N=-build_$1
174 local chapter6=""
175 mkdir chapter06$N
176 cp chapter06/* chapter06$N
177 for script in chapter06$N/* ; do
178 # Overwrite existing symlinks, files, and dirs
179 sed -e 's/ln *-sv/&f/g' \
180 -e 's/mv *-v/&f/g' \
181 -e 's/mkdir *-v/&p/g' -i ${script}
182 # Suppress the mod of "test-installation.pl" because now
183 # the library path points to /usr/lib
184 if [[ ${script} =~ glibc ]]; then
185 sed '/DL=/,/unset DL/d' -i ${script}
186 fi
187 # Rename the scripts
188 mv ${script} ${script}$N
189 done
190 # Remove Bzip2 binaries before make install (LFS-6.2 compatibility)
191 sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i chapter06$N/*-bzip2$N
192 fi
193
194 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N ( CHROOT ) ${R_arrow}"
195
196 for file in chapter06$N/* ; do
197 # Keep the script file name
198 this_script=`basename $file`
199
200 # We'll run the chroot commands differently than the others, so skip them in the
201 # dependencies and target creation.
202 # Skip also linux-headers in iterative builds.
203 case "${this_script}" in
204 *chroot) continue ;;
205 *stripping*) [[ "${STRIP}" = "n" ]] && continue ;;
206 *linux-headers*) [[ -n "$N" ]] && continue ;;
207 esac
208
209 # Grab the name of the target.
210 name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@' -e 's,'$N',,'`
211
212 # Find the version of the command files, if it corresponds with the building of
213 # a specific package. We need this here to can skip scripts not needed for
214 # iterations rebuilds
215 pkg_tarball=$(get_package_tarball_name $name)
216 pkg_version=$(get_package_version $pkg_tarball)
217
218 if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
219 case "${this_script}" in
220 *stripping*) ;;
221 *) continue ;;
222 esac
223 fi
224
225 # Append each name of the script files to a list (this will become
226 # the names of the targets in the Makefile)
227 # The kernfs script must be run as part of SUDO target.
228 case "${this_script}" in
229 *kernfs) runasroot="$runasroot ${this_script}" ;;
230 *) chapter6="$chapter6 ${this_script}" ;;
231 esac
232
233 #--------------------------------------------------------------------#
234 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
235 #--------------------------------------------------------------------#
236 #
237 # Drop in the name of the target on a new line, and the previous target
238 # as a dependency. Also call the echo_message function.
239 # In the mount of kernel filesystems we need to set LFS
240 # and not to use chroot.
241 case "${this_script}" in
242 *kernfs) LUSER_wrt_target "${this_script}" "$PREV" "$pkg_version" ;;
243 *) CHROOT_wrt_target "${this_script}" "$PREV" "$pkg_version" ;;
244 esac
245
246 # If $pkg_tarball isn't empty, we've got a package...
247 # Insert instructions for unpacking the package and changing directories
248 if [ "$pkg_tarball" != "" ] ; then
249 # Touch timestamp file if installed files logs will be created.
250 # But only for the firt build when running iterative builds.
251 if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
252 CHROOT_wrt_TouchTimestamp
253 fi
254 CHROOT_Unpack "$pkg_tarball"
255 # If the testsuites must be run, initialize the log file
256 case $name in
257 binutils | gcc | glibc | gmp | mpfr )
258 [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}" "$pkg_version"
259 ;;
260 * )
261 [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}" "$pkg_version"
262 ;;
263 esac
264 # If using optimizations, write the instructions
265 [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
266 fi
267
268 # In the mount of kernel filesystems we need to set LFS
269 # and not to use chroot.
270 case "${this_script}" in
271 *kernfs) wrt_RunAsRoot "$file" "$pkg_version" ;;
272 *) CHROOT_wrt_RunAsRoot "$file" "$pkg_version" ;;
273 esac
274
275 # Write installed files log and remove the build directory(ies)
276 # except if the package build fails.
277 if [ "$pkg_tarball" != "" ] ; then
278 case "${name}" in
279 *xz-utils) CHROOT_wrt_RemoveBuildDirs "xz" ;;
280 *) CHROOT_wrt_RemoveBuildDirs "$name" ;;
281 esac
282 if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
283 CHROOT_wrt_LogNewFiles "$name"
284 fi
285 fi
286
287 # Include a touch of the target name so make can check
288 # if it's already been made.
289 wrt_touch
290 #
291 #--------------------------------------------------------------------#
292 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
293 #--------------------------------------------------------------------#
294
295 # Keep the script file name for Makefile dependencies.
296 PREV=${this_script}
297 # Set system_build envar for iteration targets
298 system_build=$chapter6
299 done # end for file in chapter06/*
300}
301
302#----------------------------#
303chapter78_Makefiles() {
304#----------------------------#
305 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8 ( BOOT ) ${R_arrow}"
306
307 for file in chapter0{7,8}/* ; do
308 # Keep the script file name
309 this_script=`basename $file`
310
311 # Grub must be configured manually.
312 # Handle fstab creation.
313 # If no .config file is supplied, the kernel build is skipped
314 case ${this_script} in
315 *grub) continue ;;
316 *fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
317 *kernel) [[ -z ${CONFIG} ]] && continue
318 cp ${CONFIG} $BUILDDIR/sources/kernel-config ;;
319 esac
320
321 # First append each name of the script files to a list (this will become
322 # the names of the targets in the Makefile
323 chapter78="$chapter78 ${this_script}"
324
325 #--------------------------------------------------------------------#
326 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
327 #--------------------------------------------------------------------#
328 #
329 # Drop in the name of the target on a new line, and the previous target
330 # as a dependency. Also call the echo_message function.
331 CHROOT_wrt_target "${this_script}" "$PREV"
332
333 # Find the bootscripts or networkscripts (for systemd)
334 # and kernel package names
335 case "${this_script}" in
336 *bootscripts)
337 name="lfs-bootscripts"
338 pkg_tarball=$(get_package_tarball_name $name)
339 if [ "${INSTALL_LOG}" = "y" ] ; then
340 CHROOT_wrt_TouchTimestamp
341 fi
342 CHROOT_Unpack "$pkg_tarball"
343 ;;
344 *network-scripts)
345 name="lfs-network-scripts"
346 pkg_tarball=$(get_package_tarball_name $name)
347 if [ "${INSTALL_LOG}" = "y" ] ; then
348 CHROOT_wrt_TouchTimestamp
349 fi
350 CHROOT_Unpack "$pkg_tarball"
351 ;;
352 *kernel)
353 name="linux"
354 pkg_tarball=$(get_package_tarball_name $name)
355 if [ "${INSTALL_LOG}" = "y" ] ; then
356 CHROOT_wrt_TouchTimestamp
357 fi
358 CHROOT_Unpack "$pkg_tarball"
359 # If using optimizations, use MAKEFLAGS (unless blacklisted)
360 # no setting of CFLAGS and friends.
361 [[ "$OPTIMIZE" != "0" ]] && wrt_makeflags "$name"
362 ;;
363 esac
364
365 # Check if we have a real /etc/fstab file
366 case "${this_script}" in
367 *fstab) if [[ -n $FSTAB ]]; then
368 CHROOT_wrt_CopyFstab
369 else
370 CHROOT_wrt_RunAsRoot "$file"
371 fi
372 ;;
373 *) CHROOT_wrt_RunAsRoot "$file"
374 ;;
375 esac
376
377 case "${this_script}" in
378 *bootscripts) CHROOT_wrt_RemoveBuildDirs "dummy"
379 if [ "${INSTALL_LOG}" = "y" ] ; then
380 CHROOT_wrt_LogNewFiles "$name"
381 fi ;;
382 *network-scripts) CHROOT_wrt_RemoveBuildDirs "dummy"
383 if [ "${INSTALL_LOG}" = "y" ] ; then
384 CHROOT_wrt_LogNewFiles "$name"
385 fi ;;
386 *kernel) CHROOT_wrt_RemoveBuildDirs "dummy"
387 if [ "${INSTALL_LOG}" = "y" ] ; then
388 CHROOT_wrt_LogNewFiles "$name"
389 fi ;;
390 esac
391
392 # Include a touch of the target name so make can check
393 # if it's already been made.
394 wrt_touch
395 #
396 #--------------------------------------------------------------------#
397 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
398 #--------------------------------------------------------------------#
399
400 # Keep the script file name for Makefile dependencies.
401 PREV=${this_script}
402 done # for file in chapter0{7,8}/*
403
404}
405
406
407
408#----------------------------#
409build_Makefile() { #
410#----------------------------#
411
412 echo "Creating Makefile... ${BOLD}START${OFF}"
413
414 cd $JHALFSDIR/${PROGNAME}-commands
415
416 # Start with a clean Makefile.tmp file
417 >$MKFILE
418
419 chapter4_Makefiles
420 chapter5_Makefiles
421 chapter6_Makefiles
422 # Add the iterations targets, if needed
423 [[ "$COMPARE" = "y" ]] && wrt_compare_targets
424 chapter78_Makefiles
425 # Add the CUSTOM_TOOLS targets, if needed
426 [[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
427
428 # Add a header, some variables and include the function file
429 # to the top of the real Makefile.
430 wrt_Makefile_header
431
432 # Add chroot commands
433 CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
434 i=1
435 for file in chapter06/*chroot* ; do
436 chroot=`cat $file | \
437 sed -e "s@chroot@$CHROOT_LOC@" \
438 -e '/#!\/bin\/bash/d' \
439 -e 's@ \\\@ @g' | \
440 tr -d '\n' | \
441 sed -e 's/ */ /g' \
442 -e 's|\\$|&&|g' \
443 -e 's|exit||g' \
444 -e 's|$| -c|' \
445 -e 's|"$$LFS"|$(MOUNT_PT)|' \
446 -e 's|set -e||' \
447 -e 's|set +h||'`
448 echo -e "CHROOT$i= $chroot\n" >> $MKFILE
449 i=`expr $i + 1`
450 done
451
452 # Drop in the main target 'all:' and the chapter targets with each sub-target
453 # as a dependency.
454(
455 cat << EOF
456
457all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_BLFS_TOOL mk_CUSTOM_TOOLS
458 @sudo make do_housekeeping
459 @echo $VERSION > lfs-release && \\
460 sudo mv lfs-release \$(MOUNT_PT)/etc && \\
461 sudo chown root:root \$(MOUNT_PT)/etc/lfs-release
462 @/bin/echo -e -n \\
463 DISTRIB_ID=\\"Linux From Scratch\\"\\\\n\\
464 DISTRIB_RELEASE=\\"$VERSION\\"\\\\n\\
465 DISTRIB_CODENAME=\\"$(whoami)-jhalfs\\"\\\\n\\
466 DISTRIB_DESCRIPTION=\\"Linux From Scratch\\"\\\\n\\
467 > lsb-release && \\
468 sudo mv lsb-release \$(MOUNT_PT)/etc && \\
469 sudo chown root:root \$(MOUNT_PT)/etc/lsb-release
470 @\$(call echo_finished,$VERSION)
471
472ck_UID:
473 @if [ \`id -u\` = "0" ]; then \\
474 echo "--------------------------------------------------"; \\
475 echo "You cannot run this makefile from the root account"; \\
476 echo "--------------------------------------------------"; \\
477 exit 1; \\
478 fi
479
480mk_SETUP:
481 @\$(call echo_SU_request)
482 @sudo make BREAKPOINT=\$(BREAKPOINT) SETUP
483 @touch \$@
484
485mk_LUSER: mk_SETUP
486 @\$(call echo_SULUSER_request)
487 @( \$(SU_LUSER) "make -C \$(MOUNT_PT)/\$(SCRIPT_ROOT) BREAKPOINT=\$(BREAKPOINT) LUSER" )
488 @sudo make restore-luser-env
489 @touch \$@
490
491mk_SUDO: mk_LUSER
492 @sudo make BREAKPOINT=\$(BREAKPOINT) SUDO
493 @touch \$@
494
495mk_CHROOT: mk_SUDO
496 @\$(call echo_CHROOT_request)
497 @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CHROOT")
498 @touch \$@
499
500mk_BOOT: mk_CHROOT
501 @\$(call echo_CHROOT_request)
502 @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BOOT")
503 @touch \$@
504
505mk_BLFS_TOOL: create-sbu_du-report
506 @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
507 \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
508 (sudo \$(CHROOT2) "make -C $BLFS_ROOT/work"); \\
509 fi;
510 @touch \$@
511
512mk_CUSTOM_TOOLS: mk_BLFS_TOOL
513 @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
514 \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
515 sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
516 (sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CUSTOM_TOOLS"); \\
517 fi;
518 @touch \$@
519
520devices: ck_UID
521 sudo mount -v --bind /dev \$(MOUNT_PT)/dev
522 sudo mount -vt devpts devpts \$(MOUNT_PT)/dev/pts
523 sudo mount -vt proc proc \$(MOUNT_PT)/proc
524 sudo mount -vt sysfs sysfs \$(MOUNT_PT)/sys
525 if [ -h \$(MOUNT_PT)/dev/shm ]; then \\
526 link=\$\$(readlink \$(MOUNT_PT)/dev/shm); \\
527 sudo mkdir -p \$(MOUNT_PT)/\$\$link; \\
528 sudo mount -vt tmpfs shm \$(MOUNT_PT)/\$\$link; \\
529 unset link; \\
530 else \\
531 sudo mount -vt tmpfs shm \$(MOUNT_PT)/dev/shm; \\
532 fi
533
534teardown:
535 sudo umount -v \$(MOUNT_PT)/sys
536 sudo umount -v \$(MOUNT_PT)/proc
537 sudo umount -v \$(MOUNT_PT)/dev/pts
538 if [ -h \$(MOUNT_PT)/dev/shm ]; then \\
539 link=\$\$(readlink \$(MOUNT_PT)/dev/shm); \\
540 sudo umount -v \$(MOUNT_PT)/\$\$link; \\
541 unset link; \\
542 else \\
543 sudo umount -v \$(MOUNT_PT)/dev/shm; \\
544 fi
545 sudo umount -v \$(MOUNT_PT)/dev
546
547chroot: devices
548 sudo /usr/sbin/chroot \$(MOUNT_PT) /tools/bin/env -i \\
549 HOME=/root TERM=\$(TERM) PS1='\\u:\\w\\\$\$ ' \\
550 PATH=/bin:/usr/bin:/sbin:/usr/sbin \\
551 /tools/bin/bash --login
552 \$(MAKE) teardown
553
554SETUP: $chapter4
555LUSER: $chapter5
556SUDO: $runasroot
557CHROOT: SHELL=/tools/bin/bash
558CHROOT: $chapter6
559BOOT: $chapter78
560CUSTOM_TOOLS: $custom_list
561
562
563create-sbu_du-report: mk_BOOT
564 @\$(call echo_message, Building)
565 @if [ "\$(ADD_REPORT)" = "y" ]; then \\
566 sudo ./create-sbu_du-report.sh logs $VERSION; \\
567 \$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report); \\
568 fi;
569 @touch \$@
570
571restore-luser-env:
572 @\$(call echo_message, Building)
573 @if [ -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
574 mv -f \$(LUSER_HOME)/.bashrc.XXX \$(LUSER_HOME)/.bashrc; \\
575 fi;
576 @if [ -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
577 mv \$(LUSER_HOME)/.bash_profile.XXX \$(LUSER_HOME)/.bash_profile; \\
578 fi;
579 @chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bash*
580 @\$(call housekeeping)
581
582do_housekeeping:
583 @-umount \$(MOUNT_PT)/sys
584 @-umount \$(MOUNT_PT)/proc
585 @-if [ -h \$(MOUNT_PT)/dev/shm ]; then \\
586 link=\$\$(readlink \$(MOUNT_PT)/dev/shm); \\
587 umount \$(MOUNT_PT)/\$\$link; \\
588 unset link; \\
589 else \\
590 umount \$(MOUNT_PT)/dev/shm; \\
591 fi
592 @-umount \$(MOUNT_PT)/dev/pts
593 @-umount \$(MOUNT_PT)/dev
594 @-rm /tools
595 @-if [ ! -f luser-exist ]; then \\
596 userdel \$(LUSER); \\
597 rm -rf \$(LUSER_HOME); \\
598 fi;
599
600
601EOF
602) >> $MKFILE
603
604 # Bring over the items from the Makefile.tmp
605 cat $MKFILE.tmp >> $MKFILE
606 rm $MKFILE.tmp
607 echo "Creating Makefile... ${BOLD}DONE${OFF}"
608}
Note: See TracBrowser for help on using the repository browser.