Started blfs-tool support.
This commit is contained in:
parent
2b0f8a58aa
commit
cfdc0f1226
4 changed files with 166 additions and 53 deletions
102
Config.in
102
Config.in
|
@ -283,11 +283,99 @@ menu "--- BOOK Settings"
|
||||||
default "uclibc" if LIB_UCLIBC
|
default "uclibc" if LIB_UCLIBC
|
||||||
#--- End HLFS specific params
|
#--- End HLFS specific params
|
||||||
|
|
||||||
|
#--- blfs-tool Support
|
||||||
|
config BLFS_TOOL
|
||||||
|
bool "Add blfs-tool support"
|
||||||
|
default n
|
||||||
|
depends on !BOOK_BLFS
|
||||||
|
help
|
||||||
|
#--- Activating this option additional packages needed to
|
||||||
|
# use blfs-tool will be installed.
|
||||||
|
#
|
||||||
|
# The blfs-tool files will be installed under
|
||||||
|
# $BUILD_DIR/blfs_root.
|
||||||
|
|
||||||
|
# After booting the new xLFS system you should to
|
||||||
|
# create an user account and move the blfs-root
|
||||||
|
# directory to the user's home, making he the
|
||||||
|
# directory and files owner, before start
|
||||||
|
# using blfs-tool.
|
||||||
|
#
|
||||||
|
# Also, be sure to create the $TRACKING_DIR directory
|
||||||
|
# and bring to the build user the right privileges
|
||||||
|
# over it.
|
||||||
|
#
|
||||||
|
# And don't forget to configure sudo properly.
|
||||||
|
|
||||||
|
choice
|
||||||
|
prompt "BLFS Release"
|
||||||
|
default BLFS_SVN
|
||||||
|
depends on BLFS_TOOL
|
||||||
|
config BLFS_SVN
|
||||||
|
bool "BLFS SVN"
|
||||||
|
help
|
||||||
|
#-- Current development version as in trunk
|
||||||
|
|
||||||
|
config BLFS_BRANCH
|
||||||
|
bool "BLFS Branch or stable book"
|
||||||
|
help
|
||||||
|
#-- A supported SVN branch or stable released book
|
||||||
|
endchoice
|
||||||
|
|
||||||
|
config BLFS_BRANCH_ID
|
||||||
|
string "BLFS Book Version (mandatory)"
|
||||||
|
default "**EDIT ME**"
|
||||||
|
depends on BLFS_BRANCH
|
||||||
|
help
|
||||||
|
#-- A list of valid branches and stable books ID's is available here.
|
||||||
|
# http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks
|
||||||
|
|
||||||
|
menu "blfs-tool dependencies"
|
||||||
|
depends on BLFS_TOOL
|
||||||
|
|
||||||
|
config DEP_LIBXML
|
||||||
|
bool "libxml2 (required)"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config DEP_LIBXSLT
|
||||||
|
bool "libxslt (required)"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config DEP_DBXSL
|
||||||
|
bool "DocBook XSL (required)"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config DEP_LINKS
|
||||||
|
bool "links (required)"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config DEP_SUDO
|
||||||
|
bool "sudo (recommended)"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config DEP_WGET
|
||||||
|
bool "wget (recommended)"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config DEP_SVN
|
||||||
|
bool "SVN client (optional)"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config DEP_GPM
|
||||||
|
bool "GPM (optional, see help)"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
#-- You MUST to install manually the gpm bootscript
|
||||||
|
# and create its configuration file
|
||||||
|
endmenu
|
||||||
|
#--- End blfs-tool Support
|
||||||
|
|
||||||
#--- BLFS specific params
|
#--- BLFS specific params
|
||||||
config BLFS_ROOT
|
config BLFS_ROOT
|
||||||
string "Directory root"
|
string "Directory root"
|
||||||
default "$HOME/blfs_root"
|
default "$HOME/blfs_root" if BOOK_BLFS
|
||||||
depends on BOOK_BLFS
|
default "$BUILD_DIR/blfs_root" if BLFS_TOOL
|
||||||
|
depends on BOOK_BLFS || BLFS_TOOL
|
||||||
help
|
help
|
||||||
#-- Full path to the directory where all required
|
#-- Full path to the directory where all required
|
||||||
# files and scripts will be stored.
|
# files and scripts will be stored.
|
||||||
|
@ -295,19 +383,21 @@ menu "--- BOOK Settings"
|
||||||
config BLFS_XML
|
config BLFS_XML
|
||||||
string "BLFS sources directory"
|
string "BLFS sources directory"
|
||||||
default "blfs-xml"
|
default "blfs-xml"
|
||||||
depends on BOOK_BLFS
|
depends on BOOK_BLFS || BLFS_TOOL
|
||||||
help
|
help
|
||||||
#-- The directory name where BLFS book sources
|
#-- The directory name under $BLFS_ROOT where BLFS book
|
||||||
# will be checkout.
|
# sources will be checkout.
|
||||||
|
|
||||||
config TRACKING_DIR
|
config TRACKING_DIR
|
||||||
string "Installed packages database directory"
|
string "Installed packages database directory"
|
||||||
default "/var/lib/jhalfs/BLFS"
|
default "/var/lib/jhalfs/BLFS"
|
||||||
depends on BOOK_BLFS
|
depends on BOOK_BLFS || BLFS_TOOL
|
||||||
help
|
help
|
||||||
#-- Full path to the directory where the installed
|
#-- Full path to the directory where the installed
|
||||||
# packages database will be created.
|
# packages database will be created.
|
||||||
#
|
#
|
||||||
|
# You MUST to create manually this directory.
|
||||||
|
#
|
||||||
# Note that the user that will build the packages must
|
# Note that the user that will build the packages must
|
||||||
# have read and write privileges on that directory.
|
# have read and write privileges on that directory.
|
||||||
#--- End BLFS specific params
|
#--- End BLFS specific params
|
||||||
|
|
13
blfs-tool
13
blfs-tool
|
@ -86,13 +86,12 @@ BRANCH_ID=${BRANCH_ID:=development}
|
||||||
|
|
||||||
# Set the SVN tree
|
# Set the SVN tree
|
||||||
case $BRANCH_ID in
|
case $BRANCH_ID in
|
||||||
dev* | SVN | trunk ) TREE=trunk/BOOK ;;
|
development ) TREE=trunk/BOOK ;;
|
||||||
*EDIT* ) echo " You forgot to set the branch or stable book version."
|
*EDIT* ) echo " You forgot to set the branch or stable book version."
|
||||||
echo " Please rerun make and fix the configuration."
|
echo " Please rerun make and fix the configuration."
|
||||||
exit 2
|
exit 2 ;;
|
||||||
;;
|
branch-* ) TREE=branches/${BRANCH_ID#branch-}/BOOK ;;
|
||||||
branch-* ) TREE=branches/${BRANCH_ID#branch-}/BOOK ;;
|
* ) TREE=tags/${BRANCH_ID}/BOOK ;;
|
||||||
* ) TREE=tags/${BRANCH_ID}/BOOK ;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# For consistency with other books
|
# For consistency with other books
|
||||||
|
|
|
@ -20,14 +20,16 @@ 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 KEYMAP PAGE TIMEZONE LANG LC_ALL LUSER LGROUP"
|
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 KEYMAP PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL"
|
||||||
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 KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP"
|
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 KEYMAP VIMLANG PAGE TIMEZONE LANG LUSER LGROUP BLFS_TOOL"
|
||||||
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 BLFS_TOOL"
|
||||||
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 BLFS_TOOL"
|
||||||
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"
|
||||||
|
|
||||||
|
local -r blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR DEP_LIBXML DEP_LIBXSLT DEP_DBXSL DEP_LINKS DEP_SUDO DEP_WGET DEP_SVN DEP_GPM"
|
||||||
|
|
||||||
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='rerun make and fix your configuration settings${OFF}'
|
||||||
local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
|
local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
|
||||||
|
|
||||||
local PARAM_LIST=
|
local PARAM_LIST=
|
||||||
|
@ -107,6 +109,7 @@ inline_doc
|
||||||
ARCH | \
|
ARCH | \
|
||||||
TARGET | \
|
TARGET | \
|
||||||
GRSECURITY_HOST | \
|
GRSECURITY_HOST | \
|
||||||
|
BLFS_TOOL | \
|
||||||
TIMEZONE | \
|
TIMEZONE | \
|
||||||
PAGE) echo -e "`eval echo $PARAM_VALS`" ;;
|
PAGE) echo -e "`eval echo $PARAM_VALS`" ;;
|
||||||
|
|
||||||
|
@ -141,7 +144,7 @@ inline_doc
|
||||||
fi ;;
|
fi ;;
|
||||||
|
|
||||||
# BOOK validation. Very ugly, need be fixed
|
# BOOK validation. Very ugly, need be fixed
|
||||||
BOOK) if [[ "${WC}" = "1" ]] ; then
|
BOOK) if [[ "${WORKING_COPY}" = "y" ]] ; then
|
||||||
validate_dir -z -d
|
validate_dir -z -d
|
||||||
else
|
else
|
||||||
echo -e "`eval echo $PARAM_VALS`"
|
echo -e "`eval echo $PARAM_VALS`"
|
||||||
|
@ -185,6 +188,14 @@ inline_doc
|
||||||
|
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ "${BLFS_TOOL}" = "y" ]] ; then
|
||||||
|
echo "${nl_} ${BLUE}blfs-tool settings${OFF}"
|
||||||
|
for config_param in ${blfs_tool_PARAM_LIST}; do
|
||||||
|
echo -e "`eval echo $PARAM_VALS`"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
echo "${nl_}***${BOLD}${GREEN} ${PARAM_GROUP%%_*T} config parameters look good${OFF} ***${nl_}"
|
echo "${nl_}***${BOLD}${GREEN} ${PARAM_GROUP%%_*T} config parameters look good${OFF} ***${nl_}"
|
||||||
}
|
}
|
||||||
|
|
81
jhalfs
81
jhalfs
|
@ -90,43 +90,10 @@ 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"
|
||||||
|
|
||||||
#--- Envars not sourced from configuration (yet)
|
#--- Envars not sourced from configuration
|
||||||
declare -r SVN="svn://svn.linuxfromscratch.org"
|
declare -r SVN="svn://svn.linuxfromscratch.org"
|
||||||
declare -r LOG=000-masterscript.log
|
declare -r LOG=000-masterscript.log
|
||||||
|
|
||||||
case $PROGNAME in
|
|
||||||
clfs2) LFSVRS=development; TREE=branches/clfs-2.0/BOOK ;;
|
|
||||||
*) LFSVRS=development; TREE=trunk/BOOK ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [[ ! -z ${BRANCH_ID} ]]; then
|
|
||||||
case $BRANCH_ID in
|
|
||||||
dev* | SVN | trunk )
|
|
||||||
case $PROGNAME in
|
|
||||||
clfs2 ) TREE=branches/clfs-2.0/BOOK ;;
|
|
||||||
*) TREE=trunk/BOOK ;;
|
|
||||||
esac
|
|
||||||
LFSVRS=development
|
|
||||||
;;
|
|
||||||
branch-* )
|
|
||||||
LFSVRS=${BRANCH_ID}
|
|
||||||
TREE=branches/${BRANCH_ID#branch-}/BOOK
|
|
||||||
;;
|
|
||||||
* )
|
|
||||||
case $PROGNAME in
|
|
||||||
lfs | hlfs )
|
|
||||||
LFSVRS=${BRANCH_ID}
|
|
||||||
TREE=tags/${BRANCH_ID}/BOOK
|
|
||||||
;;
|
|
||||||
clfs | clfs2 )
|
|
||||||
LFSVRS=${BRANCH_ID}
|
|
||||||
TREE=tags/${BRANCH_ID}
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# These are boolean vars generated from Config.in.
|
# These are boolean vars generated from Config.in.
|
||||||
# ISSUE: If a boolean parameter is not set <true> that
|
# ISSUE: If a boolean parameter is not set <true> that
|
||||||
# variable is not defined by the menu app. This can
|
# variable is not defined by the menu app. This can
|
||||||
|
@ -146,9 +113,55 @@ VIMLANG=${VIMLANG:-n}
|
||||||
KEYMAP=${KEYMAP:=none}
|
KEYMAP=${KEYMAP:=none}
|
||||||
GRSECURITY_HOST=${GRSECURITY_HOST:-n}
|
GRSECURITY_HOST=${GRSECURITY_HOST:-n}
|
||||||
|
|
||||||
|
# Book surces envars
|
||||||
|
BRANCH_ID=${BRANCH_ID:=development}
|
||||||
|
|
||||||
|
case $BRANCH_ID in
|
||||||
|
development )
|
||||||
|
case $PROGNAME in
|
||||||
|
clfs2 ) TREE=branches/clfs-2.0/BOOK ;;
|
||||||
|
*) TREE=trunk/BOOK ;;
|
||||||
|
esac
|
||||||
|
LFSVRS=development
|
||||||
|
;;
|
||||||
|
*EDIT* ) echo " You forgot to set the branch or stable book version."
|
||||||
|
echo " Please rerun make and fix the configuration."
|
||||||
|
exit 2 ;;
|
||||||
|
branch-* )
|
||||||
|
LFSVRS=${BRANCH_ID}
|
||||||
|
TREE=branches/${BRANCH_ID#branch-}/BOOK
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
case $PROGNAME in
|
||||||
|
lfs | hlfs )
|
||||||
|
LFSVRS=${BRANCH_ID}
|
||||||
|
TREE=tags/${BRANCH_ID}/BOOK
|
||||||
|
;;
|
||||||
|
clfs | clfs2 )
|
||||||
|
LFSVRS=${BRANCH_ID}
|
||||||
|
TREE=tags/${BRANCH_ID}
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Set the document location...
|
# Set the document location...
|
||||||
BOOK=${BOOK:=$PROGNAME-$LFSVRS}
|
BOOK=${BOOK:=$PROGNAME-$LFSVRS}
|
||||||
|
|
||||||
|
# blfs-tool envars
|
||||||
|
BLFS_TOOL=${BLFS_TOOL:-n}
|
||||||
|
if [[ "${BLFS_TOOL}" = "y" ]] ; then
|
||||||
|
BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development}
|
||||||
|
case $BLFS_BRANCH_ID in
|
||||||
|
development ) BLFS_TREE=trunk/BOOK ;;
|
||||||
|
*EDIT* ) echo " You forgot to set the BLFS branch or stable book version."
|
||||||
|
echo " Please rerun make and fix the configuration."
|
||||||
|
exit 2 ;;
|
||||||
|
branch-* ) BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-}/BOOK ;;
|
||||||
|
* ) BLFS_TREE=tags/${BLFS_BRANCH_ID}/BOOK ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
# Set true internal variables
|
# Set true internal variables
|
||||||
COMMON_DIR="common"
|
COMMON_DIR="common"
|
||||||
PACKAGE_DIR=$(echo $PROGNAME | tr [a-z] [A-Z])
|
PACKAGE_DIR=$(echo $PROGNAME | tr [a-z] [A-Z])
|
||||||
|
|
Reference in a new issue