Merged r2942:2948 from trunk.
This commit is contained in:
parent
00f4966aa3
commit
2fedf493f4
7 changed files with 121 additions and 47 deletions
34
BLFS/TODO
34
BLFS/TODO
|
@ -11,27 +11,21 @@ Makefiles similars to the current ones for {C,H}LFS.
|
||||||
|
|
||||||
What remains to do:
|
What remains to do:
|
||||||
|
|
||||||
1. - To make the top-level blfs script functional. That script should to create
|
-- To review the XSL code needed to create the build scripts.
|
||||||
the working directory (selected at command line)
|
A lot of book-versus-scripts and testing is needed.
|
||||||
a. Copy all BLFS/* files to it,
|
We need yet to figure out if we can to to handle Perl modules installation
|
||||||
b. Fetch the BLFS sources (output directory selected at command line or
|
and other pages that have commands to install more that one package
|
||||||
based on the book version),
|
|
||||||
c. Run the packages.sh script.
|
|
||||||
|
|
||||||
2. - To develop the XSL code needed to create the build scripts.
|
|
||||||
Almost done. A lot of book-versus-scripts and testing is needed.
|
|
||||||
We need yet to figure out how to handle Perl modules installation and
|
|
||||||
other pages that have commands to install more that one package
|
|
||||||
(e.g., Gnat in GCC Java-bin in Java, sane-backends and sane-frontends
|
(e.g., Gnat in GCC Java-bin in Java, sane-backends and sane-frontends
|
||||||
in Sane, etc)
|
in Sane, etc) or not-estandart installations, like Xorg7
|
||||||
|
|
||||||
3. - To develop the code to create the Makefile.
|
-- Test the method used to track already installed packages by previous runs.
|
||||||
Should be a separate script to be run manually after the user has
|
See if the packages version can be watched also.
|
||||||
review and edited the target build scripts.
|
|
||||||
Must make the build scripts executables and set the SRC_ARCHIVE and
|
|
||||||
FTP_SERVER envars.
|
|
||||||
Work in progress.
|
|
||||||
|
|
||||||
4. - To find a way to track already installed packages by previous runs, to can
|
-- Integrate the menuconfig based package selection, trying to make use of the
|
||||||
skip them when creating the book/scripts/Makefile for a new target.
|
installed packages traking system.
|
||||||
|
|
||||||
|
-- Bugs hunting.
|
||||||
|
|
||||||
|
-- Improve README.BLFS.
|
||||||
|
|
||||||
|
-- Develop a script to make cofee.
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# Set default SRC_ARCHIVE and FTP_DIR
|
# Set default envars used in the build scripts
|
||||||
#
|
#
|
||||||
#####
|
#####
|
||||||
|
|
||||||
|
@ -14,9 +14,15 @@
|
||||||
# if the user has the right priviledges.
|
# if the user has the right priviledges.
|
||||||
export SRC_ARCHIVE=$SRC_ARCHIVE
|
export SRC_ARCHIVE=$SRC_ARCHIVE
|
||||||
|
|
||||||
# --- Server used if the file isn't found in SRC_ARCHIVE.
|
#--- Server used if the file isn't found in SRC_ARCHIVE.
|
||||||
# As a last resort, the file will dowloaded from upstream, if possible.
|
# As a last resort, the file will dowloaded from upstream, if possible.
|
||||||
#
|
#
|
||||||
# The server path MUST be set as listed in
|
# The server path MUST be set as listed in
|
||||||
# http://www.linuxfromscratch.org/blfs/download.html
|
# http://www.linuxfromscratch.org/blfs/download.html
|
||||||
export FTP_SERVER=ftp://anduin.linuxfromscratch.org/BLFS/
|
export FTP_SERVER=ftp://anduin.linuxfromscratch.org/BLFS/
|
||||||
|
|
||||||
|
|
||||||
|
#--- The sources directory.
|
||||||
|
# Full path to the top level directory where packages will be stored,
|
||||||
|
# unpacked, and compiled.
|
||||||
|
export SRC_DIR=$HOME/sources
|
|
@ -40,7 +40,7 @@ __write_build_cmd() { #
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
(
|
(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@source ../makefile.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&1
|
@source ../envars.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&1
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,14 +97,14 @@
|
||||||
<xsl:value-of select="$package"/>
|
<xsl:value-of select="$package"/>
|
||||||
<xsl:text>
PKG_DIR=</xsl:text>
|
<xsl:text>
PKG_DIR=</xsl:text>
|
||||||
<xsl:value-of select="$ftpdir"/>
|
<xsl:value-of select="$ftpdir"/>
|
||||||
<xsl:text>

</xsl:text>
|
<xsl:text>
SRC_DIR=$SRC_DIR

</xsl:text>
|
||||||
<!-- Download code and build commands -->
|
<!-- Download code and build commands -->
|
||||||
<xsl:apply-templates select="sect2">
|
<xsl:apply-templates select="sect2">
|
||||||
<xsl:with-param name="package" select="$package"/>
|
<xsl:with-param name="package" select="$package"/>
|
||||||
<xsl:with-param name="ftpdir" select="$ftpdir"/>
|
<xsl:with-param name="ftpdir" select="$ftpdir"/>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
<!-- Clean-up -->
|
<!-- Clean-up -->
|
||||||
<xsl:text>cd ~/sources/$PKG_DIR
</xsl:text>
|
<xsl:text>cd $SRC_DIR/$PKG_DIR
</xsl:text>
|
||||||
<xsl:text>rm -rf $UNPACKDIR unpacked

</xsl:text>
|
<xsl:text>rm -rf $UNPACKDIR unpacked

</xsl:text>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<!-- Non-package page -->
|
<!-- Non-package page -->
|
||||||
|
@ -125,8 +125,8 @@
|
||||||
<xsl:param name="ftpdir" select="foo"/>
|
<xsl:param name="ftpdir" select="foo"/>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="@role = 'package'">
|
<xsl:when test="@role = 'package'">
|
||||||
<xsl:text>mkdir -p ~/sources/$PKG_DIR
</xsl:text>
|
<xsl:text>mkdir -p $SRC_DIR/$PKG_DIR
</xsl:text>
|
||||||
<xsl:text>cd ~/sources/$PKG_DIR
</xsl:text>
|
<xsl:text>cd $SRC_DIR/$PKG_DIR
</xsl:text>
|
||||||
<xsl:apply-templates select="itemizedlist/listitem/para">
|
<xsl:apply-templates select="itemizedlist/listitem/para">
|
||||||
<xsl:with-param name="package" select="$package"/>
|
<xsl:with-param name="package" select="$package"/>
|
||||||
<xsl:with-param name="ftpdir" select="$ftpdir"/>
|
<xsl:with-param name="ftpdir" select="$ftpdir"/>
|
||||||
|
|
21
README.BLFS
21
README.BLFS
|
@ -14,7 +14,7 @@ $Id$
|
||||||
general rule you will need to review and edit the scripts while reading
|
general rule you will need to review and edit the scripts while reading
|
||||||
the book.
|
the book.
|
||||||
|
|
||||||
NOTE:: The code is yet under development a may contains several bugs
|
NOTE:: The code is still under development and may contains several bugs
|
||||||
|
|
||||||
|
|
||||||
2. USAGE::
|
2. USAGE::
|
||||||
|
@ -37,7 +37,7 @@ $Id$
|
||||||
TODO developers notes
|
TODO developers notes
|
||||||
packages auto-generated file with packages info
|
packages auto-generated file with packages info
|
||||||
alternatives.conf configuration files for alternative packages
|
alternatives.conf configuration files for alternative packages
|
||||||
makefile.conf envars needed when running the generated Makefile
|
envars.conf envars needed when running the build scripts
|
||||||
update_book.sh update the XML book sources and regenerate packages file
|
update_book.sh update the XML book sources and regenerate packages file
|
||||||
and GNOME and KDE dependencies tree
|
and GNOME and KDE dependencies tree
|
||||||
blfs-parser.sh generates linear BLFS books and build scripts
|
blfs-parser.sh generates linear BLFS books and build scripts
|
||||||
|
@ -54,16 +54,17 @@ $Id$
|
||||||
2.3 PARSING THE BOOK::
|
2.3 PARSING THE BOOK::
|
||||||
Next step is to create a book and build scripts in dependencies build order
|
Next step is to create a book and build scripts in dependencies build order
|
||||||
for a target package. A target package can be any of the ones listed in the
|
for a target package. A target package can be any of the ones listed in the
|
||||||
packages file. That is done using the blfs-parser.sh script, but we are triying
|
packages file. That is done using the blfs-parser.sh script, but we are trying
|
||||||
to make a menuconfig based system.
|
to make a menuconfig based system.
|
||||||
|
|
||||||
The script need three arguments:
|
The script need three arguments:
|
||||||
|
|
||||||
package name as listed in packages file
|
package name as listed in packages file
|
||||||
dependencies level 1 for required, 2 for required an recommendedand,
|
dependencies level 1 for required,
|
||||||
|
2 for required an recommended
|
||||||
3 for required, recommended, and optional
|
3 for required, recommended, and optional
|
||||||
sudo usage y if sudo will be used (you will build as normal user)
|
sudo usage y if sudo will be used (you want build as a normal user)
|
||||||
n if sudo isn't needed (you will build as root)
|
n if sudo isn't needed (you want build as root)
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
|
@ -82,12 +83,12 @@ $Id$
|
||||||
packages (i.e., for non-BLFS packages) can be inserted in an easy way.
|
packages (i.e., for non-BLFS packages) can be inserted in an easy way.
|
||||||
|
|
||||||
2.4 CREATING THE MAKEFILE
|
2.4 CREATING THE MAKEFILE
|
||||||
When the build scripts will be ready to be run, the Makefile can be
|
When the build scripts are ready to be run, the Makefile can be
|
||||||
created. Be sure that you are into the "package" directory and run
|
created. Be sure that you cd into the "package" directory and run
|
||||||
|
|
||||||
../gen_makefile.sh
|
../gen_makefile.sh
|
||||||
|
|
||||||
Review the Makefile and if all look sane, start the build.
|
Review the Makefile and if all look sane, start the build.
|
||||||
|
|
||||||
|
|
||||||
(Text is needed for the installed packages tracking system and like)
|
(Text is needed for the installed packages tracking system and like)
|
||||||
|
|
88
blfs
88
blfs
|
@ -3,6 +3,35 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# From common/common-functions
|
||||||
|
# VT100 colors
|
||||||
|
declare -r BLACK=$'\e[1;30m'
|
||||||
|
declare -r DK_GRAY=$'\e[0;30m'
|
||||||
|
|
||||||
|
declare -r RED=$'\e[31m'
|
||||||
|
declare -r GREEN=$'\e[32m'
|
||||||
|
declare -r YELLOW=$'\e[33m'
|
||||||
|
declare -r BLUE=$'\e[34m'
|
||||||
|
declare -r MAGENTA=$'\e[35m'
|
||||||
|
declare -r CYAN=$'\e[36m'
|
||||||
|
declare -r WHITE=$'\e[37m'
|
||||||
|
|
||||||
|
declare -r OFF=$'\e[0m'
|
||||||
|
declare -r BOLD=$'\e[1m'
|
||||||
|
declare -r REVERSE=$'\e[7m'
|
||||||
|
declare -r HIDDEN=$'\e[8m'
|
||||||
|
|
||||||
|
declare -r tab_=$'\t'
|
||||||
|
declare -r nl_=$'\n'
|
||||||
|
|
||||||
|
declare -r DD_BORDER="${BOLD}==============================================================================${OFF}"
|
||||||
|
declare -r SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}"
|
||||||
|
declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}"
|
||||||
|
|
||||||
|
# bold yellow > < pair
|
||||||
|
declare -r R_arrow=$'\e[1;33m>\e[0m'
|
||||||
|
declare -r L_arrow=$'\e[1;33m<\e[0m'
|
||||||
|
|
||||||
|
|
||||||
#>>>>>>>>>>>>>>>ERROR TRAPPING >>>>>>>>>>>>>>>>>>>>
|
#>>>>>>>>>>>>>>>ERROR TRAPPING >>>>>>>>>>>>>>>>>>>>
|
||||||
#-----------------------#
|
#-----------------------#
|
||||||
|
@ -34,36 +63,75 @@ trap simple_error ERR
|
||||||
trap 'echo -e "\n\n${RED}INTERRUPT${OFF} trapped\n" && exit 2' 1 2 3 15 17 18 23
|
trap 'echo -e "\n\n${RED}INTERRUPT${OFF} trapped\n" && exit 2' 1 2 3 15 17 18 23
|
||||||
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
|
|
||||||
VERBOSITY=1
|
# envars not sourced from configuration file
|
||||||
|
PROGNAME=$(basename $0)
|
||||||
|
COMMON_DIR="common"
|
||||||
|
VERBOSITY=1
|
||||||
|
|
||||||
[[ $VERBOSITY > 0 ]] && echo -n "Loading config params from <configuration>..."
|
[[ $VERBOSITY > 0 ]] && echo -n "Loading config params from <configuration>..."
|
||||||
source configuration
|
source configuration
|
||||||
[[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1
|
[[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1
|
||||||
[[ $VERBOSITY > 0 ]] && echo "OK"
|
[[ $VERBOSITY > 0 ]] && echo "OK"
|
||||||
|
|
||||||
|
[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_validate_configs.sh>..."
|
||||||
|
source $COMMON_DIR/func_validate_configs.sh
|
||||||
|
[[ $? > 0 ]] && echo " function module did not load.." && exit 2
|
||||||
|
[[ $VERBOSITY > 0 ]] && echo "OK"
|
||||||
|
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
|
||||||
|
|
||||||
|
# Be sure that we have a configuration file
|
||||||
[[ -z $BOOK_BLFS ]] && echo -e "\nNo BLFS configuration found. Please configure it." && exit 1
|
[[ -z $BOOK_BLFS ]] && echo -e "\nNo BLFS configuration found. Please configure it." && exit 1
|
||||||
|
|
||||||
TREE=trunk/BOOK
|
# Set default book version
|
||||||
|
BRANCH_ID=${BRANCH_ID:=development}
|
||||||
|
|
||||||
if [[ ! -z ${BRANCH_ID} ]]; then
|
# Set the SVN tree
|
||||||
case $BRANCH_ID in
|
case $BRANCH_ID in
|
||||||
dev* | SVN | trunk ) TREE=trunk/BOOK ;;
|
dev* | SVN | trunk ) TREE=trunk/BOOK ;;
|
||||||
branch-* ) TREE=branches/${BRANCH_ID#branch-}/BOOK ;;
|
*EDIT* ) echo " You forgot to set the branch or stable book version."
|
||||||
* ) TREE=tags/${BRANCH_ID}/BOOK ;;
|
echo " Please rerun make and fix the configuration."
|
||||||
esac
|
exit 2
|
||||||
|
;;
|
||||||
|
branch-* ) TREE=branches/${BRANCH_ID#branch-}/BOOK ;;
|
||||||
|
* ) TREE=tags/${BRANCH_ID}/BOOK ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# For consistency with other books
|
||||||
|
validate_config
|
||||||
|
echo "${SD_BORDER}${nl_}"
|
||||||
|
echo -n "Are you happy with these settings? yes/no (no): "
|
||||||
|
read ANSWER
|
||||||
|
if [ x$ANSWER != "xyes" ] ; then
|
||||||
|
echo "${nl_}Fix the configuration options and rerun the script.${nl_}"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo "${nl_}${SD_BORDER}${nl_}"
|
||||||
|
|
||||||
|
# Install the files
|
||||||
[[ ! -d $BLFS_ROOT ]] && mkdir -p $BLFS_ROOT
|
[[ ! -d $BLFS_ROOT ]] && mkdir -p $BLFS_ROOT
|
||||||
|
|
||||||
cp -r BLFS/* $BLFS_ROOT
|
cp -r BLFS/* $BLFS_ROOT
|
||||||
cp common/progress_bar.sh $BLFS_ROOT
|
cp $COMMON_DIR/progress_bar.sh $BLFS_ROOT
|
||||||
# cp -r menu $BLFS_ROOT
|
# cp -r menu $BLFS_ROOT
|
||||||
|
|
||||||
|
# Start the work
|
||||||
cd $BLFS_ROOT
|
cd $BLFS_ROOT
|
||||||
|
|
||||||
|
# Clean-up
|
||||||
|
rm -rf libs/.svn
|
||||||
|
|
||||||
|
# Fix BLFS_XML harcoded values
|
||||||
sed -i 's,blfs-xml,'$BLFS_XML',' update_book.sh
|
sed -i 's,blfs-xml,'$BLFS_XML',' update_book.sh
|
||||||
sed -i 's,blfs-xml,'$BLFS_XML',' libs/book.xsl
|
sed -i 's,blfs-xml,'$BLFS_XML',' libs/book.xsl
|
||||||
|
|
||||||
./update_book.sh $BLFS_XML get $TREE
|
# Fetch book sources and create packages and GNOME/KDE dependencies files
|
||||||
|
if [[ -d $BLFS_XML ]] ; then
|
||||||
|
./update_book.sh
|
||||||
|
else
|
||||||
|
./update_book.sh $BLFS_XML get $TREE
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Generate Config.in and run the menuconfig interfaz
|
||||||
|
# ./gen_config.sh
|
||||||
# make
|
# make
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,7 @@ inline_doc
|
||||||
local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
|
local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
|
||||||
local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET OPTIMIZE REPORT STRIP FSTAB CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
|
local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE ARCH TARGET OPTIMIZE REPORT STRIP FSTAB CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
|
||||||
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"
|
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"
|
||||||
|
local -r blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML"
|
||||||
|
|
||||||
local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
|
local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
|
||||||
local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
|
local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
|
||||||
|
@ -264,6 +265,10 @@ inline_doc
|
||||||
validate_file -z -e -s
|
validate_file -z -e -s
|
||||||
KEYMAP=${save_param}
|
KEYMAP=${save_param}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
# BLFS params. No validation is required/allowed, IMHO
|
||||||
|
BRANCH_ID | BLFS_ROOT | BLFS_XML) echo "`eval echo $PARAM_VALS`" ;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
set -e
|
set -e
|
||||||
|
|
Reference in a new issue