source: LFS/master.sh@ 90f304c

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

Cleanly umount the kernel files, following the new way of mounting /dev/shm

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