Merged r2754:2768 from trunk.

This commit is contained in:
Manuel Canales Esparcia 2006-06-10 16:48:25 +00:00
parent e35e794b50
commit 9199a13ac6
7 changed files with 227 additions and 90 deletions

View file

@ -20,20 +20,24 @@ host_prep_Makefiles() { # Initialization of the system
cat << EOF cat << EOF
023-creatingtoolsdir: 023-creatingtoolsdir:
@\$(call echo_message, Building) @\$(call echo_message, Building)
@mkdir -v \$(MOUNT_PT)/tools && \\ @mkdir \$(MOUNT_PT)/tools && \\
rm -fv /tools && \\ rm -f /tools && \\
ln -sv \$(MOUNT_PT)/tools / ln -s \$(MOUNT_PT)/tools /
@if [ ! -d \$(MOUNT_PT)/sources ]; then \\ @if [ ! -d \$(MOUNT_PT)/sources ]; then \\
mkdir \$(MOUNT_PT)/sources; \\ mkdir \$(MOUNT_PT)/sources; \\
fi; fi;
@chmod a+wt \$(MOUNT_PT)/sources && \\ @chmod a+wt \$(MOUNT_PT)/sources && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
024-creatingcrossdir: 023-creatingtoolsdir 024-creatingcrossdir: 023-creatingtoolsdir
@mkdir -v \$(MOUNT_PT)/cross-tools && \\ @mkdir -v \$(MOUNT_PT)/cross-tools && \\
rm -fv /cross-tools && \\ rm -f /cross-tools && \\
ln -sv \$(MOUNT_PT)/cross-tools / ln -s \$(MOUNT_PT)/cross-tools /
@touch \$@ @touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
025-addinguser: 024-creatingcrossdir 025-addinguser: 024-creatingcrossdir
@\$(call echo_message, Building) @\$(call echo_message, Building)
@ -47,15 +51,17 @@ cat << EOF
chown lfs \$(MOUNT_PT)/tools && \\ chown lfs \$(MOUNT_PT)/tools && \\
chown lfs \$(MOUNT_PT)/cross-tools && \\ chown lfs \$(MOUNT_PT)/cross-tools && \\
chown lfs \$(MOUNT_PT)/sources && \\ chown lfs \$(MOUNT_PT)/sources && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
026-settingenvironment: 025-addinguser 026-settingenvironment: 025-addinguser
@\$(call echo_message, Building) @\$(call echo_message, Building)
@if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\ @if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
mv -v /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\ mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
fi; fi;
@if [ -f /home/lfs/.bash_profile -a ! -f /home/lfs/.bash_profile.XXX ]; then \\ @if [ -f /home/lfs/.bash_profile -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
mv -v /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\ mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
fi; fi;
@echo "set +h" > /home/lfs/.bashrc && \\ @echo "set +h" > /home/lfs/.bashrc && \\
echo "umask 022" >> /home/lfs/.bashrc && \\ echo "umask 022" >> /home/lfs/.bashrc && \\
@ -73,7 +79,9 @@ cat << EOF
echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc
@chown lfs:lfs /home/lfs/.bashrc && \\ @chown lfs:lfs /home/lfs/.bashrc && \\
touch envars && \\ touch envars && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
EOF EOF
) >> $MKFILE.tmp ) >> $MKFILE.tmp
@ -138,7 +146,7 @@ cross_tools_Makefiles() { #
[[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -191,7 +199,7 @@ temptools_Makefiles() { #
[[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -275,7 +283,7 @@ boot_Makefiles() { #
[[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -341,7 +349,7 @@ chroot_Makefiles() { #
[[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -395,7 +403,7 @@ testsuite_tools_Makefiles() { #
wrt_remove_build_dirs "${name}" wrt_remove_build_dirs "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -450,7 +458,7 @@ bm_testsuite_tools_Makefiles() { #
wrt_remove_build_dirs2 "${name}" wrt_remove_build_dirs2 "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -560,7 +568,7 @@ final_system_Makefiles() { #
[[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -673,7 +681,7 @@ bm_final_system_Makefiles() { #
[[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}" [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -735,7 +743,7 @@ bootscripts_Makefiles() { #
[[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -796,7 +804,7 @@ bm_bootscripts_Makefiles() { #
[[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}" [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -870,7 +878,7 @@ bootable_Makefiles() { #
[[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}" [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -950,7 +958,7 @@ bm_bootable_Makefiles() { #
[[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}" [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
# #
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -1090,21 +1098,23 @@ clean-chapter4:
restore-lfs-env: restore-lfs-env:
@\$(call echo_message, Building) @\$(call echo_message, Building)
@if [ -f /home/lfs/.bashrc.XXX ]; then \\ @if [ -f /home/lfs/.bashrc.XXX ]; then \\
mv -fv /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\ mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
fi; fi;
@if [ -f /home/lfs/.bash_profile.XXX ]; then \\ @if [ -f /home/lfs/.bash_profile.XXX ]; then \\
mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\ mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
fi; fi;
@chown lfs:lfs /home/lfs/.bash* && \\ @chown lfs:lfs /home/lfs/.bash* && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
do-housekeeping: do-housekeeping:
-umount \$(MOUNT_PT)/dev/pts @-umount \$(MOUNT_PT)/dev/pts
-umount \$(MOUNT_PT)/dev/shm @-umount \$(MOUNT_PT)/dev/shm
-umount \$(MOUNT_PT)/dev @-umount \$(MOUNT_PT)/dev
-umount \$(MOUNT_PT)/sys @-umount \$(MOUNT_PT)/sys
-umount \$(MOUNT_PT)/proc @-umount \$(MOUNT_PT)/proc
-if [ ! -f user-lfs-exist ]; then \\ @-if [ ! -f user-lfs-exist ]; then \\
userdel lfs; \\ userdel lfs; \\
rm -rf /home/lfs; \\ rm -rf /home/lfs; \\
fi; fi;
@ -1176,7 +1186,9 @@ restore-lfs-env:
mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\ mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
fi; fi;
@chown lfs:lfs /home/lfs/.bash* && \\ @chown lfs:lfs /home/lfs/.bash* && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
EOF EOF

View file

@ -30,14 +30,16 @@ chapter3_Makefiles() { # Initialization of the system
cat << EOF cat << EOF
020-creatingtoolsdir: 020-creatingtoolsdir:
@\$(call echo_message, Building) @\$(call echo_message, Building)
@mkdir -v \$(MOUNT_PT)/tools && \\ @mkdir \$(MOUNT_PT)/tools && \\
rm -fv /tools && \\ rm -f /tools && \\
ln -sv \$(MOUNT_PT)/tools / ln -s \$(MOUNT_PT)/tools /
@if [ ! -d \$(MOUNT_PT)/sources ]; then \\ @if [ ! -d \$(MOUNT_PT)/sources ]; then \\
mkdir \$(MOUNT_PT)/sources; \\ mkdir \$(MOUNT_PT)/sources; \\
fi; fi;
@chmod a+wt \$(MOUNT_PT)/sources && \\ @chmod a+wt \$(MOUNT_PT)/sources && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
021-addinguser: 020-creatingtoolsdir 021-addinguser: 020-creatingtoolsdir
@\$(call echo_message, Building) @\$(call echo_message, Building)
@ -49,15 +51,17 @@ cat << EOF
fi; fi;
@chown lfs \$(MOUNT_PT)/tools && \\ @chown lfs \$(MOUNT_PT)/tools && \\
chown lfs \$(MOUNT_PT)/sources && \\ chown lfs \$(MOUNT_PT)/sources && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
022-settingenvironment: 021-addinguser 022-settingenvironment: 021-addinguser
@\$(call echo_message, Building) @\$(call echo_message, Building)
@if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\ @if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
mv -v /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\ mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
fi; fi;
@if [ -f /home/lfs/.bash_profile -a ! -f /home/lfs/.bash_profile.XXX ]; then \\ @if [ -f /home/lfs/.bash_profile -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
mv -v /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\ mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
fi; fi;
@echo "set +h" > /home/lfs/.bashrc && \\ @echo "set +h" > /home/lfs/.bashrc && \\
echo "umask 022" >> /home/lfs/.bashrc && \\ echo "umask 022" >> /home/lfs/.bashrc && \\
@ -72,7 +76,9 @@ cat << EOF
echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\ echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\
chown lfs:lfs /home/lfs/.bashrc && \\ chown lfs:lfs /home/lfs/.bashrc && \\
touch envars && \\ touch envars && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
EOF EOF
) >> $MKFILE.tmp ) >> $MKFILE.tmp
@ -197,7 +203,7 @@ EOF
esac esac
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -365,7 +371,7 @@ EOF
esac esac
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -457,7 +463,7 @@ EOF
esac esac
# Include a touch of the target name so make can check if it's already been made. # Include a touch of the target name so make can check if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -572,21 +578,23 @@ clean-chapter7:
restore-lfs-env: restore-lfs-env:
@\$(call echo_message, Building) @\$(call echo_message, Building)
@if [ -f /home/lfs/.bashrc.XXX ]; then \\ @if [ -f /home/lfs/.bashrc.XXX ]; then \\
mv -fv /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\ mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
fi; fi;
@if [ -f /home/lfs/.bash_profile.XXX ]; then \\ @if [ -f /home/lfs/.bash_profile.XXX ]; then \\
mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\ mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
fi; fi;
@chown lfs:lfs /home/lfs/.bash* && \\ @chown lfs:lfs /home/lfs/.bash* && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
do-housekeeping: do-housekeeping:
-umount \$(MOUNT_PT)/dev/pts @-umount \$(MOUNT_PT)/dev/pts
-umount \$(MOUNT_PT)/dev/shm @-umount \$(MOUNT_PT)/dev/shm
-umount \$(MOUNT_PT)/dev @-umount \$(MOUNT_PT)/dev
-umount \$(MOUNT_PT)/sys @-umount \$(MOUNT_PT)/sys
-umount \$(MOUNT_PT)/proc @-umount \$(MOUNT_PT)/proc
-if [ ! -f user-lfs-exist ]; then \\ @-if [ ! -f user-lfs-exist ]; then \\
userdel lfs; \\ userdel lfs; \\
rm -rf /home/lfs; \\ rm -rf /home/lfs; \\
fi; fi;

View file

@ -20,10 +20,12 @@ chapter4_Makefiles() {
cat << EOF cat << EOF
020-creatingtoolsdir: 020-creatingtoolsdir:
@\$(call echo_message, Building) @\$(call echo_message, Building)
@mkdir -v \$(MOUNT_PT)/tools && \\ @mkdir \$(MOUNT_PT)/tools && \\
rm -fv /tools && \\ rm -f /tools && \\
ln -sv \$(MOUNT_PT)/tools / && \\ ln -s \$(MOUNT_PT)/tools / && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
021-addinguser: 020-creatingtoolsdir 021-addinguser: 020-creatingtoolsdir
@\$(call echo_message, Building) @\$(call echo_message, Building)
@ -35,15 +37,17 @@ chapter4_Makefiles() {
fi; fi;
@chown lfs \$(MOUNT_PT)/tools && \\ @chown lfs \$(MOUNT_PT)/tools && \\
chmod a+wt \$(MOUNT_PT)/sources && \\ chmod a+wt \$(MOUNT_PT)/sources && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
022-settingenvironment: 021-addinguser 022-settingenvironment: 021-addinguser
@\$(call echo_message, Building) @\$(call echo_message, Building)
@if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\ @if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
mv -v /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\ mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
fi; fi;
@if [ -f /home/lfs/.bash_profile -a ! -f /home/lfs/.bash_profile.XXX ]; then \\ @if [ -f /home/lfs/.bash_profile -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
mv -v /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\ mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
fi; fi;
@echo "set +h" > /home/lfs/.bashrc && \\ @echo "set +h" > /home/lfs/.bashrc && \\
echo "umask 022" >> /home/lfs/.bashrc && \\ echo "umask 022" >> /home/lfs/.bashrc && \\
@ -54,7 +58,9 @@ chapter4_Makefiles() {
echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\ echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\
chown lfs:lfs /home/lfs/.bashrc && \\ chown lfs:lfs /home/lfs/.bashrc && \\
touch envars && \\ touch envars && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
EOF EOF
) >> $MKFILE.tmp ) >> $MKFILE.tmp
} }
@ -134,7 +140,7 @@ chapter5_Makefiles() {
# Include a touch of the target name so make can check # Include a touch of the target name so make can check
# if it's already been made. # if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -246,7 +252,7 @@ chapter6_Makefiles() {
# Include a touch of the target name so make can check # Include a touch of the target name so make can check
# if it's already been made. # if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -328,7 +334,7 @@ chapter789_Makefiles() {
# Include a touch of the target name so make can check # Include a touch of the target name so make can check
# if it's already been made. # if it's already been made.
echo -e '\t@touch $@' >> $MKFILE.tmp wrt_touch
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -406,6 +412,8 @@ clean-all: clean
clean: clean-chapter789 clean-chapter6 clean-chapter5 clean-chapter4 clean: clean-chapter789 clean-chapter6 clean-chapter5 clean-chapter4
restart: restart_code all
clean-chapter4: clean-chapter4:
-if [ ! -f user-lfs-exist ]; then \\ -if [ ! -f user-lfs-exist ]; then \\
userdel lfs; \\ userdel lfs; \\
@ -438,25 +446,67 @@ clean-chapter789:
restore-lfs-env: restore-lfs-env:
@\$(call echo_message, Building) @\$(call echo_message, Building)
@if [ -f /home/lfs/.bashrc.XXX ]; then \\ @if [ -f /home/lfs/.bashrc.XXX ]; then \\
mv -fv /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\ mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
fi; fi;
@if [ -f /home/lfs/.bash_profile.XXX ]; then \\ @if [ -f /home/lfs/.bash_profile.XXX ]; then \\
mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\ mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
fi; fi;
@chown lfs:lfs /home/lfs/.bash* && \\ @chown lfs:lfs /home/lfs/.bash* && \\
touch \$@ touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
do_housekeeping: do_housekeeping:
-umount \$(MOUNT_PT)/sys @-umount \$(MOUNT_PT)/sys
-umount \$(MOUNT_PT)/proc @-umount \$(MOUNT_PT)/proc
-umount \$(MOUNT_PT)/dev/shm @-umount \$(MOUNT_PT)/dev/shm
-umount \$(MOUNT_PT)/dev/pts @-umount \$(MOUNT_PT)/dev/pts
-umount \$(MOUNT_PT)/dev @-umount \$(MOUNT_PT)/dev
-if [ ! -f user-lfs-exist ]; then \\ @-if [ ! -f user-lfs-exist ]; then \\
userdel lfs; \\ userdel lfs; \\
rm -rf /home/lfs; \\ rm -rf /home/lfs; \\
fi; fi;
restart_code:
@echo ">>> This feature is experimental, BUGS may exist"
@if [ ! -L /tools ]; then \\
echo -e "\\nERROR::\\n /tools is NOT a symlink.. /tools must point to \$(MOUNT_PT)/tools\\n" && false;\\
fi;
@if [ ! -e /tools ]; then \\
echo -e "\\nERROR::\\nThe target /tools points to does not exist.\\nVerify the target.. \$(MOUNT_PT)/tools\\n" && false;\\
fi;
@if ! stat -c %N /tools | grep "\$(MOUNT_PT)/tools" >/dev/null ; then \\
echo -e "\\nERROR::\\nThe symlink \\"/tools\\" does not point to \\"\$(MOUNT_PT)/tools\\".\\nCorrect the problem and rerun\\n" && false;\\
fi;
@if [ -f ???-kernfs ]; then \\
mkdir -pv \$(MOUNT_PT)/{dev,proc,sys};\\
if [ ! -e \$(MOUNT_PT)/dev/console ]; then \\
mknod -m 600 \$(MOUNT_PT)/dev/console c 5 1;\\
fi;\\
if [ ! -e \$(MOUNT_PT)/dev/null ]; then \\
mknod -m 666 \$(MOUNT_PT)/dev/null c 1 3;\\
fi;\\
if ! mount -l | grep bind >/dev/null ; then \\
mount --bind /dev \$(MOUNT_PT)/dev;\\
fi;\\
if ! mount -l | grep "\$(MOUNT_PT)/dev/pts" >/dev/null ; then \\
mount -vt devpts devpts \$(MOUNT_PT)/dev/pts;\\
fi;\\
if ! mount -l | grep "\$(MOUNT_PT)/dev/shm" >/dev/null ; then \\
mount -vt tmpfs shm \$(MOUNT_PT)/dev/shm;\\
fi;\\
if ! mount -l | grep "\$(MOUNT_PT)/proc" >/dev/null ; then \\
mount -vt proc proc \$(MOUNT_PT)/proc;\\
fi;\\
if ! mount -l | grep "$\(MOUNT_PT)/sys" >/dev/null ; then \\
mount -vt sysfs sysfs \$(MOUNT_PT)/sys;\\
fi;\\
fi;
EOF EOF
) >> $MKFILE ) >> $MKFILE

View file

@ -218,8 +218,8 @@ cat << EOF
ROOT=\`tar -tf \$\$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\ ROOT=\`tar -tf \$\$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\
[[ -n \$\$ROOT ]] && \\ [[ -n \$\$ROOT ]] && \\
rm -rf \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\ rm -rf \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
if [ -e \$(MOUNT_PT)\$(SRC)/${PKG_NAME%%-*}-build ]; then \\ if [ -e \$(MOUNT_PT)\$(SRC)/${PKG_NAME%-*}-build ]; then \\
rm -rf \$(MOUNT_PT)\$(SRC)/${PKG_NAME%%-*}-build; \\ rm -rf \$(MOUNT_PT)\$(SRC)/${PKG_NAME%-*}-build; \\
fi; fi;
EOF EOF
) >> $MKFILE.tmp ) >> $MKFILE.tmp
@ -235,8 +235,8 @@ cat << EOF
ROOT=\`tar -tf \$\$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\ ROOT=\`tar -tf \$\$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\
[[ -n \$\$ROOT ]] && \\ [[ -n \$\$ROOT ]] && \\
rm -rf \$(SRC)/\$\$ROOT && \\ rm -rf \$(SRC)/\$\$ROOT && \\
if [ -e \$(SRC)/${PKG_NAME%%-*}-build ]; then \\ if [ -e \$(SRC)/${PKG_NAME%-*}-build ]; then \\
rm -rf \$(SRC)/${PKG_NAME%%-*}-build; \\ rm -rf \$(SRC)/${PKG_NAME%-*}-build; \\
fi; fi;
EOF EOF
) >> $MKFILE.tmp ) >> $MKFILE.tmp
@ -464,6 +464,20 @@ EOF
} }
#----------------------------------#
wrt_touch() { #
#----------------------------------#
(
cat << EOF
@touch \$@ && \\
sleep .25 && \\
echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
EOF
) >> $MKFILE.tmp
}
#----------------------------------# #----------------------------------#
wrt_report() { # wrt_report() { #
#----------------------------------# #----------------------------------#

View file

@ -101,7 +101,7 @@ wrt_do_farce_work() { #
} }
#----------------------------------# #----------------------------------#
wrt_logs() { # wrt_logs() { #
#----------------------------------# #----------------------------------#
local ITERATION=iteration-$1 local ITERATION=iteration-$1
@ -111,7 +111,9 @@ wrt_logs() { #
mkdir $ITERATION && \\ mkdir $ITERATION && \\
mv ${LOGS} $ITERATION && \\ mv ${LOGS} $ITERATION && \\
popd 1> /dev/null popd 1> /dev/null
@touch \$@ @touch \$@ && \\
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
EOF EOF
) >> $MKFILE.tmp ) >> $MKFILE.tmp
} }

View file

@ -12,7 +12,7 @@ define echo_message
@echo $(BOLD) @echo $(BOLD)
@echo -------------------------------------------------------------------------------- @echo --------------------------------------------------------------------------------
@echo $(BOLD)$(1) target $(BLUE)$@$(BOLD) @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)
@echo --------------------------------------------------------------------------------$(WHITE) @echo $(WHITE)
endef endef
define unpack define unpack
@ -56,16 +56,22 @@ define echo_finished
@echo -e \\tin the section -Entering the Chroot Environment- @echo -e \\tin the section -Entering the Chroot Environment-
@echo -e \\texcept if building CLFS with METHOO=boot. @echo -e \\texcept if building CLFS with METHOO=boot.
@echo @echo
@echo -e \\t- Set a password for the root user @echo -e \\t- Set a password for the root user.
@echo @echo
@echo -e \\t- Edit /etc/fstab, /etc/hosts, /etc/sysconfig/clock, @echo -e \\t- Edit /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
@echo -e \\t/etc/sysconfig/console, /etc/sysconfig/network, @echo -e \\t/etc/sysconfig/console, /etc/sysconfig/network,
@echo -e \\t/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and @echo -e \\t/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
@echo -e \\tany other configuration file required to suit your needs. @echo -e \\tany other configuration file required to suit your needs.
@echo @echo
@echo -e \\t- Set-up the boot loader. See the relevant book section. @echo -e \\t- Exit from the chroot.
@echo @echo
@echo -e \\t- Unmount the filesystems. @echo -e \\t- Set-up the boot loader, except if building CLFS with METHOO=boot.
@echo -e \\tYou can set-up the host bootloader or the new boot-loader
@echo -e \\tinstalled on the new system.
@echo -e \\tIf the last, you must to mount the virtual filesystems, re-enter
@echo -e \\tto the chroot and be sure that /dev is populated with the
@echo -e \\trequired devices before configure the boot-loader. When ready,
@echo -e \\texit from the chroot and umount the filesystems
@echo @echo
@echo If you are an experienced LFS user, several of those steps can be @echo If you are an experienced LFS user, several of those steps can be
@echo skipped or done in a different way. But then, that is something @echo skipped or done in a different way. But then, that is something

View file

@ -4,12 +4,57 @@
set -e set -e
# Be sure that we know the taget name
[[ -z $1 ]] && exit [[ -z $1 ]] && exit
TARGET=$1 # Remember the target build we are looking for
if [ ! -f $1 ] ; then declare -r CSI=$'\e[' # DEC terminology, Control Sequence Introducer
while fuser -v . 2>&1 | grep make >/dev/null ; do declare -r CURSOR_OFF=${CSI}$'?25l'
echo -n "." declare -r CURSOR_ON=${CSI}$'?25h'
sleep 1 declare -r ERASE_LINE=${CSI}$'2K'
[[ -f $1 ]] && exit declare -r FRAME_OPEN=${CSI}$'2G['
done declare -r FRAME_CLOSE=${CSI}$'63G]'
fi declare -r TS_POSITION=${CSI}$'65G'
declare -a RESET_LINE=${CURSOR_OFF}${ERASE_LINE}${FRAME_OPEN}${FRAME_CLOSE}
declare -a GRAPHIC_STR="| / - \\ + "
declare -i SEC=0 # Seconds accumulator
declare -i PREV_SEC=0
write_or_exit() {
# make has been killed or failed or run to completion, leave
if ! fuser -v . 2>&1 | grep make >/dev/null ; then
echo -n "${CURSOR_ON}" && exit
fi
# Target build complete, leave.
[[ -f ${TARGET} ]] && echo -n "${CURSOR_ON}" && exit
# It is safe to write to the screen
echo -n "$1"
}
# initialize screen
write_or_exit "${RESET_LINE}${TS_POSITION}0 min. 0 sec. "
# loop forever..
while true ; do
# Loop through the animation string
for GRAPHIC_CHAR in ${GRAPHIC_STR} ; do
write_or_exit "${CSI}$((SEC + 3))G${GRAPHIC_CHAR}"
sleep .12 # This value MUST be less than .2 seconds.
done
# A BASH internal variable, the number of seconds the script
# has been running. modulo convert to 0-59
SEC=$(($SECONDS % 60))
# Detect rollover of the seconds.
(( PREV_SEC > SEC )) && write_or_exit "${RESET_LINE}"
(( PREV_SEC = SEC ))
# Display the accumulated time. div minutes.. modulo seconds.
write_or_exit "${TS_POSITION}$(($SECONDS / 60)) min. $SEC sec. "
done
exit