Add the possibility to install BLFS tools to a running LFS from the jhalfs
menu: - Add the possibility to choose BOOK_BLFS from menu. That hides all the irrelevant parameters - Adapt install-blfs-tools.sh - Change slightly mconf.c so that there is a better alignement in menus
This commit is contained in:
parent
18567e96ff
commit
e5d44f5f1f
3 changed files with 1040 additions and 1006 deletions
|
@ -19,6 +19,9 @@ use jhalfs, or forgot to include the jhalfs-blfs tools:
|
|||
(as user) INIT_SYSTEM=<your system> ./install-blfs-tools.sh
|
||||
2 - To install with only user privileges (default to sysv):
|
||||
TRACKING_DIR=$HOME/blfs_root/trackdir ./install-blfs-tools.sh
|
||||
|
||||
This script can also be called automatically after running make in this
|
||||
directory. The parameters will then be taken from the configuration file.
|
||||
inline_doc
|
||||
|
||||
|
||||
|
@ -45,20 +48,63 @@ declare -r nl_=$'\n'
|
|||
declare -r DD_BORDER="${BOLD}==============================================================================${OFF}"
|
||||
declare -r SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}"
|
||||
declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}"
|
||||
declare -r dotSTR=".................." # Format display of parameters and versions
|
||||
|
||||
# bold yellow > < pair
|
||||
declare -r R_arrow=$'\e[1;33m>\e[0m'
|
||||
declare -r L_arrow=$'\e[1;33m<\e[0m'
|
||||
|
||||
VERBOSITY=1
|
||||
|
||||
# Take parameters from "configuration" if $1="auto"
|
||||
if [ "$1" = auto ]; then
|
||||
[[ $VERBOSITY > 0 ]] && echo -n "Loading configuration ... "
|
||||
source configuration
|
||||
[[ $? > 0 ]] && echo -e "\nconfiguration could not be loaded" && exit 2
|
||||
[[ $VERBOSITY > 0 ]] && echo "OK"
|
||||
fi
|
||||
|
||||
if [ "$BOOK_BLFS" = y ]; then
|
||||
## Read variables and sanity checks
|
||||
[[ "$relSVN" = y ]] && BLFS_BRANCH_ID=development
|
||||
[[ "$BRANCH" = y ]] && BLFS_BRANCH_ID=$BRANCH_ID
|
||||
[[ "$WORKING_COPY" = y ]] && BLFS_BOOK=$BOOK
|
||||
[[ "$BRANCH_ID" = "**EDIT ME**" ]] &&
|
||||
echo You have not set the book version or branch && exit 1
|
||||
[[ "$BOOK" = "**EDIT ME**" ]] &&
|
||||
echo You have not set the working copy location && exit 1
|
||||
fi
|
||||
|
||||
COMMON_DIR="common"
|
||||
# blfs-tool envars
|
||||
BLFS_TOOL='y'
|
||||
BUILDDIR=$(cd ~;pwd)
|
||||
BLFS_ROOT="${BLFS_ROOT:=/blfs_root}"
|
||||
TRACKING_DIR="${TRACKING_DIR:=/var/lib/jhalfs/BLFS}"
|
||||
INIT_SYSTEM="${INIT_SYSTEM:=sysv}"
|
||||
BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development}
|
||||
BLFS_XML=${BLFS_XML:=blfs-xml}
|
||||
|
||||
# Validate the configuration:
|
||||
PARAMS="BLFS_ROOT TRACKING_DIR INIT_SYSTEM BLFS_XML"
|
||||
if [ "$WORKING_COPY" = y ]; then
|
||||
PARAMS="$PARAMS WORKING_COPY BOOK"
|
||||
else
|
||||
PARAMS="$PARAMS BLFS_BRANCH_ID"
|
||||
fi
|
||||
# Format for displaying parameters:
|
||||
declare -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
|
||||
|
||||
for config_param in $PARAMS; do
|
||||
echo -e "`eval echo $PARAM_VALS`"
|
||||
done
|
||||
|
||||
echo "${SD_BORDER}${nl_}"
|
||||
echo -n "Are you happy with these settings? yes/no (no): "
|
||||
read ANSWER
|
||||
if [ x$ANSWER != "xyes" ] ; then
|
||||
echo "${nl_}Rerun make and fix your settings.${nl_}"
|
||||
exit
|
||||
fi
|
||||
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
|
||||
|
||||
#*******************************************************************#
|
||||
|
@ -69,8 +115,6 @@ source $COMMON_DIR/libs/func_check_version.sh
|
|||
|
||||
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
|
||||
|
||||
# blfs-tool envars
|
||||
BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development}
|
||||
case $BLFS_BRANCH_ID in
|
||||
development ) BLFS_TREE=trunk/BOOK ;;
|
||||
branch-* ) BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-} ;;
|
||||
|
@ -78,7 +122,6 @@ case $BLFS_BRANCH_ID in
|
|||
esac
|
||||
|
||||
# Check for build prerequisites.
|
||||
declare -r dotSTR=".................." # needed for proper display of versions
|
||||
echo
|
||||
check_alfs_tools
|
||||
check_blfs_tools
|
||||
|
@ -87,6 +130,7 @@ echo "${SD_BORDER}${nl_}"
|
|||
# Install the files
|
||||
[[ $VERBOSITY > 0 ]] && echo -n Populating the ${BUILDDIR}${BLFS_ROOT} directory
|
||||
[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -pv ${BUILDDIR}${BLFS_ROOT}
|
||||
rm -rf ${BUILDDIR}${BLFS_ROOT}/*
|
||||
cp -r BLFS/* ${BUILDDIR}${BLFS_ROOT}
|
||||
cp -r menu ${BUILDDIR}${BLFS_ROOT}
|
||||
cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT}
|
||||
|
@ -101,7 +145,7 @@ rm -rf ${BUILDDIR}${BLFS_ROOT}/xsl/.svn
|
|||
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/.svn
|
||||
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/lxdialog/.svn
|
||||
# We do not want to keep an old version of the book:
|
||||
rm -rf ${BUILDDIR}${BLFS_ROOT}/blfs-xml
|
||||
rm -rf ${BUILDDIR}${BLFS_ROOT}/$BLFS_XML
|
||||
|
||||
# Set some harcoded envars to their proper values
|
||||
sed -i s@tracking-dir@$TRACKING_DIR@ \
|
||||
|
@ -114,10 +158,17 @@ sed -i s@tracking-dir@$TRACKING_DIR@ \
|
|||
mkdir -p $TRACKING_DIR
|
||||
[[ $VERBOSITY > 0 ]] && echo "... OK"
|
||||
|
||||
[[ $VERBOSITY > 0 ]] && echo "Downloading and validating the book (may take some time)"
|
||||
[[ $VERBOSITY > 0 ]] &&
|
||||
echo "Retrieving and validating the book (may take some time)"
|
||||
|
||||
[[ -z "$BLFS_BOOK" ]] ||
|
||||
[[ $BLFS_BOOK = $BUILDDIR$BLFS_ROOT/$BLFS_XML ]] ||
|
||||
cp -a $BLFS_BOOK $BUILDDIR$BLFS_ROOT/$BLFS_XML
|
||||
|
||||
make -j1 -C $BUILDDIR$BLFS_ROOT \
|
||||
TRACKING_DIR=$TRACKING_DIR \
|
||||
REV=$INIT_SYSTEM \
|
||||
BLFS_XML=$BUILDDIR$BLFS_ROOT/$BLFS_XML \
|
||||
SVN=svn://svn.linuxfromscratch.org/BLFS/$BLFS_TREE \
|
||||
$BUILDDIR$BLFS_ROOT/packages.xml
|
||||
[[ $VERBOSITY > 0 ]] && echo "... OK"
|
||||
|
|
16
menu/mconf.c
16
menu/mconf.c
|
@ -473,7 +473,8 @@ static void build_conf(struct menu *menu)
|
|||
struct symbol *sym;
|
||||
struct property *prop;
|
||||
struct menu *child;
|
||||
int type, tmp, doint = 2;
|
||||
/* int type, tmp, doint = 2; */
|
||||
int type, doint = 2;
|
||||
tristate val;
|
||||
char ch;
|
||||
|
||||
|
@ -595,13 +596,16 @@ static void build_conf(struct menu *menu)
|
|||
break;
|
||||
default:
|
||||
cprint_tag("s%p", menu);
|
||||
tmp = cprint_name("(%s)", sym_get_string_value(sym));
|
||||
/* tmp = cprint_name("(%s)", sym_get_string_value(sym));
|
||||
tmp = indent - tmp + 4;
|
||||
if (tmp < 0)
|
||||
tmp = 0;
|
||||
cprint_name("%*c%s%s", tmp, ' ', menu_get_prompt(menu),
|
||||
(sym_has_value(sym) || !sym_is_changable(sym)) ?
|
||||
"" : " (NEW)");
|
||||
tmp = 0; */
|
||||
cprint_name(" %*c%s (%s)%s",
|
||||
indent+1, ' ',
|
||||
menu_get_prompt(menu),
|
||||
sym_get_string_value(sym),
|
||||
(sym_has_value(sym) || !sym_is_changable(sym)) ?
|
||||
"" : " (NEW)");
|
||||
goto conf_childs;
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue