Started support to customize de base system build allowing Makefile regeneration.
This commit is contained in:
parent
e7655b2815
commit
7b6ecc5b8e
4 changed files with 152 additions and 102 deletions
13
Config.in
13
Config.in
|
@ -823,3 +823,16 @@ endif
|
||||||
|
|
||||||
#--- End Advanced Features
|
#--- End Advanced Features
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
config RE_MAKE
|
||||||
|
bool "Rebuild the Makefile (see help)"
|
||||||
|
default n
|
||||||
|
depends on !BOOK_BLFS
|
||||||
|
help
|
||||||
|
#-- Rebuild the Makefile
|
||||||
|
#
|
||||||
|
# This option alow to rebuild the Makefile after
|
||||||
|
# customizing the base system build scripts.
|
||||||
|
#
|
||||||
|
# See README.CUSTOM for more info about this feature.
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,39 @@ needs of every individual and requests are made "Can you add xxxx package".
|
||||||
Rather than adding numerous package scripts and switches for each request it
|
Rather than adding numerous package scripts and switches for each request it
|
||||||
was easier to add a tool for the user(s) to code their own package needs.
|
was easier to add a tool for the user(s) to code their own package needs.
|
||||||
|
|
||||||
|
There is two areas that can be customized: how the base system is build
|
||||||
|
and what additional configurations and packages requires your hardware to can
|
||||||
|
boot and work with. Each one of this areas is handled in a diferent way.
|
||||||
|
|
||||||
|
BASE SYSTEM CUSTOMIZATION
|
||||||
|
|
||||||
|
There is two ways to alter how the base system will be built:
|
||||||
|
|
||||||
|
- Using a working copy of the book sources and editing the XML files.
|
||||||
|
This is the way used by book editors to test packages upgrades,
|
||||||
|
command changes, build order changes. etc.
|
||||||
|
|
||||||
|
This method requires you know very well the book sources and what
|
||||||
|
files need be edited. It will not be discussed here.
|
||||||
|
|
||||||
|
- Editing the generated build scripts to make any change you would.
|
||||||
|
This is the method discussed below.
|
||||||
|
|
||||||
|
(TO BE WRITTEN)
|
||||||
|
|
||||||
|
|
||||||
|
ADDING POST-SYSTEM BUILD CONFIGURATION FILES AND EXTRA PACKAGES
|
||||||
|
|
||||||
|
The installation of BLFS packages is handled via blfs-tool and activated
|
||||||
|
when you select the appropiate menu option. See README and README.BLFS for
|
||||||
|
more info.
|
||||||
|
|
||||||
|
The feature descrbed below was added so users could install remaining
|
||||||
|
configuration files, build the packages necessary to access the internet
|
||||||
|
or to support specific hardware, or to install basic utilities that need
|
||||||
|
have availables from the beginning, and was not intended to replace the BLFS
|
||||||
|
install system.
|
||||||
|
|
||||||
|
|
||||||
LAYOUT
|
LAYOUT
|
||||||
A new directory has been added to JHALFS tree which will contain the
|
A new directory has been added to JHALFS tree which will contain the
|
||||||
|
@ -63,10 +96,6 @@ configuration file which enables/disables the inclusion of personal scripts.
|
||||||
the cmd
|
the cmd
|
||||||
make mk_CUSTOM_TOOLS
|
make mk_CUSTOM_TOOLS
|
||||||
|
|
||||||
:::FINAL COMMENT:::
|
|
||||||
This feature was added so users could build the packages necessary to access
|
|
||||||
the internet and was not intended to replace the BLFS install system.
|
|
||||||
|
|
||||||
|
|
||||||
#--------- GLIB example -----------
|
#--------- GLIB example -----------
|
||||||
|
|
||||||
|
|
5
TODO
5
TODO
|
@ -17,7 +17,8 @@ xLFS MODULES
|
||||||
- To develop a new "restart" Makefile target code.
|
- To develop a new "restart" Makefile target code.
|
||||||
|
|
||||||
- To add support for copying to the final system pre-generated
|
- To add support for copying to the final system pre-generated
|
||||||
configuration files created by the user, if that can be implemented.
|
configuration files created by the user.
|
||||||
|
Work in progress via CUSTOM_TOOLS
|
||||||
|
|
||||||
|
|
||||||
BLFS MODULE (See BLFS/TODO)
|
BLFS MODULE (See BLFS/TODO)
|
||||||
|
@ -34,3 +35,5 @@ OTHERS
|
||||||
That requires a way to can regenerate the Makefile if additional
|
That requires a way to can regenerate the Makefile if additional
|
||||||
scripts are manually added to the *-commands/*/ dirs.
|
scripts are manually added to the *-commands/*/ dirs.
|
||||||
|
|
||||||
|
Work in progress via RE_MAKE
|
||||||
|
|
||||||
|
|
195
jhalfs
195
jhalfs
|
@ -108,6 +108,7 @@ REPORT=${REPORT:=n}
|
||||||
VIMLANG=${VIMLANG:-n}
|
VIMLANG=${VIMLANG:-n}
|
||||||
GRSECURITY_HOST=${GRSECURITY_HOST:-n}
|
GRSECURITY_HOST=${GRSECURITY_HOST:-n}
|
||||||
CUSTOM_TOOLS=${CUSTOM_TOOLS:-n}
|
CUSTOM_TOOLS=${CUSTOM_TOOLS:-n}
|
||||||
|
RE_MAKE=${RE_MAKE:-n}
|
||||||
|
|
||||||
# Book surces envars
|
# Book surces envars
|
||||||
BRANCH_ID=${BRANCH_ID:=development}
|
BRANCH_ID=${BRANCH_ID:=development}
|
||||||
|
@ -316,108 +317,112 @@ if [[ "$OPTIMIZE" != "0" ]]; then
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
|
|
||||||
# If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
|
if [[ "$RE_MAKE" = "n" ]] ; then
|
||||||
# and notify the user about that.
|
|
||||||
if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
|
|
||||||
eval "$no_empty_builddir"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If requested, clean the build directory
|
# If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
|
||||||
clean_builddir
|
# and notify the user about that.
|
||||||
|
if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
|
||||||
if [[ ! -d $JHALFSDIR ]]; then
|
eval "$no_empty_builddir"
|
||||||
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
|
|
||||||
fi
|
|
||||||
#
|
|
||||||
# Create the log directory
|
|
||||||
if [[ ! -d $LOGDIR ]]; then
|
|
||||||
mkdir $LOGDIR
|
|
||||||
fi
|
|
||||||
>$LOGDIR/$LOG
|
|
||||||
#
|
|
||||||
[[ "$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
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
# If requested, clean the build directory
|
||||||
if [[ "$REPORT" = "y" ]]; then
|
clean_builddir
|
||||||
cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/
|
|
||||||
# After being sure that all looks sane, dump the settings to a file
|
|
||||||
# This file will be used to create the REPORT header
|
|
||||||
validate_config > $JHALFSDIR/jhalfs.config
|
|
||||||
fi
|
|
||||||
#
|
|
||||||
[[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/
|
|
||||||
#
|
|
||||||
cp $COMMON_DIR/packages.xsl $JHALFSDIR/
|
|
||||||
#
|
|
||||||
sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
|
|
||||||
export XSL=$JHALFSDIR/${XSL}
|
|
||||||
|
|
||||||
# Install blfs-tool, if requested.
|
if [[ ! -d $JHALFSDIR ]]; then
|
||||||
if [[ "${BLFS_TOOL}" = "y" ]] ; then
|
mkdir -p $JHALFSDIR
|
||||||
# Install the files
|
fi
|
||||||
[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -p ${BUILDDIR}${BLFS_ROOT}
|
#
|
||||||
cp -r BLFS/* ${BUILDDIR}${BLFS_ROOT}
|
# Create $BUILDDIR/sources even though it could be created by get_sources()
|
||||||
cp -r menu ${BUILDDIR}${BLFS_ROOT}
|
if [[ ! -d $BUILDDIR/sources ]]; then
|
||||||
cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT}
|
mkdir -p $BUILDDIR/sources
|
||||||
cp README.BLFS ${BUILDDIR}${BLFS_ROOT}
|
fi
|
||||||
# Clean-up
|
#
|
||||||
rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.svn
|
# Create the log directory
|
||||||
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/.svn
|
if [[ ! -d $LOGDIR ]]; then
|
||||||
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/lxdialog/.svn
|
mkdir $LOGDIR
|
||||||
# Set some harcoded envars to their proper values
|
fi
|
||||||
sed -i 's,blfs-xml,'$BLFS_XML',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,libs/book.xsl}
|
>$LOGDIR/$LOG
|
||||||
sed -i 's,tracking-dir,'$TRACKING_DIR',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,gen-makefile.sh}
|
#
|
||||||
# Copy the dependencies build scripts
|
[[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR
|
||||||
cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/
|
#
|
||||||
rm -rf $JHALFSDIR/blfs-tool-deps/.svn
|
cp $COMMON_DIR/{makefile-functions,progress_bar.sh} $JHALFSDIR/
|
||||||
fi
|
#
|
||||||
|
[[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
|
||||||
get_book
|
#
|
||||||
echo "${SD_BORDER}${nl_}"
|
if [[ "$COMPARE" = "y" ]]; then
|
||||||
|
mkdir -p $JHALFSDIR/extras
|
||||||
# Get the BLFS book, if requested.
|
cp extras/* $JHALFSDIR/extras
|
||||||
if [[ "${BLFS_TOOL}" = "y" ]] ; then
|
fi
|
||||||
echo -n "Downloading the BLFS document, $BLFS_BRANCH_ID version... "
|
#
|
||||||
if [[ ! -d ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} ]] ; then
|
if [[ -n "$FILES" ]]; then
|
||||||
mkdir -p ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML}
|
# pushd/popd necessary to deal with multiple files
|
||||||
svn co $SVN_2/BLFS/$BLFS_TREE ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} >>$LOGDIR/$LOG 2>&1
|
pushd $PACKAGE_DIR 1> /dev/null
|
||||||
else
|
cp $FILES $JHALFSDIR/
|
||||||
pushd ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} 1> /dev/null
|
|
||||||
svn up >>$LOGDIR/$LOG 2>&1
|
|
||||||
popd 1> /dev/null
|
popd 1> /dev/null
|
||||||
fi
|
fi
|
||||||
echo -ne "done\n"
|
#
|
||||||
|
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
|
||||||
|
cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/
|
||||||
|
# After being sure that all looks sane, dump the settings to a file
|
||||||
|
# This file will be used to create the REPORT header
|
||||||
|
validate_config > $JHALFSDIR/jhalfs.config
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
[[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/
|
||||||
|
#
|
||||||
|
cp $COMMON_DIR/packages.xsl $JHALFSDIR/
|
||||||
|
#
|
||||||
|
sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
|
||||||
|
export XSL=$JHALFSDIR/${XSL}
|
||||||
|
|
||||||
|
# Install blfs-tool, if requested.
|
||||||
|
if [[ "${BLFS_TOOL}" = "y" ]] ; then
|
||||||
|
# Install the files
|
||||||
|
[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -p ${BUILDDIR}${BLFS_ROOT}
|
||||||
|
cp -r BLFS/* ${BUILDDIR}${BLFS_ROOT}
|
||||||
|
cp -r menu ${BUILDDIR}${BLFS_ROOT}
|
||||||
|
cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT}
|
||||||
|
cp README.BLFS ${BUILDDIR}${BLFS_ROOT}
|
||||||
|
# Clean-up
|
||||||
|
rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.svn
|
||||||
|
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/.svn
|
||||||
|
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/lxdialog/.svn
|
||||||
|
# Set some harcoded envars to their proper values
|
||||||
|
sed -i 's,blfs-xml,'$BLFS_XML',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,libs/book.xsl}
|
||||||
|
sed -i 's,tracking-dir,'$TRACKING_DIR',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,gen-makefile.sh}
|
||||||
|
# Copy the dependencies build scripts
|
||||||
|
cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/
|
||||||
|
rm -rf $JHALFSDIR/blfs-tool-deps/.svn
|
||||||
|
fi
|
||||||
|
|
||||||
|
get_book
|
||||||
echo "${SD_BORDER}${nl_}"
|
echo "${SD_BORDER}${nl_}"
|
||||||
|
|
||||||
|
# Get the BLFS book, if requested.
|
||||||
|
if [[ "${BLFS_TOOL}" = "y" ]] ; then
|
||||||
|
echo -n "Downloading the BLFS document, $BLFS_BRANCH_ID version... "
|
||||||
|
if [[ ! -d ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} ]] ; then
|
||||||
|
mkdir -p ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML}
|
||||||
|
svn co $SVN_2/BLFS/$BLFS_TREE ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} >>$LOGDIR/$LOG 2>&1
|
||||||
|
else
|
||||||
|
pushd ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} 1> /dev/null
|
||||||
|
svn up >>$LOGDIR/$LOG 2>&1
|
||||||
|
popd 1> /dev/null
|
||||||
|
fi
|
||||||
|
echo -ne "done\n"
|
||||||
|
echo "${SD_BORDER}${nl_}"
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
build_Makefile
|
build_Makefile
|
||||||
|
|
Reference in a new issue