Ported CUSTOM_TOOLS support to all books.

This commit is contained in:
Manuel Canales Esparcia 2006-12-15 10:53:10 +00:00
parent 830f28d18c
commit 3e7ceed256
15 changed files with 254 additions and 175 deletions

View file

@ -731,6 +731,8 @@ set -e
bootscripts_Makefiles # mk_BOOTSCRIPT (CHROOT) $bootscripttools bootscripts_Makefiles # mk_BOOTSCRIPT (CHROOT) $bootscripttools
bootable_Makefiles # mk_BOOTABLE (CHROOT) $bootabletools bootable_Makefiles # mk_BOOTABLE (CHROOT) $bootabletools
# Add the CUSTOM_TOOLS targets, if needed
[[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
# Add the BLFS_TOOL targets, if needed # Add the BLFS_TOOL targets, if needed
[[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets [[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
@ -764,7 +766,7 @@ if [[ "${METHOD}" = "chroot" ]]; then
( (
cat << EOF cat << EOF
all: ck_UID mk_SETUP mk_CROSS mk_SUDO mk_SYSTOOLS create-sbu_du-report mk_BLFS_TOOL all: ck_UID mk_SETUP mk_CROSS mk_SUDO mk_SYSTOOLS create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL
@sudo make do-housekeeping @sudo make do-housekeeping
@echo "$VERSION - jhalfs build" > clfs-release && \\ @echo "$VERSION - jhalfs build" > clfs-release && \\
sudo mv clfs-release \$(MOUNT_PT)/etc sudo mv clfs-release \$(MOUNT_PT)/etc
@ -815,9 +817,19 @@ mk_SYSTOOLS: mk_SUDO
@( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT_JAIL") @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT_JAIL")
@touch \$@ @touch \$@
mk_BLFS_TOOL: create-sbu_du-report mk_CUSTOM_TOOLS: create-sbu_du-report
@\$(call echo_PHASE,Building BLFS-TOOLS) @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
\$(call echo_PHASE,Building CUSTOM_TOOLS); \\
\$(call echo_CHROOT_request); \\
sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
(sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CUSTOM_TOOLS"); \\
fi;
@touch \$@
mk_BLFS_TOOL: mk_CUSTOM_TOOLS
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\ @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call echo_PHASE,Building BLFS_TOOL); \\
\$(call echo_CHROOT_request); \\
sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\ sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"; \\ sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"; \\
fi; fi;
@ -827,6 +839,7 @@ SETUP: $host_prep
AS_LUSER: $cross_tools $temptools AS_LUSER: $cross_tools $temptools
SUDO: $orphan_scripts SUDO: $orphan_scripts
CHROOT_JAIL: ${chroottools} $testsuitetools $basicsystem $bootscripttools $bootabletools CHROOT_JAIL: ${chroottools} $testsuitetools $basicsystem $bootscripttools $bootabletools
CUSTOM_TOOLS: $custom_list
BLFS_TOOL: $blfs_tool BLFS_TOOL: $blfs_tool
@ -866,7 +879,7 @@ all: ck_UID mk_SETUP mk_CROSS mk_SUDO
@sudo make do-housekeeping @sudo make do-housekeeping
@\$(call echo_boot_finished,$VERSION) @\$(call echo_boot_finished,$VERSION)
makesys: mk_FINAL mk_BLFS_TOOL makesys: mk_FINAL mk_CUSTOM_TOOLS mk_BLFS_TOOL
@echo "$VERSION - jhalfs build" > /etc/clfs-release @echo "$VERSION - jhalfs build" > /etc/clfs-release
@\$(call echo_finished,$VERSION) @\$(call echo_finished,$VERSION)
@ -908,11 +921,19 @@ mk_FINAL:
@( source /root/.bash_profile && make AS_ROOT ) @( source /root/.bash_profile && make AS_ROOT )
@touch \$@ @touch \$@
mk_BLFS_TOOL: mk_FINAL mk_CUSTOM_TOOLS: mk_FINAL
@\$(call echo_PHASE,Building BLFS-TOOLS) @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
mkdir -p ${TRACKING_DIR}; \\
\$(call echo_PHASE,Building CUSTOM_TOOLS); \\
( source /root/.bash_profile && make CUSTOM_TOOLS"); \\
fi;
@touch \$@
mk_BLFS_TOOL: mk_CUSTOM_TOOLS
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\ @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
mkdir -p $TRACKING_DIR; \\ mkdir -p $TRACKING_DIR; \\
( make BLFS_TOOL ); \\ \$(call echo_PHASE,Building BLFS_TOOL); \\
( source /root/.bash_profile && make BLFS_TOOL ); \\
fi fi
@touch \$@ @touch \$@
@ -920,6 +941,7 @@ SETUP: $host_prep
AS_LUSER: $cross_tools $temptools ${boottools} AS_LUSER: $cross_tools $temptools ${boottools}
SUDO: $orphan_scripts SUDO: $orphan_scripts
AS_ROOT: $testsuitetools $basicsystem $bootscripttools $bootabletools AS_ROOT: $testsuitetools $basicsystem $bootscripttools $bootabletools
CUSTOM_TOOLS: $custom_list
BLFS_TOOL: $blfs_tool BLFS_TOOL: $blfs_tool
do-housekeeping: do-housekeeping:

View file

@ -408,9 +408,10 @@ build_Makefile() { # Construct a Makefile from the book scripts
final_system_Makefiles # $basicsystem final_system_Makefiles # $basicsystem
bootscripts_Makefiles # $bootscripttools bootscripts_Makefiles # $bootscripttools
bootable_Makefiles # $bootable bootable_Makefiles # $bootable
# Add the BLFS_TOOL targets, if needed. Clean PREV to prevent that # Add the CUSTOM_TOOLS targets, if needed
# the first dependency script will depend on *-chowning [[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
[[ "$BLFS_TOOL" = "y" ]] && PREV="" && wrt_blfs_tool_targets # Add the BLFS_TOOL targets, if needed.
[[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
# Add a header, some variables and include the function file # Add a header, some variables and include the function file
# to the top of the real Makefile. # to the top of the real Makefile.
@ -421,7 +422,7 @@ build_Makefile() { # Construct a Makefile from the book scripts
( (
cat << EOF cat << EOF
all: ck_UID mk_SETUP mk_LUSER create-sbu_du-report mk_BLFS_TOOL mk_ROOT all: ck_UID mk_SETUP mk_LUSER create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL mk_ROOT
@sudo make restore-luser-env @sudo make restore-luser-env
@sudo make do-housekeeping @sudo make do-housekeeping
@\$(call echo_finished,$VERSION) @\$(call echo_finished,$VERSION)
@ -444,15 +445,26 @@ mk_LUSER: mk_SETUP
@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SHELL=/bin/bash LUSER" ) @(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SHELL=/bin/bash LUSER" )
@touch \$@ @touch \$@
mk_BLFS_TOOL: create-sbu_du-report mk_CUSTOM_TOOLS: create-sbu_du-report
@\$(call echo_PHASE,Building BLFS-TOOLS)
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\ @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call echo_PHASE,Building CUSTOM_TOOLS); \\
\$(call echo_SULUSER_request); \\
(sudo \$(SU_LUSER) "mkdir -p $BUILDDIR$TRACKING_DIR"); \\
(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SHELL=/bin/bash CUSTOM_TOOLS"); \\
fi;
@touch \$@
mk_BLFS_TOOL: mk_CUSTOM_TOOLS
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call echo_PHASE,Building BLFS_TOOL); \\
\$(call echo_SULUSER_request); \\
(sudo \$(SU_LUSER) "mkdir -p $BUILDDIR$TRACKING_DIR"); \\ (sudo \$(SU_LUSER) "mkdir -p $BUILDDIR$TRACKING_DIR"); \\
(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SHELL=/bin/bash BLFS_TOOL"); \\ (sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SHELL=/bin/bash BLFS_TOOL"); \\
fi; fi;
@touch \$@ @touch \$@
mk_ROOT: mk_ROOT: mk_BLFS_TOOL
@\$(call echo_SU_request)
@echo "$VERSION-sysroot - jhalfs build" > clfs-release && \\ @echo "$VERSION-sysroot - jhalfs build" > clfs-release && \\
sudo mv clfs-release \$(MOUNT_PT)/etc sudo mv clfs-release \$(MOUNT_PT)/etc
@sudo make SHELL=/bin/bash ROOT @sudo make SHELL=/bin/bash ROOT
@ -460,6 +472,7 @@ mk_ROOT:
SETUP: $host_prep SETUP: $host_prep
LUSER: $cross_tools $basicsystem $bootscripttools $bootable LUSER: $cross_tools $basicsystem $bootscripttools $bootable
CUSTOM_TOOLS: $custom_list
BLFS_TOOL: $blfs_tool BLFS_TOOL: $blfs_tool
ROOT: $chowning ROOT: $chowning

View file

@ -411,6 +411,8 @@ build_Makefile() { # Construct a Makefile from the book scripts
final_system_Makefiles # $basicsystem final_system_Makefiles # $basicsystem
bootscripts_Makefiles # $bootscripttools bootscripts_Makefiles # $bootscripttools
bootable_Makefiles # $bootable bootable_Makefiles # $bootable
# Add the CUSTOM_TOOLS targets, if needed
[[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
# Add a header, some variables and include the function file # Add a header, some variables and include the function file
# to the top of the real Makefile. # to the top of the real Makefile.
@ -421,7 +423,7 @@ build_Makefile() { # Construct a Makefile from the book scripts
( (
cat << EOF cat << EOF
all: ck_UID mk_SETUP mk_LUSER create-sbu_du-report mk_ROOT all: ck_UID mk_SETUP mk_LUSER create-sbu_du-report mk_CUSTOM_TOOLS mk_ROOT
@sudo make restore-luser-env @sudo make restore-luser-env
@sudo make do-housekeeping @sudo make do-housekeeping
@\$(call echo_finished,$VERSION) @\$(call echo_finished,$VERSION)
@ -444,7 +446,17 @@ mk_LUSER: mk_SETUP
@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SHELL=/bin/bash LUSER" ) @(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SHELL=/bin/bash LUSER" )
@touch \$@ @touch \$@
mk_ROOT: mk_CUSTOM_TOOLS: create-sbu_du-report
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call echo_PHASE,Building CUSTOM_TOOLS); \\
\$(call echo_SULUSER_request); \\
(sudo \$(SU_LUSER) "mkdir -p $BUILDDIR$TRACKING_DIR"); \\
(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SHELL=/bin/bash CUSTOM_TOOLS"); \\
fi;
@touch \$@
mk_ROOT: mk_CUSTOM_TOOLS
@\$(call echo_SU_request)
@echo "$VERSION-embedded - jhalfs build" > clfs-release && \\ @echo "$VERSION-embedded - jhalfs build" > clfs-release && \\
sudo mv clfs-release \$(MOUNT_PT)/etc sudo mv clfs-release \$(MOUNT_PT)/etc
@sudo make SHELL=/bin/bash ROOT @sudo make SHELL=/bin/bash ROOT
@ -453,6 +465,7 @@ mk_ROOT:
SETUP: $host_prep SETUP: $host_prep
LUSER: $cross_tools $basicsystem $bootscripttools $bootable LUSER: $cross_tools $basicsystem $bootscripttools $bootable
CUSTOM_TOOLS: $custom_list
ROOT: $chowning ROOT: $chowning

View file

@ -316,12 +316,12 @@ menu "--- BOOK Settings"
#--- Custom Tools support #--- Custom Tools support
config CUSTOM_TOOLS config CUSTOM_TOOLS
bool "Add custom tool support" bool "Add custom tools support"
default n default n
depends on BOOK_LFS depends on !BOOK_BLFS
help help
#--- Activating this option additional packages you create #--- Activating this option additional packages you create
# will be installed. # will be installed after finished the xLFS system build.
# #
#--- End Custom Tools support #--- End Custom Tools support

View file

@ -494,6 +494,10 @@ build_Makefile() { # Construct a Makefile from the book scripts
# Add the iterations targets, if needed # Add the iterations targets, if needed
[[ "$COMPARE" = "y" ]] && wrt_compare_targets [[ "$COMPARE" = "y" ]] && wrt_compare_targets
chapter7_Makefiles chapter7_Makefiles
# Add the CUSTOM_TOOLS targets, if needed
[[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
# Add the BLFS_TOOL targets, if needed
[[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
# Add a header, some variables and include the function file # Add a header, some variables and include the function file
# to the top of the real Makefile. # to the top of the real Makefile.
@ -526,7 +530,7 @@ build_Makefile() { # Construct a Makefile from the book scripts
( (
cat << EOF cat << EOF
all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_BLFS_TOOL all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL
@sudo make do-housekeeping @sudo make do-housekeeping
@echo "$VERSION - jhalfs build" > hlfs-release && \\ @echo "$VERSION - jhalfs build" > hlfs-release && \\
sudo install -m444 hlfs-release \$(MOUNT_PT)/etc/hlfs-release sudo install -m444 hlfs-release \$(MOUNT_PT)/etc/hlfs-release
@ -578,11 +582,21 @@ mk_BOOT: mk_CHROOT
@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BOOT") @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BOOT")
@touch \$@ @touch \$@
mk_BLFS_TOOL: create-sbu_du-report mk_CUSTOM_TOOLS: create-sbu_du-report
@\$(call echo_PHASE,Building BLFS-TOOLS) @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
\$(call echo_PHASE,Building CUSTOM_TOOLS); \\
\$(call echo_CHROOT_request); \\
sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
(sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make CUSTOM_TOOLS"); \\
fi;
@touch \$@
mk_BLFS_TOOL: mk_CUSTOM_TOOLS
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\ @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call echo_PHASE,Building BLFS_TOOL); \\
\$(call echo_CHROOT_request); \\
sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\ sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"; \\ (sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"); \\
fi; fi;
@touch \$@ @touch \$@
@ -592,6 +606,7 @@ LUSER: $chapter5
SUDO: $runasroot SUDO: $runasroot
CHROOT: $chapter6 CHROOT: $chapter6
BOOT: $chapter7 BOOT: $chapter7
CUSTOM_TOOLS: $custom_list
BLFS_TOOL: $blfs_tool BLFS_TOOL: $blfs_tool

View file

@ -374,6 +374,8 @@ build_Makefile() { #
# Add the iterations targets, if needed # Add the iterations targets, if needed
[[ "$COMPARE" = "y" ]] && wrt_compare_targets [[ "$COMPARE" = "y" ]] && wrt_compare_targets
chapter78_Makefiles chapter78_Makefiles
# Add the CUSTOM_TOOLS targets, if needed
[[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
# Add the BLFS_TOOL targets, if needed # Add the BLFS_TOOL targets, if needed
[[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets [[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
@ -406,7 +408,7 @@ build_Makefile() { #
( (
cat << EOF cat << EOF
all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_BLFS_TOOL all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL
@sudo make do_housekeeping @sudo make do_housekeeping
@echo "$VERSION - jhalfs build" > lfs-release && \\ @echo "$VERSION - jhalfs build" > lfs-release && \\
sudo mv lfs-release \$(MOUNT_PT)/etc sudo mv lfs-release \$(MOUNT_PT)/etc
@ -458,11 +460,21 @@ mk_BOOT: mk_CHROOT
@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BOOT") @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BOOT")
@touch \$@ @touch \$@
mk_BLFS_TOOL: create-sbu_du-report mk_CUSTOM_TOOLS: create-sbu_du-report
@\$(call echo_PHASE,Building BLFS-TOOLS) @if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
\$(call echo_PHASE,Building CUSTOM_TOOLS); \\
\$(call echo_CHROOT_request); \\
sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
(sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make CUSTOM_TOOLS"); \\
fi;
@touch \$@
mk_BLFS_TOOL: mk_CUSTOM_TOOLS
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\ @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call echo_PHASE,Building BLFS_TOOL); \\
\$(call echo_CHROOT_request); \\
sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\ sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"; \\ (sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"); \\
fi; fi;
@touch \$@ @touch \$@
@ -472,6 +484,7 @@ LUSER: $chapter5
SUDO: $runasroot SUDO: $runasroot
CHROOT: $chapter6 CHROOT: $chapter6
BOOT: $chapter78 BOOT: $chapter78
CUSTOM_TOOLS: $custom_list
BLFS_TOOL: $blfs_tool BLFS_TOOL: $blfs_tool

3
README
View file

@ -24,6 +24,9 @@ $Id$
configuration of the uClibc package when building a HLFS system using configuration of the uClibc package when building a HLFS system using
uClibc rather than glibc. uClibc rather than glibc.
*. Read carefully this file and the other README.* files before start
using the tool.
2. PREREQUISITES:: 2. PREREQUISITES::
To use this tool you MUST: To use this tool you MUST:

29
README.CLFS Normal file
View file

@ -0,0 +1,29 @@
# $Id$
CLFS-1.x NOTES
None for now.
CLFS SYSROOT METHOD NOTES
None for now.
CLFS EMBEDDED SYSTEMS NOTES
.- To install CBLFS packages you must to use the "Add custom tools support"
feature. To learn how it works and how to use it, see the section titled
"Adding Post-System Build Configuration Files and Extra Packages"
found in README.CUSTOM. That is also applicable to bootloaders installation.
.- If your target is a MIPS wireless router, you must to use the "Rebuild
Makefile" feature to install wireless tools. To learn how it works and how
to use it, see the section titled "Base System Customization" found in
README.CUSTOM
.- The backup & clean-up phases aren't run. This is to allow users to
review the installed files and do a more in-deeper clan-up before creating
the system tarball.

View file

@ -147,12 +147,6 @@ configuration file which enables/disables the inclusion of personal scripts.
file and NOT in the package script. The gpm script is included as an file and NOT in the package script. The gpm script is included as an
example of multiple patch files and the need for a blfs bootscript. example of multiple patch files and the need for a blfs bootscript.
RUNNING:::
Although your scripts are added to the generated makefile they are not
automatically built. You must tell the makefile to build the tools with
the cmd
make mk_CUSTOM_TOOLS
#--------- GLIB example ----------- #--------- GLIB example -----------

View file

@ -117,6 +117,7 @@ copy_blfs_deps_scripts() { # method avoid to place the test on all
#----------------------------------# #----------------------------------#
wrt_blfs_tool_targets() { # wrt_blfs_tool_targets() { #
#----------------------------------# #----------------------------------#
PREV=""
echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}" echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"

View file

@ -3,53 +3,38 @@
# $Id$ # $Id$
#----------------------------------# #----------------------------------#
add_CustomTools() { # Add any users supplied scripts wrt_CustomTools_target() { # Add any users supplied scripts
#----------------------------------# #----------------------------------#
PREV_SCRIPT="" PREV=""
CUSTOM_LIST=""
echo "Adding custom packages... ${BOLD}START${OFF}" echo " Adding custom packages... ${BOLD}START${OFF}"
cd $JHALFSDIR # Create the custom_tools scripts directory
> ${MKFILE}.tmp2 mkdir -p custom-tools
# First some build commands and a placeholder for the build list. for file in $JHALFSDIR/custom-commands/*; do
# This will not cause problems if there are no custom scripts. if [[ `basename ${file}` = "*" ]]; then
( cat << xEOFx
mk_CUSTOM_TOOLS:
@\$(call echo_CHROOT_request)
@ sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}
@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make CUSTOM_TOOLS")
@touch \$@
CUSTOM_TOOLS:
xEOFx
) >> ${MKFILE}.tmp2
for this_script in custom-commands/config/*; do
if [[ `basename ${this_script}` = "*" ]]; then
break break
fi fi
source $this_script source $file
THIS_SCRIPT=$(basename ${this_script}) this_script=$(basename ${file})
echo "$tab_${GREEN}Adding${OFF} ${THIS_SCRIPT}" echo "$tab_${GREEN}Adding${OFF} ${this_script}"
# Create a Makefile entry # Create a Makefile entry
if [[ "x${PKG}" = "x" ]]; then if [[ "x${PKG}" = "x" ]]; then
# Create an entry for a self contained cmd script that does not reference a package tarball # Create an entry for a self contained cmd script that does not
( cat << EOF # reference a package tarball
case $PROGNAME in
${THIS_SCRIPT}: ${PREV_SCRIPT} clfs2 | clfs3 )
@\$(call echo_message, Building) LUSER_wrt_target "${this_script}" "$PREV"
@./progress_bar.sh \$@ \$\$PPID & LUSER_wrt_RunAsUser "custom-tools/${this_script}"
@( time { source envars && /\$(SCRIPT_ROOT)/custom-commands/scripts/${THIS_SCRIPT} >>logs/${THIS_SCRIPT} 2>&1 ; } ) 2>>logs/${THIS_SCRIPT} ;;
@touch \$@ *)
@\$(call housekeeping) CHROOT_wrt_target "${this_script}" "$PREV"
EOF CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
) >> ${MKFILE}.tmp2 ;;
esac
wrt_touch
# Create the build script file # Create the build script file
( cat <<- xEOFx ( cat <<- xEOFx
@ -59,25 +44,27 @@ set -e
`cat tmp` `cat tmp`
exit exit
xEOFx xEOFx
) > custom-commands/scripts/$THIS_SCRIPT ) > custom-tools/${this_script}
else else
# Create an entry for package # Create an entry for package
( cat << EOF case $PROGNAME in
clfs2 | clfs3 )
${THIS_SCRIPT}: ${PREV_SCRIPT} LUSER_wrt_target "${this_script}" "$PREV"
@\$(call echo_message, Building) LUSER_wrt_unpack "${PKG_FILE}"
@./progress_bar.sh \$@ \$\$PPID & LUSER_wrt_RunAsUser "custom-tools/${this_script}"
@\$(call remove_existing_dirs2,${PKG_FILE}) LUSER_RemoveBuildDirs "${PKG}"
@\$(call unpack2,${PKG_FILE}) echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${PKG}-${PKG_VERSION}" >> $MKFILE.tmp
@\$(call get_pkg_root2) ;;
@( time { source envars && /\$(SCRIPT_ROOT)/custom-commands/scripts/${THIS_SCRIPT} >>logs/${THIS_SCRIPT} 2>&1 ; } ) 2>>logs/${THIS_SCRIPT} *)
@\$(call remove_build_dirs2,${PKG}) CHROOT_wrt_target "${this_script}" "$PREV"
@touch \$@ CHROOT_Unpack "${PKG_FILE}"
@touch ${TRACKING_DIR}/${PKG}-${PKG_VERSION} CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
@\$(call housekeeping) CHROOT_wrt_RemoveBuildDirs "${PKG}"
EOF echo -e "\t@touch $TRACKING_DIR/${PKG}-${PKG_VERSION}" >> $MKFILE.tmp
) >> ${MKFILE}.tmp2 ;;
esac
wrt_touch
# Create the build script file # Create the build script file
( cat <<- xEOFx ( cat <<- xEOFx
@ -88,22 +75,19 @@ cd \$PKGDIR
`cat tmp` `cat tmp`
exit exit
xEOFx xEOFx
) > custom-commands/scripts/$THIS_SCRIPT ) > custom-tools/$this_script
fi fi
chmod 755 custom-commands/scripts/$THIS_SCRIPT
rm -f tmp rm -f tmp
PREV_SCRIPT=$THIS_SCRIPT PREV=$this_script
CUSTOM_LIST="${CUSTOM_LIST}${THIS_SCRIPT} " custom_list="${custom_list} ${this_script}"
done done
# Add the dependancy list. # Make the scripts executable.
sed "s|^CUSTOM_TOOLS:|CUSTOM_TOOLS: ${CUSTOM_LIST}|" -i ${MKFILE}.tmp2 chmod +x custom-tools/*
cat ${MKFILE}.tmp2 >> ${MKFILE}
rm ${MKFILE}.tmp2
echo "Adding custom packages... ${BOLD}DONE${OFF}"
}
echo " Adding custom packages... ${BOLD}DONE${OFF}"
}
#----------------------------------# #----------------------------------#
@ -114,7 +98,7 @@ add_CustomToolsURLS() { # Add any users supplied scripts URL informat
local URL PKG PKG_VERSION PKG_FILE MD5 local URL PKG PKG_VERSION PKG_FILE MD5
> urls.lst.tmp > urls.lst.tmp
for this_script in $JHALFSDIR/custom-commands/config/*; do for this_script in $JHALFSDIR/custom-commands/*; do
if [[ `basename ${this_script}` = "*" ]]; then if [[ `basename ${this_script}` = "*" ]]; then
CUSTOM_TOOLS="n" CUSTOM_TOOLS="n"
break break

View file

@ -20,10 +20,10 @@ validate_config() { # Are the config values sane (within reason)
inline_doc inline_doc
# First internal variables, then the ones that change the book's flavour, and lastly system configuration variables # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL REBUILD_MAKEFILE" local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TARGET32 TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL REBUILD_MAKEFILE" local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TARGET32 TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET REPORT STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL REBUILD_MAKEFILE" local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET REPORT STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
local -r clfs3_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET MIPS_LEVEL REPORT STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP REBUILD_MAKEFILE" local -r clfs3_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET MIPS_LEVEL REPORT STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP CUSTOM_TOOLS REBUILD_MAKEFILE"
local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE" local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
local -r blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR" local -r blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"

View file

@ -38,6 +38,7 @@ PRT_DU = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lo
PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found / \`\n" PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found / \`\n"
ADD_REPORT = $REPORT ADD_REPORT = $REPORT
ADD_CUSTOM_TOOLS = $CUSTOM_TOOLS
ADD_BLFS_TOOLS = $BLFS_TOOL ADD_BLFS_TOOLS = $BLFS_TOOL

View file

@ -18,7 +18,6 @@ nl_ = ""
#==== BUILD MESSAGES === #==== BUILD MESSAGES ===
define echo_PHASE define echo_PHASE
@clear
@echo $(BOLD)-------------------------------------------------------------------------------- @echo $(BOLD)--------------------------------------------------------------------------------
@echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts @echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts
@echo $(BOLD)-------------------------------------------------------------------------------- @echo $(BOLD)--------------------------------------------------------------------------------
@ -33,15 +32,13 @@ define echo_SU_request
endef endef
define echo_SULUSER_request define echo_SULUSER_request
@clear
@echo $(BOLD)-------------------------------------------------------------------------------- @echo $(BOLD)--------------------------------------------------------------------------------
@echo $(BOLD)$(BLUE)$@ @echo $(BOLD)$(BLUE)$@
@echo $(WHITE)You are going to log into the user account $(BOLD)$(YELLOW)$(LUSER)$(OFF) @echo $(WHITE)You are going to log into the user account $(BOLD)$(YELLOW)$(LUSER)$(OFF)
@echo su requires a password @echo sudo requires a password
endef endef
define echo_CHROOT_request define echo_CHROOT_request
@clear
@echo $(BOLD)-------------------------------------------------------------------------------- @echo $(BOLD)--------------------------------------------------------------------------------
@echo $(BOLD)$(BLUE)$@ @echo $(BOLD)$(BLUE)$@
@echo $(WHITE)You are going to CHROOT into $(MOUNT_PT) $(BOLD)$(YELLOW)$(LUSER)$(OFF) @echo $(WHITE)You are going to CHROOT into $(MOUNT_PT) $(BOLD)$(YELLOW)$(LUSER)$(OFF)

66
jhalfs
View file

@ -332,7 +332,7 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
if [[ ! -d $JHALFSDIR ]]; then if [[ ! -d $JHALFSDIR ]]; then
mkdir -p $JHALFSDIR mkdir -p $JHALFSDIR
fi fi
#
# Create $BUILDDIR/sources even though it could be created by get_sources() # Create $BUILDDIR/sources even though it could be created by get_sources()
if [[ ! -d $BUILDDIR/sources ]]; then if [[ ! -d $BUILDDIR/sources ]]; then
mkdir -p $BUILDDIR/sources mkdir -p $BUILDDIR/sources
@ -344,34 +344,21 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
fi fi
>$LOGDIR/$LOG >$LOGDIR/$LOG
# #
# Copy common helper files
cp $COMMON_DIR/{makefile-functions,progress_bar.sh,packages.xsl} $JHALFSDIR/
#
# Fix the XSL book parser
sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
export XSL=$JHALFSDIR/${XSL}
#
# Copy urls.xsl, if needed
[[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/
#
# Create the test-log directory, if needed
[[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR [[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR
# #
cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/ # Prepare report creation, if needed
#
[[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
#
if [[ "$COMPARE" = "y" ]]; then
mkdir -p $JHALFSDIR/extras
cp extras/* $JHALFSDIR/extras
fi
#
if [[ -n "$FILES" ]]; then
# pushd/popd necessary to deal with multiple files
pushd $PACKAGE_DIR 1> /dev/null
cp $FILES $JHALFSDIR/
popd 1> /dev/null
fi
#
if [[ "${PROGNAME}" = "lfs" ]]; then
if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
echo "Copying custom tool scripts to $JHALFSDIR"
mkdir -p $JHALFSDIR/custom-commands/config
mkdir -p $JHALFSDIR/custom-commands/scripts
cp -Rf custom/* $JHALFSDIR/custom-commands
fi
fi
#
if [[ "$REPORT" = "y" ]]; then if [[ "$REPORT" = "y" ]]; then
cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/ cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/
# After being sure that all looks sane, dump the settings to a file # After being sure that all looks sane, dump the settings to a file
@ -379,13 +366,23 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
validate_config > $JHALFSDIR/jhalfs.config validate_config > $JHALFSDIR/jhalfs.config
fi fi
# #
[[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/ # Copy optimize files, if needed
[[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
# #
cp $COMMON_DIR/packages.xsl $JHALFSDIR/ # Copy compare files, if needed
if [[ "$COMPARE" = "y" ]]; then
mkdir -p $JHALFSDIR/extras
cp extras/* $JHALFSDIR/extras
fi
# #
sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
export XSL=$JHALFSDIR/${XSL}
# Copy custom tools config files, if requested
if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
echo "Copying custom tool scripts to $JHALFSDIR"
mkdir -p $JHALFSDIR/custom-commands
cp -f custom/config/* $JHALFSDIR/custom-commands
fi
#
# Install blfs-tool, if requested. # Install blfs-tool, if requested.
if [[ "${BLFS_TOOL}" = "y" ]] ; then if [[ "${BLFS_TOOL}" = "y" ]] ; then
# Install the files # Install the files
@ -405,6 +402,7 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/ cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/
rm -rf $JHALFSDIR/blfs-tool-deps/.svn rm -rf $JHALFSDIR/blfs-tool-deps/.svn
fi fi
#
get_book get_book
echo "${SD_BORDER}${nl_}" echo "${SD_BORDER}${nl_}"
@ -437,11 +435,7 @@ if [[ "$REBUILD_MAKEFILE" = "y" ]] ; then
fi fi
build_Makefile build_Makefile
if [[ "${PROGNAME}" = "lfs" ]]; then
if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
add_CustomTools
fi
fi
echo "${SD_BORDER}${nl_}" echo "${SD_BORDER}${nl_}"
run_make run_make