source: LFS/master.sh@ eb14b7f

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

Retry failed commit r3686: LFS/master.sh:

  • Ignore error when useradd does not support "-k /dev/null" (happens at

least on Suse)

  • strip "-libstdc++" from the script name to allow building gcc-libstdc++

with package gcc

  • Property mode set to 100644
File size: 19.8 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.
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 # 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.
118 LUSER_wrt_target "${this_script}" "$PREV"
119
120 # Find the version of the command files, if it corresponds with the building of
121 # a specific package
122 pkg_tarball=$(get_package_tarball_name $name)
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}"
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" ;;
139 *) LUSER_wrt_RunAsUser "$file" ;;
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
217 if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
218 case "${this_script}" in
219 *stripping*) ;;
220 *) continue ;;
221 esac
222 fi
223
224 # Append each name of the script files to a list (this will become
225 # the names of the targets in the Makefile)
226 # The kernfs script must be run as part of SUDO target.
227 case "${this_script}" in
228 *kernfs) runasroot="$runasroot ${this_script}" ;;
229 *) chapter6="$chapter6 ${this_script}" ;;
230 esac
231
232 #--------------------------------------------------------------------#
233 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
234 #--------------------------------------------------------------------#
235 #
236 # Drop in the name of the target on a new line, and the previous target
237 # as a dependency. Also call the echo_message function.
238 # In the mount of kernel filesystems we need to set LFS
239 # and not to use chroot.
240 case "${this_script}" in
241 *kernfs) LUSER_wrt_target "${this_script}" "$PREV" ;;
242 *) CHROOT_wrt_target "${this_script}" "$PREV" ;;
243 esac
244
245 # If $pkg_tarball isn't empty, we've got a package...
246 # Insert instructions for unpacking the package and changing directories
247 if [ "$pkg_tarball" != "" ] ; then
248 # Touch timestamp file if installed files logs will be created.
249 # But only for the firt build when running iterative builds.
250 if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
251 CHROOT_wrt_TouchTimestamp
252 fi
253 CHROOT_Unpack "$pkg_tarball"
254 # If the testsuites must be run, initialize the log file
255 case $name in
256 binutils | gcc | glibc | gmp | mpfr )
257 [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
258 ;;
259 * )
260 [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}"
261 ;;
262 esac
263 # If using optimizations, write the instructions
264 [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
265 fi
266
267 # In the mount of kernel filesystems we need to set LFS
268 # and not to use chroot.
269 case "${this_script}" in
270 *kernfs) wrt_RunAsRoot "$file" ;;
271 *) CHROOT_wrt_RunAsRoot "$file" ;;
272 esac
273
274 # Write installed files log and remove the build directory(ies)
275 # except if the package build fails.
276 if [ "$pkg_tarball" != "" ] ; then
277 case "${name}" in
278 *xz-utils) CHROOT_wrt_RemoveBuildDirs "xz" ;;
279 *) CHROOT_wrt_RemoveBuildDirs "$name" ;;
280 esac
281 if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
282 CHROOT_wrt_LogNewFiles "$name"
283 fi
284 fi
285
286 # Include a touch of the target name so make can check
287 # if it's already been made.
288 wrt_touch
289 #
290 #--------------------------------------------------------------------#
291 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
292 #--------------------------------------------------------------------#
293
294 # Keep the script file name for Makefile dependencies.
295 PREV=${this_script}
296 # Set system_build envar for iteration targets
297 system_build=$chapter6
298 done # end for file in chapter06/*
299}
300
301#----------------------------#
302chapter78_Makefiles() {
303#----------------------------#
304 echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8 ( BOOT ) ${R_arrow}"
305
306 for file in chapter0{7,8}/* ; do
307 # Keep the script file name
308 this_script=`basename $file`
309
310 # Grub must be configured manually.
311 # Handle fstab creation.
312 # If no .config file is supplied, the kernel build is skipped
313 case ${this_script} in
314 *grub) continue ;;
315 *fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
316 *kernel) [[ -z ${CONFIG} ]] && continue
317 cp ${CONFIG} $BUILDDIR/sources/kernel-config ;;
318 esac
319
320 # First append each name of the script files to a list (this will become
321 # the names of the targets in the Makefile
322 chapter78="$chapter78 ${this_script}"
323
324 #--------------------------------------------------------------------#
325 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
326 #--------------------------------------------------------------------#
327 #
328 # Drop in the name of the target on a new line, and the previous target
329 # as a dependency. Also call the echo_message function.
330 CHROOT_wrt_target "${this_script}" "$PREV"
331
332 # Find the bootscripts and kernel package names
333 case "${this_script}" in
334 *bootscripts)
335 name="lfs-bootscripts"
336 pkg_tarball=$(get_package_tarball_name $name)
337 if [ "${INSTALL_LOG}" = "y" ] ; then
338 CHROOT_wrt_TouchTimestamp
339 fi
340 CHROOT_Unpack "$pkg_tarball"
341 ;;
342 *kernel)
343 name="linux"
344 pkg_tarball=$(get_package_tarball_name $name)
345 if [ "${INSTALL_LOG}" = "y" ] ; then
346 CHROOT_wrt_TouchTimestamp
347 fi
348 CHROOT_Unpack "$pkg_tarball"
349 # If using optimizations, use MAKEFLAGS (unless blacklisted)
350 # no setting of CFLAGS and friends.
351 [[ "$OPTIMIZE" != "0" ]] && wrt_makeflags "$name"
352 ;;
353 esac
354
355 # Check if we have a real /etc/fstab file
356 case "${this_script}" in
357 *fstab) if [[ -n $FSTAB ]]; then
358 CHROOT_wrt_CopyFstab
359 else
360 CHROOT_wrt_RunAsRoot "$file"
361 fi
362 ;;
363 *) CHROOT_wrt_RunAsRoot "$file"
364 ;;
365 esac
366
367 case "${this_script}" in
368 *bootscripts) CHROOT_wrt_RemoveBuildDirs "dummy"
369 if [ "${INSTALL_LOG}" = "y" ] ; then
370 CHROOT_wrt_LogNewFiles "$name"
371 fi ;;
372 *kernel) CHROOT_wrt_RemoveBuildDirs "dummy"
373 if [ "${INSTALL_LOG}" = "y" ] ; then
374 CHROOT_wrt_LogNewFiles "$name"
375 fi ;;
376 esac
377
378 # Include a touch of the target name so make can check
379 # if it's already been made.
380 wrt_touch
381 #
382 #--------------------------------------------------------------------#
383 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
384 #--------------------------------------------------------------------#
385
386 # Keep the script file name for Makefile dependencies.
387 PREV=${this_script}
388 done # for file in chapter0{7,8}/*
389
390}
391
392
393
394#----------------------------#
395build_Makefile() { #
396#----------------------------#
397
398 echo "Creating Makefile... ${BOLD}START${OFF}"
399
400 cd $JHALFSDIR/${PROGNAME}-commands
401
402 # Start with a clean Makefile.tmp file
403 >$MKFILE
404
405 chapter4_Makefiles
406 chapter5_Makefiles
407 chapter6_Makefiles
408 # Add the iterations targets, if needed
409 [[ "$COMPARE" = "y" ]] && wrt_compare_targets
410 chapter78_Makefiles
411 # Add the CUSTOM_TOOLS targets, if needed
412 [[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
413
414 # Add a header, some variables and include the function file
415 # to the top of the real Makefile.
416 wrt_Makefile_header
417
418 # Add chroot commands
419 CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
420 i=1
421 for file in chapter06/*chroot* ; do
422 chroot=`cat $file | \
423 sed -e "s@chroot@$CHROOT_LOC@" \
424 -e '/#!\/bin\/bash/d' \
425 -e 's@ \\\@ @g' | \
426 tr -d '\n' | \
427 sed -e 's/ */ /g' \
428 -e 's|\\$|&&|g' \
429 -e 's|exit||g' \
430 -e 's|$| -c|' \
431 -e 's|"$$LFS"|$(MOUNT_PT)|' \
432 -e 's|set -e||' \
433 -e 's|set +h||'`
434 echo -e "CHROOT$i= $chroot\n" >> $MKFILE
435 i=`expr $i + 1`
436 done
437
438 # Drop in the main target 'all:' and the chapter targets with each sub-target
439 # as a dependency.
440(
441 cat << EOF
442
443all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_BLFS_TOOL mk_CUSTOM_TOOLS
444 @sudo make do_housekeeping
445 @echo $VERSION > lfs-release && \\
446 sudo mv lfs-release \$(MOUNT_PT)/etc && \\
447 sudo chown root:root \$(MOUNT_PT)/etc/lfs-release
448 @/bin/echo -e -n \\
449 DISTRIB_ID=\\"Linux From Scratch\\"\\\\n\\
450 DISTRIB_RELEASE=\\"$VERSION\\"\\\\n\\
451 DISTRIB_CODENAME=\\"$(whoami)-jhalfs\\"\\\\n\\
452 DISTRIB_DESCRIPTION=\\"Linux From Scratch\\"\\\\n\\
453 > lsb-release && \\
454 sudo mv lsb-release \$(MOUNT_PT)/etc && \\
455 sudo chown root:root \$(MOUNT_PT)/etc/lsb-release
456 @\$(call echo_finished,$VERSION)
457
458ck_UID:
459 @if [ \`id -u\` = "0" ]; then \\
460 echo "--------------------------------------------------"; \\
461 echo "You cannot run this makefile from the root account"; \\
462 echo "--------------------------------------------------"; \\
463 exit 1; \\
464 fi
465
466ck_LFS:
467 @if [ \`echo \$(LFS)\`x = "x" ]; then \\
468 echo "--------------------------------------------------"; \\
469 echo "Enviroment variable LFS must be set"; \\
470 echo "--------------------------------------------------"; \\
471 exit 1; \
472 fi
473
474mk_SETUP:
475 @\$(call echo_SU_request)
476 @sudo make BREAKPOINT=\$(BREAKPOINT) SETUP
477 @touch \$@
478
479mk_LUSER: mk_SETUP
480 @\$(call echo_SULUSER_request)
481 @( sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) LUSER" )
482 @sudo make restore-luser-env
483 @touch \$@
484
485mk_SUDO: mk_LUSER
486 @sudo make BREAKPOINT=\$(BREAKPOINT) SUDO
487 @touch \$@
488
489mk_CHROOT: mk_SUDO
490 @\$(call echo_CHROOT_request)
491 @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CHROOT")
492 @touch \$@
493
494mk_BOOT: mk_CHROOT
495 @\$(call echo_CHROOT_request)
496 @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BOOT")
497 @touch \$@
498
499mk_BLFS_TOOL: create-sbu_du-report
500 @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
501 \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
502 (sudo \$(CHROOT2) "make -C $BLFS_ROOT/work"); \\
503 fi;
504 @touch \$@
505
506mk_CUSTOM_TOOLS: mk_BLFS_TOOL
507 @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
508 \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
509 sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
510 (sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CUSTOM_TOOLS"); \\
511 fi;
512 @touch \$@
513
514devices: ck_LFS ck_UID
515 sudo mount -v --bind /dev \$(LFS)/dev
516 sudo mount -vt devpts devpts \$(LFS)/dev/pts
517 sudo mount -vt proc proc \$(LFS)/proc
518 sudo mount -vt sysfs sysfs \$(LFS)/sys
519 if [ -h \$(LFS)/dev/shm ]; then \\
520 link=\$\$(readlink \$(LFS)/dev/shm); \\
521 sudo mkdir -p \$(LFS)/\$\$link; \\
522 sudo mount -vt tmpfs shm \$(LFS)/\$\$link; \\
523 unset link; \\
524 else \\
525 sudo mount -vt tmpfs shm \$(LFS)/dev/shm; \\
526 fi
527
528teardown: ck_LFS
529 sudo umount -v \$(LFS)/sys
530 sudo umount -v \$(LFS)/proc
531 sudo umount -v \$(LFS)/dev/pts
532 if [ -h \$(LFS)/dev/shm ]; then \\
533 link=\$\$(readlink \$(LFS)/dev/shm); \\
534 sudo umount -v \$(LFS)/\$\$link; \\
535 unset link; \\
536 else \\
537 sudo umount -v \$(LFS)/dev/shm; \\
538 fi
539 sudo umount -v \$(LFS)/dev
540
541chroot: devices
542 sudo /usr/sbin/chroot \$(LFS) /tools/bin/env -i \\
543 HOME=/root TERM=\$(TERM) PS1='\\u:\\w\\\$\$ ' \\
544 PATH=/bin:/usr/bin:/sbin:/usr/sbin \\
545 /tools/bin/bash --login
546 \$(MAKE) teardown
547
548SETUP: $chapter4
549LUSER: $chapter5
550SUDO: $runasroot
551CHROOT: SHELL=/tools/bin/bash
552CHROOT: $chapter6
553BOOT: $chapter78
554CUSTOM_TOOLS: $custom_list
555
556
557create-sbu_du-report: mk_BOOT
558 @\$(call echo_message, Building)
559 @if [ "\$(ADD_REPORT)" = "y" ]; then \\
560 sudo ./create-sbu_du-report.sh logs $VERSION; \\
561 \$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report); \\
562 fi;
563 @touch \$@
564
565restore-luser-env:
566 @\$(call echo_message, Building)
567 @if [ -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
568 mv -f \$(LUSER_HOME)/.bashrc.XXX \$(LUSER_HOME)/.bashrc; \\
569 fi;
570 @if [ -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
571 mv \$(LUSER_HOME)/.bash_profile.XXX \$(LUSER_HOME)/.bash_profile; \\
572 fi;
573 @chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bash*
574 @\$(call housekeeping)
575
576do_housekeeping:
577 @-umount \$(MOUNT_PT)/sys
578 @-umount \$(MOUNT_PT)/proc
579 @-if [ -h \$(MOUNT_PT)/dev/shm ]; then \\
580 link=\$\$(readlink \$(MOUNT_PT)/dev/shm); \\
581 umount \$(MOUNT_PT)/\$\$link; \\
582 unset link; \\
583 else \\
584 umount \$(MOUNT_PT)/dev/shm; \\
585 fi
586 @-umount \$(MOUNT_PT)/dev/pts
587 @-umount \$(MOUNT_PT)/dev
588 @-rm /tools
589 @-if [ ! -f luser-exist ]; then \\
590 userdel \$(LUSER); \\
591 rm -rf \$(LUSER_HOME); \\
592 fi;
593
594
595EOF
596) >> $MKFILE
597
598 # Bring over the items from the Makefile.tmp
599 cat $MKFILE.tmp >> $MKFILE
600 rm $MKFILE.tmp
601 echo "Creating Makefile... ${BOLD}DONE${OFF}"
602}
Note: See TracBrowser for help on using the repository browser.