Started support to customize de base system build allowing Makefile regeneration.

This commit is contained in:
Manuel Canales Esparcia 2006-10-18 19:28:47 +00:00
parent e7655b2815
commit 7b6ecc5b8e
4 changed files with 152 additions and 102 deletions

View file

@ -823,3 +823,16 @@ endif
#--- End Advanced Features
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.

View file

@ -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
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
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
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 -----------

5
TODO
View file

@ -17,7 +17,8 @@ xLFS MODULES
- To develop a new "restart" Makefile target code.
- 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)
@ -34,3 +35,5 @@ OTHERS
That requires a way to can regenerate the Makefile if additional
scripts are manually added to the *-commands/*/ dirs.
Work in progress via RE_MAKE

103
jhalfs
View file

@ -108,6 +108,7 @@ REPORT=${REPORT:=n}
VIMLANG=${VIMLANG:-n}
GRSECURITY_HOST=${GRSECURITY_HOST:-n}
CUSTOM_TOOLS=${CUSTOM_TOOLS:-n}
RE_MAKE=${RE_MAKE:-n}
# Book surces envars
BRANCH_ID=${BRANCH_ID:=development}
@ -316,74 +317,76 @@ if [[ "$OPTIMIZE" != "0" ]]; then
fi
#
# If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
# and notify the user about that.
if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
if [[ "$RE_MAKE" = "n" ]] ; then
# If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
# and notify the user about that.
if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
eval "$no_empty_builddir"
fi
fi
# If requested, clean the build directory
clean_builddir
# If requested, clean the build directory
clean_builddir
if [[ ! -d $JHALFSDIR ]]; 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
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
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
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
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
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 [[ "$REPORT" = "y" ]]; then
#
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}
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 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}
@ -400,13 +403,13 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then
# Copy the dependencies build scripts
cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/
rm -rf $JHALFSDIR/blfs-tool-deps/.svn
fi
fi
get_book
echo "${SD_BORDER}${nl_}"
get_book
echo "${SD_BORDER}${nl_}"
# Get the BLFS book, if requested.
if [[ "${BLFS_TOOL}" = "y" ]] ; then
# 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}
@ -418,6 +421,8 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then
fi
echo -ne "done\n"
echo "${SD_BORDER}${nl_}"
fi
fi
build_Makefile