Compare commits

...
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.

54 commits

Author SHA1 Message Date
Pierre Labastie
e7f93a02ce typo 2017-04-03 12:36:01 +00:00
Pierre Labastie
95c46b9df5 Merge trunk "When asked its version, jhalfs should not return an error code"
r3953
2017-04-02 09:04:15 +00:00
Pierre Labastie
de10f6c5a5 Merge trunk r3949 "Fix issues in clfs" 2017-04-02 08:46:55 +00:00
Pierre Labastie
10bc5b9130 merge trunk r3950 "fix version wording" 2017-04-02 08:42:47 +00:00
Pierre Labastie
479cb9b70e Add a CHEATSHEET file 2017-03-28 20:13:06 +00:00
Pierre Labastie
654a56a4d9 Merge trunk r3945 (refactor two README files) 2017-03-27 19:51:06 +00:00
Pierre Labastie
b9cd0ee5f1 Merge trunk r3943 2017-03-27 19:12:06 +00:00
Pierre Labastie
580d773239 Merge trunk r3940,41 2017-03-27 16:26:14 +00:00
Pierre Labastie
90f822ab03 Merge trunk r3938:
Existence of package management files is tested even if PKGMNGT=n. Fix that.
Thanks to Michael D.L. for reporting
2017-03-25 21:02:19 +00:00
Pierre Labastie
3d48216613 typo 2017-03-20 15:37:16 +00:00
Pierre Labastie
085739c3eb Fix BLFS/TODO Id keyword and update it 2017-03-20 15:23:37 +00:00
Pierre Labastie
2706ad528f - Update README.PACKAGE_MANAGEMENT for porg
- Improve (?) README test
- Make VERSION lowercase in packInstall.sh.porg, since porg will do that
  anyway
2017-03-20 15:14:54 +00:00
Pierre Labastie
89b7cce9ca Merge trunk r3928, update README's 2017-03-20 14:15:28 +00:00
Pierre Labastie
14bcaee318 Merge trunk r3926-27 2017-03-20 14:12:25 +00:00
Pierre Labastie
76cf25fb34 Merge trunk r3924:
Make SBU and size computations incompatible with package management, since
the figures are wrong when package management is on (see #1694)
2017-03-18 18:25:21 +00:00
Pierre Labastie
fc0802bf5f Add instructions to copy to SRC_ARCHIVE in func_install_blfs, so that files
are kept in host repo, and not downloaded again, should a new build be
    started.
2017-03-16 13:36:47 +00:00
Pierre Labastie
54380e5020 Allows to retrieve package from SRC_ARCHIVE, in case it is not already there
and is in archive. This should not happen in normal operation, but may happen
    in func_install_blfs
2017-03-16 12:45:11 +00:00
Pierre Labastie
50618eeb88 Add the possibility to choose build and source dirs, and whether subdirs are
used in blfs tools, + various fixes
2017-03-15 21:00:31 +00:00
Pierre Labastie
8010030910 Merge trunk rev 3916:
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
2017-03-15 09:50:15 +00:00
Pierre Labastie
e43d0d0edb Test for FQDN in <replaceable> tags, instead of HOSTNAME, for the full
name of the host. Adapted only to LFS-20170310 and up.
2017-03-11 19:37:26 +00:00
Pierre Labastie
7e5ff87dd2 Merge trunk revs 3906-8 2017-03-11 16:53:29 +00:00
Pierre Labastie
e06a0d35bc Default to not stripping binaries 2017-03-05 18:28:03 +00:00
Pierre Labastie
d8ddcfb96a Fix the generation of scripts of
the networkd page (systemd book).
2017-03-05 08:49:45 +00:00
Pierre Labastie
deb6b6c8fd Fixes:
- when the user fstab and/or kernel config are the same as the ones in
$BUILDDIR/sources: avoid to cp on itself
- set SRC_ARCHIVE=/dev/null in BLFS tools download script if SRC_ARCHIVE is
empty
2017-03-05 08:35:09 +00:00
Pierre Labastie
5253014591 Add soundtouchs case to packInstall.sh.porg 2017-03-04 11:58:31 +00:00
Pierre Labastie
a9dadcf142 Output /etc/os-release when the init system is systemd 2017-03-03 21:13:38 +00:00
Pierre Labastie
796cd28b08 Merge trunk rev 3896:
Unless explicitely set on the command line, the REV parameter
in BLFS tools make is the same as the preceding used one. Formerly, it
was set to sysv unless defined on the command line
2017-03-02 16:40:34 +00:00
Pierre Labastie
eb8667a45d Install units rather than bootscripts when REV=systemd 2017-03-01 16:07:26 +00:00
Pierre Labastie
50a8ed0de7 Update and fix README files 2017-03-01 10:59:02 +00:00
Pierre Labastie
45f0437fcf Merge rev 3890 from trunk:
Fix Ed tarball download
2017-02-28 12:49:28 +00:00
Pierre Labastie
f769d1fca3 Fix installation of BLFS tools for recent book instructions 2017-02-27 17:32:14 +00:00
Pierre Labastie
6c9002b012 Fix the BLFS tools for the "Xorg Legacy" page 2017-02-27 14:02:16 +00:00
Pierre Labastie
ed4f11f2a7 Invert the logic for downloading tarballs:
- First upstream url
- Second upstrem ftp
- Last mirror server.
This allows to test whether upstream links are alive
2017-02-27 14:00:04 +00:00
Pierre Labastie
1cf1ad6fa6 Adapt BLFS/envars.conf to modern BLFS books 2017-02-27 13:57:52 +00:00
Pierre Labastie
0c5dfcc581 Add several cases to the special cases in packInstall.sh.porg:
- put the version extraction in a function
- use packages.xml if needed
2017-02-27 13:55:30 +00:00
Pierre Labastie
dc315ea7c8 Merge trunk r3881 into new_features branch 2016-12-03 18:31:32 +00:00
Pierre Labastie
e042e91776 Remove completely all references to tidy as a BLfs tool. 2016-11-24 16:45:41 +00:00
Pierre Labastie
c785566356 propagate trunk 3877 2016-10-16 14:16:26 +00:00
Pierre Labastie
c650f9bf2a When testing preceding/following-sibling for wrapping,
only use the first in the series
2016-08-26 14:42:07 +00:00
Pierre Labastie
24e2a6f2f8 Fixes for BLFS porg:
- add a special case for cacerts in packInstall.sh, so that a dummy version
  is generated, otherwise porgball does not work as intended
- do not quote out apostrophes in scripts, when generating configuration
  instructions
2016-08-26 07:13:09 +00:00
Pierre Labastie
7bbcce3ce7 Fix "blfs_root" location in envars.conf, to match initial location
when installing BLFS tools.
Convert package names to lowercase in wrap and pack functions for porg, since
porg does that anyway
2016-08-25 10:04:30 +00:00
Pierre Labastie
316db22956 Install the wrap and pack functions whan installing BLFS tools 2016-08-24 15:56:50 +00:00
Pierre Labastie
013a0bcac8 Merge trunk 3871 2016-08-24 15:25:33 +00:00
Pierre Labastie
e234d23768 BLFS porg style package management:
- update envarc.conf so that the system is made aware of the wrapInstall
and packInstall functions
- update scripts.xsl for wrapping install commands
- update gen_config.xsl to add the variable WRAP_INSTALL
- use the variable WRAP_INSTALL in gen_pkg_book
TODO: install the correct pack - wrap functions when installing BLFS tools
2016-08-24 15:15:14 +00:00
Pierre Labastie
df42c7cff7 Porg style package management:
- Add new variable WRAP_INSTALL in COnfig.in and jhalfs
- Generates the install commands inside a wrapper function
- Add files packInstall.sh.porg and packageManager.xml.porg
- TODO: update README.PACKAGE...
- TODO: make new templates in pkgmngt and document them
2016-07-21 16:43:35 +00:00
Pierre Labastie
33ff403b33 Adapt IP GATEWAY to book instructions 2016-06-25 14:39:47 +00:00
Pierre Labastie
04952c6322 Merge trunk up to revision 3866 2016-06-25 10:30:15 +00:00
Pierre Labastie
7bd0866514 Merge trunk up to revision 3864 2016-06-19 14:41:18 +00:00
Pierre Labastie
99ba6d8548 Merge trunk up to r3857 2016-03-08 20:29:02 +00:00
Pierre Labastie
af20a037df Merge trunk r3853 2016-01-30 08:36:23 +00:00
Pierre Labastie
bc5aee2c5f Merge trunk r3851 2016-01-01 18:24:07 +00:00
Pierre Labastie
6b6d54d952 Merge trunk r3849 2015-12-21 08:02:53 +00:00
Pierre Labastie
77fa8baa59 Add IP, hostname, domain, etc to the list of configuration parameters.
Font and encoding are in configuration too, but are not passed to the build
commands
Works only for LFS
2015-12-13 15:28:33 +00:00
Pierre Labastie
2453b766d0 Create a new branch for experimenting with new featutes described in
http://lists.linuxfromscratch.org/pipermail/alfs-discuss/2015-November/010357.html
+ long overdue: allowing to set hostname, address, etc, during the
configuration process.
2015-12-13 13:50:54 +00:00
55 changed files with 3203 additions and 1861 deletions

View file

@ -15,21 +15,39 @@ endif
LANG=C
LC_ALL=C
# The right-hand side is updated by jhalfs
TRACKING_DIR = tracking-dir
TOPDIR=$(shell pwd)
BLFS_XML = $(TOPDIR)/blfs-xml
XSLDIR = $(TOPDIR)/xsl
# Makefile should reside in a directory where there are two subdirectories
# initially:
TOPDIR = $(shell pwd)
# the stylesheets
XSLDIR = $(TOPDIR)/xsl
# the menu program sources
MENU = $(TOPDIR)/menu
RENDERTMP = $(BLFS_XML)/tmp
BLFS_FULL = $(RENDERTMP)/blfs-full.xml
PACK_LIST = $(TOPDIR)/packages.xml
MENU = $(TOPDIR)/menu
# Those directories and files will be created and populated by make:
# directory of the book sources:
BLFS_XML = $(TOPDIR)/blfs-xml
# contains the REV used in the preceding call:
REVFILE = $(TOPDIR)/revision
# the list of packages:
PACK_LIST = $(TOPDIR)/packages.xml
# the generated menu input:
CONFIG_CONFIG_IN = $(TOPDIR)/Config.in
CONFIG_OUT = $(TOPDIR)/configuration
BOOK_XML = $(TOPDIR)/book.xml
TRACKFILE = $(TRACKING_DIR)/instpkg.xml
# menu output:
CONFIG_OUT = $(TOPDIR)/configuration
# the linear book:
BOOK_XML = $(TOPDIR)/book.xml
RENDERTMP = $(BLFS_XML)/tmp
BLFS_FULL = $(RENDERTMP)/blfs-full.xml
# The right-hand side is updated by jhalfs:
# Where the tracking file resides:
TRACKING_DIR = tracking-dir
# Will be created by make, if not existent
TRACKFILE = $(TRACKING_DIR)/instpkg.xml
# Initial content of the tracking file
define INITIAL_TRACK
<?xml version="1.0" encoding="ISO-8859-1"?>\n\
\n\
@ -42,9 +60,30 @@ endef
SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK
ALLXML := $(filter-out $(RENDERTMP)/%, \
$(wildcard $(BLFS_XML)/*.xml $(BLFS_XML)/*/*.xml $(BLFS_XML)/*/*/*.xml $(BLFS_XML)/*/*/*/*.xml $(BLFS_XML)/*/*/*/*/*.xml))
$(shell if [ -d $(BLFS_XML) ]; then \
find $(BLFS_XML) -name \*.xml; \
fi))
ALLXSL := $(filter-out $(RENDERTMP)/%, \
$(wildcard $(BLFS_XML)/*.xsl $(BLFS_XML)/*/*.xsl $(BLFS_XML)/*/*/*.xsl $(BLFS_XML)/*/*/*/*.xsl $(BLFS_XML)/*/*/*/*/*.xsl))
$(shell if [ -d $(BLFS_XML) ]; then \
find $(BLFS_XML) -name \*.xsl; \
fi))
# Try to set the REV variable according to previous runs, except when
# set on the command line:
REV1 := $(shell if [ -f $(REVFILE) ] ; then cat $(REVFILE); fi)
ifneq ($(origin REV),command line)
ifdef REV1
REV = $(REV1)
else
REV = not defined
endif
endif
ifneq ($(REV),sysv)
ifneq ($(REV),systemd)
$(error The REV variable is $(REV), but can only be 'sysv' or 'systemd')
endif
endif
$(BOOK_XML): $(CONFIG_OUT)
$(Q)$(TOPDIR)/gen_pkg_book.sh $(TOPDIR) $(BLFS_FULL)
@ -96,11 +135,21 @@ $(TRACKING_DIR):
$(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL)
$(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@
ifneq ($(REV),$(REV1))
$(BLFS_FULL): FORCE
endif
$(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL)
@echo "Validating the book..."
$(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
$(Q)xmllint --nonet --noent --xinclude --postvalid \
-o $@ $(BLFS_XML)/index.xml
@echo "Adjusting for revision $(REV)..."
$(Q)xsltproc --nonet --xinclude \
--stringparam profile.revision $(REV) \
--output $(RENDERTMP)/blfs-prof.xml \
$(BLFS_XML)/stylesheets/lfs-xsl/profile.xsl \
$(BLFS_XML)/index.xml
@echo "Validating the book..."
$(Q)xmllint --nonet --noent --postvalid \
-o $@ $(RENDERTMP)/blfs-prof.xml
$(Q)echo $(REV) > $(REVFILE)
all: update $(BOOK_XML)
@ -119,4 +168,5 @@ clean:
rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts
- $(MAKE) -C $(MENU) clean
.PHONY: clean all update $(CONFIG_OUT)
FORCE:
.PHONY: clean all update $(CONFIG_OUT) FORCE

View file

@ -16,5 +16,3 @@
the BLFS book should be revised and validated, but our time is limited.
-- Bugs hunting.
-- Find a better way to define circular dependencies.

View file

@ -10,121 +10,53 @@
#======== Common envars ==========
#--- The build directory:
# - If BUILD_SUBDIRS is set, this directory contains sub directories
# (one for each package), where packages are unpacked, and compiled.
# - If BUILD_SUBDIRS is unset, packages are unpacked, and compiled directly
# in $BUILD_ROOT.
export BUILD_ROOT=/sources
export BUILD_SUBDIRS=1
#--- The local repository for packages/file:
# Any missing file will be downloaded and archived either:
# - into a subdirectory (one for each page of the book) fo this directory,
# if SRC_SUBDIRS is set.
# - directly into this directory if SRC_SUBDIRS is unset.
# This directory can be the same as $BUILD_ROOT, provided BUILD_SUBDIRS
# and SRC_SUBDIRS are different.
export SRC_ARCHIVE=/sources
unset SRC_SUBDIRS
#--- Set a well-known working locale when building software
# Note that an UTF-8 locale may be needed for some packages,
# but normally it is set in the package instructions.
# Furthermore, LANG may be set in /etc/profile, which is
# sourced at the end of this file.
export LC_ALL=C
#--- The local repository for packages/file
# Any missing file will be downloaded and archived here,
# if the user has the right priviledges.
export SRC_ARCHIVE=/sources
#--- Server used if the file isn't found in SRC_ARCHIVE.
# As a last resort, the file will dowloaded from upstream, if possible.
#--- Server used if the file isn't found in SRC_DIR,
# and cannot be downloaded from upstream.
#
# The server path MUST be set as listed in
# http://www.linuxfromscratch.org/blfs/download.html
export FTP_SERVER=ftp://anduin.linuxfromscratch.org/BLFS/
# http://www.linuxfromscratch.org/blfs/download.html.
# Note that despite the name of the variable, it can be an http url.
export FTP_SERVER=http://ftp.osuosl.org/pub/blfs/
#--- Keep the buid directory to examine it:
# If KEEP_FILES is unset, the extracted tarball is removed after build.
# Otherwise, the build tree is kept for later study.
#export KEEP_FILES=1
unset KEEP_FILES
### Currently not used in scripts ###
# Use a server close to you for Xorg (see http://wiki.x.org/wiki/Mirrors)
export FTP_X_SERVER=ftp://mirror.cict.fr/x.org/
#--- The sources directory.
# Full path to the top level directory where packages will be stored,
# unpacked, and compiled.
export SRC_DIR=/sources
#======== Xorg7 envars ===========
#--- Installation prefix
export XORG_PREFIX=/usr
#--- Configure switches
export XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/etc \
--localstatedir=/var --disable-static"
#======== ABOUT GNOME envars =====
# Refer to `Chapter 30. Right now, the book hard codes --prefix=/usr
# and does not make use of the variables below. If you need another prefix,
# You'll have to modifiy the prefix in the book source and use the variables
# below. But this is not supported in this tool.
#======== LEGACY GNOME envars ====
# We use envars.conf instead of /etc/profile.d. But if you
# install into a different prefix, you'll need to update ld.so.conf and
# man-db.conf, too.
#--- Installation prefix
# export GNOME_PREFIX=/usr
# export GNOME_SYSCONFDIR=/etc/gnome/3.2.2
# export XDG_CONFIG_DIRS=$GNOME_SYSCONFDIR/xdg
# export XDG_DATA_DIRS=/usr/share:/usr/local/share
#--- If you want to install GNOME on a non standard prefix, uncomment
# the next export lines and edit it if needed.
# See also the GNOME Pre-installation Configuration HTML page for
# aditional required commands.
#export PATH=$PATH:$GNOME_PREFIX/bin
#export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$GNOME_PREFIX/lib/pkgconfig
#export GNOME_LIBCONFIG_PATH=/usr/lib:$GNOME_PREFIX/lib
#======== KDE envars =============
# Refer to `Chapter 27. Introduction->KDE Pre-installation Configuration'
# for rationale. We use envars.conf instead of /etc/profile.d. But if you
# install into a different prefix, you'll need to update ld.so.conf and
# man-db.conf, and to create and populate the directories $KDE_PREFIX/share
# and /etc/dbus-1, as instructed.
#--- Installation prefix
export KDE_PREFIX=/usr
#--- If you want to install KDE on a non standard prefix, uncomment
# the next lines and edit them as needed.
#export KDE_PREFIX=/opt/kde
#export KDEDIR=$KDE_PREFIX
#PATH=$PATH:$KDE_PREFIX/bin
#if [ -z PKG_CONFIG_PATH ]; then
#export PKG_CONFIG_PATH=$KDE_PREFIX/lib/pkgconfig:$KDE_PREFIX/share/pkgconfig
#else
# PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$KDE_PREFIX/lib/pkgconfig:$KDE_PREFIX/share/pkgconfig
#fi
# Note: there is a report that setting XDG_... vars for kde may break LXDE
#if [ -z XDG_DATA_DIRS ]; then
#export XDG_DATA_DIRS=$KDE_PREFIX/share
#else
# XDG_DATA_DIRS=$XDG_DATA_DIRS:$KDE_PREFIX/share
#fi
#if [ -z XDG_CONFIG_DIRS ]; then
#export XDG_CONFIG_DIRS=/etc/kde/xdg
#else
# XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:/etc/kde/xdg
#fi
#======== LXQt envars =============
# Refer to `Chapter 40. LXQt Desktop Pre-Install Instructions'
# We use envars.conf for LXQT_PREFIX, instead of /etc/profile.d. But if you
# install into a different prefix, you'll need to create the relevant
# directory, to create /etc/profiles.d/lxqt.sh, update /etc/ld.so.conf, and
# to create and populate the directories $LXQT_PREFIX/share/icons, as
# instructed.
#--- Installation prefix
export LXQT_PREFIX=/usr
#--- If you want to install LXQT on a non standard prefix, uncomment
# the next line and edit it as needed, or just use the book's
# /etc/profile.d/lxqt.sh.
# export LXQT_PREFIX=/opt/lxqt
# export FTP_X_SERVER=ftp://mirror.cict.fr/x.org/
#======== Optimizations =============
# Global optimization settings can be placed here. This settings can be
# overrided by settings in the packages build scripts.
# overriden by settings in the packages build scripts.
# WARNING: The use of build optimizations may be dangerous.
# You should know what you are doing and be sure that the
@ -145,8 +77,23 @@ export MAKEFLAGS="-j5"
#======== Environment settings ========
# Since the startup files may be changed in the course
# of a build, ensure that environment variables are
# up to date
# The prefered way to setup environment variables nowadays
# is to set them in /etc/profile{,.d/*.sh}.
# It is recommended to source /etc/profile in this file
# since a package may add some new variables in there,
# which may be needed later in dependant packages.
if [ -r /etc/profile ]; then source /etc/profile; fi
#======== Package management ========
# We need the functions in "packInstall.sh" when installing a package,
# if package management is requested. Note that we have no way to know
# whether package management is requested for a given build.
# Furthermore, "sudo -E" exports variables, but not functions from
# the environment, and sudo needs to be called before porg, due
# to porg limitations. So we just export the location of the file
# where the functions are defined, and we'll source it just before
# installing.
export PACK_INSTALL=/blfs_root/packInstall.sh # change as needed

View file

@ -156,11 +156,19 @@ EOF
}
if [[ ! -d ${BUILD_SCRIPTS} ]] ; then
echo -e "\n\tThe \'${BUILD_SCRIPTS}\' directory has not been found.\n"
echo -e "\n\tThe '${BUILD_SCRIPTS}' directory has not been found.\n"
exit 1
fi
# Let us make a clean base, but first ensure that we are
# not emptying a useful directory.
MYDIR=$(pwd)
MYDIR=$(basename $MYDIR)
if [ "${MYDIR#work}" = "${MYDIR}" ] ; then
echo -e \\n\\tDirectory ${BOLD}$MYDIR${OFF} does not begin with \"work\"\\n
exit 1
fi
# Let us make a clean base:
rm -rf *
generate_Makefile

View file

@ -34,12 +34,12 @@ BLFS_DIR=$3
if test -z "${BLFS_DIR}"; then BLFS_DIR=$(cd $(dirname ${BLFS_XML})/.. ; pwd);fi
# Packages whose version does not begin with a number
EXCEPTIONS=$(grep 'ENTITY.*version[ ]*"[^0-9"&.].*[0-9]' $BLFS_XML |
EXCEPTIONS=$(grep 'ENTITY.*version[ ]*"[^0-9"&.].*[0-9]' ${BLFS_DIR}/packages.ent |
sed 's@^[^"]*"\([^"]*\)".*@\1@')
# Non-versioned packages:
NV_LIST="cacerts xorg-env kde-pre-install-config kf5-intro lxqt-pre-install \
ojdk-conf tex-path"
lxqt-post-install ojdk-conf tex-path"
# Set PATH to be sure to find udevadm
SAVPATH=$PATH
@ -146,7 +146,7 @@ EOF
# that the preceding package is a dependency of the following,
# except the first.
list_cat="$(sed -n '/>cat/,/EOF</p' $file | grep -v 'cat\|EOF' |
sed 's/^[^ ]*\ *\([^&]*\).*/\1/' | sed 's/-$//')"
awk '{ print $NF }' | sed 's/-&.*//')"
# Rationale for the sed below: the following for breaks words at spaces (unless
# we tweak IFS). So replace spaces with commas in lines so that only newlines

View file

@ -26,6 +26,7 @@ declare BLFS_XML="${TOPDIR}/blfs-xml"
declare -a TARGET
declare DEP_LEVEL
declare SUDO
declare WRAP_INSTALL
#--------------------------#
parse_configuration() { #
@ -44,6 +45,7 @@ parse_configuration() { #
# Create global variables for these parameters.
optDependency=* | \
MAIL_SERVER=* | \
WRAP_INSTALL=* | \
SUDO=* ) eval ${REPLY} # Define/set a global variable..
continue ;;
esac
@ -62,13 +64,14 @@ parse_configuration() { #
TARGET=(${optTARGET[*]})
DEP_LEVEL=$optDependency
SUDO=${SUDO:-n}
WRAP_INSTALL=${WRAP_INSTALL:-n}
}
#--------------------------#
validate_configuration() { #
#--------------------------#
local -r dotSTR=".................."
local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER"
local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER WRAP_INSTALL"
local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
local config_param
local -i index
@ -179,6 +182,7 @@ echo -en "\n\tGenerating the build scripts ...\n"
rm -rf scripts
xsltproc --xinclude --nonet \
--stringparam sudo $SUDO \
--stringparam wrap-install $WRAP_INSTALL \
-o ./scripts/ ${MakeScripts} \
${BookXml}
# Make the scripts executable.

View file

@ -277,15 +277,16 @@ tree_erase() { #
local file=$1
local f
local -a rootlink
local -a rootlink2
local rootlink2
#echo file=$file
rootlink=($(head -n1 $file))
for f in $(grep '[^0-9 ]' $file | sed 's/.* //'); do
# echo " f"=$f
if [ -f ${f}.dep ]; then
rootlink2=($(head -n1 ${f}.dep))
if [[ "${rootlink2[*]}" =~ "${rootlink[*]}" ]] ; then
rootlink2="$(head -n1 ${f}.dep) "
# See comment above about srootlink
if [[ ${rootlink2#"${rootlink[*]} "} != ${rootlink2} ]] ; then
tree_erase ${f}.dep
fi
fi

View file

@ -58,6 +58,16 @@ config SUDO
help
Select if sudo will be used (you build as a normal user)
otherwise sudo is not needed (you build as root)
config WRAP_INSTALL
bool "Use `porg style' package management"
default n
help
Select if you want the installation commands to be wrapped
between "wrapInstall '" and "' ; packInstall" functions,
where wrapInstall is used to set up a LD_PRELOAD library (for
example using porg), and packInstall makes the package tarball
</xsl:text>
</xsl:template>

View file

@ -40,7 +40,7 @@
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
<xsl:text>&#xA; </xsl:text>
<xsl:element name="name">
<xsl:value-of select="title"/>
<xsl:value-of select="normalize-space(title)"/>
</xsl:element>
<xsl:text>&#xA;&#xA;</xsl:text>
<xsl:apply-templates select="chapter"/>
@ -61,7 +61,7 @@
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
<xsl:text>&#xA; </xsl:text>
<xsl:element name="name">
<xsl:value-of select="title"/>
<xsl:value-of select="normalize-space(title)"/>
</xsl:element>
<xsl:text>&#xA;</xsl:text>
<xsl:apply-templates select=".//sect1">
@ -89,7 +89,7 @@
<xsl:text> </xsl:text>
<package><xsl:text>&#xA; </xsl:text>
<xsl:element name="name">
<xsl:value-of select="title"/>
<xsl:value-of select="normalize-space(title)"/>
</xsl:element>
<xsl:text>&#xA;</xsl:text>
<!-- Do not use .//*, which would include self. -->
@ -247,7 +247,7 @@
<xsl:template match="para" mode="dependency">
<xsl:variable name="status" select="./@role"/>
<!-- First internal dependencies -->
<xsl:for-each select="./xref">
<xsl:for-each select=".//xref">
<xsl:choose>
<!-- Avoid depending of myself -->
<xsl:when test="ancestor::*[@id=current()/@linkend]"/>
@ -278,7 +278,7 @@
</xsl:choose>
</xsl:for-each>
<!-- then external dependencies -->
<xsl:for-each select="./ulink">
<xsl:for-each select=".//ulink">
<xsl:text>
</xsl:text>
<xsl:element name="dependency">

View file

@ -8,6 +8,18 @@
<xsl:param name="list" select="''"/>
<xsl:param name="MTA" select="'sendmail'"/>
<!-- Check whether the book is sysv or systemd -->
<xsl:variable name="rev">
<xsl:choose>
<xsl:when test="//bookinfo/title/phrase[@revision='systemd']">
<xsl:text>systemd</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>sysv</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:output
method="xml"
encoding="ISO-8859-1"
@ -19,7 +31,14 @@
<preface>
<?dbhtml filename="preface.html"?>
<title>Preface</title>
<xsl:copy-of select="id('bootscripts')"/>
<xsl:choose>
<xsl:when test="$rev='sysv'">
<xsl:copy-of select="id('bootscripts')"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="id('systemd-units')"/>
</xsl:otherwise>
</xsl:choose>
</preface>
<chapter>
<?dbhtml filename="chapter.html"?>
@ -112,7 +131,8 @@
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@linkend='bootscripts'">
<xsl:when test="@linkend='bootscripts' or
@linkend='systemd-units'">
<xsl:copy-of select="."/>
</xsl:when>
<xsl:otherwise>
@ -307,6 +327,13 @@
select=".//userinput[starts-with(string(),'cat ')]"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="download-dir">
<xsl:call-template name="download-dir">
<xsl:with-param name="package" select="concat(' ',$package,'-')"/>
<xsl:with-param name="cat-md5"
select=".//userinput[starts-with(string(),'cat ')]"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="install-instructions">
<xsl:call-template name="inst-instr">
<xsl:with-param name="inst-instr"
@ -328,6 +355,7 @@
<xsl:attribute name="url">
<xsl:value-of
select=".//para[contains(string(),'(HTTP)')]/ulink/@url"/>
<xsl:value-of select="$download-dir"/>
<xsl:value-of select="$tarball"/>
</xsl:attribute>
</xsl:element>
@ -338,6 +366,7 @@
<xsl:attribute name="url">
<xsl:value-of
select=".//para[contains(string(),'(FTP)')]/ulink/@url"/>
<xsl:value-of select="$download-dir"/>
<xsl:value-of select="$tarball"/>
</xsl:attribute>
</xsl:element>
@ -407,9 +436,43 @@ END DEBUG -->
select="substring-after($cat-md5,'&#xA;')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(substring-before($cat-md5,$package),' ')">
<xsl:call-template name="tarball">
<xsl:with-param name="package" select="$package"/>
<xsl:with-param name="cat-md5"
select="substring-after($cat-md5,' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="substring-after(
substring-before($cat-md5,'&#xA;'),' ')"/>
substring-before($cat-md5,'&#xA;'),' ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- get the download dirname from the text that comes from the .md5 file -->
<xsl:template name="download-dir">
<xsl:param name="package"/>
<xsl:param name="cat-md5"/>
<xsl:choose>
<xsl:when test="not(@id='xorg7-legacy')">
<xsl:copy-of select="''"/>
</xsl:when>
<xsl:when test="contains(substring-before($cat-md5,$package),'&#xA;')">
<xsl:call-template name="download-dir">
<xsl:with-param name="package" select="$package"/>
<xsl:with-param name="cat-md5"
select="substring-after($cat-md5,'&#xA;')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(substring-before($cat-md5,$package),' ')">
<xsl:call-template name="download-dir">
<xsl:with-param name="package" select="$package"/>
<xsl:with-param name="cat-md5"
select="substring-after($cat-md5,' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="substring-before($cat-md5,' ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

View file

@ -9,6 +9,22 @@
<!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. -->
<!-- Check whether the book is sysv or systemd -->
<xsl:variable name="rev">
<xsl:choose>
<xsl:when test="//bookinfo/title/phrase[@revision='systemd']">
systemd
</xsl:when>
<xsl:otherwise>
sysv
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Wrap "root" commands inside a wrapper function, allowing
"porg style" package management -->
<xsl:param name="wrap-install" select="'n'"/>
<!-- Build as user (y) or as root (n)? -->
<xsl:param name="sudo" select="'y'"/>
@ -20,7 +36,7 @@
<xsl:template match="sect1">
<xsl:if test="@id != 'bootscripts'">
<xsl:if test="@id != 'bootscripts' and @id != 'systemd-units'">
<!-- The file names -->
<xsl:variable name="filename" select="@id"/>
@ -57,14 +73,23 @@
<xsl:choose>
<!-- Package page -->
<xsl:when test="sect2[@role='package']">
<!-- We build in a subdirectory -->
<xsl:text>PKG_DIR=</xsl:text>
<!-- We build in a subdirectory, whose name may be needed
if using package management (see envars.conf), so
"export" it -->
<xsl:text>export PKG_DIR=</xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>&#xA;</xsl:text>
<xsl:text>
SRC_DIR=${SRC_ARCHIVE}${SRC_SUBDIRS:+/${PKG_DIR}}
BUILD_DIR=${BUILD_ROOT}${BUILD_SUBDIRS:+/${PKG_DIR}}
mkdir -p $SRC_DIR
mkdir -p $BUILD_DIR
</xsl:text>
<!-- Download code and build commands -->
<xsl:apply-templates select="sect2"/>
<!-- Clean-up -->
<xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
<xsl:text>cd $BUILD_DIR
[[ -n "$KEEP_FILES" ]] || </xsl:text>
<!-- In some case, some files in the build tree are owned
by root -->
<xsl:if test="$sudo='y'">
@ -87,8 +112,8 @@
<xsl:template match="sect2">
<xsl:choose>
<xsl:when test="@role = 'package'">
<xsl:text>mkdir -p $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
<xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
<xsl:text>cd $SRC_DIR
</xsl:text>
<!-- Download information is in bridgehead tags -->
<xsl:apply-templates select="bridgehead[@renderas='sect3']"/>
<xsl:text>&#xA;</xsl:text>
@ -98,32 +123,39 @@
</xsl:when>
<xsl:when test="@role = 'installation'">
<xsl:text>
cd $BUILD_DIR
find . -maxdepth 1 -mindepth 1 -type d | xargs </xsl:text>
<xsl:if test="$sudo='y'">
<xsl:text>sudo </xsl:text>
</xsl:if>
<xsl:text>rm -rf
case $PACKAGE in
*.tar.gz|*.tar.bz2|*.tar.xz|*.tgz)
tar -xvf $PACKAGE &gt; unpacked
UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^./@@;s@/.*@@'`
*.tar.gz|*.tar.bz2|*.tar.xz|*.tgz|*.tar.lzma)
tar -xvf $SRC_DIR/$PACKAGE &gt; unpacked
UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^\./@@;s@/.*@@'`
;;
*.tar.lz)
bsdtar -xvf $SRC_DIR/$PACKAGE 2&gt; unpacked
UNPACKDIR=`head -n1 unpacked | cut -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
;;
*.zip)
zipinfo -1 $PACKAGE &gt; unpacked
zipinfo -1 $SRC_DIR/$PACKAGE &gt; unpacked
UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
if test $(wc -w &lt;&lt;&lt; $UNPACKDIR) -eq 1; then
unzip $PACKAGE
unzip $SRC_DIR/$PACKAGE
else
UNPACKDIR=${PACKAGE%.zip}
unzip -d $UNPACKDIR $PACKAGE
unzip -d $UNPACKDIR $SRC_DIR/$PACKAGE
fi
;;
*)
UNPACKDIR=$PKG_DIR-build
mkdir $UNPACKDIR
cp $PACKAGE $UNPACKDIR
cp $SRC_DIR/$PACKAGE $UNPACKDIR
cp $(find . -mindepth 1 -maxdepth 1 -type l) $UNPACKDIR
;;
esac
export UNPACKDIR
cd $UNPACKDIR&#xA;
</xsl:text>
<xsl:apply-templates select=".//screen | .//para/command"/>
@ -197,43 +229,37 @@ cd $UNPACKDIR&#xA;
<xsl:value-of select="$package"/>
<xsl:text>&#xA;if [[ ! -f $</xsl:text>
<xsl:value-of select="$varname"/>
<xsl:text> ]] ; then&#xA;</xsl:text>
<!-- SRC_ARCHIVE may have subdirectories or not -->
<xsl:text> if [[ -f $SRC_ARCHIVE/$PKG_DIR/$</xsl:text>
<xsl:value-of select="$varname"/>
<xsl:text> ]] ; then&#xA;</xsl:text>
<xsl:text> cp $SRC_ARCHIVE/$PKG_DIR/$</xsl:text>
<xsl:value-of select="$varname"/>
<xsl:text> $</xsl:text>
<xsl:value-of select="$varname"/>
<xsl:text>&#xA;</xsl:text>
<xsl:text> elif [[ -f $SRC_ARCHIVE/$</xsl:text>
<xsl:text> ]] ; then
if [[ -f $SRC_ARCHIVE/$</xsl:text>
<xsl:value-of select="$varname"/>
<xsl:text> ]] ; then&#xA;</xsl:text>
<xsl:text> cp $SRC_ARCHIVE/$</xsl:text>
<xsl:value-of select="$varname"/>
<xsl:text> $</xsl:text>
<xsl:value-of select="$varname"/>
<xsl:text>&#xA; else&#xA;</xsl:text>
<!-- The FTP_SERVER mirror -->
<xsl:text>
else&#xA;</xsl:text>
<!-- Download from upstream http -->
<xsl:if test="string-length($httpurl) &gt; 10">
<xsl:text> wget -T 30 -t 5 </xsl:text>
<xsl:value-of select="$httpurl"/>
<xsl:text> ||&#xA;</xsl:text>
</xsl:if>
<!-- Download from upstream ftp -->
<xsl:if test="string-length($ftpurl) &gt; 10">
<xsl:text> wget -T 30 -t 5 </xsl:text>
<xsl:value-of select="$ftpurl"/>
<xsl:text> ||&#xA;</xsl:text>
</xsl:if>
<!-- The FTP_SERVER mirror as a last resort -->
<xsl:text> wget -T 30 -t 5 ${FTP_SERVER}svn/</xsl:text>
<xsl:value-of select="$first_letter"/>
<xsl:text>/$</xsl:text>
<xsl:value-of select="$varname"/>
<xsl:if test="string-length($httpurl) &gt; 10">
<xsl:text> ||
wget -T 30 -t 5 </xsl:text>
<xsl:value-of select="$httpurl"/>
</xsl:if>
<xsl:if test="string-length($ftpurl) &gt; 10">
<xsl:text> ||
wget -T 30 -t 5 </xsl:text>
<xsl:value-of select="$ftpurl"/>
</xsl:if>
<xsl:text>
<xsl:text><!--
cp $</xsl:text>
<xsl:value-of select="$varname"/>
<xsl:text> $SRC_ARCHIVE
<xsl:text> $SRC_ARCHIVE-->
fi
fi
</xsl:text>
@ -243,6 +269,14 @@ fi
<xsl:text>&#x20;&#x20;$</xsl:text>
<xsl:value-of select="$varname"/>
<xsl:text>" | md5sum -c -
</xsl:text>
</xsl:if>
<!-- link additional packages into $BUILD_DIR, because they are supposed to
be there-->
<xsl:if test="string($varname) != 'PACKAGE'">
<xsl:text>[[ "$SRC_DIR" != "$BUILD_DIR" ]] &amp;&amp; ln -sf $SRC_DIR/$</xsl:text>
<xsl:value-of select="$varname"/>
<xsl:text> $BUILD_DIR
</xsl:text>
</xsl:if>
</xsl:template>
@ -380,12 +414,30 @@ fi
<xsl:if test="child::* = userinput and not(@role = 'nodump')">
<xsl:choose>
<xsl:when test="@role = 'root'">
<xsl:if test="$sudo = 'y'">
<xsl:text>sudo -E sh &lt;&lt; ROOT_EOF&#xA;</xsl:text>
<xsl:if test="not(preceding-sibling::screen[1][@role='root'])">
<xsl:if test="$sudo = 'y'">
<xsl:text>sudo -E sh &lt;&lt; ROOT_EOF&#xA;</xsl:text>
</xsl:if>
<xsl:if test="$wrap-install = 'y' and
ancestor::sect2[@role='installation']">
<xsl:text>if [ -r "$PACK_INSTALL" ]; then
source $PACK_INSTALL
export -f wrapInstall
export -f packInstall
fi
wrapInstall '
</xsl:text>
</xsl:if>
</xsl:if>
<xsl:apply-templates mode="root"/>
<xsl:if test="$sudo = 'y'">
<xsl:text>&#xA;ROOT_EOF</xsl:text>
<xsl:if test="not(following-sibling::screen[1][@role='root'])">
<xsl:if test="$wrap-install = 'y' and
ancestor::sect2[@role='installation']">
<xsl:text>'&#xA;packInstall</xsl:text>
</xsl:if>
<xsl:if test="$sudo = 'y'">
<xsl:text>&#xA;ROOT_EOF</xsl:text>
</xsl:if>
</xsl:if>
</xsl:when>
<xsl:otherwise>
@ -396,12 +448,20 @@ fi
</xsl:if>
</xsl:template>
<xsl:template match="screen" mode="config">
<xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
<xsl:text>[[ ! -d $SRC_DIR/blfs-bootscripts ]] &amp;&amp; mkdir $SRC_DIR/blfs-bootscripts
pushd $SRC_DIR/blfs-bootscripts
<xsl:template name="set-bootpkg-dir">
<xsl:param name="bootpkg" select="'bootscripts'"/>
<xsl:param name="url" select="''"/>
<xsl:text>[[ ! -d $SRC_DIR/blfs-</xsl:text>
<xsl:copy-of select="$bootpkg"/>
<xsl:text> ]] &amp;&amp; mkdir $SRC_DIR/blfs-</xsl:text>
<xsl:copy-of select="$bootpkg"/>
<xsl:text>
pushd $SRC_DIR/blfs-</xsl:text>
<xsl:copy-of select="$bootpkg"/>
<xsl:text>
URL=</xsl:text>
<xsl:value-of select="id('bootscripts')//itemizedlist//ulink/@url"/><xsl:text>
<xsl:value-of select="$url"/>
<xsl:text>
BOOTPACKG=$(basename $URL)
if [[ ! -f $BOOTPACKG ]] ; then
if [[ -f $SRC_ARCHIVE/$PKG_DIR/$BOOTPACKG ]] ; then
@ -428,9 +488,26 @@ else
fi
cd $BOOTUNPACKDIR
</xsl:text>
</xsl:template>
<xsl:template match="screen" mode="config">
<xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
<xsl:call-template name="set-bootpkg-dir">
<xsl:with-param name="bootpkg" select="'bootscripts'"/>
<xsl:with-param name="url"
select="id('bootscripts')//itemizedlist//ulink/@url"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="preceding-sibling::para[1]/xref[@linkend='systemd-units']">
<xsl:call-template name="set-bootpkg-dir">
<xsl:with-param name="bootpkg" select="'systemd-units'"/>
<xsl:with-param name="url"
select="id('systemd-units')//itemizedlist//ulink/@url"/>
</xsl:call-template>
</xsl:if>
<xsl:apply-templates select='.'/>
<xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
<xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts' or
@linkend='systemd-units']">
<xsl:text>
popd</xsl:text>
</xsl:if>
@ -462,6 +539,8 @@ popd</xsl:text>
</xsl:call-template>
</xsl:template>
<xsl:variable name="APOS">'</xsl:variable>
<xsl:template name="output-root">
<xsl:param name="out-string" select="''"/>
<xsl:choose>
@ -509,6 +588,19 @@ popd</xsl:text>
select="substring-after($out-string,'\')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($out-string,string($APOS))
and $wrap-install = 'y'
and ancestor::sect2[@role='installation']">
<xsl:call-template name="output-root">
<xsl:with-param name="out-string"
select="substring-before($out-string,string($APOS))"/>
</xsl:call-template>
<xsl:text>'\''</xsl:text>
<xsl:call-template name="output-root">
<xsl:with-param name="out-string"
select="substring-after($out-string,string($APOS))"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$out-string"/>
</xsl:otherwise>

187
CHEATSHEET Normal file
View file

@ -0,0 +1,187 @@
$Id$
This file contains examples of menu settings for various tasks.
------------------------------
LFS book, System V, stable (8.0) version.
Download the files to /usr/src (verify you have write access)
Build in /mnt/lfs (verify you have write access too)
Clean the build directory before beginning
Build a kernel, whose configuration is in /home/user/config-4.9.9-lfs-1
An fstab for the future system si located in /home/user/fstablfs
Run only the critical testsuites
Settings for a French user
Run four make jobs in parallel
-----------------------------
BOOK Settings --->
Use BOOK (Linux From Scratch System V) --->
Release (Branch or stable book) --->
Branch (preceded by "branch-"), stable Version, or tag (8.0)
[ ] Add blfs-tool support (NEW)
[ ] Add custom tools support (NEW)
General Settings --->
[ ] Change the default user/group and homedir for this build (NEW)
Build Directory (/mnt/lfs)
[*] Retrieve source files
Package Archive Directory (/usr/src)
[ ] Retry on 'connection refused' failure (NEW)
Number of retry attempts on download failures (20) (NEW)
Download timeout (in seconds) (30) (NEW)
FTP mirror (http://ftp.osuosl.org) (NEW)
[*] Run the makefile
[*] Rebuild files
Build Settings --->
[*] Run testsuites
Tests level (Only final critical testsuites) --->
Flavour (Don't stop on testsuite failures) --->
[ ] Package management
[ ] Create a log of installed files for each package
[*] Use a custom fstab file
Fstab file (optional) ($HOME/fstablfs)
[*] Build the kernel
Kernel config file ($HOME/config-4.9.9-lfs-1)
[ ] Strip Installed Binaries/Libraries
[ ] Install vim-lang package
[ ] DO NOT use/display progress_bar
TimeZone (Europe/Paris)
Language (fr_FR.UTF-8)
[ ] Install the full set of locales
Groff page size (A4) --->
Advanced Features --->
[*] Create SBU and disk usage report
[ ] Run comparison analysis on final stage
[*] Optimization and parallelization
Optimization settings --->
Number of parallel `make' jobs (4)
Optimization level (Both temp tools and final system) --->
Internal Settings (WARNING: for jhalfs developers only) --->
[ ] Rebuild the Makefile (see help)
------------------------------
------------------------------
LFS book, systemd, XML source of the LFS book in /usr/src/lfsbook
Download the files to /usr/src (verify you have write access)
Build in /mnt/lfs (verify you have write access too)
Clean the build directory before beginning
Build a kernel, whose configuration is in /home/user/config-4.10.3-lfs-systemd
An fstab for the future system si located in /home/user/fstablfs
Run all the testsuites
Settings for an user in California
Run four make jobs in parallel
-----------------------------
BOOK Settings --->
Use BOOK (Linux From Scratch systemd) --->
Release (Working Copy) --->
Loc of working copy (mandatory) (/usr/src/lfsbook)
[ ] Add blfs-tool support (NEW)
[ ] Add custom tools support (NEW)
General Settings --->
[ ] Change the default user/group and homedir for this build (NEW)
Build Directory (/mnt/lfs)
[*] Retrieve source files
Package Archive Directory (/usr/src)
[ ] Retry on 'connection refused' failure (NEW)
Number of retry attempts on download failures (20) (NEW)
Download timeout (in seconds) (30) (NEW)
FTP mirror (http://ftp.osuosl.org) (NEW)
[*] Run the makefile
[*] Rebuild files
Build Settings --->
[*] Run testsuites
Tests level (Both temporary tools and final system testsuites) --->
Flavour (Don't stop on testsuite failures) --->
[ ] Package management
[ ] Create a log of installed files for each package
[*] Use a custom fstab file
Fstab file (optional) ($HOME/fstablfs)
[*] Build the kernel
Kernel config file ($HOME/config-4.10.3-lfs-systemd
[ ] Strip Installed Binaries/Libraries
[ ] Install vim-lang package
[ ] DO NOT use/display progress_bar
TimeZone (America/Los_Angeles)
Language (en_US.UTF-8)
[ ] Install the full set of locales
Groff page size (letter) --->
Advanced Features --->
[*] Create SBU and disk usage report
[ ] Run comparison analysis on final stage
[*] Optimization and parallelization
Optimization settings --->
Number of parallel `make' jobs (4)
Optimization level (Both temp tools and final system) --->
Internal Settings (WARNING: for jhalfs developers only) --->
[ ] Rebuild the Makefile (see help)
------------------------------
------------------------------
CLFS book, systemd, stable version (as of April 2017)
X86 multilib
Download the files to /usr/src (verify you have write access)
Build in /mnt/clfs (verify you have write access too)
Clean the build directory before beginning
Use "boot" method, with a temporary kernel in /home/user/config-boot
Build a kernel, whose configuration is in /home/user/config-4.10.3-clfs-systemd
An fstab for the future system si located in /home/user/fstablfs
Run all the testsuites for final system
Settings for an user in Sidney (Australia)
Run four make jobs in parallel
-----------------------------
BOOK Settings --->
Use BOOK (Cross-Compiled Linux From Scratch) --->
Release (Branch or stable book) --->
Branch (preceded by "branch-"), stable Version, or tag (3.0.0-systemd)
Target architecture (x86) --->
Library (multilib) --->
Build method (boot) --->
BOOT kernel config file (mandatory) ($HOME/config-boot)
[ ] Add blfs-tool support (NEW)
[ ] Add custom tools support (NEW)
General Settings --->
[ ] Change the default user/group and homedir for this build (NEW)
Build Directory (/mnt/clfs)
[*] Retrieve source files
Package Archive Directory (/usr/src)
[ ] Retry on 'connection refused' failure (NEW)
Number of retry attempts on download failures (20) (NEW)
Download timeout (in seconds) (30) (NEW)
FTP mirror (http://ftp.osuosl.org) (NEW)
[*] Run the makefile
[*] Rebuild files
Build Settings --->
[*] Run testsuites
Tests level (All final system testsuites) --->
Flavour (Don't stop on testsuite failures) --->
[ ] Create a log of installed files for each package
[*] Use a custom fstab file
Fstab file (optional) ($HOME/fstablfs)
[*] Build the kernel
Kernel config file ($HOME/config-4.10.3-clfs-systemd
[ ] Strip Installed Binaries/Libraries
[ ] Install vim-lang package
[ ] DO NOT use/display progress_bar
TimeZone (Australia/Sydney)
Language (en_AU.UTF-8)
[ ] Install the full set of locales
Groff page size (A4) --->
Advanced Features --->
[*] Create SBU and disk usage report
[ ] Run comparison analysis on final stage
[*] Optimization and parallelization
Optimization settings --->
Number of parallel `make' jobs (4)
Optimization level (Cross tools (only MAKEFLAGS), temp tools and final system) --->
Internal Settings (WARNING: for jhalfs developers only) --->
[ ] Rebuild the Makefile (see help)
--------------------------------

View file

@ -63,6 +63,7 @@ cat << EOF
echo "" >> \$(LUSER_HOME)/.bashrc && \\
echo "unset CFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
echo "unset CXXFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
echo "unset PKG_CONFIG_PATH" >> \$(LUSER_HOME)/.bashrc && \\
echo "" >> \$(LUSER_HOME)/.bashrc && \\
EOF
) >> $MKFILE.tmp
@ -377,10 +378,13 @@ boot_Makefiles() { #
*grub | *aboot | *colo | *silo | *arcload | *lilo | *introduction ) continue ;;
*how-to-view*) continue ;;
*whatnext*) continue ;;
*fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
*fstab) [[ -z "${FSTAB}" ]] ||
[[ ${FSTAB} == $BUILDDIR/sources/fstab ]] ||
cp ${FSTAB} $BUILDDIR/sources/fstab ;;
*kernel) # if there is no kernel config file do not build the kernel
[[ -z $CONFIG ]] && continue
[[ -z $BOOT_CONFIG ]] && continue
# Copy the config file to /sources with a standardized name
[[ ${BOOT_CONFIG} == $BUILDDIR/sources/bootkernel-config ]] ||
cp $BOOT_CONFIG $BUILDDIR/sources/bootkernel-config
;;
esac
@ -495,7 +499,7 @@ boot_Makefiles() { #
*changingowner) wrt_RunAsRoot "${file}" ;;
*devices) wrt_RunAsRoot "${file}" ;;
*fstab)
if [[ -n "$FSTAB" ]]; then
if [[ -n "${FSTAB}" ]]; then
LUSER_wrt_CopyFstab
else
LUSER_wrt_RunAsUser "${file}"
@ -730,10 +734,12 @@ bootscripts_Makefiles() { #
this_script=`basename $file`
case $this_script in
*udev) continue ;; # This is not a script but a commentary, we want udev-rules
*udev) continue ;; # This is not a script but a comment, we want udev-rules
*console*) continue ;; # Use the files that came with the bootscripts
# fstab is now here (for 3.x.y)
*fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
*fstab) [[ -z "${FSTAB}" ]] ||
[[ ${FSTAB} == $BUILDDIR/sources/fstab ]] ||
cp ${FSTAB} $BUILDDIR/sources/fstab ;;
*) ;;
esac
@ -906,10 +912,13 @@ bootable_Makefiles() { #
# A little housekeeping on the scripts
case $this_script in
*grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* ) continue ;;
*fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
*fstab) [[ -z "${FSTAB}" ]] ||
[[ ${FSTAB} == $BUILDDIR/sources/fstab ]] ||
cp ${FSTAB} $BUILDDIR/sources/fstab ;;
*kernel) # if there is no kernel config file do not build the kernel
[[ -z $CONFIG ]] && continue
# Copy the config file to /sources with a standardized name
[[ $CONFIG == $BUILDDIR/sources/kernel-config ]] ||
cp $CONFIG $BUILDDIR/sources/kernel-config
;;
esac

View file

@ -45,6 +45,7 @@ cat << EOF
echo "" >> \$(LUSER_HOME)/.bashrc && \\
echo "unset CFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
echo "unset CXXFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
echo "unset PKG_CONFIG_PATH" >> \$(LUSER_HOME)/.bashrc && \\
echo "" >> \$(LUSER_HOME)/.bashrc && \\
echo "export CLFS_HOST=\"${CLFS_HOST}\"" >> \$(LUSER_HOME)/.bashrc && \\
echo "export CLFS_TARGET=\"${TARGET}\"" >> \$(LUSER_HOME)/.bashrc && \\

View file

@ -45,6 +45,7 @@ cat << EOF
echo "" >> \$(LUSER_HOME)/.bashrc && \\
echo "unset CFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
echo "unset CXXFLAGS" >> \$(LUSER_HOME)/.bashrc && \\
echo "unset PKG_CONFIG_PATH" >> \$(LUSER_HOME)/.bashrc && \\
echo "" >> \$(LUSER_HOME)/.bashrc && \\
echo "export CLFS_HOST=\"${CLFS_HOST}\"" >> \$(LUSER_HOME)/.bashrc && \\
echo "export CLFS_TARGET=\"${TARGET}\"" >> \$(LUSER_HOME)/.bashrc && \\

2086
Config.in

File diff suppressed because it is too large Load diff

View file

@ -8,15 +8,28 @@
extension-element-prefixes="exsl"
version="1.0">
<!-- Parameters -->
<!-- which revision attribute to include: can only be sysv or systemd,
but we leave checking to the caller-->
<xsl:param name="revision" select="'sysv'"/>
<!-- use package management ?
n = no, original behavior
y = yes, add PKG_DEST to scripts in install commands of chapter06-08
-->
<xsl:param name="pkgmngt" select="n"/>
<xsl:param name="pkgmngt" select="'n'"/>
<!-- Package management with "porg style" ?
n = no, same as pkgmngt description above
y = yes, wrap install commands of chapter06-08 into a bash function.
note that pkgmngt must be 'y' in this case
-->
<xsl:param name="wrap-install" select='"n"'/>
<!-- Run test suites?
0 = none
1 = only chapter06 Glibc, GCC and Binutils testsuites
1 = only chapter06 critical testsuites
2 = all chapter06 testsuites
3 = all chapter05 and chapter06 testsuites
-->
@ -26,37 +39,58 @@
n = no, I want to build the full system and review the logs
y = yes, bomb at the first test suite failure to can review the build dir
-->
<xsl:param name="bomb-testsuite" select="n"/>
<xsl:param name="bomb-testsuite" select="'n'"/>
<!-- Install vim-lang package? OBSOLETE should always be 'n'-->
<xsl:param name="vim-lang" select="n"/>
<xsl:param name="vim-lang" select="'n'"/>
<!-- Time zone -->
<xsl:param name="timezone" select="GMT"/>
<xsl:param name="timezone" select="'GMT'"/>
<!-- Page size -->
<xsl:param name="page" select="letter"/>
<xsl:param name="page" select="'letter'"/>
<!-- Locale settings -->
<xsl:param name="lang" select="C"/>
<xsl:param name="lang" select="'C'"/>
<!-- Install the whole set of locales -->
<xsl:param name='full-locale' select='n'/>
<xsl:param name='full-locale' select='"n"'/>
<!-- Hostname -->
<xsl:param name='hostname' select='"HOSTNAME"'/>
<!-- Network parameters: interface, ip, gateway, prefix, broadcast, domain
and nameservers -->
<xsl:param name='interface' select="'eth0'"/>
<xsl:param name='ip' select='"10.0.2.9"'/>
<xsl:param name='gateway' select='"10.0.2.2"'/>
<xsl:param name='prefix' select='24'/>
<xsl:param name='broadcast' select='"10.0.2.255"'/>
<xsl:param name='domain' select='"lfs.org"'/>
<xsl:param name='nameserver1' select='"10.0.2.3"'/>
<xsl:param name='nameserver2' select='"8.8.8.8"'/>
<!-- End parameters -->
<xsl:template match="/">
<xsl:apply-templates select="//sect1"/>
<xsl:apply-templates select="//sect1[not(@revision) or
@revision=$revision]"/>
</xsl:template>
<xsl:template match="sect1">
<!-- Since this xsl:if tag encloses the whole template, it would
be much better to transpose this condition to the select part
of the "calling" apply-template. But that would change the numbering,
so that it would be difficult to compare to previous versions. So for
version 2.4, let us keep this -->
<xsl:if test="(../@id='chapter-temporary-tools' or
../@id='chapter-building-system' or
../@id='chapter-bootscripts' or
../@id='chapter-bootable') and
count(descendant::screen/userinput) &gt; 0 and
count(descendant::screen/userinput) &gt;
count(descendant::screen[@role='nodump']) and
count(descendant::screen/userinput) &gt;
count(descendant::screen/userinput[starts-with(string(),'chroot')])">
(sect2[not(@revision) or @revision=$revision]//..|.)/
screen[(not(@role) or @role != 'nodump') and
(not(@revision) or @revision=$revision)]/
userinput[not(starts-with(string(),'chroot'))]">
<!-- The last condition is a hack to allow previous versions of the
book where the chroot commands did not have role="nodump".
It only works if the chroot command is the only one on the page -->
@ -123,9 +157,12 @@
<xsl:if test="sect2[@role='installation']">
<xsl:text>cd $PKGDIR&#xA;</xsl:text>
</xsl:if>
<xsl:apply-templates select="sect2|
screen[not(@role) or
@role!='nodump']/userinput"/>
<xsl:apply-templates select="sect2[not(@revision) or
@revision=$revision] |
screen[(not(@role) or
@role!='nodump') and
(not(@revision) or
@revision=$revision)]/userinput"/>
<xsl:if test="@id='ch-system-creatingdirs' and $pkgmngt='y'">
<xsl:apply-templates
select="document('packageManager.xml')//sect1[
@ -148,8 +185,10 @@
<xsl:template match="sect2">
<xsl:apply-templates
select=".//screen[not(@role) or
@role != 'nodump']/userinput[
select=".//screen[(not(@role) or
@role != 'nodump') and
(not(@revision) or
@revision=$revision)]/userinput[
@remap = 'pre' or
@remap = 'configure' or
@remap = 'make' or
@ -162,7 +201,13 @@
descendant::screen[not(@role) or
@role != 'nodump']/userinput[
@remap='install']">
<xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
<xsl:choose>
<xsl:when test="$wrap-install='y'">
<xsl:text>wrapInstall '
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
@ -171,42 +216,74 @@ case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 &amp;&amp; ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="../@id = 'ch-system-glibc' and
@role='installation' and
$pkgmngt = 'y'">
$pkgmngt = 'y' and
$wrap-install = 'n'">
<xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
</xsl:text>
</xsl:if>
<xsl:apply-templates
select=".//screen[not(@role) or
@role != 'nodump']/userinput[@remap = 'install']"/>
select=".//screen[(not(@role) or
@role != 'nodump') and
(not(@revision) or
@revision=$revision)]/userinput[@remap = 'install']"/>
<xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
$pkgmngt = 'y' and
descendant::screen[not(@role) or
@role != 'nodump']/userinput[
@remap='install']">
<xsl:if test="../@id = 'ch-system-man-pages'">
<xsl:choose>
<xsl:when test="$wrap-install='y'">
<xsl:if test="../@id = 'ch-system-man-pages'">
<!-- these files are provided by the shadow package -->
<xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
<xsl:text>rm -fv /usr/share/man/{man3/getspnam.3,man5/passwd.5}
</xsl:text>
</xsl:if>
</xsl:if>
<!-- Attr man/man2 pages are already installed by man-pages. As of
March 2013, they are the same pages.
November 2015: now they are more accurate
in man-pages, and the man5 section is also in man-pages... -->
<xsl:if test="../@id = 'ch-system-attr'">
<xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
<xsl:if test="../@id = 'ch-system-attr'">
<xsl:text>rm -fv /usr/share/man/man2/*
rm -fv /usr/share/man/man5/*
</xsl:text>
</xsl:if>
<!-- nologin is installed by util-linux. remove it from shadow -->
<xsl:if test="../@id = 'ch-system-shadow'">
<xsl:text>rm -fv /usr/share/man/man8/nologin.8
rm -fv /sbin/nologin
</xsl:text>
</xsl:if>
<xsl:text>'
packInstall
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:if test="../@id = 'ch-system-man-pages'">
<!-- these files are provided by the shadow package -->
<xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
</xsl:text>
</xsl:if>
<!-- Attr man/man2 pages are already installed by man-pages. As of
March 2013, they are the same pages.
November 2015: now they are more accurate
in man-pages, and the man5 section is also in man-pages... -->
<xsl:if test="../@id = 'ch-system-attr'">
<xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
rm -fv $PKG_DEST/usr/share/man/man5/*
</xsl:text>
</xsl:if>
</xsl:if>
<!-- nologin is installed by util-linux. remove it from shadow -->
<xsl:if test="../@id = 'ch-system-shadow'">
<xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8
<xsl:if test="../@id = 'ch-system-shadow'">
<xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8
rm -fv $PKG_DEST/sbin/nologin
</xsl:text>
</xsl:if>
<xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
</xsl:if>
<xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/man/man{1..8}; do
[[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
@ -223,6 +300,8 @@ done
packInstall
rm -rf $PKG_DEST
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="$testsuite='3' and
../@id='ch-tools-glibc' and
@ -255,8 +334,10 @@ fi
</xsl:if>
<xsl:apply-templates
select=".//screen[
not(@role) or
@role != 'nodump'
(not(@role) or
@role != 'nodump') and
(not(@revision) or
@revision=$revision)
]/userinput[
not(@remap) or
@remap='adjust' or
@ -291,7 +372,7 @@ cd $PKGDIR
mode="pkgmngt"/>
<xsl:if test="$dirname = 'chapter06'">
<xsl:text>packInstall
rm -rf $PKG_DEST
rm -rf "$PKG_DEST"
</xsl:text>
</xsl:if>
<xsl:apply-templates
@ -434,7 +515,26 @@ exit
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise><!--pkgmngt = 'y'-->
<xsl:when test="$wrap-install='y'">
<xsl:choose>
<xsl:when test="./literal">
<xsl:call-template name="output-wrap">
<xsl:with-param name="commands" select="text()[1]"/>
</xsl:call-template>
<xsl:apply-templates select="literal"/>
<xsl:call-template name="output-wrap">
<xsl:with-param name="commands" select="text()[2]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="output-wrap">
<xsl:with-param name="commands" select="string()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise><!--pkgmngt = 'y' and wrap-install='n'-->
<xsl:choose>
<xsl:when test="./literal">
<xsl:call-template name="outputpkgdest">
@ -458,7 +558,7 @@ exit
tzdata. -->
<xsl:when test="contains(string(),'tzdata') and $pkgmngt='y'">
<xsl:text>
OLD_PKG_DEST=$PKG_DEST
OLD_PKG_DEST="$PKG_DEST"
OLD_PKGDIR=$PKGDIR
PKG_DEST=$(dirname $OLD_PKG_DEST)/001-tzdata
PKGDIR=$(dirname $PKGDIR)/tzdata-</xsl:text>
@ -467,12 +567,28 @@ PKGDIR=$(dirname $PKGDIR)/tzdata-</xsl:text>
'.tar')"/>
<xsl:text>
</xsl:text>
<xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
<xsl:text>ZONEINFO=$PKG_DEST</xsl:text>
<xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
<xsl:text>
<xsl:choose>
<xsl:when test="$wrap-install='n'">
<xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
<xsl:text>ZONEINFO=$PKG_DEST</xsl:text>
<xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
<xsl:text>
packInstall
rm -rf $PKG_DEST
</xsl:text>
</xsl:when>
<xsl:otherwise><!-- wrap-install='y' -->
<xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
<xsl:text>
wrapInstall '
ZONEINFO=</xsl:text>
<xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
<xsl:text>'
packInstall
</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text>
PKG_DEST=$OLD_PKG_DEST
unset OLD_PKG_DEST
PKGDIR=$OLD_PKGDIR
@ -499,6 +615,34 @@ unset OLD_PKGDIR
<xsl:when test="contains(string(.),'&lt;ll&gt;_&lt;CC&gt;')">
<xsl:value-of select="$lang"/>
</xsl:when>
<xsl:when test="contains(string(.),'Domain')">
<xsl:value-of select="$domain"/>
</xsl:when>
<xsl:when test="contains(string(.),'primary')">
<xsl:value-of select="$nameserver1"/>
</xsl:when>
<xsl:when test="contains(string(.),'secondary')">
<xsl:value-of select="$nameserver2"/>
</xsl:when>
<xsl:when test="contains(string(.),'192.168.1.1')">
<xsl:value-of select="$ip"/>
</xsl:when>
<xsl:when test="contains(string(.),'192.168.0.2')">
<xsl:value-of select="$ip"/>
</xsl:when>
<!-- Only adapted to LFS-20170310 and later -->
<xsl:when test="contains(string(.),'HOSTNAME')">
<xsl:value-of select="$hostname"/>
</xsl:when>
<xsl:when test="contains(string(.),'FQDN')">
<xsl:value-of select="$hostname"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="$domain"/>
</xsl:when>
<xsl:when test="contains(string(.),'alias')"/>
<xsl:when test="contains(string(.),'&lt;lfs&gt;')">
<xsl:value-of select="$hostname"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>**EDITME</xsl:text>
<xsl:apply-templates/>
@ -507,6 +651,185 @@ unset OLD_PKGDIR
</xsl:choose>
</xsl:template>
<xsl:template match="literal">
<xsl:choose>
<xsl:when test="contains(string(),'ONBOOT')">
<xsl:call-template name="outputnet">
<xsl:with-param name="netstring" select="string()"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(string(),'[Match]')">
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring" select="string()"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="outputnet">
<xsl:param name="netstring" select="''"/>
<!-- We suppose that book example has the following values:
- interface: eth0
- ip: 192.168.1.2
- gateway: 192.168.1.1
- prefix: 24
- broadcast: 192.168.1.255
Change below if book changes -->
<xsl:choose>
<xsl:when test="contains($netstring,'eth0')">
<xsl:call-template name="outputnet">
<xsl:with-param name="netstring"
select="substring-before($netstring,'eth0')"/>
</xsl:call-template>
<xsl:value-of select="$interface"/>
<xsl:call-template name="outputnet">
<xsl:with-param name="netstring"
select="substring-after($netstring,'eth0')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($netstring,'192.168.1.1')">
<xsl:call-template name="outputnet">
<xsl:with-param name="netstring"
select="substring-before($netstring,'192.168.1.1')"/>
</xsl:call-template>
<xsl:value-of select="$gateway"/>
<xsl:call-template name="outputnet">
<xsl:with-param name="netstring"
select="substring-after($netstring,'192.168.1.1')"/>
</xsl:call-template>
</xsl:when>
<!-- must test this before the following, because 192.168.1.255 contains
192.168.1.2! -->
<xsl:when test="contains($netstring,'192.168.1.255')">
<xsl:call-template name="outputnet">
<xsl:with-param name="netstring"
select="substring-before($netstring,'192.168.1.255')"/>
</xsl:call-template>
<xsl:value-of select="$broadcast"/>
<xsl:call-template name="outputnet">
<xsl:with-param name="netstring"
select="substring-after($netstring,'192.168.1.255')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($netstring,'192.168.1.2')">
<xsl:call-template name="outputnet">
<xsl:with-param name="netstring"
select="substring-before($netstring,'192.168.1.2')"/>
</xsl:call-template>
<xsl:value-of select="$ip"/>
<xsl:call-template name="outputnet">
<xsl:with-param name="netstring"
select="substring-after($netstring,'192.168.1.2')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($netstring,'24')">
<xsl:call-template name="outputnet">
<xsl:with-param name="netstring"
select="substring-before($netstring,'24')"/>
</xsl:call-template>
<xsl:value-of select="$prefix"/>
<xsl:call-template name="outputnet">
<xsl:with-param name="netstring"
select="substring-after($netstring,'24')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$netstring"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="outputsysdnet">
<xsl:param name="netstring" select="''"/>
<!-- We suppose that book example has the following values:
- interface: eth0
- ip: 192.168.0.2
- gateway: 192.168.0.1
- prefix: 24
- DNS: 192.168.0.1
- Domain: <Your Domain Name>
and gateway comes before DNS. Change below if book changes -->
<xsl:choose>
<xsl:when test="contains($netstring,'eth0')">
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-before($netstring,'eth0')"/>
</xsl:call-template>
<xsl:value-of select="$interface"/>
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-after($netstring,'eth0')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($netstring,'192.168.0.1') and
contains($netstring,'Gateway')">
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-before($netstring,'192.168.0.1')"/>
</xsl:call-template>
<xsl:value-of select="$gateway"/>
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-after($netstring,'192.168.0.1')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($netstring,'192.168.0.1') and
not(contains($netstring,'Gateway'))">
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-before($netstring,'192.168.0.1')"/>
</xsl:call-template>
<xsl:value-of select="$nameserver1"/>
<xsl:text>
DNS=</xsl:text>
<xsl:value-of select="$nameserver2"/>
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-after($netstring,'192.168.0.1')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($netstring,'192.168.0.2')">
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-before($netstring,'192.168.0.2')"/>
</xsl:call-template>
<xsl:value-of select="$ip"/>
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-after($netstring,'192.168.0.2')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($netstring,'24')">
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-before($netstring,'24')"/>
</xsl:call-template>
<xsl:value-of select="$prefix"/>
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-after($netstring,'24')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($netstring,'&lt;Your Domain Name&gt;')">
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-before($netstring,'&lt;Your Domain Name&gt;')"/>
</xsl:call-template>
<xsl:value-of select="$domain"/>
<xsl:call-template name="outputsysdnet">
<xsl:with-param name="netstring"
select="substring-after($netstring,'&lt;Your Domain Name&gt;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$netstring"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="outputpkgdest">
<xsl:param name="outputstring" select="foo"/>
<xsl:choose>
@ -605,4 +928,26 @@ unset OLD_PKGDIR
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:variable name="APOS">'</xsl:variable>
<xsl:template name="output-wrap">
<xsl:param name="commands" select="''"/>
<xsl:choose>
<xsl:when test="contains($commands,string($APOS))">
<xsl:call-template name="output-wrap">
<xsl:with-param name="commands"
select="substring-before($commands,string($APOS))"/>
</xsl:call-template>
<xsl:text>'\''</xsl:text>
<xsl:call-template name="output-wrap">
<xsl:with-param name="commands"
select="substring-after($commands,string($APOS))"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$commands"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View file

@ -312,8 +312,11 @@ chapter78_Makefiles() {
# If no .config file is supplied, the kernel build is skipped
case ${this_script} in
*grub) continue ;;
*fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
*fstab) [[ -z "${FSTAB}" ]] ||
[[ ${FSTAB} == $BUILDDIR/sources/fstab ]] ||
cp ${FSTAB} $BUILDDIR/sources/fstab ;;
*kernel) [[ -z ${CONFIG} ]] && continue
[[ ${CONFIG} == $BUILDDIR/sources/kernel-config ]] ||
cp ${CONFIG} $BUILDDIR/sources/kernel-config ;;
esac
@ -363,7 +366,7 @@ chapter78_Makefiles() {
# Check if we have a real /etc/fstab file
case "${this_script}" in
*fstab) if [[ -n $FSTAB ]]; then
*fstab) if [[ -n "$FSTAB" ]]; then
CHROOT_wrt_CopyFstab
else
CHROOT_wrt_RunAsRoot "$file"
@ -450,6 +453,25 @@ build_Makefile() { #
all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_BLFS_TOOL mk_CUSTOM_TOOLS
@sudo make do_housekeeping
EOF
) >> $MKFILE
if [ "$INITSYS" = systemd ]; then
(
cat << EOF
@/bin/echo -e -n \\
NAME=\\"Linux From Scratch\\"\\\\n\\
VERSION=\\"$VERSION\\"\\\\n\\
ID=lfs\\\\n\\
PRETTY_NAME=\\"Linux From Scratch $VERSION\\"\\\\n\\
VERSION_CODENAME=\\"$(whoami)-jhalfs\\"\\\\n\\
> os-release && \\
sudo mv os-release \$(MOUNT_PT)/etc && \\
sudo chown root:root \$(MOUNT_PT)/etc/os-release
EOF
) >> $MKFILE
fi
(
cat << EOF
@echo $VERSION > lfs-release && \\
sudo mv lfs-release \$(MOUNT_PT)/etc && \\
sudo chown root:root \$(MOUNT_PT)/etc/lfs-release

308
README
View file

@ -2,129 +2,175 @@ $Id$
1. INTRODUCTION::
This collection of scripts, known as jhalfs, strives to create
accurate makefiles from the Linux From Scratch book series XML files.
This software is an evolution of the original "jhalfs-0.2" code developed
by Jeremy Huntwork.
The scripts in this directory implement an automation of the building
of a GNU/LInux system, as described in the Linux From Scratch book series.
The name of the project is jhalfs: in that name, "alfs" stands for
"automated linux from scratch", and the initials "jh" have been kept since
the original "jhalfs-0.2" code developed by Jeremy Huntwork.
The usage of this script assumes you have read and are familiar with
the book(s) and, therefore, the configuration variables found in menuconfig
interface will have meaning to you.
The list of supported books can be found at
http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks.
The list of supported books can be found at
http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks
The documentation is split among various README.* files. Here is a list
of what is in which:
- README (this file): instructions to use the LFS book. This should be
enough if you just want to build a base system as per the LFS book. It is
also a required reading for all the other projects.
- README.CLFS: supplementary instructions to use the CLFS book series.
- README.BLFS: instructions to install an automated build infrastructure
for the BLFS book. There are two ways to do so: (i) install the
tools at the end of an LFS build (CLFS is not supported in that case), or
(ii) install the tools on an already running system. Both methods are
described in that file.
- README.CUSTOM: instructions to run custom commands either during the xLFS
build, at the end of a xLFS build. Note that you will not find
instructions on how to write those commands, but some examples are
available.
- README.PACKAGE_MANAGEMENT: instructions to use package management during
the build (only for LFS, patches welcome for CLFS...)
- README.HLFS: very short file explaining why you cannot use HLFS with the
present tool version.
NOTES::
*. The resulting Makefile takes considerable time to run to completion.
Lay in a supply of caffeine beverages.
*. It is recommended that you temporarily unpack your linux kernel,
run <make menuconfig>, configure the kernel as per the book and save
the resulting .config file. This suggestion also applies to the
configuration of the uClibc package when building a HLFS system using
uClibc rather than glibc.
*. Read carefully this file and the other README.* files before start
using the tool.
Other sources of information are the context help in the menu interface,
and the xLFS books themselves.
2. PREREQUISITES::
To use this tool you MUST:
- have experience building {c,h,b}LFS packages
- know how to edit and write shell scripts
- know how a Makefile works
- be able to trace build failures and to find what is causing it
(user error, package bug, {c,h,b}LFS command bug, or jhalfs code bug)
If you do not have the above skills, please don't use this tool.
As said elsewhere, it is strongly advised that you first build manually
a complete system before attempting to automate the build.
Of course the "Host System Requirements" should be fulfilled. The needed
supplementary packages are detailed at the bottom of the page:
http://www.linuxfromscratch.org/alfs/download.html
3. INSTALLATION::
No installation is required. System-wide installation is not allowed.
No installation is required. You may want to move the files in this
directory to a convenient location, and then follow the instructions below.
4. CONFIGURATION::
We have installed the familiar menu based configuration tool driven by
GNU make. see the section RUNNING, for details
4.1. CONFIGURATION OF THE TOOLS:
There is no configuration of the tools themselves. The various
parameters for the build are set through a menu driven interface. See
the section RUNNING below for details.
4.2. PRELIMINARY TASKS:
This tool has no support at all for creating a partition and a mount
point for the built system. You should follow the book up to the section
"Mounting the new partition". Note that the default name for the
partition mount point is "/mnt/build_dir", instead of /mnt/{c,}lfs.
You can change that default to anything you'd like in the menu, so you
may name it /mnt/lfs, or whatever you like. One important point is that
the user you are logged in as (and not the (c)lfs user) should have write
permission to the mounted directory. We'll use the name /mnt/build_dir
in the sequel.
The tool can download the needed packages for you, or you may download
them yourself. The tool may optionally use a package archive directory
where the downloaded packages are stored. That directory name may be made
available to the tool in two ways: (i) export the SRC_ARCHIVE variable,
for example SRC_ARCHIVE=/usr/src, (ii) enter the name at the "Package
Archive Directory" menu prompt. Note that the user should have write
permission to that directory. If a needed package is found in that
directory, it is copied to /mnt/build_dir/sources, if not, it is
downloaded to that directory and copied to /mnt/build_dir/sources,
except if found in /mnt/build_dir/sources, in which case, it is just
copied to $SRC_ARCHIVE. If you want the tool to download packages and you
do not want to archive them, just unset SRC_ARCHIVE, and keep the
default entry for "Package Archive Directory". If you choose to download
the packages by yourself, you should download (or copy) them to
/mnt/build_dir/sources directly.
If you want to build the kernel as part of the automated build, select
"Build the kernel" in the menu. Then, a configuration file must be
provided. In order to do so, it is recommended to download the kernel
tarball, unpack it, run <make menuconfig>, configure the kernel as per
the book, and save the resulting .config file to a location where it can
be retrieved later on (a convenient location and name is
$SRC_ARCHIVE/config-<arch>-<kernel version>-<config details>).
Another file you may provide is the fstab file. To use it, select
"Use a custom fstab file" in the menu interface, and enter the name of
the file where asked. As for the kernel configuration, this file has to
be prepared before running the menu. A convenient location and name is
$SRC_ARCHIVE/fstablfs.
At a more advanced level, you may want to supply custom commands
to be run at the end of (C)LFS build. Scripts containing those commands
are located in the ./custom/config directory. Examples are given in
./custom/examples. A template is provided as ./custom/template. See
README.CUSTOM for more details.
5. RUNNING::
The command <make> will launch a menu based configuration program. You will
recognize the layout from building the kernel or uClibc/BusyBox. The
underlying menu code was borrowed from BusyBox and slightly modified for
our use.
The command <make> will launch a menu based configuration program. The
underlying menu code was borrowed from BusyBox and slightly modified for
our use.
Help on parameter function is available from the on-line help. Please
make use of that feature for additional information not in this file.
make use of that feature: it may contain additional information not
duplicated in this file.
Once you have set the parameters you wish and have saved your work the
jhalfs script is launch. The script verify first that the host can run
it and build the xLFS system, then validate the configuration and present
you with your selections which you may accept or reject.
You should first choose which book and flavour you want to build. Note
that when you choose the BLFS book, the tool will just install the BLFS
tool to your system. You'll have to run that installed tool to build
packages in BLFS. See README.BLFS to know how. If you choose any other
book, you'll have to configure the settings and the build parameters
from the menu. Note that you may choose to install the blfs tools onto
the newly built system. It is not the same thing as choosing
the BLFS book in the menu, which will install the blfs tools on the
currently running system.
If you accepted the displayed settings jhalfs will proceed to create the
Makefile, optionally download packages.
The "General Settings" menu is where the "Build Directory" name is to be
entered. Other entries in that menu select what the tool should do. The
"Run the Makefile" entry selects whether the tool will start the build
automatically after generating the needed files. The "Rebuild files" selects
whether to clean the build directory before doing anything else. To protect
against removing important files, this can only be done in an empty directory,
or a directory previously populated by the tool.
IMPORTANT::
You must be logged as a normal user with sudo privileges to run
the Makefile. Furthermore, you are supposed to have enough privilege
to become any user. If you are not bothered about security issues,
the entry for the user "jhalfs_user" in /etc/sudoers could be
jhalfs_user ALL=(ALL) NOPASSWD:ALL
The "Build Settings" menu is where various options for the build can be
selected. Two options, "Use a custom fstab file" and "Build the kernel",
have been described above. "Do not use/display progress_bar", if set, will
prevent a progress bar to be displayed during the build. That may be useful
on slow machine. The other options should be self explanatory, using either
the online help or book reading.
NOTE::
If you run the jhalfs script directly the only function you can select
is to display the version number running <./jhalfs -v>
The "Advanced Features" menu is for various maintenance tasks, like
testing the build instructions or reporting build statistics. One useful
option is "Optimization and parallelisation". It is not recommended to use
it for setting compiler optimization flags, although it is possible, but
if you select it, you'll be able to select the number of parallel `make'
jobs, which allows much faster builds on modern multicore CPUs.
6. BLFS_TOOL SUPPORT::
Once you have set the parameters and saved the configuration, the script
is launched. Its aim is to extract instructions from the selected book
to generate scripts, and to generate a Makefile, which allows running
the scripts in the right order. The script verifies first that the host
can run itself and build the xLFS system, then validates the configuration
and lists the parameters. At this point, you may choose to quit or to
continue with the listed parameters. The script will then proceed to
generate the Makefile and the build scripts, optionally download
packages, and eventually verify the host prerequisite. If you have
selected "Run the makefile", the command <make> is launched in the
adequate directory, and the build begins. If not, you'll have to run
"make" manually, for example: "make -C /mnt/build_dir/jhalfs", if you
have used the default parameters (see the layout under $BUILDDIR in the
Q&A below).
For books that support it (TODO: which ones?), there is an option
to install an automated framework for building BLFS packages. Let
us call it blfs-tool for now. When you tick `BOOK Settings/Add
blfs-tool support' in jhalfs configuration menu, the tools are
installed in $BLFS_ROOT (default /blfs_root) on the xLFS system,
and a few dependencies (which you may select) are built at the
end of the jhalfs run, before the custom tools. As of March 8, 2012,
works only with LFS. The instructions for building the dependencies
are taken from the BLFS book.
IMPORTANT::
You must be logged as a normal user with sudo privileges to run
the Makefile. Furthermore, you are supposed to have enough privilege
to become any user. If you are not bothered about security issues,
the entry for the user "jhalfs_user" in /etc/sudoers could be
jhalfs_user ALL=(ALL) NOPASSWD:ALL
(TODO: is this relevant to present CLFS?)
WARNING:: If you add blfs-tool support on a CLFS Sysroot build
you MUST edit the scripts to fix the installation paths.
NOTE::
If you run the jhalfs script directly the only function you can select
is to display the version number by running <./jhalfs -v>
After booting the new xLFS system some steps are needed to finish
the installation of the automated tools:
- A user account must be created. You must be logged on that user
account to use blfs-tool. This is not strictly necessary,
since the packages can be built as root, too, but it is
never a good idea to build packages as root.
- Move /blfs-root to that user's home and change ownership of the
directory and files to the user.
- Give the user read and write privileges over the $TRACKING_DIR
directory and the files that it contains.
- Configure sudo, adding the needed privileges for the user. For
newer sudo version, do not forget to add a line Defaults secure_path=
containing /sbin and /usr/sbin (in /etc/sudoers), otherwise some
executables are not found.
- Although it is not strictly necessary, it is recommended to install
the bash shell startup files (as per `3.After LFS Configuration
Issues' of the BLFS book), as some instructions in BLFS rely on
their being present.
We assume that blfs-tool will be used on a running fresh xLFS system.
To use it to build BLFS packages from the chroot jail is also possible,
but not supported.
To know how to use blfs-tool, see README.BLFS.
7. LAYOUT::
6. LAYOUT::
/BLFS (see README.BLFS)
@ -187,27 +233,22 @@ $Id$
jhalfs
blfs-tool
8. FAQ::
Q. "This 'help' file is very sparse"
A. Yes, it is. This tool, jhalfs, is for those who understand the LFS books
and wish to automate the build. 99% of any problems that arise can be
solved by reading the book(s).
Q. "It doesn't work!"
A. Yes it does, try >> make
Remember you must have 'sudo' privileges.
Q. "It still doesn't work"
A. jhalfs was designed to work against the development versions of the LFS
series of books. Consequently changes in a book(s) sometimes breaks older
versions of jhalfs. Before you start pulling out your hair download the
latest version of jhalfs to see if that solves your problem.
7. FAQ::
Q. "It doesn't work"
A. There are several reasons why it may be so. One possibility is the
following:jhalfs was designed to work against the development versions
of the LFS series of books. Consequently changes in a book(s) sometimes
breaks older versions of jhalfs. Before you start pulling out your hair
download the latest version of jhalfs to see if that solves your
problem. Note that it may be the other way around. If you want to build
an old version of the book, you may have to downgrade you jahlfs
version.
Q. "How do I specify the build location?"
A. The original LFS document worked against the well known location /mnt/lfs.
This script automates the build of all of the LFS series of books and uses
a generic location $BUILDDIR with a default value of /mnt/build_dir.
You may change this value to suit your needs.
A. The original LFS document worked against the well known location
/mnt/lfs. This script automates the build of all of the LFS series of
books and uses a generic location $BUILDDIR with a default value of
/mnt/build_dir. You may change this value to suit your needs.
The layout below $BUILDDIR is as follows.
$BUILDDIR/
@ -238,13 +279,16 @@ $Id$
Q. "Why have 2 copies of the files?"
A. The package files must be visible during the chroot phase and this is a
simple and reliable method of doing so. This method also handles the CLFS
boot build method where the final build may be done on a separate machine.
simple and reliable method of doing so. This method also handles the
CLFS boot build method where the final build may be done on a separate
machine.
Q. "What is the function of "User account" and "Group account" menu settings?"
A. If you are running jhalfs from a low or non-privileged account you may not
have the priv to create/delete the user needed to build temporary tools.
These settings allow you to use your own user and group name to do that
Q. "What is the function of "User account" and "Group account" menu
settings?"
A. If you are running jhalfs from a low or non-privileged account you may
not have the priv to create/delete the user needed to build temporary
tools.
These settings allow you to use your own user and group name to do those
build steps.
These variables are adjustable also when invoking make:
@ -254,21 +298,22 @@ $Id$
The only changes to your account will be the creation of a NEW .bashrc
after saving your original to .bashrc.XXX
Q. "When I try to build CLFS the Makefile fails at the mid-point"
A. There could be numerous reasons for the failure but the most likely reason
is you are doing a cross-build using the 'chroot' method and the target is
not compatible with the host. If you choose to build using the chroot
method a test is performed at the end of the temptools phase. If the test
succeeds the build continues inside a chroot jail. However if the test fails
it means the host and target are not compatible an you should use the
'boot' method to create your target code.
Q. "When I try to build CLFS the Makefile fails at mid-point"
A. There could be numerous reasons for the failure but the most likely
reason is you are doing a cross-build using the 'chroot' method and the
target is not compatible with the host. If you choose to build using
the chroot method a test is performed at the end of the temptools
phase. If the test succeeds the build continues inside a chroot jail.
However if the test fails, it means the host and target are not
compatible an you should use the 'boot' method to create your target
code.
As an extreme example: You can build a sparc target on a x86 platform but
only the temptools phase. You must select the 'boot' method and not the
'chroot.' You must transfer the toolchain to a sparc platform, reboot the
sparc box and continue the build.
Of all the LFS series of books Cross-LFS requires the greatest
understanding of host/target hardware combination. Please read the book
carefully and don't skip the easy parts (there are none..)
carefully and don't skip the easy parts (there are none...)
Q. "How could I stop the build at a predefined chosen point?"
A. Launch the Makefile manually passing the last numbered target to be build
@ -286,3 +331,4 @@ $Id$
Authors:
George Boudreau
Manuel Canales Esparcia
Pierre Labastie

View file

@ -2,10 +2,6 @@ $Id$
1. INTRODUCTION::
If you want to add blfs-tool support into an xLFS base system build,
read the "BLFS_TOOL SUPPORT" section found in the README and be sure
to follow the after-booting installation intructions.
To automate package builds from the BLFS book instructions is a huge
task. Some of the issues are: the BLFS book isn't linear; some package
pages use a custom layout; there are circular dependencies; several
@ -20,55 +16,88 @@ $Id$
2. PREREQUISITES::
To use this tool you MUST:
In addition to a full LFS system, the following packages and their
dependencies are needed by this tool:
- required: libxml2, libxslt, DocBook XML DTD
- recommended: wget (to download the package tarballs) and sudo (to build
as a user)
- optional: lynx (allows to read the generated linearized book), GPM (to
cut and paste commands from the book), subversion (to update the book
sources), openssl (used by wget for all https:// sites)
Note that the optional dependencies are recommended for ease of use of the
tool.
- have experience building BLFS packages
- know how to edit and write shell scripts
- know how a Makefile works
- be able to trace build failures and to find what is causing it
(user error, package bug, BLFS command bug, or jhalfs code bug)
You should also have the following personal skills:
- Ability to write and debug shell scripts: as said in the introduction,
not all the generated scripts can be used directly. They need to be
edited to produce an error free build.
- Ability to debug build failures, like missing dependencies or
installation directories not known to the system (when you install in
/opt for example).
- Ability to choose the tools you need to configure and administrate
your system: in the BLFS book, nothing is mandatory, nothing is
useless. You are on your own in choosing what to build, but wrong
decisions may lead to a non functional system...
If you do not have the above skills, please don't use this tool.
3. INSTALL::
There are two ways to install the BLFS tools on an LFS system, described
in paragraphs 3.1 and 3.2, respectively:
3. USAGE::
3.1 INSTALLATION ON A RUNNING SYSTEM
Due to the complexity of the BLFS book, the scripts and Makefile
generation is done in several steps:
Select "Use Book --> Beyond Linux From Scratch" in the jhalfs menu:
The tools are installed in $HOME$BLFS_ROOT (the default for $BLFS_ROOT
is /blfs_root). The BLFS book is downloaded or copied to its directory.
The tracking directory (see below) is initialized but not created: before
the installation, you should ensure the tracking directory (default location
/var/lib/jhalfs/BLFS) exists and is writable by the user. After the
intallation, you should perform the following additional steps:
3.1 INSTALLED PACKAGES TRACKING SYSTEM::
- Configure sudo, adding the needed privileges for the user. For
newer sudo version, do not forget to add a line `Defaults secure_path='
containing /sbin and /usr/sbin (in /etc/sudoers), otherwise some
executables are not found.
This tool includes a very simple tracking system to log which packages
have been installed using the tool. It is used to skip installed packages
from target selection menu and to test if an installed package has been
updated in the BLFS book. Do not rely on this feature as a package
management tool.
- Although it is not strictly necessary, it is recommended to install
the bash shell startup files (as per `3.After LFS Configuration
Issues' of the BLFS book), as some instructions in BLFS rely on
their being present.
The tracking system itself is an XML file: instpkg.xml. It is
initialized when <make> is first run in blfs_root. It resides in a
directory, which is created when needed during the process of building
custom tools or blfs dependencies, right after xLFS. You can specify
that directory location in the blfs-tools submenu of jhalfs. You may
need to update permissions and/or ownership of this directory before
using the blfs tool (see README in jhalfs).
3.2 INSTALLATION ON A JUST BUILT xLFS SYSTEM
The default location of the tracking directory is /var/lib/jhalfs/BLFS.
NB : after the initial build, that directory is only used to contain
instpkg.xml, unless custom tools have been built. In the latter case,
it also contains empty files whose name are $PKG-$VERSION for each
versionned package built. The information about those packages is
included into instpkg.xml the next time the tool is run.
For books that support it (only LFS for jhalfs version 2.4),
there is an option to install the BLFS tools right after building
the xLFS system: just tick `BOOK Settings/Add blfs-tool support' in
jhalfs configuration menu. The tools are installed in $BLFS_ROOT
(default /blfs_root) on the xLFS system, and the dependencies are built
at the end of the jhalfs run, before the custom tools.
3.2 BLFS_TOOL INSTALLATION::
(TODO: blfs-tools have not been tested with current (version 3.0) of CLFS,
and certainly need some adaptation to run)
3.2.1 Normal install
The tools are installed just after the building of xLFS, if the
appropriate options have been selected in the building menu, as per
jhalfs README. If you forgot to select the options and xLFS has been
built, it is possible to go back to selecting the appropriate
BLFS tools options in the jhalfs menu, then tick `Run makefile'
and not `Rebuild files'. You obtain a /blfs_root directory in the
root directory of the new xLFS system, which contains the followings:
After booting the new xLFS system some steps are needed to finish
the installation of the automated tools:
- A user account must be created. You must be logged on that user
account to use blfs-tool. This is not strictly necessary,
since the packages can be built as root, too, but it is
never a good idea to build packages as root.
- Move /blfs-root to that user's home and change ownership of the
directory and files to the user.
- Give the user read and write privileges over the $TRACKING_DIR
directory and the files that it contains.
- Configure sudo and add the bash shell startup files, as described
above
We assume that the BLFS tools will be used on a booted xLFS system.
Using them to build BLFS packages in a chroot jail is also possible,
but not supported.
3.3 DIRECTORY LAYOUT IN THE $BLFS_ROOT DIRECTORY
blfs-xml/* SVN tree of the selected BLFS book version
lib/constants.inc functions libraries
@ -82,8 +111,7 @@ $Id$
/make_book.xsl XSL stylesheet to generate the linear book.xml
/scripts.xsl XSL stylesheet to generate the scriptlets from
book.xml
/bump.xsl XSL stylesheet to generate to update the tracking
file
/bump.xsl XSL stylesheet to update the tracking file
README.BLFS this file
TODO developers notes (well, not updated often)
gen_pkg_book.sh resolves dependencies and generates linear BLFS
@ -99,16 +127,7 @@ $Id$
database and the tracking file.
envars.conf envars needed when running the target build scripts
3.2.2 Install to an already running LFS/BLFS system
If you forgot to install the tools when building xLFS, or want to try
the tools, you can just run the install-blfs-tools.sh script. It will
create the above hierarchy in your home directory and intialize the
tracking file. You have first to make sure that the tracking dir exists
and is writable by the user. You may also populate it with (empty) files
whose names are of the form package-version, for installed packages, so
that they are included into the tracking file.
3.3.3 Working files
Several files are generated during the process:
Working files: several files are generated when first running the tool
packages.xml auto-generated packages database
Config.in input file for the menu driven choices
@ -118,13 +137,38 @@ $Id$
book-html/* the linearized book rendered in html
scripts/* the scriptlets
3.4 INSTALLED PACKAGES TRACKING SYSTEM:
This tool includes a very simple tracking system to log which packages
have been installed using the tool. It is used to skip installed packages
from target selection menu and to test if an installed package has been
updated in the BLFS book. Do not rely on this feature as a package
management tool.
The tracking system itself is an XML file: instpkg.xml. It is
initialized when <make> is first run in blfs_root. It resides in a
directory, which is created when needed during the process of building
custom tools or blfs dependencies, right after xLFS. You can specify
that directory location in the blfs-tools sub-menu of jhalfs. You may
need to update permissions and/or ownership of this directory before
using the blfs tool (see README in jhalfs).
The default location of the tracking directory is /var/lib/jhalfs/BLFS.
NB : after the initial build, that directory is only used to contain
instpkg.xml, unless custom tools have been built. In the latter case,
it also contains empty files whose name are "$PKG-$VERSION" for each
versionned package built. The information about those packages is
included into instpkg.xml the next time the tool is run.
4. USAGE::
From now on, all the work must be done from inside the installation
root directory.
You may move that directory to the $HOME of a non root user, or build
as root from that directory.
Due to the complexity of the BLFS book, the scripts and Makefile
generation is done in several steps:
3.3 UPDATING BOOK SOURCES::
4.1 UPDATING BOOK SOURCES::
If you are using the development book version and you want to update
installed packages to the latest version found in that book, you need to
@ -142,7 +186,7 @@ $Id$
with a new version in the book will be available for target selection
and used to solve dependencies.
3.4 CONFIGURING AND PARSING THE BOOK::
4.2 CONFIGURING AND PARSING THE BOOK::
The next step is to create a book and build scripts in dependency
build order for one or several packages.
@ -159,23 +203,16 @@ $Id$
as in the previous version of this tool. But we suggest to not select
too many at a time to be able to sort issues!
When you are done with the menu, a few checks occur, and the book is
generated. When circular dependencies are found, a 3 line message is
printed:
A is a dependency of B
C is a dependency of A
A is a dependency of C
and a question:
Do you want to build A first?
This means that the system has found the dependency chain: B->A->C->A.
You have therefore to choose whether A is built before C, or
C before A: the system cannot make that choice (well, maybe in a few
year, with an AI system able to understand the book). If you answer no,
C is built first. If you answer yes, C is put in place of A as a dependency
of B, then the tree dependency restarts from there, that is with the
layout B->C->... You may then hit the case B->C->A->C, for which you
should answer no, unless you want to enter an infinite (human driven)
loop;-)
When you are done with the menu, a few checks occur, and the dependency
chain is generated. Each dependency appears with its priority (required,
recommended, optional, or external), and it's level. There is a root level
1. The selected packages have level 2. The dependencies of selected packages
have level 3, the dependencies of the dependencies have level 4, and so on.
When circular dependencies are found, they appear with a priority of
"circular". This means that two (or more) dependency chains arrive at the
same package. The algorithm chooses the chain with the highest priority and
reorders dependencies to remove the other chain(s). This is not always the
solution an user would prefer, but we have found no way to do it better.
You end up with a book.xml file which contains the linearized book,
and a rendered HTML, in the directory book-html, which you can browse with
@ -187,7 +224,7 @@ $Id$
There is also another directory, "dependencies" that contains files
generated while resolving dependencies.
3.5 EDITING BUILD SCRIPTS::
4.3 EDITING BUILD SCRIPTS::
Now it is time to review the generated book and scripts, making any
changes to the scripts necessary to fix generation bugs or to suit your
@ -204,7 +241,7 @@ $Id$
Also, review and edit envars.conf. This file is used to set global envars
needed by the build scripts.
3.6 CREATING THE MAKEFILE::
4.4 CREATING THE MAKEFILE::
When the build scripts are ready to be run, the Makefile can be
created. Create an empty directory (for example "mkdir work") and cd
@ -213,67 +250,70 @@ $Id$
Review the Makefile, and, if all looks sane, start the build by running
"make".
4. GENERATED BUILD SCRIPTS ISSUES::
5. GENERATED BUILD SCRIPTS ISSUES::
In this section, known issues with the generated build scripts are
discussed. They are due to build procedures and/or BLFS layout
particularities that we can't handle. In several cases, editing the
build scripts is mandatory.
You may also need to insert some build scripts created by you to resolve
unhandled dependencies and/or to remove some script installing the affected
package by hand.
You may also need to insert some build scripts created by you to resolve
unhandled dependencies and/or to remove some script installing an unneeded
package (unneeded packages may be pulled in the dependency chain, if
they occur as an "or" with another package).
When there are circular dependencies (only one known in BLFS 8.0 for
recommended dependencies), you may need to move around scripts so that they
run in the order script-A script-B script-A. This involves copying script-A
to another name (using the xxx-a- fields), and possibly renaming the xxx-a-
fields of each involved script.
4.1 BLFS BOOTSCRIPTS::
5.1 BLFS BOOTSCRIPTS::
Normally, bootscript installation should work. On the other hand, the
book does not give instruction for running them, so you might have to
manually insert /etc/init.d/rc.d/<initscript> at some place during the build.
Normally, bootscript installation should work. On the other hand, the
book does not give instruction for running them, so you might have to
manually insert "/etc/init.d/rc.d/<initscript> start" at some place during
the build.
4.2 PACKAGE CONFIGURATION::
5.2 PACKAGE CONFIGURATION::
For those packages that have a "Configuration" section, you should
edit the build script to fit the needs of your system. Sometimes, the
bash startup files are modified (see for example the instructions for
llvm). The shipped 'envars.conf' contains a line 'source /etc/profile',
which ensures that the proper environment variables are used.
For those packages that have a "Configuration" section, you should
edit the build script to fit the needs of your system. Sometimes, the
bash startup files are modified. The shipped 'envars.conf' contains a
line 'source /etc/profile', which ensures that the proper environment
variables are used.
4.3 GCC, JDK, Sane, and KDE-multimedia, freetype2, MesaLib and others
5.3 PAGES WITH TWO OR MORE PACKAGES::
For example: sane, poppler, audacious, freetts, which, etc.
On the pages for those packages, the BLFS book actually has instructions
to download and install two or more packages. You must edit the scripts to
fix this.
fix this. A common pitfall is that the variable PACKAGE may be used for
several tarballs. Be sure to save the PACKAGE variable to some other
name (for example PKG1, PKG2, etc) after each download. The unpacking
instructions may need to be repeated for each tarball in turn.
We will try to fix some of them, but this may not be possible.
5.4 XORG7
4.4 XORG7
The book has special page layouts for the Xorg7 packages. The tool
breaks those pages into individual pages for each packages in the linear
book. Also, the menu gives the choice to select each package individually.
The generated scripts for Xorg7 packages have $SRC_ARCHIVE
support for individual packages, but not for patches nor *.wget and *.md5
files.
To build the whole Xorg7 chapter, select twm. The (recommended)
dependency chain brings in the whole set of Xorg packages.
If you have previously downloaded the patches, you must edit
the scripts to use your local packages.
The *.wget and *.md5 files should be downladed always from inside
the scripts to be sure that the most current individual packages are
used. Thus don't reuse previously existing ones.
In the script for xorg7-font, be sure to move the fonts directories
symlinks creation to after the "for ... done" loop.
4.5 PATCHES
5.5 PATCHES
Please, make sure that all scripts have the commands to download/apply
the required patches. Due to book layout issues, some patches may be
missing.
missing (as of BLFS 8.0, all the patches seem to be downloaded).
4.6 ROOT COMMANDS
5.6 ROOT COMMANDS
If building as a normal user (the default setting), be sure that all
commands that require root privileges are run using sudo. Also make sure
necessary root privilege commands are visible in your PATH. Or use
the `Defaults secure_path=' in /etc/sudoers.
For commands necessitating root privileges, the generated scripts wrap
them with the construct:
sudo -E sh << ROOT_EOF
@ -288,9 +328,15 @@ $Id$
Although this construct is rather strong, it can fail in some corner
cases, so carefully review those instructions.
WARNING: One variable from the environment is not passed through the
-E switch, namely PATH. This is because "sudo" always reset the PATH to
the default "secure_path". If you need to have the same PATH as the user
"root" would have, you may want to add "source /etc/profile" at the
beginning of the commands to be executed as root.
Due to book layout issues, some sudo commands may be missing.
4.7 OTHERS
5.7 OTHERS
There may be other issues that we are not aware of. If you find
any, please report it to <alfs-discuss@linuxfromscratch.org>.

View file

@ -5,21 +5,20 @@
Normally JHALFS creates a Makefile containing only those scripts found in
the {B,C,H}LFS books. An automated construction tool cannot predict the
the {,B,C,H}LFS books. An automated construction tool cannot predict the
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 different way.
There are two areas that can be customized: how the base system is built
and what additional configurations and packages your hardware requires to be
able to boot and run. Each of those areas are handled in a different way.
BASE SYSTEM CUSTOMIZATION
There is two ways to alter how the base system will be built:
There are 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,
@ -28,22 +27,22 @@ boot and work with. Each one of this areas is handled in a different way.
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.
- Editing the generated build scripts to make any change you want.
This is the method discussed below.
EDITING THE BASE SCRIPTS
First step is to generate the build scripts with book defaults. To do that,
configure jhalfs activating any option you want included, but do not select
"Run the Makefile" option.
To begin with, the build scripts should be generated with book defaults. To
do that, configure jhalfs activating any option you want included, but do not
select "Run the Makefile" option.
Under the ${BUILD_DIR}/${SCRIPT_ROOT}/${PROGNAME}-commands directory
(using the defaults values to do an LFS build, that directory name is
/mnt/build_dir/jhalfs/lfs-commands) you will find the default build scripts.
If all you want is modify, add, or remove some command from a package
installation, for example to change it ./configure line, just edit the related
installation, for example to change its ./configure line, just edit the related
script. If changing or adding a patch, be sure to copy the new patch to the
${BUILD_DIR}/sources directory. When done, run 'make' from inside the
${BUILD_DIR}/${SCRIPT_ROOT} directory.
@ -53,39 +52,38 @@ ${BUILD_DIR}/${SCRIPT_ROOT} directory.
To remove a package from the system, just remove its script(s).
To change the version of some package to build a newest or oldest one than the
one found in the book, edit ${BUILD_DIR}/${SCRIPT_ROOT}/pkg_tarball_list to
change it tarball name and place the new tarball in the ${BUILD_DIR}/sources
directory,
To change the version of some package, or to build a newer or older version
than that in the book, edit ${BUILD_DIR}/${SCRIPT_ROOT}/pkg_tarball_list to
change its tarball name and place the new tarball in the ${BUILD_DIR}/sources
directory.
To replace a package by an equivalent one, rename the replaced package script
to reflect the new package name (for example, 102-man-db -> 102-man), edit the
script to made the required commands changes, place the new tarball in the
${BUILD_DIR}/sources directory, and edit ${BUILD_DIR}/${SCRIPT_ROOT}/pkg_tarball_list
file to replace the removed package tarball name by the new package tarball name.
file to replace the removed package tarball name by the new package tarball
name.
To change the build order, rename the scripts changing the first 3-digits
string until have it ordered in the way you want.
string until they are sorted in the way you want.
To insert a new package, for example to build Cracklib to can build Shadow
with Cracklib support, first you should decide before what default package it
need be installed, in this example before 107-shadow. Then create a new script
containing the needed commands, using an existing one as template, and name it with
the same 3-digits string used for that mentioned default package, but adding
another 1-digit string. In our example, the new script to build Cracklib just
before Shadow will be named 107-1-cracklib. This naming schema allow to insert
up to 10 scripts before each one of the default scripts. Place the tarball for
the new package and required patches, if any, if ${BUILD_DIR}/sources and edit
To insert a new package, for example to build Cracklib in order to build
Shadow with Cracklib support, you should first decide before what package it
needs to be installed, in this example 107-shadow. Then create a new script
containing the needed commands, using an existing one as template, and name it
with the same 3-digits string used for that mentioned default package, but
adding another 1-digit string. In our example, the new script to build Cracklib
before Shadow will be named 107-1-cracklib. This naming scheme allows inserting
up to 10 scripts before each of the existing scripts. Place the tarball for
the new package and required patches, if any, in ${BUILD_DIR}/sources and edit
${BUILD_DIR}/${SCRIPT_ROOT}/pkg_tarball_list to add the tarball name for that
package.
When ready, launch again the jhalfs configuration interface. Be sure that
are selected exactly the same options than when generating the default build
scripts. Be sure that "Rebuild files" is unselected and select "Run the Makefile"
if you want. Then select "Rebuild the Makefile". This will create a new Makefile
based on the changes you made to the build scripts.
When ready, launch again the jhalfs configuration interface. Make sure that
exactly the same options are selected as when generating the default build
scripts. Be sure that "Rebuild files" is unselected and select "Run the
Makefile" if you want. Then select "Rebuild the Makefile". This will create a
new Makefile based on the changes you made to the build scripts.
ADDING POST-SYSTEM BUILD CONFIGURATION FILES AND EXTRA PACKAGES
@ -96,8 +94,8 @@ more info.
The feature described 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 available from the beginning, and was not intended to replace the BLFS
or to support specific hardware, or to install basic utilities that are
needed from the beginning, and was not intended to replace the BLFS
install system.
:::NOTICE:::
@ -108,9 +106,9 @@ add should honour the DESTDIR=${CLFS} switch or equivalent.
LAYOUT
A new directory has been added to JHALFS tree which will contain the
A new directory has been added to JHALFS tree which contains the
configuration scripts and a few examples. A switch has been added to the
configuration file which enables/disables the inclusion of personal scripts.
configuration file which enables/disables the inclusion of custom scripts.
custom
/config <-- where to put your scripts.
@ -121,7 +119,7 @@ configuration file which enables/disables the inclusion of personal scripts.
NOTE::: You are responsible for including all dependencies and ensuring they
are built in the proper order.
are built in the right order.
1. To add a package to the final JHALFS Makefile you must first create a file
in the custom/config directory.
@ -200,7 +198,7 @@ xEOFx
PKG="gpm"
PKG_VERSION="1.20.1"
PKG_FILE="gmp-1.20.1.tar.bz2"
PKG_FILE="gpm-1.20.1.tar.bz2"
URL="ftp://arcana.linux.it/pub/gpm/gpm-1.20.1.tar.bz2"
MD5="2c63e827d755527950d9d13fe3d87692"
for i in PATCH{1..10}; do

View file

@ -2,10 +2,5 @@ $Id$
::::NOTICE::::
Hardened Linux From Scratch is a highly volatile project. Extreme design
changes can occur and the build could be broken for extended periods of
time.
As of July 26.2007, the Glibc-based systems builds should work.
uClibc-based system still fail due book issues.
HLFS has not be updated for a very long time. Since then, jhalfs has evolved
and is now incompatible with HLFS.

View file

@ -1,28 +1,54 @@
TITLE : Package management in jhalfs
BY : Pierre Labastie (work in progress)
$Id$
1. INTRODUCTION:
There are several hints discussing package management for LFS, but
nothing under jhalfs. There used to be a patch for PACO that I cannot
find now. This is a modification, which allows to use a package manager
inside jhalfs. I hope it is flexible enough to support several package
managers. My implementation uses dpkg, from Debian, in a very crude way.
Debian has a sophisticated package management system, which I have not
tried to use here. For example, it should be usable with Pacman from
Arch Linux (http://www.archlinux.org), as far as I remember from my old
days with DIYL. I am sorry to say I have (almost) no experience with
rpm, so I cannot tell whether it would fit.
find now. So there was a need for such a tool, and an infrastructure,
which allows using a package manager inside jhalfs, has been developped.
I hope it is flexible enough to support several package managers, at least
among those who use DESTDIR install and/or LD_PRELOAD during install.
It has been tested with dpkg from Debian, pacman from Arch Linux,
and porg. Sample configuration files are given for those three packages.
I am sorry to say I have (almost) no experience with rpm, so I cannot
tell whether it would fit.
2. OVERVIEW OF THE SYSTEM:
For now, package management is only available for LFS. I plan to
upgrade BLFS tools, but nothing usable right now. I have not attempted
to adapt this tool for the other flavours of LFS.
This system performs basically a "DESTDIR install" for all pages
in chapter 6, 7 and 8 of the book. The name of the DESTDIR directory is the
same as the one of the executed script. The path to this directory is
available to the scriplets through the PKG_DEST variable.
For now, package management is only available for LFS. The `porg style'
(see below) package management has been ported to BLFS, but not the distro
style one (the book layout makes it rather difficult). I have not attempted
to adapt this tool for the other flavours of LFS (TODO).
This tool comes in two flavours:
- for distros package managers (e.g dpkg or pacman), it basically performs
a "DESTDIR install" for all pages in chapter 6, 7 and 8 of the book. The
name of the DESTDIR directory is the same as the one of the executed
script. The path to this directory is available to the scriplets through
the PKG_DEST variable. The details of the DESTDIR part are given below.
After the package is installed in $PKG_DEST, a function "packInstall" is
called, which is supposed to create a binary package (e.g. make a .deb
file), store it to a repository and install it to the system.
- for porg style package manager, the install instructions are wrapped
between pairs of single quotes ('). This allows passing those instructions
to a function ("wrapInstall"), which may itself call porg or another
(e.g. fakeroot, not tested) instruction wrapper. Note that if the
instructions contain single quote charaters, they are changed to '\'',
which pass them literally. At the end of the installation, a function
"packInstall" is called, with a slighly different aim compared to the
DESTDIR one: it is used to make a tarball of the installed files (e.g.
using "porgball") and store them into some repository. But there is no
need to install them to the system, since this has already been done.
Note that with carefully crafted "packInstall" and "wrapInstall"
functions, a combination of the two methods could be used, for example for
DESTDIR installs using fakeroot. This is work in progress and not fully
implemented yet.
3. DETAILS:
The XSL stylesheet used for generating the scriptlets, automatically
adds DESTDIR install instructions when "package management" is selected.
Also all the paths beginning with " /" or ">/" (absolute paths) are prepended
@ -34,6 +60,7 @@ BY : Pierre Labastie (work in progress)
creates a reasonable subset of the FHS hierarchy into the destination
directory. Empty directories are then removed before packing the
binary package.
In order to use the package manager, it has to be installed at the end of
chapter 5 (temporary installation in /tools) and chapter 6 (final install).
Furthermore, the administrative files and directories have to be created
@ -42,18 +69,21 @@ BY : Pierre Labastie (work in progress)
the necessary instructions and enough information to download the tarball.
This file should reside in the `pkgmngt' directory and be named
`packageManager.xml'. A template named `packageManager.xml.template' is
provided in the `pkgmngt' subdirectory. There are also two XML files for
dpkg and pacman, respectively `packageManager.xml.dpkg' and
`packageManager.xml.pacman', that you can copy to `packageManager.xml'.
provided in the `pkgmngt' subdirectory. There are also three XML files for
dpkg, pacman, and porg, respectively `packageManager.xml.dpkg',
`packageManager.xml.pacman', and `packageManager.xml.porg', that you can
copy to `packageManager.xml' and modify to suit your needs.
They are not updated often, so the versions used can be rather old.
The last thing to do is to tell how to use the package manager. When
the binary package is ready, the scriptlets call a shell function named
`packInstall', which should pack the binary package and install it on the
system. Note that nothing has been done to manage configuration files,
The last thing to do is to tell how to use the package manager. The user
has to provide two functions, "wrapInstall" and "packInstall", as described
above. Please note that nothing has been done to manage configuration files,
which are ususally treated specially by package managers: depending on
the book layout, it is sometimes possible to create those files afterwards,
and sometimes not, which means that you have to check them after each
upgrade. The user has to write his own `packInstall' function. The shell
function should be defined in a file named `packInstall.sh', residing in
the `pkgmngt' directory. A template is provided, as well as two example
scripts for dpkg and pacman.
upgrade. Both functions should be defined in a file named `packInstall.sh',
residing in the `pkgmngt' directory. A template is provided (actually a copy
of the file for dpkg), as well as three example scripts for dpkg, pacman,
and porg. Pacman Note: due to the way pacman checks the available space on
disk, the root directory in chroot must be a mount point, otherwise the
installation of packages fails.

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id:$ -->
<!-- $Id$ -->
<!-- Extracts minimal versions from LFS book host requirements,
and generates a script containing statements of the
form MIN_prog_VERSION=xx.yy.zz.

View file

@ -8,9 +8,18 @@ get_book() { #
cd $JHALFSDIR
if [ -z $WORKING_COPY ] ; then
# Check for Subversion instead of just letting the script hit 'svn' and fail.
test `type -p svn` || eval "echo \"This feature requires Subversion.\"
exit 1"
# Check for Subversion or git instead of just letting the script fail.
case $PROGNAME in
lfs | hlfs)
test `type -p svn` || eval "echo \"This feature requires Subversion.\"
exit 1"
;;
clfs*)
test `type -p git` || eval "echo \"This feature requires Git.\"
exit 1"
;;
esac
echo -n "Downloading the $PROGNAME document, $LFSVRS version... "
case $PROGNAME in
@ -23,23 +32,30 @@ get_book() { #
# Grab a fresh book if it's missing, otherwise, update it from the
# repo. If we've already extracted the commands, move on to getting the
# sources.
if [ $PROGNAME == "lfs" ] || [ $PROGNAME == "hlfs" ] && [ ! -d ${PROGNAME}-${LFSVRS}/.svn ]; then
if [ $PROGNAME == "lfs" ] || [ $PROGNAME == "hlfs" ] &&
[ ! -d ${PROGNAME}-${LFSVRS}/.svn ]; then
svn co $SVN/${svn_root}/${TREE} ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1
elif [ $PROGNAME == "clfs" ] || [ $PROGNAME == "clfs2" ] || [ $PROGNAME == "clfs3" ] && [ ! -d ${PROGNAME}-${LFSVRS}/.git ]; then
elif [ $PROGNAME == "clfs" ] || [ $PROGNAME == "clfs2" ] ||
[ $PROGNAME == "clfs3" ] && [ ! -d ${PROGNAME}-${LFSVRS}/.git ]; then
echo $TREE
git clone $GIT ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1
if [ ! $TREE == "development" ]; then
cd ${PROGNAME}-$LFSVRS
pushd ${PROGNAME}-$LFSVRS > /dev/null
echo "Checking out $LFSVRS at $PWD in $TREE"
git checkout ${TREE} >>$LOGDIR/$LOG 2>&1
popd > /dev/null
fi
else
cd ${PROGNAME}-$LFSVRS
case $PROGNAME in
clfs*) git pull >>$LOGDIR/$LOG 2>&1
if [ ! $TREE == "development" ]; then
git checkout ${TREE} >>$LOGDIR/$LOG 2>&1
fi
clfs*)
# If the repo is in "detached head" state, git pull fails, so get
# back first to master:
git checkout master >>$LOGDIR/$LOG 2>&1
git pull >>$LOGDIR/$LOG 2>&1
if [ ! $TREE == "development" ]; then
git checkout ${TREE} >>$LOGDIR/$LOG 2>&1
fi
;;
lfs | hlfs) svn up >>$LOGDIR/$LOG 2>&1 ;;
*) ;;
@ -47,7 +63,7 @@ get_book() { #
fi
echo -ne "done\n"
else
else # Working copy
echo -ne "Using $BOOK as book's sources ...\n"
fi
}
@ -60,6 +76,13 @@ extract_commands() { #
case $PROGNAME in
clfs*)
VERSION=$(xmllint --noent $BOOK/BOOK/prologue/$ARCH/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
lfs)
if [ "$INITSYS" = "sysv" ] ; then
VERSION=$(grep 'ENTITY version ' $BOOK/general.ent| cut -d\" -f2)
else
VERSION=$(grep 'ENTITY versiond' $BOOK/general.ent| cut -d\" -f2)
fi
;;
*)
VERSION=$(xmllint --noent $BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
esac
@ -72,57 +95,66 @@ extract_commands() { #
case ${PROGNAME} in
clfs)
echo -n " ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture... "
xsltproc --nonet \
--xinclude \
--stringparam method $METHOD \
--stringparam testsuite $TEST \
xsltproc --nonet \
--xinclude \
--stringparam method $METHOD \
--stringparam testsuite $TEST \
--stringparam bomb-testsuite $BOMB_TEST \
--stringparam vim-lang $VIMLANG \
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
--stringparam sparc $SPARC64_PROC \
--stringparam x86 $TARGET \
--stringparam mips $TARGET \
-o ./${PROGNAME}-commands/ $XSL $BOOK/BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
--stringparam vim-lang $VIMLANG \
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
--stringparam sparc $SPARC64_PROC \
--stringparam x86 $TARGET \
--stringparam mips $TARGET \
-o ./${PROGNAME}-commands/ \
$XSL \
$BOOK/BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
;;
clfs2)
echo -n " ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture... "
xsltproc --nonet \
--xinclude \
--stringparam vim-lang $VIMLANG \
xsltproc --nonet \
--xinclude \
--stringparam vim-lang $VIMLANG \
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
-o ./${PROGNAME}-commands/ $XSL $BOOK/BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
--stringparam page $PAGE \
--stringparam lang $LANG \
--output ./${PROGNAME}-commands/ \
$XSL \
$BOOK/BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
;;
clfs3)
echo -n " ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture... "
xsltproc --nonet \
--xinclude \
--stringparam endian x$ENDIAN \
xsltproc --nonet \
--xinclude \
--stringparam endian x$ENDIAN \
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
-o ./${PROGNAME}-commands/ $XSL $BOOK/BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
--stringparam page $PAGE \
--stringparam lang $LANG \
--output ./${PROGNAME}-commands/ \
$XSL \
$BOOK/BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
;;
hlfs)
echo -n " ${L_arrow}${BOLD}$MODEL + $KERNEL${R_arrow} HLFS flavour... "
xsltproc --nonet \
--xinclude \
--stringparam model $MODEL \
--stringparam kernel $KERNEL \
--stringparam testsuite $TEST \
--stringparam bomb-testsuite $BOMB_TEST \
--stringparam features x$SSP$ASLR$PAX$HARDENED_TMP$WARNINGS$MISC$BLOWFISH \
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
--stringparam grsecurity_host $GRSECURITY_HOST \
-o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
xsltproc --nonet \
--xinclude \
--stringparam model $MODEL \
--stringparam kernel $KERNEL \
--stringparam testsuite $TEST \
--stringparam bomb-testsuite $BOMB_TEST \
--stringparam features \
x$SSP$ASLR$PAX$HARDENED_TMP$WARNINGS$MISC$BLOWFISH \
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
--stringparam grsecurity_host $GRSECURITY_HOST \
--output ./${PROGNAME}-commands/ \
$XSL \
$BOOK/index.xml >>$LOGDIR/$LOG 2>&1
;;
lfs)
echo -n " ${L_arrow}${BOLD}LFS${R_arrow} build... "
@ -131,17 +163,31 @@ extract_commands() { #
bash process-scripts.sh >> $LOGDIR/$LOG 2>&1
fi
popd > /dev/null
xsltproc --nonet \
--xinclude \
--stringparam testsuite $TEST \
--stringparam bomb-testsuite $BOMB_TEST \
--stringparam vim-lang $VIMLANG \
--stringparam full-locale $FULL_LOCALE \
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
--stringparam pkgmngt $PKGMNGT \
-o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
xsltproc --nonet \
--xinclude \
--stringparam revision $INITSYS \
--stringparam testsuite $TEST \
--stringparam bomb-testsuite $BOMB_TEST \
--stringparam vim-lang $VIMLANG \
--stringparam full-locale $FULL_LOCALE \
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
--stringparam pkgmngt $PKGMNGT \
--stringparam wrap-install $WRAP_INSTALL \
--stringparam hostname $HOSTNAME \
--stringparam interface $INTERFACE \
--stringparam ip $IP_ADDR \
--stringparam gateway $GATEWAY \
--stringparam prefix $PREFIX \
--stringparam broadcast $BROADCAST \
--stringparam domain $DOMAIN \
--stringparam nameserver1 $DNS1 \
--stringparam nameserver2 $DNS2 \
--output ./${PROGNAME}-commands/ \
$XSL \
$BOOK/index.xml >> $LOGDIR/$LOG 2>&1
;;
*) echo -n " ${L_arrow}${PROGNAME}${R_arrow} book invalid, terminate build... "
exit 1 ;;
@ -172,20 +218,25 @@ create_package_list() { #
echo -n "... "
case ${PROGNAME} in
clfs*)
xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \
xsltproc --nonet --xinclude \
-o pkg_tarball_list \
packages.xsl \
$BOOK/BOOK/materials/${ARCH}-chapter.xml >>$LOGDIR/$LOG 2>&1
;;
hlfs)
xsltproc --nonet --xinclude \
--stringparam model $MODEL \
xsltproc --nonet --xinclude \
--stringparam model $MODEL \
--stringparam kernel $KERNEL \
-o pkg_tarball_list packages.xsl \
--output pkg_tarball_list \
packages.xsl \
$BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1
;;
lfs)
xsltproc --nonet --xinclude \
--stringparam pkgmngt $PKGMNGT \
-o pkg_tarball_list packages.xsl \
xsltproc --nonet --xinclude \
--stringparam pkgmngt $PKGMNGT \
--stringparam revision $INITSYS \
--output pkg_tarball_list \
packages.xsl \
$BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
;;
*)

View file

@ -88,12 +88,9 @@ inline_doc
check_prerequisites() { #
#----------------------------#
case $PROGNAME in
clfs | clfs2 | clfs3) HOSTREQS="BOOK/prologue/common/hostreqs.xml" ;;
*) HOSTREQS="prologue/hostreqs.xml" ;;
esac
HOSTREQS=$(find $BOOK -name hostreqs.xml)
eval $(xsltproc $COMMON_DIR/hostreqs.xsl $BOOK/$HOSTREQS)
eval $(xsltproc $COMMON_DIR/hostreqs.xsl $HOSTREQS)
# Avoid translation of version strings
local LC_ALL=C
export LC_ALL
@ -236,17 +233,14 @@ inline_doc
check_blfs_tools() { #
#----------------------------#
: << inline_doc
In addition to the tools needed for the LFS part, tidy and docbook-xml
are needed for installing the BLFS tools
In addition to the tools needed for the LFS part, docbook-xml
is needed for installing the BLFS tools
inline_doc
# Avoid translation of version strings
local LC_ALL=C
export LC_ALL
tidyVer=$(tidy -V | cut -d " " -f9)
check_version "2004" "${tidyVer}" "TIDY"
# Minimal docbook-xml code for testing
XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>

View file

@ -150,31 +150,35 @@ create_urls() { #
case ${PROGNAME} in
clfs*)
echo -n "Creating CLFS <${ARCH}> specific URLs file"
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
--stringparam family clfs \
-o $BUILDDIR/sources/urls.lst urls.xsl \
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
--stringparam family clfs \
-o $BUILDDIR/sources/urls.lst \
urls.xsl \
$BOOK/BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
echo " ...OK"
;;
hlfs)
echo -n "Creating HLFS <${MODEL}> + <${KERNEL}> specific URLs file"
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
--stringparam family lfs \
--stringparam model $MODEL \
--stringparam kernel $KERNEL \
-o $BUILDDIR/sources/urls.lst urls.xsl \
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
--stringparam family lfs \
--stringparam model $MODEL \
--stringparam kernel $KERNEL \
-o $BUILDDIR/sources/urls.lst \
urls.xsl \
$BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1
echo " ...OK"
;;
lfs)
echo -n "Creating LFS specific URLs file"
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
--stringparam family lfs \
--stringparam pkgmngt $PKGMNGT \
-o ../sources/urls.lst urls.xsl \
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
--stringparam family lfs \
--stringparam pkgmngt $PKGMNGT \
--stringparam revision $INITSYS \
--output ../sources/urls.lst \
urls.xsl \
$BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
echo " ...OK"
;;

View file

@ -12,6 +12,11 @@ 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}
if [ "$WRAP_INSTALL" = y ]; then
sed -e 's/PKGDIR/UNPACKDIR/' \
-e 's/PKG_DEST/PKG_DIR/' \
$PKGMNGTDIR/packInstall.sh > ${BUILDDIR}${BLFS_ROOT}/packInstall.sh
fi
# Clean-up
make -C ${BUILDDIR}${BLFS_ROOT}/menu clean
@ -40,8 +45,10 @@ fi
# package database.
# sudo is needed if $BUILDDIR/var/lib is owned by root and /var/lib/jhalfs
# has to be created
sudo make -j1 -C $BUILDDIR$BLFS_ROOT TRACKING_DIR=$BUILDDIR$TRACKING_DIR \
$BUILDDIR$BLFS_ROOT/packages.xml
sudo make -j1 -C $BUILDDIR$BLFS_ROOT \
REV=$INITSYS \
TRACKING_DIR=$BUILDDIR$TRACKING_DIR \
$BUILDDIR$BLFS_ROOT/packages.xml
# Because the BLFS Makefile is supposed to be used in chroot (or booted)
# mode, the tracking file has wrong path for DTD. Change it:
@ -58,11 +65,6 @@ if [ "$DEP_LIBXSLT" = y ]; then
else
LINE_LIBXSLT='#CONFIG_libxslt is not set'
fi
if [ "$DEP_TIDY" = y ]; then
LINE_TIDY='CONFIG_html-tidy=y'
else
LINE_TIDY='#CONFIG_html-tidy is not set'
fi
# DocBook is a rec dep of libxslt
# if [ "$DEP_DBXML" = y ]; then
# LINE_DBXML='CONFIG_DocBook=y'
@ -110,7 +112,6 @@ $LINE_OPENSSL
$LINE_PYTHON
$LINE_LIBXML
$LINE_LIBXSLT
$LINE_TIDY
$LINE_WGET
$LINE_SVN
$LINE_GPM
@ -119,6 +120,7 @@ $LINE_SUDO
MAIL_SERVER=sendmail
optDependency=2
SUDO=n
WRAP_INSTALL=$WRAP_INSTALL
EOF
# Generates the scripts for the blfs tools dependencies (in ./scripts)
@ -128,19 +130,21 @@ yes "yes" | $BUILDDIR$BLFS_ROOT/gen_pkg_book.sh $BUILDDIR$BLFS_ROOT
sudo rm -rf $BUILDDIR$BLFS_ROOT/scripts
mv scripts $BUILDDIR$BLFS_ROOT
# The book instructions for CA certificates contains downloading
# instructions, which should not be used here, so:
if test -f $BUILDDIR$BLFS_ROOT/scripts/*cacerts; then
sed -i '/URL=/,/^wget/d' $BUILDDIR$BLFS_ROOT/scripts/*cacerts
fi
# Generates a list containing download and copying instructions for tarballs
echo -e '#!/bin/bash\nset -e\n' > $BUILDDIR$BLFS_ROOT/download_script
sed -n -e '/PACKAGE=/,/^fi/p' \
sed -n -e '/PACKAGE=/,/^fi/{/^fi/a\
cp $PACKAGE $SRC_ARCHIVE
p}' \
-e '/|[ ]*md5sum/p' \
-e '/PACKAGE1=/,/^fi/p' \
-e '/PATCH=/,/^fi/p' \
-e '/URL=/,/^fi/p' \
-e '/PACKAGE1=/,/^fi/{/^fi/a\
cp $PACKAGE1 $SRC_ARCHIVE
p}' \
-e '/PATCH=/,/^fi/{/^fi/a\
cp $PACKAGE1 $SRC_ARCHIVE
p}' \
-e '/URL=/,/^fi/{/^fi/a\
cp $PACKAGE1 $SRC_ARCHIVE
p}' \
$BUILDDIR$BLFS_ROOT/scripts/* >> $BUILDDIR$BLFS_ROOT/download_script
chmod u+x $BUILDDIR$BLFS_ROOT/download_script
@ -148,7 +152,13 @@ chmod u+x $BUILDDIR$BLFS_ROOT/download_script
pushd $BUILDDIR/sources
# Remove `unpacked' files if some have been left
sudo find . -name unpacked -exec rm \{\} \;
FTP_SERVER=$SERVER/pub/blfs/ SRC_ARCHIVE=$SRC_ARCHIVE $BUILDDIR$BLFS_ROOT/download_script
if [ "$GETPKG" = "y" ]; then
FTP_SERVER=$SERVER/pub/blfs/ \
SRC_ARCHIVE=${SRC_ARCHIVE:-/dev/null} \
$BUILDDIR$BLFS_ROOT/download_script
else # Save the download script in case the user wants to run it later
cp $BUILDDIR$BLFS_ROOT/download_script .
fi
popd
rm -v $BUILDDIR$BLFS_ROOT/download_script
@ -179,9 +189,8 @@ if [ "$DEP_SVN" = y ]; then
fi
if [ "$DEP_LYNX" = y ]; then
if [ "$DEP_OPENSSL" = y -o "$DEP_WGET" = y ]; then
sed -i -e 's/configure/& --with-ssl/' \
-e '/make$/i echo "#define USE_OPENSSL_INCL 1" >> lynx_cfg.h &&' \
$BUILDDIR$BLFS_ROOT/scripts/*lynx
sed -e 's/configure/& --with-ssl/' \
-i $BUILDDIR$BLFS_ROOT/scripts/*lynx
fi
fi
# At last generates the build Makefile

View file

@ -31,7 +31,7 @@ inline_doc
local -r ADVANCED_common="REPORT REBUILD_MAKEFILE"
# BOOK Settings by book
local -r LFS_book="$BOOK_common BLFS_TOOL"
local -r LFS_book="$BOOK_common INITSYS BLFS_TOOL"
#local -r HLFS_added="SET_SSP SET_ASLR SET_PAX SET_HARDENED_TMP SET_WARNINGS \
# SET_MISC SET_BLOWFISH"
local -r HLFS_added=""
@ -41,14 +41,17 @@ inline_doc
local -r CLFS3_book="$BOOK_common $BOOK_clfsX PLATFORM MIPS_LEVEL"
# Build Settings by book
local -r LFS_build="$BUILD_chroot VIMLANG $BUILD_common PKGMNGT FULL_LOCALE"
local -r LFS_build="$BUILD_chroot VIMLANG $BUILD_common PKGMNGT FULL_LOCALE WRAP_INSTALL"
local -r HLFS_build="$BUILD_chroot $BUILD_common"
local -r CLFS_build="$BUILD_chroot VIMLANG $BUILD_common"
local -r CLFS2_build="STRIP VIMLANG $BUILD_common"
local -r CLFS3_build=" $BUILD_common"
# System Settings by book (only LFS for now)
local -r LFS_system="HOSTNAME INTERFACE IP_ADDR GATEWAY PREFIX BROADCAST DOMAIN DNS1 DNS2 FONT CONSOLE_MAP UNICODE KEYMAP"
# Full list of books settings
local -r lfs_PARAM_LIST="$LFS_book $GENERAL_common $LFS_build $ADVANCED_chroot $ADVANCED_common"
local -r lfs_PARAM_LIST="$LFS_book $GENERAL_common $LFS_build $LFS_system $ADVANCED_chroot $ADVANCED_common"
local -r hlfs_PARAM_LIST="$HLFS_book $GENERAL_common $HLFS_build $ADVANCED_chroot $ADVANCED_common"
local -r clfs_PARAM_LIST="$CLFS_book $GENERAL_common $CLFS_build $ADVANCED_chroot $ADVANCED_common"
local -r clfs2_PARAM_LIST="$CLFS2_book $GENERAL_common $CLFS2_build $ADVANCED_common"
@ -58,7 +61,7 @@ inline_doc
# Additional variables
local -r blfs_tool_PARAM_LIST="\
BLFS_TREE BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR \
DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \
DEP_LIBXML DEP_LIBXSLT DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \
DEP_SVN DEP_GPM DEP_OPENSSL DEP_PYTHON"
local -r custom_tool_PARAM_LIST="TRACKING_DIR"
@ -80,6 +83,15 @@ inline_doc
exit 1
}
# This function is only used when testing package management files.
write_pkg_and_die() {
echo -e "\n${DD_BORDER}"
echo "Package management is requested but" >&2
echo -e $* >&2
echo -e "${DD_BORDER}\n"
exit 1
}
validate_file() {
# For parameters ending with a '+' failure causes a warning message only
echo -n "`eval echo $PARAM_VALS`"
@ -184,6 +196,35 @@ inline_doc
echo
;;
# Treatment of HOSTNAME
HOSTNAME) echo -e "`eval echo $PARAM_VALS`"
[[ "${!config_param}" = "**EDIT ME**" ]] && write_error_and_die
;;
# Case of PKGMNGT: two files, packageManager.xml and packInstall.sh
# must exist in $PKGMNGTDIR if PKGMNGT='y':
PKGMNGT) echo -e "`eval echo $PARAM_VALS`"
if [ "$PKGMNGT" = y ]; then
if [ ! -e "$PKGMNGTDIR/packageManager.xml" ]; then
write_pkg_and_die $PKGMNGTDIR/packageManager.xml does not exist
fi
if [ ! -e "$PKGMNGTDIR/packInstall.sh" ]; then
write_pkg_and_die $PKGMNGTDIR/packInstall.sh does not exist
fi
if [ ! -s "$PKGMNGTDIR/packageManager.xml" ]; then
write_pkg_and_die $PKGMNGTDIR/packageManager.xml has zero size
fi
if [ ! -s "$PKGMNGTDIR/packInstall.sh" ]; then
write_pkg_and_die $PKGMNGTDIR/packInstall.sh has zero size
fi
if [ ! -r "$PKGMNGTDIR/packageManager.xml" ]; then
write_pkg_and_die $PKGMNGTDIR/packageManager.xml is not readable
fi
if [ ! -r "$PKGMNGTDIR/packInstall.sh" ]; then
write_pkg_and_die $PKGMNGTDIR/packInstall.sh is not readable
fi
fi
;;
# Display non-validated envars found in ${PROGNAME}_PARAM_LIST
* ) echo -e "`eval echo $PARAM_VALS`" ;;

View file

@ -115,6 +115,7 @@ define get_pkg_root2
echo "export PKG_DEST=$(SRC)/$@" >> envars; \
echo "source packInstall.sh" >> envars; \
echo "export -f packInstall" >> envars; \
echo "export -f wrapInstall" >> envars; \
fi;
endef

View file

@ -8,13 +8,16 @@
<xsl:output method="text"/>
<!-- The libc model used for HLFS -->
<xsl:param name="model" select="glibc"/>
<xsl:param name="model" select="'glibc'"/>
<!-- The kernel series used for HLFS -->
<xsl:param name="kernel" select="2.6"/>
<xsl:param name="kernel" select="'2.6'"/>
<!-- Should we include a package manager -->
<xsl:param name="pkgmngt" select="n"/>
<!-- Should we include a package manager? -->
<xsl:param name="pkgmngt" select="'n'"/>
<!-- The system for LFS: sysv of systemd -->
<xsl:param name="revision" select="'sysv'"/>
<xsl:template match="/">
<xsl:apply-templates select="//para"/>
@ -28,6 +31,8 @@
<xsl:if test="contains(string(),'Download:') and
(ancestor::varlistentry[@condition=$model]
or not(ancestor::varlistentry[@condition])) and
(ancestor::varlistentry[@revision=$revision]
or not(ancestor::varlistentry[@revision])) and
(ancestor::varlistentry[@vendor=$kernel]
or not(ancestor::varlistentry[@vendor]))">
<xsl:call-template name="package_name">

View file

@ -14,16 +14,20 @@
<xsl:param name="family">lfs</xsl:param>
<!-- The libc model used for HLFS -->
<xsl:param name="model" select="glibc"/>
<xsl:param name="model" select="'glibc'"/>
<!-- The kernel series used for HLFS -->
<xsl:param name="kernel" select="2.6"/>
<xsl:param name="kernel" select="'2.6'"/>
<!-- Do we use a package manager? -->
<xsl:param name="pkgmngt" select="n"/>
<xsl:param name="pkgmngt" select="'n'"/>
<!-- The system for LFS: sysv of systemd -->
<xsl:param name="revision" select="'sysv'"/>
<xsl:template match="/">
<xsl:apply-templates select="//ulink"/>
<xsl:apply-templates select="//varlistentry[@revision=$revision
or not(@revision)]//ulink"/>
<xsl:if test="$pkgmngt='y'">
<xsl:apply-templates
select="document('packageManager.xml')//ulink"/>
@ -101,6 +105,9 @@
<xsl:when test="contains($dirname, 'udev')">
<xsl:text>udev/</xsl:text>
</xsl:when>
<xsl:when test="contains($dirname, 'iputils')">
<xsl:text>iputils/</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$dirname"/>
<xsl:text>/</xsl:text>

View file

@ -0,0 +1,25 @@
#
# $Id$
#
PKG="libffi"
PKG_VERSION="3.2.1"
PKG_FILE="libffi-3.2.1.tar.gz"
URL="http://sourceware.org/pub/libffi/${PKG_FILE}"
MD5="83b89587607e3eb65c70d361f13bab43"
for i in PATCH{1..10}; do
unset $i
done
( cat << "xEOFx"
sed -e '/^includesdir/ s/$(libdir).*$/$(includedir)/' \
-i include/Makefile.in &&
sed -e '/^includedir/ s/=.*$/=@includedir@/' \
-e 's/^Cflags: -I${includedir}/Cflags:/' \
-i libffi.pc.in &&
./configure --prefix=/usr --disable-static &&
make
make install
xEOFx
) > tmp

31
custom/examples/941-pcre Normal file
View file

@ -0,0 +1,31 @@
#
# $Id$
#
PKG="pcre"
PKG_VERSION="8.37"
PKG_FILE="pcre-8.37.tar.bz2"
URL="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${PKG_FILE}"
MD5="ed91be292cb01d21bc7e526816c26981"
for i in PATCH{1..10}; do
unset $i
done
PATCH1="http://www.linuxfromscratch.org/patches/blfs/7.8/pcre-8.37-upstream_fixes-1.patch 718c4314fba52ed559c75ff7660cc391"
( cat << "xEOFx"
patch -Np1 -i ../pcre-8.37-upstream_fixes-1.patch &&
./configure --prefix=/usr \
--docdir=/usr/share/doc/pcre-8.37 \
--enable-unicode-properties \
--enable-pcre16 \
--enable-pcre32 \
--enable-pcregrep-libz \
--enable-pcregrep-libbz2 \
--enable-pcretest-libreadline \
--disable-static &&
make
make install &&
mv -v /usr/lib/libpcre.so.* /lib &&
ln -sfv ../../lib/$(readlink /usr/lib/libpcre.so) /usr/lib/libpcre.so
xEOFx
) > tmp

View file

@ -0,0 +1,25 @@
#
# $Id$
#
PKG="python3"
PKG_VERSION="3.4.3"
PKG_FILE="Python-3.4.3.tar.xz"
URL="https://www.python.org/ftp/python/3.4.3/${PKG_FILE}"
MD5="7d092d1bba6e17f0d9bd21b49e441dd5"
for i in PATCH{1..10}; do
unset $i
done
( cat << "xEOFx"
CXX="/usr/bin/g++" \
./configure --prefix=/usr \
--enable-shared \
--with-system-expat \
--with-system-ffi \
--without-ensurepip &&
make
make install &&
chmod -v 755 /usr/lib/libpython3.4m.so &&
chmod -v 755 /usr/lib/libpython3.so
xEOFx
) > tmp

View file

@ -1,22 +0,0 @@
#
# $Id$
#
PKG="bc"
PKG_VERSION="1.06"
PKG_FILE="bc-1.06.tar.gz"
URL="http://ftp.gnu.org/gnu/bc/${PKG_FILE}"
MD5="d44b5dddebd8a7a7309aea6c36fda117"
for i in PATCH{1..10}; do
unset $i
done
( cat << "xEOFx"
sed -i '/PROTO.*readline/d' bc/scan.l &&
sed -i '/flex -I8/s/8//' configure &&
sed -i '/stdlib/a #include <string.h>' lib/number.c &&
sed -i 's/program.*save/static &/' bc/load.c &&
./configure --prefix=/usr --with-readline &&
make
make install
xEOFx
) > tmp

View file

@ -2,21 +2,17 @@
# $Id$
#
PKG="glib"
PKG_VERSION="1.2.10"
PKG_FILE="glib-1.2.10.tar.gz"
URL="http://gd.tuwien.ac.at/graphics/gimp/gtk/v1.2/${PKG_FILE}"
MD5="6fe30dad87c77b91b632def29dd69ef9"
PKG_VERSION="2.44.1"
PKG_FILE="glib-2.44.1.tar.xz"
URL="http://ftp.gnome.org/pub/gnome/sources/glib/2.44/${PKG_FILE}"
MD5="83efba4722a9674b97437d1d99af79db"
for i in PATCH{1..10}; do
unset $i
done
PATCH1="http://www.linuxfromscratch.org/patches/blfs/svn/glib-1.2.10-gcc34-1.patch 0077a1cce5e8a2231ac5a9b08c6263ba"
( cat << "xEOFx"
patch -Np1 -i ../glib-1.2.10-gcc34-1.patch &&
./configure --prefix=/usr &&
./configure --prefix=/usr --with-pcre=system &&
make
make install &&
chmod -v 755 /usr/lib/libgmodule-1.2.so.0.0.10
make install
xEOFx
) > tmp

View file

@ -2,17 +2,21 @@
# $Id$
#
PKG="mc"
PKG_VERSION="4.6.1"
PKG_FILE="mc-4.6.1.tar.gz"
URL="http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/${PKG_FILE}"
MD5="18b20db6e40480a53bac2870c56fc3c4"
PKG_VERSION="4.8.14"
PKG_FILE="mc-4.8.14.tar.xz"
URL="http://ftp.midnight-commander.org/${PKG_FILE}"
MD5="fbdaddb9edcf8925dcf3231331a8720b"
for i in PATCH{1..10}; do
unset $i
done
( cat << "xEOFx"
./configure --prefix=/usr &&
./configure --prefix=/usr \
--sysconfdir=/etc \
--with-screen=ncurses \
--enable-charset &&
make
make install
cp -v doc/keybind-migration.txt /usr/share/mc
xEOFx
) > tmp

View file

@ -7,10 +7,10 @@
#
PKG="ppp"
PKG_VERSION="2.4.4"
PKG_VERSION="2.4.7"
PKG_FILE="ppp-${PKG_VERSION}.tar.gz"
URL="http://samba.org/ftp/ppp/${PKG_FILE}"
MD5="183800762e266132218b204dfb428d29"
MD5="78818f40e6d33a1d1de68a1551f6595a"
for i in PATCH{1..10}; do
unset $i
done

View file

@ -8,28 +8,30 @@
#
PKG="openssl"
PKG_VERSION="0.9.8d"
PKG_VERSION="1.0.2d"
PKG_FILE="openssl-${PKG_VERSION}.tar.gz"
URL="ftp://ftp.openssl.org/source/${PKG_FILE}"
MD5="8ed1853538e1d05a1f5ada61ebf8bffa"
MD5="38dd619b2e77cbac69b99f52a053d25a"
for i in PATCH{1..10}; do
unset $i
done
PATCH1=" http://www.linuxfromscratch.org/patches/blfs/svn/openssl-0.9.8d-fix_manpages-1.patch"
( cat << "xEOFx"
sed -i -e 's/mcpu/march/' config
patch -Np1 -i ../openssl-0.9.8d-fix_manpages-1.patch &&
./config --openssldir=/etc/ssl --prefix=/usr shared &&
make MANDIR=/usr/share/man
./config --prefix=/usr \
--openssldir=/etc/ssl \
--libdir=lib \
shared \
zlib-dynamic &&
make
make MANDIR=/usr/share/man install &&
cp -v -r certs /etc/ssl &&
install -v -d -m755 /usr/share/doc/openssl-0.9.8d &&
cp -v -r doc/{HOWTO,README,*.{txt,html,gif}} \
/usr/share/doc/openssl-0.9.8d
#sed -i 's# libcrypto.a##;s# libssl.a##' Makefile
make MANDIR=/usr/share/man MANSUFFIX=ssl install &&
install -dv -m755 /usr/share/doc/openssl-1.0.2d &&
cp -vfr doc/* /usr/share/doc/openssl-1.0.2d
#
# Note: certificates not installed by this.
#
xEOFx
) > tmp

View file

@ -2,27 +2,33 @@
# $Id$
#
PKG="gpm"
PKG_VERSION="1.20.1"
PKG_VERSION="1.20.7"
PKG_FILE="gpm-${PKG_VERSION}.tar.bz2"
URL="ftp://arcana.linux.it/pub/gpm/${PKG_FILE}"
MD5="2c63e827d755527950d9d13fe3d87692"
URL="http://www.nico.schottelius.org/software/gpm/archives/${PKG_FILE}"
MD5="bf84143905a6a903dbd4d4b911a2a2b8"
for i in PATCH{1..10}; do
unset $i
done
PATCH1=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-segfault-1.patch"
PATCH2=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-silent-1.patch"
( cat << "xEOFx"
patch -Np1 -i ../gpm-1.20.1-segfault-1.patch &&
patch -Np1 -i ../gpm-1.20.1-silent-1.patch &&
./autogen.sh &&
./configure --prefix=/usr --sysconfdir=/etc &&
LDFLAGS="-lm" make
make
make install &&
cp -v conf/gpm-root.conf /etc &&
ldconfig
make install &&
install-info --dir-file=/usr/share/info/dir \
/usr/share/info/gpm.info &&
ln -sfv libgpm.so.2.1.0 /usr/lib/libgpm.so &&
install -v -m644 conf/gpm-root.conf /etc &&
install -v -m755 -d /usr/share/doc/gpm-${PKG_FILE}/support &&
install -v -m644 doc/support/* \
/usr/share/doc/gpm-${PKG_FILE}/support &&
install -v -m644 doc/{FAQ,HACK_GPM,README*} \
/usr/share/doc/gpm-${PKG_FILE}
# The normal cmd to install the boot script for gpm
# --- PUT THIS CMD INSIDE 999-blfs_bootscripts
@ -31,7 +37,7 @@ ldconfig
cat > /etc/sysconfig/mouse << "EOF"
# Begin /etc/sysconfig/mouse
MDEVICE="/dev/psaux"
MDEVICE="/dev/input/mice"
PROTOCOL="imps2"
GPMOPTS=""

View file

@ -5,28 +5,31 @@
#
PKG="lynx"
PKG_VERSION="2.8.6"
PKG_VERSION="2.8.8rel.2"
PKG_FILE="lynx${PKG_VERSION}.tar.bz2"
URL="ftp://lynx.isc.org/lynx2.8.6/${PKG_FILE}"
MD5="dc80497b7dda6a28fd80404684d27548"
URL="ftp://lynx.isc.org/${PKG_FILE}"
MD5="b231c2aa34dfe7ca25681ef4e55ee7e8"
for i in PATCH{1..10}; do
unset $i
done
( cat << "xEOFx"
./configure --prefix=/usr \
./configure --prefix=/usr \
--sysconfdir=/etc/lynx \
--datadir=/usr/share/doc/lynx-2.8.6 \
--with-zlib \
--with-bzlib \
--datadir=/usr/share/doc/lynx-2.8.8rel.2 \
--with-zlib \
--with-bzlib \
--with-screen=ncursesw \
--enable-locale-charset &&
make
make install-full &&
chgrp -v -R root /usr/share/doc/lynx-2.8.6/lynx_doc
chgrp -v -R root /usr/share/doc/lynx-2.8.8rel.2/lynx_doc
sed -i 's/#\(LOCALE_CHARSET\):FALSE/\1:TRUE/' /etc/lynx/lynx.cfg
sed -i 's/#\(DEFAULT_EDITOR\):/\1:vi/' /etc/lynx/lynx.cfg
sed -i 's/#\(PERSISTENT_COOKIES\):FALSE/\1:TRUE/' /etc/lynx/lynx.cfg
xEOFx
) > tmp

View file

@ -0,0 +1,31 @@
#
# $Id$
#
# dhcpcd is an implementation of the DHCP client specified in RFC2131.
# This is useful for connecting your computer to a network which uses
# DHCP to assign network addresses.
#
PKG="dhcpcd"
PKG_VERSION="6.9.3"
PKG_FILE="dhcpcd-${PKG_VERSION}.tar.xz"
URL="http://roy.marples.name/downloads/dhcpcd/${PKG_FILE}"
MD5="8357d023c4687d27bc6ea7964236b2a6"
for i in PATCH{1..10}; do
unset $i
done
( cat << "xEOFx"
./configure --libexecdir=/lib/dhcpcd \
--dbdir=/var/lib/dhcpcd &&
make
make install
# Add the following to boot scripts.
#make install-service-dhcpcd
# more configuration?
xEOFx
) > tmp

View file

@ -1,27 +0,0 @@
#
# $Id$
#
# dhcpcd is an implementation of the DHCP client specified in RFC2131.
# This is useful for connecting your computer to a network which uses
# DHCP to assign network addresses.
#
PKG="dhcpcd"
PKG_VERSION="2.0.8"
PKG_FILE="dhcpcd-${PKG_VERSION}.tar.bz2"
URL="ftp://ftp.osuosl.org/pub/gentoo/distfiles/${PKG_FILE}"
MD5="ec91c33b6d9cb46a42f9564e573fd249"
for i in PATCH{1..10}; do
unset $i
done
( cat << "xEOFx"
./configure --prefix="" --mandir=/usr/share/man &&
make
make install &&
chmod -v 754 /etc/dhcpc/dhcpcd.exe
xEOFx
) > tmp

View file

@ -1,25 +0,0 @@
#
# $Id$
#
# Program for ejecting removable media under software control.
# Can also control the auto-eject feature of some drives and
# can be used to switch CDs on an IDE/ATAPI CD changer.
#
PKG="eject"
PKG_VERSION="2.10"
PKG_FILE="eject-${PKG_VERSION}.tar.gz"
URL="ftp://sunsite.unc.edu/pub/Linux/utils/disk-management/${PKG_FILE}"
MD5="82e3a7a4d7e3323018c6938015ff25f7"
PATCH1=""
( cat << "xEOFx"
./configure --prefix=/usr \
--enable-default-device=/dev/cdrom \
--disable-nls
make
make install
xEOFx
) > tmp

View file

@ -5,29 +5,20 @@
# disassembler as well.
PKG="nasm"
PKG_VERSION="0.98.39"
PKG_FILE="nasm-${PKG_VERSION}.tar.bz2"
URL="http://downloads.sourceforge.net/nasm/${PKG_FILE}"
MD5="2032ad44c7359f7a9a166a40a633e772"
PKG_VERSION="2.11.08"
PKG_FILE="nasm-${PKG_VERSION}.tar.xz"
URL="http://www.nasm.us/pub/nasm/releasebuilds/2.11.08/${PKG_FILE}"
MD5="0d461a085b088a14dd6628c53be1ce28"
for i in PATCH{1..10}; do
unset $i
done
PATCH1="http://www.linuxfromscratch.org/patches/blfs/svn/nasm-0.98.39-security_fix-1.patch"
( cat << "xEOFx"
patch -Np1 -i ../nasm-0.98.39-security_fix-1.patch &&
./configure --prefix=/usr &&
make
make -C rdoff/doc
make -C rdoff/doc html
make install &&
make install_rdf &&
install -v -m644 rdoff/doc/rdoff.info /usr/share/info &&
install -v -m755 -d /usr/share/doc/nasm/html &&
install -v -m644 rdoff/doc/v1-v2.txt /usr/share/doc/nasm &&
cp -v -R rdoff/doc/rdoff /usr/share/doc/nasm/html
make install
xEOFx
) > tmp

View file

@ -2,10 +2,10 @@
# $Id$
#
PKG="blfs-bootscripts"
PKG_VERSION="20060910"
PKG_VERSION="20150924"
PKG_FILE="blfs-bootscripts-${PKG_VERSION}.tar.bz2"
URL="http://www.linuxfromscratch.org/blfs/downloads/svn/${PKG_FILE}"
MD5="e1715c58dc694bf474c4468e6bade3ad"
URL="http://anduin.linuxfromscratch.org/sources/BLFS/conglomeration/blfs-bootscripts/${PKG_FILE}"
MD5="97a371743223ac3815bf491863a39c7d"
for i in PATCH{1..10}; do
unset $i
done

View file

@ -11,13 +11,17 @@ BLFS_ROOT : where the installed tools will be installed, relative to $HOME.
Must start with a '/' (default /blfs_root)
BLFS_BRANCH_ID: development, branch-xxx, xxx (where xxx is a valid tag)
(default development)
INITSYS : which book do you want? 'sysv' or 'systemd' (default sysv)
Examples:
1 - If you plan to use the tools to build BLFS on top of LFS, but you did not
use jhalfs, or forgot to include the jhalfs-blfs tools:
(as root) mkdir -p /var/lib/jhalfs/BLFS && chown -R <user> /var/lib/jhalfs
(as user) ./install-blfs-tools.sh
2 - To install with only user privileges:
(as user) INITSYS=<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
@ -44,19 +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}"
INITSYS="${INITSYS:=sysv}"
BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development}
BLFS_XML=${BLFS_XML:=blfs-xml}
# Validate the configuration:
PARAMS="BLFS_ROOT TRACKING_DIR INITSYS 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_}"
#*******************************************************************#
@ -67,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-} ;;
@ -76,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
@ -85,21 +130,22 @@ 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}
cp README.BLFS ${BUILDDIR}${BLFS_ROOT}
[[ $VERBOSITY > 0 ]] && echo "... OK"
[[ $VERBOSITY > 0 ]] && echo -n Cleaning the ${BUILDDIR}${BLFS_ROOT} directory
# Clean-up
[[ $VERBOSITY > 0 ]] && echo Cleaning the ${BUILDDIR}${BLFS_ROOT} directory
make -C ${BUILDDIR}${BLFS_ROOT}/menu clean
rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.svn
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@ \
@ -112,9 +158,17 @@ sed -i s@tracking-dir@$TRACKING_DIR@ \
mkdir -p $TRACKING_DIR
[[ $VERBOSITY > 0 ]] && echo "... OK"
[[ $VERBOSITY > 0 ]] && echo -n "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=$INITSYS \
BLFS_XML=$BUILDDIR$BLFS_ROOT/$BLFS_XML \
SVN=svn://svn.linuxfromscratch.org/BLFS/$BLFS_TREE \
$BUILDDIR$BLFS_ROOT/packages.xml
[[ $VERBOSITY > 0 ]] && echo "... OK"

25
jhalfs
View file

@ -50,7 +50,7 @@ simple_error() { # Basic error trap.... JUST DIE
}
see_ya() {
echo -e "\n${L_arrow}${BOLD}jhalfs-trunk${R_arrow} exit${OFF}\n"
echo -e "\n${L_arrow}${BOLD}jhalfs${R_arrow} exit${OFF}\n"
}
##### Simple error TRAPS
# ctrl-c SIGINT
@ -70,20 +70,21 @@ trap 'echo -e "\n\n${RED}INTERRUPT${OFF} trapped\n" && exit 2' 1 2 3 15 17 18
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
version="
${BOLD} \"jhalfs-trunk\"${OFF} builder tool (development) \$Rev$
${BOLD} \"jhalfs\"${OFF} builder tool (development) \$Rev$
\$Date$
Written by George Boudreau and Manuel Canales Esparcia,
Written by George Boudreau, Manuel Canales Esparcia, Pierre Labastie,
plus several contributions.
Based on an idea from Jeremy Huntwork
This set of files are published under the
${BOLD}Gnu General Public License, Version 2.${OFF}
See the ${BOLD}LICENCE${OFF} file in this directory.
"
case $1 in
-v ) echo "$version" && exit 1 ;;
-v ) echo "$version" && exit ;;
run ) : ;;
* )
echo "${nl_}${tab_}${BOLD}${RED}This script cannot be called directly: EXITING ${OFF}${nl_}"
@ -123,6 +124,7 @@ COMPARE=${COMPARE:-n}
RUN_FARCE=${RUN_FARCE:-n}
RUN_ICA=${RUN_ICA:-n}
PKGMNGT=${PKGMNGT:-n}
WRAP_INSTALL=${WRAP_INSTALL:-n}
BOMB_TEST=${BOMB_TEST:-n}
STRIP=${STRIP:=n}
REPORT=${REPORT:=n}
@ -140,6 +142,7 @@ SET_HARDENED_TMP=${SET_HARDENED_TMP:=n}
SET_WARNINGS=${SET_WARNINGS:=n}
SET_MISC=${SET_MISC:=n}
SET_BLOWFISH=${SET_BLOWFISH:=n}
UNICODE=${UNICODE:=n}
if [[ "${NO_PROGRESS_BAR}" = "y" ]] ; then
NO_PROGRESS="#"
@ -382,9 +385,10 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
#
# Copy packageManager.xml, if needed
[[ "$PKGMNGT" = "y" ]] && [[ "$PROGNAME" = "lfs" ]] &&
cp $PKGMNGTDIR/packageManager.xml $JHALFSDIR/ &&
[[ "$PKGMNGT" = "y" ]] && [[ "$PROGNAME" = "lfs" ]] && {
cp $PKGMNGTDIR/packageManager.xml $JHALFSDIR/
cp $PKGMNGTDIR/packInstall.sh $JHALFSDIR/
}
#
# Copy urls.xsl, if needed
[[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/
@ -440,8 +444,15 @@ if [[ "$REBUILD_MAKEFILE" = "y" ]] ; then
case $PROGNAME in
clfs* )
VERSION=$(xmllint --noent $JHALFSDIR/$BOOK/prologue/$ARCH/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
lfs)
if [[ "$INITSYS" = "sysv" ]] ; then
VERSION=$(grep 'ENTITY version ' $JHALFSDIR/$BOOK/general.ent| cut -d\" -f2)
else
VERSION=$(grep 'ENTITY versiond' $JHALFSDIR/$BOOK/general.ent| cut -d\" -f2)
fi
;;
*)
VERSION=$(xmllint --noent $JHALFSDIR/$BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
VERSION=$(xmllint --noent $JHALFSDIR/$BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
esac
fi

View file

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

104
pkgmngt/packInstall.sh.porg Normal file
View file

@ -0,0 +1,104 @@
# $Id:$
# functions for recording installation of a package and make a tarball,
# or using fakeroot type commands for install, then packing and installing
# the package.
# We only have access to variables PKGDIR and PKG_DEST. Other variables could
# be set in the environment
extract_version() {
local VERSION
case $1 in
expect*|tcl*|tk*|mozjs*)
VERSION=$(echo $1 | sed 's/^[^0-9]*//')
;;
vim*|unzip*|zip*)
VERSION=$(echo $1 | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/')
;;
wireless_tools*|LVM2*)
VERSION=$(echo $1 | sed 's/^[^.]*\.//')
;;
x264*)
VERSION=$(echo $1 | sed 's/.*shot-//')
;;
icu*) # No version in PCKGVRS! Use version directly from xml book.
# PACK_INSTALL contains the path to this script, which is in the
# parent dir of the book.
local PACKENT=$(dirname $PACK_INSTALL)/blfs-xml/packages.ent
local VERSION1=$(sed -n 's/.*icu-major[^0-9]*\([^"]*\).*/\1/p' $PACKENT)
local VERSION2=$(sed -n 's/.*icu-minor[^0-9]*\([^"]*\).*/\1/p' $PACKENT)
VERSION=$VERSION1.$VERSION2
;;
soundtouch*)
local PACKENT=$(dirname $PACK_INSTALL)/blfs-xml/packages.ent
VERSION=$(sed -n 's/.*soundtouch[^0-9]*\([^"]*\).*/\1/p' $PACKENT)
;;
xf86-video-intel)
local PACKENT=$(dirname $PACK_INSTALL)/blfs-xml/x/installing/x7driver-intel.xml
VERSION=$(sed -n '/<!--/!s/.*-version[^;][^0-9]*\([^"]*\).*/\1/p' $PACKENT)
;;
jdk8*)
VERSION=1.8.0.$(echo $1 | sed 's/.*u\([0-9]\+\).*/\1/')
;;
docbook-xml)
VERSION=4.5
;;
cacerts*)
VERSION=0.1
;;
*)
VERSION=$(echo $1 | sed 's/^.*[-_]\([0-9]\)/\1/' | sed 's/_/./g')
;;
# the last sed above is because some package managers do not want a '_'
# in version.
esac
echo ${VERSION,,} # convert to lowercase, in case there is a capital letter
# in version
}
# Export the previous function, since it is used by the others
export -f extract_version
# The other "official" functions, wrapInstall and packInstall, are exported
# by "envars" (in LFS), and the scripts (in BLFS).
wrapInstall() {
# a bash command is passed as an argument (that may be a compound command).
# It is executed by this function, after various set-ups...
# Note that PKGDIR is changed to UNPACKDIR
# and PKG_DEST is changed to PKG_DIR in BLFS tools.
# The sed for PACKAGE is therefore not needed in BLFS,
# but it does not hurt, either.
local PCKGVRS=$(basename $PKGDIR)
local TGTPKG=$(basename $PKG_DEST)
local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
sed 's/^[0-9]\{1\}-//')
# Porg converts package names to lowercase anyway, so do the conversion
# ourselves
PACKAGE=${PACKAGE,,}
# version is only accessible from PKGDIR name. Since the format of the
# name is not normalized, several hacks are necessary (now in function
# extract_version)...
VERSION=$(extract_version $PCKGVRS)
porg -lp ${PACKAGE}-${VERSION} sh << PORG_EOF
$*
PORG_EOF
}
#----------------
packInstall() {
# With porg, we need only the package name to make the tarball
local TGTPKG=$(basename $PKG_DEST)
local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
sed 's/^[0-9]\{1\}-//')
local PCKGVRS=$(basename $PKGDIR)
# Porg converts package names to lowercase anyway, so do the conversion
# ourselves
PACKAGE=${PACKAGE,,}
# Building the binary package
porgball ${PACKAGE}
# The package is in the current directory
VERSION=$(extract_version $PCKGVRS)
mv -v ${PACKAGE}-${VERSION}.porg* /var/lib/packages
}

View file

@ -31,7 +31,7 @@ esac
pushd $PKG_DEST
rm -fv ./usr/share/info/dir # recommended since this directory is already there
# on the system
# The next lines are specific to dpkg, but usually all pacakge managers
# The next lines are specific to dpkg, but usually all package managers
# need some information on the version and the package.
mkdir DEBIAN
cat > DEBIAN/control <<EOF

View file

@ -9,10 +9,10 @@
<!ENTITY before "Must be installed before">
<!ENTITY external "Optional dependencies">
<!ENTITY debian-pool "http://ftp2.fr.debian.org/debian/pool/main/">
<!ENTITY dpkg-version "1.18.3">
<!ENTITY dpkg-size "4,258 KB">
<!ENTITY dpkg-version "1.18.23">
<!ENTITY dpkg-size "4,411 KB">
<!ENTITY dpkg-url "&debian-pool;d/dpkg/dpkg_&dpkg-version;.tar.xz">
<!ENTITY dpkg-md5 "a5ca138121cc37c8fb0083462a3b4d47">
<!ENTITY dpkg-md5 "2195338c1792b0678575309a099d2da8">
<!ENTITY dpkg-home "http://wiki.debian.org/Teams/Dpkg">
<!ENTITY dpkg-ch5-du "56 MB">
<!ENTITY dpkg-ch5-sbu "0.2 SBU">
@ -111,7 +111,7 @@
--disable-nls --disable-dselect \
--disable-start-stop-daemon \
--disable-update-alternatives \
--without-zlib --with-liblzma=static --without-selinux</userinput></screen>
--without-zlib --with-liblzma=static --without-libselinux</userinput></screen>
<variablelist>
<title>The meaning of the configure options:</title>
@ -157,10 +157,10 @@
</varlistentry>
<varlistentry>
<term><parameter>--without-selinux</parameter></term>
<term><parameter>--without-libselinux</parameter></term>
<listitem>
<para>Disable building for <application>selinux</application>, which
is not used woth LFS/BLFS.</para>
is not used with LFS/BLFS.</para>
</listitem>
</varlistentry>
@ -275,7 +275,7 @@ touch /var/log/dpkg.log</userinput></screen>
--disable-dselect \
--disable-start-stop-daemon \
--disable-update-alternatives \
--without-selinux</userinput></screen>
--without-libselinux</userinput></screen>
<variablelist>
<title>The meaning of the configure options:</title>
@ -304,7 +304,7 @@ touch /var/log/dpkg.log</userinput></screen>
</varlistentry>
<varlistentry>
<term><parameter>--without-selinux</parameter></term>
<term><parameter>--without-libselinux</parameter></term>
<listitem>
<para>Selinux is not used in LFS.</para>
</listitem>

View file

@ -22,7 +22,7 @@ Do not change anything, except the url and the md5 checksum. -->
<para>MD5 sum: <literal>e9aa6dec29920eba8ef706ea5823bad7</literal></para>
<para>Download: <ulink url="http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz"/></para>
<para>MD5 sum: <literal>efad5a503f66329bb9d2f4308b5de98a</literal></para>
<para>Download: <ulink url="ftp://ftp.archlinux.org/other/pacman/pacman-4.1.2.tar.gz"/></para>
<para>Download: <ulink url="https://sources.archlinux.org/other/pacman/pacman-4.1.2.tar.gz"/></para>
<para>MD5 sum: <literal>063c8b0ff6bdf903dc235445525627cd</literal></para>
</sect1>
@ -43,6 +43,7 @@ instruction contains file="name.html" -->
<sect2 role="installation">
<screen><userinput remap="configure">./configure --prefix=/tools \
--without-bz2lib \
--without-xml2 \
--enable-bsdtar=static \
--enable-bsdcpio=static</userinput></screen>
<screen><userinput remap="make">make</userinput></screen>
@ -75,6 +76,7 @@ put line breaks before and after your instructions. <userinput> without
remap attribute are considered configuration instructions and executed last. You
can also use remap="adjust" for the same purpose. -->
<screen><userinput remap="configure">./configure --prefix=/tools \
--without-openssl \
PKG_CONFIG_PATH=/tools/lib/pkgconfig \
DUPATH=/tools/bin/du</userinput></screen>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" >
<article>
<sect1 id="package">
<title>Package Information</title>
<para>Download: <ulink url="https://sourceforge.net/projects/porg/files/porg-0.10.tar.gz"/></para>
<para>MD5 sum: <literal>2eceb8a73bb188dbb06b12d90cabdbb4</literal></para>
</sect1>
<sect1 id="ch-tools-pkgmngt" role="wrap">
<?dbhtml filename="porg.html"?>
<title>Porg in tools</title>
<sect2 role="installation">
<title>Instructions</title>
<screen><userinput remap="configure">./configure --prefix=/tools \
--disable-grop \
--with-porg-logdir=/tools/var/porg</userinput></screen>
<para>
<parameter>--disable-grop</parameter> is needed to prevent the sytem from
trying to build the graphical interface, and
<parameter>--with-porg-logdir=...</parameter> is needed because
<command>make install</command> insists on creating a directory in
<filename class="directory">/var</filename>, where we do not want
to write.
</para>
<screen><userinput remap="make">make</userinput></screen>
<screen><userinput remap="install">make install</userinput></screen>
<screen><userinput>cat &gt;&gt; /tools/etc/porgrc &lt;&lt; EOF
# Porg logdir on LFS system
LOGDIR=/var/lib/porg
EOF
sed -e '/EXCLUDE/{s/^#//;s@$@:/sources:/home@}' \
-i /tools/etc/porgrc</userinput></screen>
</sect2>
</sect1>
<sect1 id="ch-pkgmngt-creatingdirs">
<title>Directories</title>
<screen><userinput>mkdir -pv /var/lib/porg
mkdir -pv /var/lib/packages</userinput></screen>
</sect1>
<sect1 id="ch-pkgmngt-createfiles">
<title>Files</title>
<para><command>porgball</command> needs <filename>porgrc</filename>
in <filename class="directory">/etc</filename>:</para>
<screen><userinput>cp /tools/etc/porgrc /etc</userinput></screen>
</sect1>
<sect1 id="ch-system-pkgmngt" role="wrap">
<?dbhtml filename="porg.html"?>
<title>Final Porg</title>
<sect2 role="installation">
<title>Instructions</title>
<screen><userinput remap="configure">./configure --prefix=/usr \
--disable-grop \
--sysconfdir=/etc \
--with-porg-logdir=/var/lib/porg</userinput></screen>
<screen><userinput remap="make">make</userinput></screen>
<screen><userinput remap="install">porg -lD "make install"</userinput></screen>
<screen><userinput>sed -e '/EXCLUDE/{s/^#//;s@$@:/sources:/home@}' \
-i /etc/porgrc</userinput></screen>
</sect2>
</sect1>
</article>