1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # $Id$
|
---|
4 |
|
---|
5 | ###################################
|
---|
6 | ### FUNCTIONS ###
|
---|
7 | ###################################
|
---|
8 |
|
---|
9 |
|
---|
10 | #############################################################
|
---|
11 |
|
---|
12 |
|
---|
13 | #----------------------------#
|
---|
14 | chapter4_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
|
---|
23 | 04_02-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 |
|
---|
30 | 04_03-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 |
|
---|
43 | 04_04-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 "SRCDIR=\$(MOUNT_PT)/sources" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
55 | echo "LC_ALL=POSIX" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
56 | echo "PATH=/tools/bin:/bin:/usr/bin" >> \$(LUSER_HOME)/.bashrc && \\
|
---|
57 | echo "export LFS LC_ALL 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)
|
---|
63 | EOF
|
---|
64 | ) > $MKFILE.tmp
|
---|
65 |
|
---|
66 | chapter4=" 04_02-creatingtoolsdir 04_03-addinguser 04_04-settingenvironment"
|
---|
67 | }
|
---|
68 |
|
---|
69 |
|
---|
70 |
|
---|
71 | #----------------------------#
|
---|
72 | chapter5_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 will be run, then TCL, Expect and DejaGNU aren't needed
|
---|
81 | case "${this_script}" in
|
---|
82 | *tcl) [[ "${TEST}" = "0" ]] && continue ;;
|
---|
83 | *expect) [[ "${TEST}" = "0" ]] && continue ;;
|
---|
84 | *dejagnu) [[ "${TEST}" = "0" ]] && continue ;;
|
---|
85 | *stripping) [[ "${STRIP}" = "n" ]] && continue ;;
|
---|
86 | esac
|
---|
87 |
|
---|
88 | # First append each name of the script files to a list (this will become
|
---|
89 | # the names of the targets in the Makefile
|
---|
90 | # DO NOT append the changingowner script, it need be run as root.
|
---|
91 | # A hack is necessary: create script in chap5 BUT run as a dependency for
|
---|
92 | # SUDO target
|
---|
93 | case "${this_script}" in
|
---|
94 | *changingowner) runasroot="$runasroot ${this_script}" ;;
|
---|
95 | *) chapter5="$chapter5 ${this_script}" ;;
|
---|
96 | esac
|
---|
97 |
|
---|
98 | # Grab the package name, if the script is building a package
|
---|
99 | name=`grep "^PACKAGE=" ${file} | sed -e 's@PACKAGE=@@'`
|
---|
100 |
|
---|
101 | # Set the dependency for the first target.
|
---|
102 | if [ -z $PREV ] ; then PREV=04_04-settingenvironment ; fi
|
---|
103 |
|
---|
104 | #--------------------------------------------------------------------#
|
---|
105 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
106 | #--------------------------------------------------------------------#
|
---|
107 | #
|
---|
108 | # Drop in the name of the target on a new line, and the previous target
|
---|
109 | # as a dependency. Also call the echo_message function.
|
---|
110 | LUSER_wrt_target "${this_script}" "$PREV"
|
---|
111 |
|
---|
112 | # If $name isn't empty, we've got a package...
|
---|
113 | if [ "$name" != "" ] ; then
|
---|
114 | # If the testsuites must be run, initialize the log file
|
---|
115 | [[ "$TEST" = "3" ]] && LUSER_wrt_test_log "${this_script}"
|
---|
116 | # If using optimizations, write the instructions
|
---|
117 | [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
118 | fi
|
---|
119 |
|
---|
120 | # Run the script.
|
---|
121 | # The changingowner script must be run as root.
|
---|
122 | case "${this_script}" in
|
---|
123 | *changingowner) wrt_RunAsRoot "$file" ;;
|
---|
124 | *) LUSER_wrt_RunAsUser "$file" ;;
|
---|
125 | esac
|
---|
126 |
|
---|
127 | # Include a touch of the target name so make can check
|
---|
128 | # if it's already been made.
|
---|
129 | wrt_touch
|
---|
130 | #
|
---|
131 | #--------------------------------------------------------------------#
|
---|
132 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
133 | #--------------------------------------------------------------------#
|
---|
134 |
|
---|
135 | # Keep the script file name for Makefile dependencies.
|
---|
136 | PREV=${this_script}
|
---|
137 | done # end for file in chapter05/*
|
---|
138 | }
|
---|
139 |
|
---|
140 |
|
---|
141 | #----------------------------#
|
---|
142 | chapter6_Makefiles() {
|
---|
143 | #----------------------------#
|
---|
144 |
|
---|
145 | # Set envars and scripts for iteration targets
|
---|
146 | if [[ -z "$1" ]] ; then
|
---|
147 | local N=""
|
---|
148 | else
|
---|
149 | local N=-build_$1
|
---|
150 | local chapter6=""
|
---|
151 | mkdir chapter06$N
|
---|
152 | cp chapter06/* chapter06$N
|
---|
153 | for script in chapter06$N/* ; do
|
---|
154 | # Overwrite existing symlinks, files, and dirs
|
---|
155 | sed -e 's/ln -sv/&f/g' \
|
---|
156 | -e 's/mv -v/&f/g' \
|
---|
157 | -e 's/mkdir -v/&p/g' -i ${script}
|
---|
158 | # Rename the scripts
|
---|
159 | mv ${script} ${script}$N
|
---|
160 | done
|
---|
161 | fi
|
---|
162 |
|
---|
163 | echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N ( CHROOT ) ${R_arrow}"
|
---|
164 |
|
---|
165 | for file in chapter06$N/* ; do
|
---|
166 | # Keep the script file name
|
---|
167 | this_script=`basename $file`
|
---|
168 |
|
---|
169 | # We'll run the chroot commands differently than the others, so skip them in the
|
---|
170 | # dependencies and target creation.
|
---|
171 | # Skip also linux-headers in iterative builds.
|
---|
172 | case "${this_script}" in
|
---|
173 | *chroot) continue ;;
|
---|
174 | *stripping*) [[ "${STRIP}" = "n" ]] && continue ;;
|
---|
175 | *linux-headers*) [[ -n "$N" ]] && continue ;;
|
---|
176 | esac
|
---|
177 |
|
---|
178 | # Grab the name of the target.
|
---|
179 | name=`grep "^PACKAGE=" ${file} | sed -e 's@PACKAGE=@@'`
|
---|
180 |
|
---|
181 | # Skip scripts not needed for iterations rebuilds
|
---|
182 | if [[ "$name" = "" ]] && [[ -n "$N" ]] ; then
|
---|
183 | case "${this_script}" in
|
---|
184 | *stripping*) ;;
|
---|
185 | *) continue ;;
|
---|
186 | esac
|
---|
187 | fi
|
---|
188 |
|
---|
189 | # Append each name of the script files to a list (this will become
|
---|
190 | # the names of the targets in the Makefile)
|
---|
191 | # The kernfs script must be run as part of SUDO target.
|
---|
192 | case "${this_script}" in
|
---|
193 | *kernfs) runasroot="$runasroot ${this_script}" ;;
|
---|
194 | *) chapter6="$chapter6 ${this_script}" ;;
|
---|
195 | esac
|
---|
196 |
|
---|
197 | #--------------------------------------------------------------------#
|
---|
198 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
199 | #--------------------------------------------------------------------#
|
---|
200 | #
|
---|
201 | # Drop in the name of the target on a new line, and the previous target
|
---|
202 | # as a dependency. Also call the echo_message function.
|
---|
203 | # In the mount of kernel filesystems we need to set LFS
|
---|
204 | # and not to use chroot.
|
---|
205 | case "${this_script}" in
|
---|
206 | *kernfs) LUSER_wrt_target "${this_script}" "$PREV" ;;
|
---|
207 | *) CHROOT_wrt_target "${this_script}" "$PREV" ;;
|
---|
208 | esac
|
---|
209 |
|
---|
210 | # If $name isn't empty, we've got a package...
|
---|
211 | if [ "$name" != "" ] ; then
|
---|
212 | # Touch timestamp file if installed files logs will be created.
|
---|
213 | # But only for the firt build when running iterative builds.
|
---|
214 | if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
|
---|
215 | CHROOT_wrt_TouchTimestamp
|
---|
216 | fi
|
---|
217 | # If the testsuites must be run, initialize the log file
|
---|
218 | case $name in
|
---|
219 | binutils | gcc | glibc )
|
---|
220 | [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
|
---|
221 | ;;
|
---|
222 | * )
|
---|
223 | [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}"
|
---|
224 | ;;
|
---|
225 | esac
|
---|
226 | # If using optimizations, write the instructions
|
---|
227 | [[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
|
---|
228 | fi
|
---|
229 |
|
---|
230 | # In the mount of kernel filesystems we need to set LFS
|
---|
231 | # and not to use chroot.
|
---|
232 | case "${this_script}" in
|
---|
233 | *kernfs) wrt_RunAsRoot "$file" ;;
|
---|
234 | *) CHROOT_wrt_RunAsRoot "$file" ;;
|
---|
235 | esac
|
---|
236 |
|
---|
237 | # Write installed files log
|
---|
238 | if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
|
---|
239 | CHROOT_wrt_LogNewFiles "$name"
|
---|
240 | fi
|
---|
241 |
|
---|
242 | # Include a touch of the target name so make can check
|
---|
243 | # if it's already been made.
|
---|
244 | wrt_touch
|
---|
245 | #
|
---|
246 | #--------------------------------------------------------------------#
|
---|
247 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
248 | #--------------------------------------------------------------------#
|
---|
249 |
|
---|
250 | # Keep the script file name for Makefile dependencies.
|
---|
251 | PREV=${this_script}
|
---|
252 | # Set system_build envar for iteration targets
|
---|
253 | system_build=$chapter6
|
---|
254 | done # end for file in chapter06/*
|
---|
255 | }
|
---|
256 |
|
---|
257 | #----------------------------#
|
---|
258 | chapter78_Makefiles() {
|
---|
259 | #----------------------------#
|
---|
260 | echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8 ( BOOT ) ${R_arrow}"
|
---|
261 |
|
---|
262 | for file in chapter0{7,8}/* ; do
|
---|
263 | # Keep the script file name
|
---|
264 | this_script=`basename $file`
|
---|
265 |
|
---|
266 | # Grub must be configured manually.
|
---|
267 | # Handle fstab creation.
|
---|
268 | # If no .config file is supplied, the kernel build is skipped
|
---|
269 | case ${this_script} in
|
---|
270 | *grub) continue ;;
|
---|
271 | *fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
|
---|
272 | *kernel) [[ -z ${CONFIG} ]] && continue
|
---|
273 | cp ${CONFIG} $BUILDDIR/sources/kernel-config ;;
|
---|
274 | esac
|
---|
275 |
|
---|
276 | # First append each name of the script files to a list (this will become
|
---|
277 | # the names of the targets in the Makefile
|
---|
278 | chapter78="$chapter78 ${this_script}"
|
---|
279 |
|
---|
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.
|
---|
286 | CHROOT_wrt_target "${this_script}" "$PREV"
|
---|
287 |
|
---|
288 | # For bootscripts and kernel, start INSTALL_LOG if requested
|
---|
289 | case "${this_script}" in
|
---|
290 | *bootscripts | *kernel ) if [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
291 | CHROOT_wrt_TouchTimestamp
|
---|
292 | fi ;;
|
---|
293 | esac
|
---|
294 |
|
---|
295 | # Check if we have a real /etc/fstab file
|
---|
296 | case "${this_script}" in
|
---|
297 | *fstab) if [[ -n $FSTAB ]]; then
|
---|
298 | CHROOT_wrt_CopyFstab
|
---|
299 | else
|
---|
300 | CHROOT_wrt_RunAsRoot "$file"
|
---|
301 | fi
|
---|
302 | ;;
|
---|
303 | *) CHROOT_wrt_RunAsRoot "$file"
|
---|
304 | ;;
|
---|
305 | esac
|
---|
306 |
|
---|
307 | case "${this_script}" in
|
---|
308 | *bootscripts) if [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
309 | CHROOT_wrt_LogNewFiles "lfs-bootscripts"
|
---|
310 | fi ;;
|
---|
311 | *kernel) if [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
312 | CHROOT_wrt_LogNewFiles "linux"
|
---|
313 | fi ;;
|
---|
314 | esac
|
---|
315 |
|
---|
316 | # Include a touch of the target name so make can check
|
---|
317 | # if it's already been made.
|
---|
318 | wrt_touch
|
---|
319 | #
|
---|
320 | #--------------------------------------------------------------------#
|
---|
321 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
322 | #--------------------------------------------------------------------#
|
---|
323 |
|
---|
324 | # Keep the script file name for Makefile dependencies.
|
---|
325 | PREV=${this_script}
|
---|
326 | done # for file in chapter0{7,8}/*
|
---|
327 |
|
---|
328 | }
|
---|
329 |
|
---|
330 |
|
---|
331 |
|
---|
332 | #----------------------------#
|
---|
333 | build_Makefile() { #
|
---|
334 | #----------------------------#
|
---|
335 |
|
---|
336 | echo "Creating Makefile... ${BOLD}START${OFF}"
|
---|
337 |
|
---|
338 | cd $JHALFSDIR/${PROGNAME}-commands
|
---|
339 |
|
---|
340 | # Start with a clean Makefile.tmp file
|
---|
341 | >$MKFILE
|
---|
342 |
|
---|
343 | chapter4_Makefiles
|
---|
344 | chapter5_Makefiles
|
---|
345 | chapter6_Makefiles
|
---|
346 | # Add the iterations targets, if needed
|
---|
347 | [[ "$COMPARE" = "y" ]] && wrt_compare_targets
|
---|
348 | chapter78_Makefiles
|
---|
349 | # Add the CUSTOM_TOOLS targets, if needed
|
---|
350 | [[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
|
---|
351 | # Add the BLFS_TOOL targets, if needed
|
---|
352 | [[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
|
---|
353 |
|
---|
354 | # Add a header, some variables and include the function file
|
---|
355 | # to the top of the real Makefile.
|
---|
356 | wrt_Makefile_header
|
---|
357 |
|
---|
358 | # Add chroot commands
|
---|
359 | CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
|
---|
360 | i=1
|
---|
361 | for file in chapter06/*chroot* ; do
|
---|
362 | chroot=`cat $file | tr -d '\n' | \
|
---|
363 | sed -e "s@chroot@$CHROOT_LOC@" \
|
---|
364 | -e 's@ \\\@ @g' \
|
---|
365 | -e 's|\\$|&&|g' \
|
---|
366 | -e 's|"$$LFS"|$(MOUNT_PT)|' \
|
---|
367 | -e 's|$| -c|'`
|
---|
368 | echo -e "CHROOT$i= $chroot\n" >> $MKFILE
|
---|
369 | i=`expr $i + 1`
|
---|
370 | done
|
---|
371 |
|
---|
372 | # Drop in the main target 'all:' and the chapter targets with each sub-target
|
---|
373 | # as a dependency.
|
---|
374 | (
|
---|
375 | cat << EOF
|
---|
376 |
|
---|
377 | all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL
|
---|
378 | @sudo make do_housekeeping
|
---|
379 | @echo "$VERSION - jhalfs build" > lfs-release && \\
|
---|
380 | sudo mv lfs-release \$(MOUNT_PT)/etc
|
---|
381 | @\$(call echo_finished,$VERSION)
|
---|
382 |
|
---|
383 | ck_UID:
|
---|
384 | @if [ \`id -u\` = "0" ]; then \\
|
---|
385 | echo "--------------------------------------------------"; \\
|
---|
386 | echo "You cannot run this makefile from the root account"; \\
|
---|
387 | echo "--------------------------------------------------"; \\
|
---|
388 | exit 1; \\
|
---|
389 | fi
|
---|
390 |
|
---|
391 | mk_SETUP:
|
---|
392 | @\$(call echo_SU_request)
|
---|
393 | @sudo make BREAKPOINT=\$(BREAKPOINT) SETUP
|
---|
394 | @touch \$@
|
---|
395 |
|
---|
396 | mk_LUSER: mk_SETUP
|
---|
397 | @\$(call echo_SULUSER_request)
|
---|
398 | @( sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) LUSER" )
|
---|
399 | @sudo make restore-luser-env
|
---|
400 | @touch \$@
|
---|
401 |
|
---|
402 | mk_SUDO: mk_LUSER
|
---|
403 | @sudo make BREAKPOINT=\$(BREAKPOINT) SUDO
|
---|
404 | @touch \$@
|
---|
405 |
|
---|
406 | mk_CHROOT: mk_SUDO
|
---|
407 | @\$(call echo_CHROOT_request)
|
---|
408 | @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CHROOT")
|
---|
409 | @touch \$@
|
---|
410 |
|
---|
411 | mk_BOOT: mk_CHROOT
|
---|
412 | @\$(call echo_CHROOT_request)
|
---|
413 | @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BOOT")
|
---|
414 | @touch \$@
|
---|
415 |
|
---|
416 | mk_CUSTOM_TOOLS: create-sbu_du-report
|
---|
417 | @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
|
---|
418 | \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
|
---|
419 | sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
|
---|
420 | (sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CUSTOM_TOOLS"); \\
|
---|
421 | fi;
|
---|
422 | @touch \$@
|
---|
423 |
|
---|
424 | mk_BLFS_TOOL: mk_CUSTOM_TOOLS
|
---|
425 | @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
|
---|
426 | \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
|
---|
427 | sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
|
---|
428 | (sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL"); \\
|
---|
429 | fi;
|
---|
430 | @touch \$@
|
---|
431 |
|
---|
432 |
|
---|
433 | SETUP: $chapter4
|
---|
434 | LUSER: $chapter5
|
---|
435 | SUDO: $runasroot
|
---|
436 | CHROOT: SHELL=/tools/bin/bash
|
---|
437 | CHROOT: $chapter6
|
---|
438 | BOOT: $chapter78
|
---|
439 | CUSTOM_TOOLS: $custom_list
|
---|
440 | BLFS_TOOL: $blfs_tool
|
---|
441 |
|
---|
442 |
|
---|
443 | create-sbu_du-report: mk_BOOT
|
---|
444 | @\$(call echo_message, Building)
|
---|
445 | @if [ "\$(ADD_REPORT)" = "y" ]; then \\
|
---|
446 | ./create-sbu_du-report.sh logs $VERSION; \\
|
---|
447 | \$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report); \\
|
---|
448 | fi;
|
---|
449 | @touch \$@
|
---|
450 |
|
---|
451 | restore-luser-env:
|
---|
452 | @\$(call echo_message, Building)
|
---|
453 | @if [ -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
|
---|
454 | mv -f \$(LUSER_HOME)/.bashrc.XXX \$(LUSER_HOME)/.bashrc; \\
|
---|
455 | fi;
|
---|
456 | @if [ -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
|
---|
457 | mv \$(LUSER_HOME)/.bash_profile.XXX \$(LUSER_HOME)/.bash_profile; \\
|
---|
458 | fi;
|
---|
459 | @chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bash*
|
---|
460 | @\$(call housekeeping)
|
---|
461 |
|
---|
462 | do_housekeeping:
|
---|
463 | @-umount \$(MOUNT_PT)/sys
|
---|
464 | @-umount \$(MOUNT_PT)/proc
|
---|
465 | @-umount \$(MOUNT_PT)/dev/shm
|
---|
466 | @-umount \$(MOUNT_PT)/dev/pts
|
---|
467 | @-umount \$(MOUNT_PT)/dev
|
---|
468 | @-rm /tools
|
---|
469 | @-if [ ! -f luser-exist ]; then \\
|
---|
470 | userdel \$(LUSER); \\
|
---|
471 | rm -rf \$(LUSER_HOME); \\
|
---|
472 | fi;
|
---|
473 |
|
---|
474 |
|
---|
475 | EOF
|
---|
476 | ) >> $MKFILE
|
---|
477 |
|
---|
478 | # Bring over the items from the Makefile.tmp
|
---|
479 | cat $MKFILE.tmp >> $MKFILE
|
---|
480 | rm $MKFILE.tmp
|
---|
481 | echo "Creating Makefile... ${BOLD}DONE${OFF}"
|
---|
482 | }
|
---|