Ported CUSTOM_TOOLS support to all books.
This commit is contained in:
parent
830f28d18c
commit
3e7ceed256
15 changed files with 254 additions and 175 deletions
|
@ -731,6 +731,8 @@ set -e
|
|||
bootscripts_Makefiles # mk_BOOTSCRIPT (CHROOT) $bootscripttools
|
||||
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
|
||||
[[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
|
||||
|
||||
|
@ -764,7 +766,7 @@ if [[ "${METHOD}" = "chroot" ]]; then
|
|||
(
|
||||
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
|
||||
@echo "$VERSION - jhalfs build" > clfs-release && \\
|
||||
sudo mv clfs-release \$(MOUNT_PT)/etc
|
||||
|
@ -815,9 +817,19 @@ mk_SYSTOOLS: mk_SUDO
|
|||
@( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT_JAIL")
|
||||
@touch \$@
|
||||
|
||||
mk_BLFS_TOOL: create-sbu_du-report
|
||||
@\$(call echo_PHASE,Building BLFS-TOOLS)
|
||||
mk_CUSTOM_TOOLS: create-sbu_du-report
|
||||
@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 \\
|
||||
\$(call echo_PHASE,Building BLFS_TOOL); \\
|
||||
\$(call echo_CHROOT_request); \\
|
||||
sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
|
||||
sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"; \\
|
||||
fi;
|
||||
|
@ -827,6 +839,7 @@ SETUP: $host_prep
|
|||
AS_LUSER: $cross_tools $temptools
|
||||
SUDO: $orphan_scripts
|
||||
CHROOT_JAIL: ${chroottools} $testsuitetools $basicsystem $bootscripttools $bootabletools
|
||||
CUSTOM_TOOLS: $custom_list
|
||||
BLFS_TOOL: $blfs_tool
|
||||
|
||||
|
||||
|
@ -866,7 +879,7 @@ all: ck_UID mk_SETUP mk_CROSS mk_SUDO
|
|||
@sudo make do-housekeeping
|
||||
@\$(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
|
||||
@\$(call echo_finished,$VERSION)
|
||||
|
||||
|
@ -908,11 +921,19 @@ mk_FINAL:
|
|||
@( source /root/.bash_profile && make AS_ROOT )
|
||||
@touch \$@
|
||||
|
||||
mk_BLFS_TOOL: mk_FINAL
|
||||
@\$(call echo_PHASE,Building BLFS-TOOLS)
|
||||
mk_CUSTOM_TOOLS: mk_FINAL
|
||||
@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 \\
|
||||
mkdir -p $TRACKING_DIR; \\
|
||||
( make BLFS_TOOL ); \\
|
||||
\$(call echo_PHASE,Building BLFS_TOOL); \\
|
||||
( source /root/.bash_profile && make BLFS_TOOL ); \\
|
||||
fi
|
||||
@touch \$@
|
||||
|
||||
|
@ -920,6 +941,7 @@ SETUP: $host_prep
|
|||
AS_LUSER: $cross_tools $temptools ${boottools}
|
||||
SUDO: $orphan_scripts
|
||||
AS_ROOT: $testsuitetools $basicsystem $bootscripttools $bootabletools
|
||||
CUSTOM_TOOLS: $custom_list
|
||||
BLFS_TOOL: $blfs_tool
|
||||
|
||||
do-housekeeping:
|
||||
|
|
|
@ -408,9 +408,10 @@ build_Makefile() { # Construct a Makefile from the book scripts
|
|||
final_system_Makefiles # $basicsystem
|
||||
bootscripts_Makefiles # $bootscripttools
|
||||
bootable_Makefiles # $bootable
|
||||
# Add the BLFS_TOOL targets, if needed. Clean PREV to prevent that
|
||||
# the first dependency script will depend on *-chowning
|
||||
[[ "$BLFS_TOOL" = "y" ]] && PREV="" && wrt_blfs_tool_targets
|
||||
# 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
|
||||
# to the top of the real Makefile.
|
||||
|
@ -421,7 +422,7 @@ build_Makefile() { # Construct a Makefile from the book scripts
|
|||
(
|
||||
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 do-housekeeping
|
||||
@\$(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" )
|
||||
@touch \$@
|
||||
|
||||
mk_BLFS_TOOL: create-sbu_du-report
|
||||
@\$(call echo_PHASE,Building BLFS-TOOLS)
|
||||
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_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) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SHELL=/bin/bash BLFS_TOOL"); \\
|
||||
fi;
|
||||
@touch \$@
|
||||
|
||||
mk_ROOT:
|
||||
mk_ROOT: mk_BLFS_TOOL
|
||||
@\$(call echo_SU_request)
|
||||
@echo "$VERSION-sysroot - jhalfs build" > clfs-release && \\
|
||||
sudo mv clfs-release \$(MOUNT_PT)/etc
|
||||
@sudo make SHELL=/bin/bash ROOT
|
||||
|
@ -460,6 +472,7 @@ mk_ROOT:
|
|||
|
||||
SETUP: $host_prep
|
||||
LUSER: $cross_tools $basicsystem $bootscripttools $bootable
|
||||
CUSTOM_TOOLS: $custom_list
|
||||
BLFS_TOOL: $blfs_tool
|
||||
ROOT: $chowning
|
||||
|
||||
|
|
|
@ -411,6 +411,8 @@ build_Makefile() { # Construct a Makefile from the book scripts
|
|||
final_system_Makefiles # $basicsystem
|
||||
bootscripts_Makefiles # $bootscripttools
|
||||
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
|
||||
# to the top of the real Makefile.
|
||||
|
@ -421,7 +423,7 @@ build_Makefile() { # Construct a Makefile from the book scripts
|
|||
(
|
||||
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 do-housekeeping
|
||||
@\$(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" )
|
||||
@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 && \\
|
||||
sudo mv clfs-release \$(MOUNT_PT)/etc
|
||||
@sudo make SHELL=/bin/bash ROOT
|
||||
|
@ -453,6 +465,7 @@ mk_ROOT:
|
|||
|
||||
SETUP: $host_prep
|
||||
LUSER: $cross_tools $basicsystem $bootscripttools $bootable
|
||||
CUSTOM_TOOLS: $custom_list
|
||||
ROOT: $chowning
|
||||
|
||||
|
||||
|
|
|
@ -316,12 +316,12 @@ menu "--- BOOK Settings"
|
|||
|
||||
#--- Custom Tools support
|
||||
config CUSTOM_TOOLS
|
||||
bool "Add custom tool support"
|
||||
bool "Add custom tools support"
|
||||
default n
|
||||
depends on BOOK_LFS
|
||||
depends on !BOOK_BLFS
|
||||
help
|
||||
#--- Activating this option additional packages you create
|
||||
# will be installed.
|
||||
# will be installed after finished the xLFS system build.
|
||||
#
|
||||
#--- End Custom Tools support
|
||||
|
||||
|
|
|
@ -494,6 +494,10 @@ build_Makefile() { # Construct a Makefile from the book scripts
|
|||
# Add the iterations targets, if needed
|
||||
[[ "$COMPARE" = "y" ]] && wrt_compare_targets
|
||||
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
|
||||
# to the top of the real Makefile.
|
||||
|
@ -526,7 +530,7 @@ build_Makefile() { # Construct a Makefile from the book scripts
|
|||
(
|
||||
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
|
||||
@echo "$VERSION - jhalfs build" > 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")
|
||||
@touch \$@
|
||||
|
||||
mk_BLFS_TOOL: create-sbu_du-report
|
||||
@\$(call echo_PHASE,Building BLFS-TOOLS)
|
||||
mk_CUSTOM_TOOLS: create-sbu_du-report
|
||||
@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 \\
|
||||
\$(call echo_PHASE,Building BLFS_TOOL); \\
|
||||
\$(call echo_CHROOT_request); \\
|
||||
sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
|
||||
sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"; \\
|
||||
(sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"); \\
|
||||
fi;
|
||||
@touch \$@
|
||||
|
||||
|
@ -592,6 +606,7 @@ LUSER: $chapter5
|
|||
SUDO: $runasroot
|
||||
CHROOT: $chapter6
|
||||
BOOT: $chapter7
|
||||
CUSTOM_TOOLS: $custom_list
|
||||
BLFS_TOOL: $blfs_tool
|
||||
|
||||
|
||||
|
|
|
@ -374,6 +374,8 @@ build_Makefile() { #
|
|||
# Add the iterations targets, if needed
|
||||
[[ "$COMPARE" = "y" ]] && wrt_compare_targets
|
||||
chapter78_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
|
||||
|
||||
|
@ -406,7 +408,7 @@ build_Makefile() { #
|
|||
(
|
||||
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
|
||||
@echo "$VERSION - jhalfs build" > lfs-release && \\
|
||||
sudo mv lfs-release \$(MOUNT_PT)/etc
|
||||
|
@ -458,11 +460,21 @@ mk_BOOT: mk_CHROOT
|
|||
@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BOOT")
|
||||
@touch \$@
|
||||
|
||||
mk_BLFS_TOOL: create-sbu_du-report
|
||||
@\$(call echo_PHASE,Building BLFS-TOOLS)
|
||||
mk_CUSTOM_TOOLS: create-sbu_du-report
|
||||
@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 \\
|
||||
\$(call echo_PHASE,Building BLFS_TOOL); \\
|
||||
\$(call echo_CHROOT_request); \\
|
||||
sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
|
||||
sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"; \\
|
||||
(sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL"); \\
|
||||
fi;
|
||||
@touch \$@
|
||||
|
||||
|
@ -472,6 +484,7 @@ LUSER: $chapter5
|
|||
SUDO: $runasroot
|
||||
CHROOT: $chapter6
|
||||
BOOT: $chapter78
|
||||
CUSTOM_TOOLS: $custom_list
|
||||
BLFS_TOOL: $blfs_tool
|
||||
|
||||
|
||||
|
|
3
README
3
README
|
@ -24,6 +24,9 @@ $Id$
|
|||
configuration of the uClibc package when building a HLFS system using
|
||||
uClibc rather than glibc.
|
||||
|
||||
*. Read carefully this file and the other README.* files before start
|
||||
using the tool.
|
||||
|
||||
2. PREREQUISITES::
|
||||
|
||||
To use this tool you MUST:
|
||||
|
|
29
README.CLFS
Normal file
29
README.CLFS
Normal 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.
|
|
@ -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
|
||||
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 -----------
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@ copy_blfs_deps_scripts() { # method avoid to place the test on all
|
|||
#----------------------------------#
|
||||
wrt_blfs_tool_targets() { #
|
||||
#----------------------------------#
|
||||
PREV=""
|
||||
|
||||
echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"
|
||||
|
||||
|
|
|
@ -3,53 +3,38 @@
|
|||
# $Id$
|
||||
|
||||
#----------------------------------#
|
||||
add_CustomTools() { # Add any users supplied scripts
|
||||
wrt_CustomTools_target() { # Add any users supplied scripts
|
||||
#----------------------------------#
|
||||
PREV_SCRIPT=""
|
||||
CUSTOM_LIST=""
|
||||
PREV=""
|
||||
|
||||
echo " Adding custom packages... ${BOLD}START${OFF}"
|
||||
|
||||
cd $JHALFSDIR
|
||||
> ${MKFILE}.tmp2
|
||||
# Create the custom_tools scripts directory
|
||||
mkdir -p custom-tools
|
||||
|
||||
# First some build commands and a placeholder for the build list.
|
||||
# This will not cause problems if there are no custom scripts.
|
||||
( 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
|
||||
for file in $JHALFSDIR/custom-commands/*; do
|
||||
if [[ `basename ${file}` = "*" ]]; then
|
||||
break
|
||||
fi
|
||||
source $this_script
|
||||
THIS_SCRIPT=$(basename ${this_script})
|
||||
echo "$tab_${GREEN}Adding${OFF} ${THIS_SCRIPT}"
|
||||
source $file
|
||||
this_script=$(basename ${file})
|
||||
echo "$tab_${GREEN}Adding${OFF} ${this_script}"
|
||||
|
||||
# Create a Makefile entry
|
||||
if [[ "x${PKG}" = "x" ]]; then
|
||||
# Create an entry for a self contained cmd script that does not reference a package tarball
|
||||
( cat << EOF
|
||||
|
||||
${THIS_SCRIPT}: ${PREV_SCRIPT}
|
||||
@\$(call echo_message, Building)
|
||||
@./progress_bar.sh \$@ \$\$PPID &
|
||||
@( time { source envars && /\$(SCRIPT_ROOT)/custom-commands/scripts/${THIS_SCRIPT} >>logs/${THIS_SCRIPT} 2>&1 ; } ) 2>>logs/${THIS_SCRIPT}
|
||||
@touch \$@
|
||||
@\$(call housekeeping)
|
||||
EOF
|
||||
) >> ${MKFILE}.tmp2
|
||||
# Create an entry for a self contained cmd script that does not
|
||||
# reference a package tarball
|
||||
case $PROGNAME in
|
||||
clfs2 | clfs3 )
|
||||
LUSER_wrt_target "${this_script}" "$PREV"
|
||||
LUSER_wrt_RunAsUser "custom-tools/${this_script}"
|
||||
;;
|
||||
*)
|
||||
CHROOT_wrt_target "${this_script}" "$PREV"
|
||||
CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
|
||||
;;
|
||||
esac
|
||||
wrt_touch
|
||||
|
||||
# Create the build script file
|
||||
( cat <<- xEOFx
|
||||
|
@ -59,25 +44,27 @@ set -e
|
|||
`cat tmp`
|
||||
exit
|
||||
xEOFx
|
||||
) > custom-commands/scripts/$THIS_SCRIPT
|
||||
) > custom-tools/${this_script}
|
||||
|
||||
else
|
||||
# Create an entry for package
|
||||
( cat << EOF
|
||||
|
||||
${THIS_SCRIPT}: ${PREV_SCRIPT}
|
||||
@\$(call echo_message, Building)
|
||||
@./progress_bar.sh \$@ \$\$PPID &
|
||||
@\$(call remove_existing_dirs2,${PKG_FILE})
|
||||
@\$(call unpack2,${PKG_FILE})
|
||||
@\$(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})
|
||||
@touch \$@
|
||||
@touch ${TRACKING_DIR}/${PKG}-${PKG_VERSION}
|
||||
@\$(call housekeeping)
|
||||
EOF
|
||||
) >> ${MKFILE}.tmp2
|
||||
case $PROGNAME in
|
||||
clfs2 | clfs3 )
|
||||
LUSER_wrt_target "${this_script}" "$PREV"
|
||||
LUSER_wrt_unpack "${PKG_FILE}"
|
||||
LUSER_wrt_RunAsUser "custom-tools/${this_script}"
|
||||
LUSER_RemoveBuildDirs "${PKG}"
|
||||
echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${PKG}-${PKG_VERSION}" >> $MKFILE.tmp
|
||||
;;
|
||||
*)
|
||||
CHROOT_wrt_target "${this_script}" "$PREV"
|
||||
CHROOT_Unpack "${PKG_FILE}"
|
||||
CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
|
||||
CHROOT_wrt_RemoveBuildDirs "${PKG}"
|
||||
echo -e "\t@touch $TRACKING_DIR/${PKG}-${PKG_VERSION}" >> $MKFILE.tmp
|
||||
;;
|
||||
esac
|
||||
wrt_touch
|
||||
|
||||
# Create the build script file
|
||||
( cat <<- xEOFx
|
||||
|
@ -88,24 +75,21 @@ cd \$PKGDIR
|
|||
`cat tmp`
|
||||
exit
|
||||
xEOFx
|
||||
) > custom-commands/scripts/$THIS_SCRIPT
|
||||
) > custom-tools/$this_script
|
||||
fi
|
||||
|
||||
chmod 755 custom-commands/scripts/$THIS_SCRIPT
|
||||
rm -f tmp
|
||||
PREV_SCRIPT=$THIS_SCRIPT
|
||||
CUSTOM_LIST="${CUSTOM_LIST}${THIS_SCRIPT} "
|
||||
PREV=$this_script
|
||||
custom_list="${custom_list} ${this_script}"
|
||||
done
|
||||
|
||||
# Add the dependancy list.
|
||||
sed "s|^CUSTOM_TOOLS:|CUSTOM_TOOLS: ${CUSTOM_LIST}|" -i ${MKFILE}.tmp2
|
||||
cat ${MKFILE}.tmp2 >> ${MKFILE}
|
||||
rm ${MKFILE}.tmp2
|
||||
# Make the scripts executable.
|
||||
chmod +x custom-tools/*
|
||||
|
||||
echo " Adding custom packages... ${BOLD}DONE${OFF}"
|
||||
}
|
||||
|
||||
|
||||
|
||||
#----------------------------------#
|
||||
add_CustomToolsURLS() { # Add any users supplied scripts URL information
|
||||
#----------------------------------#
|
||||
|
@ -114,7 +98,7 @@ add_CustomToolsURLS() { # Add any users supplied scripts URL informat
|
|||
local URL PKG PKG_VERSION PKG_FILE MD5
|
||||
|
||||
> 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
|
||||
CUSTOM_TOOLS="n"
|
||||
break
|
||||
|
|
|
@ -20,10 +20,10 @@ validate_config() { # Are the config values sane (within reason)
|
|||
inline_doc
|
||||
|
||||
# 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 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 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 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 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 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 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 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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
ADD_REPORT = $REPORT
|
||||
ADD_CUSTOM_TOOLS = $CUSTOM_TOOLS
|
||||
ADD_BLFS_TOOLS = $BLFS_TOOL
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ nl_ = ""
|
|||
#==== BUILD MESSAGES ===
|
||||
|
||||
define echo_PHASE
|
||||
@clear
|
||||
@echo $(BOLD)--------------------------------------------------------------------------------
|
||||
@echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts
|
||||
@echo $(BOLD)--------------------------------------------------------------------------------
|
||||
|
@ -33,15 +32,13 @@ define echo_SU_request
|
|||
endef
|
||||
|
||||
define echo_SULUSER_request
|
||||
@clear
|
||||
@echo $(BOLD)--------------------------------------------------------------------------------
|
||||
@echo $(BOLD)$(BLUE)$@
|
||||
@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
|
||||
|
||||
define echo_CHROOT_request
|
||||
@clear
|
||||
@echo $(BOLD)--------------------------------------------------------------------------------
|
||||
@echo $(BOLD)$(BLUE)$@
|
||||
@echo $(WHITE)You are going to CHROOT into $(MOUNT_PT) $(BOLD)$(YELLOW)$(LUSER)$(OFF)
|
||||
|
|
66
jhalfs
66
jhalfs
|
@ -332,7 +332,7 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
|
|||
if [[ ! -d $JHALFSDIR ]]; then
|
||||
mkdir -p $JHALFSDIR
|
||||
fi
|
||||
#
|
||||
|
||||
# Create $BUILDDIR/sources even though it could be created by get_sources()
|
||||
if [[ ! -d $BUILDDIR/sources ]]; then
|
||||
mkdir -p $BUILDDIR/sources
|
||||
|
@ -344,34 +344,21 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
|
|||
fi
|
||||
>$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
|
||||
#
|
||||
cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/
|
||||
#
|
||||
[[ "$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
|
||||
|
||||
#
|
||||
# Prepare report creation, if needed
|
||||
if [[ "$REPORT" = "y" ]]; then
|
||||
cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/
|
||||
# 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
|
||||
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.
|
||||
if [[ "${BLFS_TOOL}" = "y" ]] ; then
|
||||
# Install the files
|
||||
|
@ -405,6 +402,7 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
|
|||
cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/
|
||||
rm -rf $JHALFSDIR/blfs-tool-deps/.svn
|
||||
fi
|
||||
#
|
||||
|
||||
get_book
|
||||
echo "${SD_BORDER}${nl_}"
|
||||
|
@ -437,11 +435,7 @@ if [[ "$REBUILD_MAKEFILE" = "y" ]] ; then
|
|||
fi
|
||||
|
||||
build_Makefile
|
||||
if [[ "${PROGNAME}" = "lfs" ]]; then
|
||||
if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
|
||||
add_CustomTools
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "${SD_BORDER}${nl_}"
|
||||
|
||||
run_make
|
||||
|
|
Reference in a new issue