Subversion Repositories svn LFS-FR

Compare Revisions

Ignore whitespace Rev 1320 → Rev 1321

/trunk/lfs/make-aux-files.sh
4,11 → 4,11
 
# Get base file name and move bootscripts directory to that name
version=`grep "ENTITY lfs-bootscripts-version" packages.ent |cut -d'"' -f2`
mv bootscripts lfs-bootscripts-$version
mv lsb-bootscripts lfs-bootscripts-$version
 
# Create the tarball and clean up
tar -cjf lfs-bootscripts-$version.tar.bz2 --exclude .svn lfs-bootscripts-$version
mv lfs-bootscripts-$version bootscripts
mv lfs-bootscripts-$version lsb-bootscripts
 
rm -f udev-config*.bz2
 
/trunk/lfs/chapter01/whatsnew.xml
45,12 → 45,12
<!--<listitem>
<para>Berkeley DB &db-version;</para>
</listitem> -->
<!--<listitem>
<!-- <listitem>
<para>Binutils &binutils-version;</para>
</listitem>-->
<!--<listitem>
<listitem>
<para>Bison &bison-version;</para>
</listitem> -->
</listitem>
<!--<listitem>
<para>Bzip2 &bzip2-version;</para>
</listitem>-->
171,9 → 171,9
<!--<listitem>
<para>Procps &procps-version;</para>
</listitem>-->
<!--<listitem>
<listitem>
<para>Pkg-config &pkg-config-version;</para>
</listitem>-->
</listitem>
<!--<listitem>
<para>Psmisc &psmisc-version;</para>
</listitem>-->
245,9 → 245,15
<para>&gcc-crosscompile-patch;</para>
</listitem>
<listitem>
<para>Glib-&glib-version;</para>
</listitem>
<listitem>
<para>libpipeline-&libpipeline-version;</para>
</listitem>
<listitem>
<para>PCRE-&pcre-version;</para>
</listitem>
<listitem>
<para>readline-&readline-version;-fixes-1.patch</para>
</listitem>
 
/trunk/lfs/chapter01/changelog.xml
38,6 → 38,41
 
-->
<listitem>
<para>23-05-2011</para>
<itemizedlist>
<listitem>
<para>[matthew] - Correction d'une coquille dans les instructions de
PCRE et on a fait en sorte que Glib place sa configuration dans
<filename class="directory">/etc</filename>.</para>
</listitem>
</itemizedlist>
</listitem>
 
<listitem>
<para>22-05-2011</para>
<itemizedlist>
<listitem>
<para>[matthew] - Passage à Udev-170. Corrige
<ulink url="&lfs-ticket-root;2878">#2878</ulink>.</para>
</listitem>
<listitem>
<para>[matthew] - Passage à Linux-2.6.39. Corrige
<ulink url="&lfs-ticket-root;2877">#2877</ulink>.</para>
</listitem>
<listitem>
<para>[matthew] - Passage à Pkg-config-0.26, impliquant une dépendance
de Glib et de la dépendance de Glib, qui est PCRE. Corrige
<ulink url="&lfs-ticket-root;2876">#2876</ulink>.</para>
</listitem>
 
<listitem>
<para>[matthew] - Passage à Bison-2.5. Corrige
<ulink url="&lfs-ticket-root;2875">#2875</ulink>.</para>
</listitem>
</itemizedlist>
</listitem>
 
<listitem>
<para>15-05-2011</para>
<itemizedlist>
<listitem>
/trunk/lfs/lsb-bootscripts/lib/lsb/init-functions
8,29 → 8,24
. /etc/default/rc
fi
 
# Source the distro functions file
if [ "${DISTRO_MINI}" != "" ]; then
. "${RC_BASE}/init.d/${DISTRO_MINI}-functions"
fi
 
################################################################################
# start_daemon() #
# Usage: start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args...] #
# #
# Purpose: This runs the specified program as a daemon #
# #
# Inputs: -f: (force) run the program even if it is already running. #
# -n nicelevel: specify a nice level. See 'man nice(1)'. #
# -p pidfile: use the specified file to determine PIDs. #
# pathname: the complete path to the specified program #
# args: additional arguments passed to the program (pathname) #
# #
# Return values (as defined by LSB exit codes): #
# 0 - program is running or service is OK #
# 1 - generic or unspecified error #
# 2 - invalid or excessive argument(s) #
# 5 - program is not installed #
################################################################################
###############################################################################
# start_daemon() #
# Usage: start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args...] #
# #
# Purpose: This runs the specified program as a daemon #
# #
# Inputs: -f: (force) run the program even if it is already running. #
# -n nicelevel: specify a nice level. See 'man nice(1)'. #
# -p pidfile: use the specified file to determine PIDs. #
# pathname: the complete path to the specified program #
# args: additional arguments passed to the program (pathname) #
# #
# Return values (as defined by LSB exit codes): #
# 0 - program is running or service is OK #
# 1 - generic or unspecified error #
# 2 - invalid or excessive argument(s) #
# 5 - program is not installed #
###############################################################################
start_daemon()
{
local force=""
127,25 → 122,25
 
}
 
################################################################################
# killproc() #
# Usage: killproc [-p pidfile] pathname [signal] #
# #
# Purpose: Send control signals to running processes #
# #
# Inputs: -p pidfile, uses the specified pidfile #
# pathname, pathname to the specified program #
# signal, send this signal to pathname #
# #
# Return values (as defined by LSB exit codes): #
# 0 - program (pathname) has stopped/is already stopped or a #
# running program has been sent specified signal and stopped #
# successfully #
# 1 - generic or unspecified error #
# 2 - invalid or excessive argument(s) #
# 5 - program is not installed #
# 7 - program is not running and a signal was supplied #
################################################################################
###############################################################################
# killproc() #
# Usage: killproc [-p pidfile] pathname [signal] #
# #
# Purpose: Send control signals to running processes #
# #
# Inputs: -p pidfile, uses the specified pidfile #
# pathname, pathname to the specified program #
# signal, send this signal to pathname #
# #
# Return values (as defined by LSB exit codes): #
# 0 - program (pathname) has stopped/is already stopped or a #
# running program has been sent specified signal and stopped #
# successfully #
# 1 - generic or unspecified error #
# 2 - invalid or excessive argument(s) #
# 5 - program is not installed #
# 7 - program is not running and a signal was supplied #
###############################################################################
killproc()
{
local pidfile
335,20 → 330,20
fi
}
 
################################################################################
# pidofproc() #
# Usage: pidofproc [-p pidfile] pathname #
# #
# Purpose: This function returns one or more pid(s) for a particular daemon #
# #
# Inputs: -p pidfile, use the specified pidfile instead of pidof #
# pathname, path to the specified program #
# #
# Return values (as defined by LSB status codes): #
# 0 - Success (PIDs to stdout) #
# 1 - Program is dead, PID file still exists (remaining PIDs output) #
# 3 - Program is not running (no output) #
################################################################################
###############################################################################
# pidofproc() #
# Usage: pidofproc [-p pidfile] pathname #
# #
# Purpose: This function returns one or more pid(s) for a particular daemon #
# #
# Inputs: -p pidfile, use the specified pidfile instead of pidof #
# pathname, path to the specified program #
# #
# Return values (as defined by LSB status codes): #
# 0 - Success (PIDs to stdout) #
# 1 - Program is dead, PID file still exists (remaining PIDs output) #
# 3 - Program is not running (no output) #
###############################################################################
pidofproc()
{
 
427,18 → 422,19
return "${exitstatus}"
fi
}
################################################################################
# log_success_msg() #
# Usage: log_success_msg [$MESSAGE | "message"] #
# #
# Purpose: Print a successful status message to the screen and optionally #
# a boot log file. #
# #
# Inputs: accepts one string value, either a quoted string or optionally #
# the value of $MESSAGE if set in the running environment. #
# #
# Return values: Not used #
################################################################################
 
###############################################################################
# log_success_msg() #
# Usage: log_success_msg [$MESSAGE | "message"] #
# #
# Purpose: Print a successful status message to the screen and optionally #
# a boot log file. #
# #
# Inputs: accepts one string value, either a quoted string or optionally #
# the value of $MESSAGE if set in the running environment. #
# #
# Return values: Not used #
###############################################################################
log_success_msg()
{
echo -n -e "${PREFIX_SUCCESS}${@}"
456,18 → 452,18
return 0
}
 
################################################################################
# log_failure_msg() #
# Usage: log_failure_msg [$MESSAGE | "message"] #
# #
# Purpose: Print a failure status message to the screen and optionally #
# a boot log file. #
# #
# Inputs: accepts one string value, either a quoted string or optionally #
# the value of $MESSAGE if set in the running environment. #
# #
# Return values: Not used #
################################################################################
###############################################################################
# log_failure_msg() #
# Usage: log_failure_msg [$MESSAGE | "message"] #
# #
# Purpose: Print a failure status message to the screen and optionally #
# a boot log file. #
# #
# Inputs: accepts one string value, either a quoted string or optionally #
# the value of $MESSAGE if set in the running environment. #
# #
# Return values: Not used #
###############################################################################
log_failure_msg()
{
echo -n -e "${PREFIX_FAILURE}${@}"
485,18 → 481,18
return 0
}
 
################################################################################
# log_warning_msg() #
# Usage: log_warning_msg [$MESSAGE | "message"] #
# #
# Purpose: Print a warning status message to the screen and optionally #
# a boot log file. #
# #
# Inputs: accepts one string value, either a quoted string or optionally #
# the value of $MESSAGE if set in the running environment. #
# #
# Return values: Not used #
################################################################################
###############################################################################
# log_warning_msg() #
# Usage: log_warning_msg [$MESSAGE | "message"] #
# #
# Purpose: Print a warning status message to the screen and optionally #
# a boot log file. #
# #
# Inputs: accepts one string value, either a quoted string or optionally #
# the value of $MESSAGE if set in the running environment. #
# #
# Return values: Not used #
###############################################################################
log_warning_msg()
{
echo -n -e "${PREFIX_WARNING}${@}"
514,20 → 510,22
return 0
}
 
################################################################################
# check_signal() #
# Usage: check_signal [ -{signal} | {signal} ] #
# #
# Purpose: Check for a valid signal. This is not defined by any LSB draft, #
# however, it is required to check the signals to determine if the #
# signals chosen are invalid arguments to the other functions. #
# #
# Inputs: accepts a single string value in the form or -{signal} or {signal} #
# #
# Return values: #
# 0 - Success (signal is valid #
# 1 - Signal is not valid #
################################################################################
# The remaining fucntions are distro specific and are not defined by the LSB
 
###############################################################################
# check_signal() #
# Usage: check_signal [ -{signal} | {signal} ] #
# #
# Purpose: Check for a valid signal. This is not defined by any LSB draft, #
# however, it is required to check the signals to determine if the #
# signals chosen are invalid arguments to the other functions. #
# #
# Inputs: accepts a single string value in the form or -{signal} or {signal} #
# #
# Return values: #
# 0 - Success (signal is valid #
# 1 - Signal is not valid #
###############################################################################
check_signal()
{
local valsig
548,22 → 546,21
fi
}
 
 
################################################################################
# check_sig_type() #
# Usage: check_signal [ -{signal} | {signal} ] #
# #
# Purpose: Check if signal is a program termination signal or a control signal #
# This is not defined by any LSB draft, however, it is required to #
# check the signals to determine if they are intended to end a #
# program or simply to control it. #
# #
# Inputs: accepts a single string value in the form or -{signal} or {signal} #
# #
# Return values: #
# 0 - Signal is used for program termination #
# 1 - Signal is used for program control #
################################################################################
###############################################################################
# check_sig_type() #
# Usage: check_signal [ -{signal} | {signal} ] #
# #
# Purpose: Check if signal is a program termination signal or a control #
# signal. This is not defined by any LSB draft, however, it is #
# required to check the signals to determine if they are intended #
# to end a program or simply to control it. #
# #
# Inputs: accepts a single string value in the form or -{signal} or {signal} #
# #
# Return values: #
# 0 - Signal is used for program termination #
# 1 - Signal is used for program control #
###############################################################################
check_sig_type()
{
local valsig
580,4 → 577,259
fi
}
 
###############################################################################
# chkstat() #
# Usage: chckstat BIN_FILE {CONFIG_FILE} #
# #
# Purpose: chk_stat checks the status of a script by checking for both a #
# binary file to execute, and if set, a config file that may be #
# needed for the program to run successfully. #
# #
# Inputs: accepts first argument of an executable file, and optionally a #
# second arugument of a configuration file. If BIN_FILE and #
# CONFIG_FILE are set in the calling environment, either or both #
# arguments may be omitted. #
# #
# Return values: #
# 0 - The executable, and optionally the configuration file exists #
# 2 - Invalid or excessive arguments #
# 5 - BIN_FILE does not exist #
# 6 - CONFIG_FILE (if set) does not exist #
###############################################################################
chk_stat()
{
if [ "${#}" -gt "0" -a "${#}" -lt "3" ]; then
BIN_FILE="${1}"
if [ -z "${2}" ]; then
CONFIG_FILE=""
else
CONFIG_FILE="${2}"
fi
elif [ -z "${BIN_FILE}" ]; then
echo "Usage: 'chk_stat BIN_FILE CONFIG_FILE'"
exit 1 # Generic Error
fi
 
if [ ! -e "${BIN_FILE}" ]; then
log_failure_msg "${BIN_FILE} not installed" &&
exit 5
fi
 
if [ ! -z "${CONFIG_FILE}" ]; then
if [ ! -e "${CONFIG_FILE}" ]; then
log_failure_msg "${CONFIG_FILE} does not exist" &&
exit 6
fi
fi
}
 
###############################################################################
# loadproc() #
# Usage: loadproc {arguments} #
# #
# Purpose: loadproc is just a wrapper to start_daemon for simple scripts, #
# which will require no aruguments if $BIN_FILE is set. #
# #
# Inputs: Any optional arguments passed to loadproc will be passed on to the #
# executable defined by $BIN_FILE. #
# #
# Return values: (none) #
###############################################################################
loadproc()
{
start_daemon "${BIN_FILE}" "${@}"
}
 
###############################################################################
# endproc() #
# Usage: endproc {arguments} #
# #
# Purpose: endproc is just a wrapper to killproc for simple scripts, which #
# which will require no aruguments if $BIN_FILE is set. #
# #
# Inputs: Any optional arguments passed to endproc will be passed on to the #
# executable defined by $BIN_FILE. #
# #
# Return values: (none) #
###############################################################################
endproc()
{
killproc "${BIN_FILE}" "${@}"
}
 
###############################################################################
# statusproc() #
# Usage: statusproc $BIN_FILE $MESSAGE #
# #
# Purpose: stautsproc is just a wrapper to pidofproc for simple scripts, #
# which will require no aruguments if $BIN_FILE and MESSAGE are set. #
# #
# Inputs: accepts first argument of an executable file, and a second message #
# arugument "MESSAGE" to be displayed. If BIN_FILE and MESSAGE are #
# set in the calling environment, both arguments may be omitted. #
# #
# Return values: exit values of pidofproc #
###############################################################################
statusproc()
{
if [ "${#}" -gt "0" -a "${#}" -lt "3" ]; then
BIN_FILE="${1}"
MESSAGE="${2}"
elif [ -z "${BIN_FILE}" -o -z "${MESSAGE}" ]; then
echo "Usage: 'statusproc BIN_FILE MESSAGE'"
exit 1 # Generic Error
fi
 
pidlist=`pidofproc "${BIN_FILE}"`
STATUS=$?
echo "Checking ${MESSAGE} status:"
if [ "${STATUS}" -eq "0" ]; then
log_success_msg "Running with PID(s) ${pidlist}"
else
log_warning_msg "Not running!"
fi
 
return "${STATUS}"
}
 
###############################################################################
# reloadproc() #
# Usage: reloadproc {--force} $BIN_FILE $MESSAGE #
# #
# Purpose: reloadproc sends a HUP signal to the running program (relaod #
# configuration). It optionally, using the -force switch, checks the #
# status of a particular program and starts it if it is not already #
# running. #
# #
# Inputs: accepts one optional switch (must be the first argument), and #
# either two, or zero string arguments. If BIN_FILE and MESSAGE are #
# set in the calling envirnoment it will use those values, else it #
# requires the bin file as the first argument (following -force if #
# used), and the message as the second. If the --force argument is #
# given, it follows the LSB definition of 'force-reload' - the #
# program is started if not already running. #
# #
# Return values: 1 - generic error #
###############################################################################
reloadproc()
{
local force="0"
if [ "${#}" -gt "0" -a "${1}" = "-force" ]; then
force="1"
shift 1
fi
 
if [ "${#}" -gt "0" -a "${#}" -lt "3" ]; then
BIN_FILE="${1}"
MESSAGE="${2}"
elif [ -z "${BIN_FILE}" -o -z "${MESSAGE}" ]; then
echo "Usage: 'reloadproc BIN_FILE MESSAGE'"
exit 1 # Generic Error
fi
}
 
###############################################################################
# evaluate_retval() #
# Usage: evaluate_retval \ #
# [standard|start|stop|reload|force-reload|restart|try-restart] #
# #
# Purpose: determines the sucess or failure of a previous command based on #
# LSB exit values, and prints messages to the screen using the #
# log_*_msg() functions. #
# #
# Inputs: accepts one argument which determines the output of the message #
# displayed on the screen based on the LSB input values for init #
# scripts. The 'standard' argument makes no changes to the value of #
# $message or $MESSAGE, but only one can be set in the calling #
# environment. #
# #
# Return values: (none) #
###############################################################################
evaluate_retval()
{
local error_value="${?}"
 
# Handle LSB defined return values
case "${1}" in
 
start)
case "${error_value}" in
0)
log_success_msg "Starting ${MESSAGE} "
return "${error_value}"
;;
2)
log_failure_msg "Starting ${MESSAGE} Error: Invalid argument!"
return "${error_value}"
;;
5)
log_failure_msg "Starting ${MESSAGE} Error: Not available!"
return "${error_value}"
;;
*)
log_failure_msg "Starting ${MESSAGE} Error: General failure!"
return "${error_value}"
;;
esac
;;
 
stop)
case "${error_value}" in
0)
log_success_msg "Stopping ${MESSAGE} "
return "${error_value}"
;;
2)
log_failure_msg "Stopping ${MESSAGE} Error: Invalid argument!"
return "${error_value}"
;;
5)
log_failure_msg "Stopping ${MESSAGE} Error: Not available!"
return "${error_value}"
;;
7)
log_warning_msg "Stopping ${MESSAGE} Warning: Not running!"
return "${error_value}"
;;
*)
log_failure_msg "Stopping ${MESSAGE} Error: General failure!"
return "${error_value}"
;;
esac
;;
 
force-reload)
message="Forcefully reloading "
;;
 
reload)
message="Reloading "
;;
 
restart)
message="Restarting "
;;
 
try-restart)
message="Trying restart "
;;
 
standard)
# $message or $MESSAGE must be set, but not both in order
# to use the 'standard' target.
;;
esac
 
# Print messages for the generic force-reload, reload, restart,
# and try-restart targets
if [ "${error_value}" -eq "0" ]
then
log_success_msg "${message}${MESSAGE} "
return "${error_value}"
else
log_failure_msg "${message}${MESSAGE} "
return "${error_value}"
fi
}
 
# End /lib/lsb/init-functions
/trunk/lfs/lsb-bootscripts/lib/network-services/ipv4-static-route
1,6 → 1,6
#!/bin/sh
########################################################################
# Begin $NETWORK_DEVICES/services/ipv4-static-route
# Begin /lib/network-services/ipv4-static-route
#
# Description : IPV4 Static Route Script
#
89,4 → 89,4
;;
esac
 
# End $NETWORK_DEVICES/services/ipv4-static-route
# End /lib/network-services/ipv4-static-route
/trunk/lfs/lsb-bootscripts/lib/network-services/ipv4-static
1,6 → 1,6
#!/bin/sh
########################################################################
# Begin $NETWORK_DEVICES/services/ipv4-static
# Begin /lib/network-services/ipv4-static
#
# Description : IPV4 Static Boot Script
#
77,4 → 77,4
;;
esac
 
# End $NETWORK_DEVICES/services/ipv4-static
# End /lib/network-services/ipv4-static
/trunk/lfs/lsb-bootscripts/ChangeLog
1,3 → 1,27
2011-05-23 DJ Lucas <dj@linuxfromscratch.org>
* Makefile, etc/default/rc: The value of ETCDIR is used to set the RC_BASE at
install time. Changed default ETCDIR to /etc/rc.d and added /etc/init.d
symlink if ETCDIR is not /etc.
* Makefile, etc/inittab: Removed the installation of /etc/inittab as this is
done in the book.
* etc/default/rc, etc/default/rc.site: Added "stop_on_error" parameter to
rc.site file and added testcase on "stop_on_error" for FAILURE_ACTION in
rc file.
 
2011-05-21 DJ Lucas <dj@linuxfromscratch.org>
* lib/lsb/init-functions: Merged the contents of etc/init.d/lfs-functions and
standardized comment headers.
* etc/init.d/lfs-functions: Removed.
* etc/default/rc, etc/default/rc.site: moved majority of etc/default/rc.site
into etc/default/rc as the configuration items are not generally user
configurable items.
* etc/init.d/udev: Changed trigger commands to use both subsystem and device
types, per udev documentation.
 
2011-05-18 DJ Lucas <dj@linuxfromscratch.org>
* sbin/ifup, sbin/ifdown: Complete rewrite for use as standalone tools.
* etc/init.d/network: Rewrote script to account for new ifup and ifdown.
 
2011-05-14 DJ Lucas <dj@linuxfromscratch.org>
* etc/default/rc.site: Added FAILURE_ACTION variable for use in remote
systems where user input is not appropriate in the event of a failure.
/trunk/lfs/lsb-bootscripts/etc/inittab
File deleted
/trunk/lfs/lsb-bootscripts/etc/default/rc
1,8 → 1,5
# Begin /etc/default/rc
 
# Author: DJ Lucas - dj@linuxfromscratch.org
# Version: 1.0 LSB V.3.1
 
# Global variable inherited by initscripts are in caps
# Local variables for the rc script are in lowercase
 
9,6 → 6,12
# Source site specific rc configuration
. /etc/default/rc.site
 
# Set base directory information
RC_BASE="/etc/rc.d"
 
# Location of network device scripts and config files
NETWORK_DEVICES="/etc/network"
 
# This sets default terminal options.
# stty sane - this has been removed as nobody recalls
# the reason for it in the first place - if no problems arize,
38,7 → 41,66
SET_WCOL="\\033[${WCOL}G" # at the $WCOL char
CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char
 
# Distro Information
DISTRO="Linux From Scratch" # The distro name
DISTRO_CONTACT="lfs-dev@linuxfromscratch.org" # Bug report address
DISTRO_MINI="lfs" # Short name used in filenames for distro config
 
# Define custom colors used in messages printed to the screen
BRACKET="\\033[1;34m" # Blue
FAILURE="\\033[1;31m" # Red
INFO="\\033[1;36m" # Cyan
NORMAL="\\033[0;39m" # Grey
SUCCESS="\\033[1;32m" # Green
WARNING="\\033[1;33m" # Yellow
 
# Prefix boot messages for easier reading on framebuffer consoles
PREFIX_SUCCESS=" ${SUCCESS}*${NORMAL} "
PREFIX_WARNING="${WARNING}**${NORMAL} "
PREFIX_FAILURE="${FAILURE}***${NORMAL}"
 
# Export the environment variables so they are inherited by the scripts
export PATH SET_COL SET_WCOL CURS_UP BOOTLOG_ENAB
export RC_BASE NETWORK_DEVICES PATH SET_COL SET_WCOL CURS_UP
export DISTRO DISTRO_CONTACT DISTRO_MINI
export BRACKET FAILURE INFO NORMAL SUCCESS WARNING
export PREFIX_SUCCESS PREFIX_WARNING PREFIX_FAILURE
 
# Interactive startup
dlen="29" # The total length of the distro welcome string
ilen="38" # The total length of the interactive message
welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}"
i_message="Press '${FAILURE}I${NORMAL}' to enter interactive startup"
 
# FAILURE_ACTION (what to do when script failure occurs)
case "${stop_on_error}" in
Y* | y* | 0)
FAILURE_ACTION='read Enter'
;;
*)
FAILURE_ACTION='echo ""'
;;
esac
 
# Error message displayed when a script's exit value is not zero
print_error_msg()
{
# ${link} and ${error_value} are defined by the rc script
echo -e "${FAILURE}FAILURE: You should not be reading this error message."
echo -e ""
echo -e -n "${FAILURE}It means that an unforseen error took place in"
echo -e -n "${INFO} ${link}"
echo -e "${FAILURE},"
echo -e "${FAILURE}which exited with a return value of ${error_value}."
echo -e ""
echo -e -n "${FAILURE}If you are able to track this error down to a bug"
echo -e "${FAILURE}in one of the files"
echo -e -n "provided by ${INFO}${DISTRO}${FAILURE}, "
echo -e -n "${FAILURE}please be so kind to inform us at "
echo -e "${INFO}${DISTRO_CONTACT}${FAILURE}.${NORMAL}"
echo -e ""
echo -e "${INFO}Press Enter to continue..."
echo -e "${NORMAL}"
$FAILURE_ACTION
}
 
# End /etc/default/rc
/trunk/lfs/lsb-bootscripts/etc/default/rc.site
1,9 → 1,7
# Set base directory information
RC_BASE="/etc"
RC_FUNCTIONS="${RC_BASE}/init.d/lfs-functions"
# Begin /etc/default/rc.site
 
# Location of network device scripts and config files
NETWORK_DEVICES="/etc/network"
# Global variable inherited by initscripts are in caps
# Local variables for the rc script are in lowercase
 
# Bootlogging (requires a tempfs mount)
BOOTLOG_ENAB="yes"
15,63 → 13,15
UTC=1
CLOCKPARAMS=
 
# Manual input is not appropriate on remote systems. Define what happens when
# an error is encountered that interupts the boot/shutdown proceess
FAILURE_ACTION="read ENTER"
 
# Distro Information
DISTRO="Linux From Scratch" # The distro name
DISTRO_CONTACT="lfs-dev@linuxfromscratch.org" # Bug report address
DISTRO_MINI="lfs" # Short name used in filenames for distro config
 
# Define custom colors used in messages printed to the screen
BRACKET="\\033[1;34m" # Blue
FAILURE="\\033[1;31m" # Red
INFO="\\033[1;36m" # Cyan
NORMAL="\\033[0;39m" # Grey
SUCCESS="\\033[1;32m" # Green
WARNING="\\033[1;33m" # Yellow
 
# Prefix boot messages for easier reading on framebuffer consoles
PREFIX_SUCCESS=" ${SUCCESS}*${NORMAL} "
PREFIX_WARNING="${WARNING}**${NORMAL} "
PREFIX_FAILURE="${FAILURE}***${NORMAL}"
 
# Export varialbles so that they are inherited by the initscripts
export RC_BASE RC_FUNCTIONS NETWORK_DEVICES BOOTLOG_ENAB
export HOSTNAME UTC CLOCKPARAMS FAILURE_ACTION
export DISTRO DISTRO_CONTACT DISTRO_MINI
export BRACKET FAILURE INFO NORMAL SUCCESS WARNING
export PREFIX_SUCCESS PREFIX_WARNING PREFIX_FAILURE
export BOOTLOG_ENAB HOSTNAME UTC CLOCKPARAMS
 
# Interactive startup
iprompt="yes" # Wether to display the interactive boot promp
itime="2" # The ammount of time (in seconds) to display the prompt
dlen="29" # The total length of the distro welcome string
ilen="38" # The total length of the interactive message
welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}"
i_message="Press '${FAILURE}I${NORMAL}' to enter interactive startup"
 
# Error message displayed when a script's exit value is not zero
print_error_msg()
{
# ${link} and ${error_value} are defined by the rc script
echo -e "${FAILURE}FAILURE: You should not be reading this error message."
echo -e ""
echo -e -n "${FAILURE}It means that an unforseen error took place in"
echo -e -n "${INFO} ${link}"
echo -e "${FAILURE},"
echo -e "${FAILURE}which exited with a return value of ${error_value}."
echo -e ""
echo -e -n "${FAILURE}If you are able to track this error down to a bug"
echo -e "${FAILURE}in one of the files"
echo -e -n "provided by ${INFO}${DISTRO}${FAILURE}, "
echo -e -n "${FAILURE}please be so kind to inform us at "
echo -e "${INFO}${DISTRO_CONTACT}${FAILURE}.${NORMAL}"
echo -e ""
echo -e "${INFO}Press Enter to continue..."
echo -e "${NORMAL}"
$FAILURE_ACTION
}
# Manual input is not appropriate on remote systems. Wait for user input on
# script error?
stop_on_error="yes"
 
 
# End /etc/default/rc.site
/trunk/lfs/lsb-bootscripts/etc/init.d/sysctl
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/sysctl
# Begin $RC_BASE/init.d/sysctl
 
### BEGIN INIT INFO
# Provides: sysctl
36,4 → 36,4
;;
esac
 
# End /etc/init.d/sysctl
# End $RC_BASE/init.d/sysctl
/trunk/lfs/lsb-bootscripts/etc/init.d/udev_retry
1,5 → 1,5
#!/bin/sh
# Begin $rc_base/init.d/udev_retry
# Begin $RC_BASE/init.d/udev_retry
 
### BEGIN INIT INFO
# Provides: udev_retry
46,4 → 46,4
;;
esac
 
# End $rc_base/init.d/udev_retry
# End $RC_BASE/init.d/udev_retry
/trunk/lfs/lsb-bootscripts/etc/init.d/halt
27,4 → 27,4
;;
esac
 
# End /etc/init.d/halt
# End $RC_BASE/init.d/halt
/trunk/lfs/lsb-bootscripts/etc/init.d/network
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/network
# Begin $RC_BASE/init.d/network
 
### BEGIN INIT INFO
# Provides: $network
17,54 → 17,68
. /lib/lsb/init-functions
 
case "${1}" in
start)
# Start all network interfaces
for file in ${NETWORK_DEVICES}/ifconfig.*
do
interface=${file##*/ifconfig.}
start)
# Start all network interfaces
for dir in ${NETWORK_DEVICES}/ifconfig.*
do
interface=${dir##*/ifconfig.}
# skip if $dir is * (because nothing was found)
if [ "${interface}" = "*" ]; then
continue
fi
# Process individual configuration files
for file in "${dir}"/* ; do
ONBOOT=`grep "ONBOOT" "${file}" | sed 's@^ONBOOT=@@'`
case "${ONBOOT}" in
Y* | y* | 0)
/sbin/ifup -c "${file}" "${interface}"
;;
esac
done
done
;;
 
# skip if $file is * (because nothing was found)
if [ "${interface}" = "*" ]
then
continue
fi
IN_BOOT=1 /sbin/ifup ${interface}
done
;;
stop)
# Reverse list
DIRS=""
for dir in /run/network/ifconfig.*
do
DIRS="${dir} ${DIRS}"
done
 
stop)
# Reverse list
FILES=""
for file in /run/network/ifconfig.*
do
FILES="${file} ${FILES}"
done
# Stop all network interfaces
for dir in ${DIRS}; do
interface=${dir##*/ifconfig.}
# skip if $dir is * (because nothing was found)
if [ "${interface}" = "*" ]; then
continue
fi
# Process individual configuration files
for file in "${dir}"/* ; do
# No checking necessary if it is in /run/network
/sbin/ifdown -c "${file}" "${interface}"
done
link_status=`/sbin/ip link show "${interface}" | \
grep -o "state DOWN"`
if [ "${link_status}" != "state DOWN" ]; then
message="Shutting down the ${interface} interface..."
/sbin/ip addr flush "${interface}" &&
/sbin/ip link set "${interface}" down
evaluate_retval standard
fi
done
;;
 
# Stop all network interfaces
for file in ${FILES}
do
interface=${file##*/ifconfig.}
restart)
${0} stop
sleep 1
${0} start
;;
 
# skip if $file is * (because nothing was found)
if [ "${interface}" = "*" ]
then
continue
fi
 
IN_BOOT=1 /sbin/ifdown ${interface}
done
;;
 
restart)
${0} stop
sleep 1
${0} start
;;
 
*)
echo "Usage: ${0} {start|stop|restart}"
exit 1
;;
*)
echo "Usage: ${0} {start|stop|restart}"
exit 1
;;
esac
 
# End /etc/init.d/network
# End $RC_BASE/init.d/network
/trunk/lfs/lsb-bootscripts/etc/init.d/reboot
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/reboot
# Begin $RC_BASE/init.d/reboot
 
### BEGIN INIT INFO
# Provides: reboot
29,4 → 29,4
 
esac
 
# End /etc/init.d/reboot
# End $RC_BASE/init.d/reboot
/trunk/lfs/lsb-bootscripts/etc/init.d/mountfs
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/mountfs
# Begin $RC_BASE/init.d/mountfs
 
### BEGIN INIT INFO
# Provides: $local_fs
56,4 → 56,4
;;
esac
 
# End /etc/init.d/mountfs
# End $RC_BASE/init.d/mountfs
/trunk/lfs/lsb-bootscripts/etc/init.d/sysklogd
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/sysklogd
# Begin $RC_BASE/init.d/sysklogd
 
### BEGIN INIT INFO
# Provides: $syslog
66,4 → 66,4
;;
esac
 
# End /etc/init.d/sysklogd
# End $RC_BASE/init.d/sysklogd
/trunk/lfs/lsb-bootscripts/etc/init.d/mountvirtfs
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/mountvirtfs
# Begin $RC_BASE/init.d/mountvirtfs
 
### BEGIN INIT INFO
# Provides: mountvirtfs
9,8 → 9,8
# Should-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Mounts /sys, /proc, and /run virtual (virtel) filesystems.
# Description: Mounts /sys, /proc, and run virtual (virtel) filesystems.
# Short-Description: Mounts /sys, /proc, and /run virtual (kernel) filesystems.
# Description: Mounts /sys, /proc, and run virtual (kernel) filesystems.
# X-LFS-Provided-By: LFS
### END INIT INFO
 
18,7 → 18,7
 
case "${1}" in
start)
message="Mounting virtel-based file systems:"
message="Mounting virtual file systems:"
 
if ! mountpoint /proc > /dev/null; then
message="${message}${INFO} /proc${NORMAL}"
43,4 → 43,4
;;
esac
 
# End /etc/init.d/mountvirtfs
# End $RC_BASE/init.d/mountvirtfs
/trunk/lfs/lsb-bootscripts/etc/init.d/localnet
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/localnet
# Begin $RC_BASE/init.d/localnet
 
### BEGIN INIT INFO
# Provides: localnet
78,4 → 78,4
;;
esac
 
# End /etc/init.d/localnet
# End $RC_BASE/init.d/localnet
/trunk/lfs/lsb-bootscripts/etc/init.d/console
1,5 → 1,5
#!/bin/sh
# Begin $rc_base/init.d/console
# Begin $RC_BASE/init.d/console
 
### BEGIN INIT INFO
# Provides: console
93,4 → 93,4
;;
esac
 
# End $rc_base/init.d/console
# End $RC_BASE/init.d/console
/trunk/lfs/lsb-bootscripts/etc/init.d/udev
1,5 → 1,5
#!/bin/sh
# Begin $rc_base/init.d/udev
# Begin $RC_BASE/init.d/udev
 
### BEGIN INIT INFO
# Provides: udev
73,7 → 73,8
 
# Now traverse /sys in order to "coldplug" devices that have
# already been discovered
/sbin/udevadm trigger --action=add
/sbin/udevadm trigger --action=add --type=subsystems
/sbin/udevadm trigger --action=add --type=devices
 
# Now wait for udevd to process the uevents we triggered
/sbin/udevadm settle
86,4 → 87,4
;;
esac
 
# End $rc_base/init.d/udev
# End $RC_BASE/init.d/udev
/trunk/lfs/lsb-bootscripts/etc/init.d/checkfs
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/checkfs
# Begin $RC_BASE/init.d/checkfs
 
### BEGIN INIT INFO
# Provides: checkfs
100,4 → 100,4
;;
esac
 
# End /etc/init.d/checkfs
# End $RC_BASE/init.d/checkfs
/trunk/lfs/lsb-bootscripts/etc/init.d/setclock
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/setclock
# Begin $RC_BASE/init.d/setclock
 
### BEGIN INIT INFO
# Provides: hwclock
51,4 → 51,4
 
esac
 
# End /etc/init.d/setclock
# End $RC_BASE/init.d/setclock
/trunk/lfs/lsb-bootscripts/etc/init.d/modules
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/modules
# Begin $RC_BASE/init.d/modules
 
### BEGIN INIT INFO
# Provides: modules
94,4 → 94,4
;;
esac
 
# End /etc/init.d/modules
# End $RC_BASE/init.d/modules
/trunk/lfs/lsb-bootscripts/etc/init.d/swap
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/swap
# Begin $RC_BASE/init.d/swap
 
### BEGIN INIT INFO
# Provides: swap
52,4 → 52,4
;;
esac
 
# End /etc/init.d/swap
# End $RC_BASE/init.d/swap
/trunk/lfs/lsb-bootscripts/etc/init.d/sendsignals
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/sendsignals
# Begin $RC_BASE/init.d/sendsignals
 
### BEGIN INIT INFO
# Provides: sendsignals
51,4 → 51,4
 
esac
 
# End /etc/init.d/sendsignals
# End $RC_BASE/init.d/sendsignals
/trunk/lfs/lsb-bootscripts/etc/init.d/cleanfs
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/cleanfs
# Begin $RC_BASE/init.d/cleanfs
 
### BEGIN INIT INFO
# Provides: cleanfs
9,10 → 9,10
# Should-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Cleans temporary directories early in the boot process.
# Description: Cleans temporary directories /var/run, /var/lock, and
# /tmp. cleanfs also creates /var/run/utmp and any files
# defined in /etc/default/createfiles.
# Short-Description: Cleans and prepares the temporary directory.
# Description: Cleans the temporary directory /tmp and creates the
# /var/run/utmp file and any other files defined in
# /etc/default/createfiles.
# X-LFS-Provided-By: LFS
### END INIT INFO
 
102,5 → 102,4
;;
esac
 
# End /etc/init.d/cleanfs
 
# End $RC_BASE/init.d/cleanfs
/trunk/lfs/lsb-bootscripts/etc/init.d/template
1,5 → 1,5
#!/bin/sh
# Begin /etc/init.d/template
# Begin $RC_BASE/init.d/template
 
### BEGIN INIT INFO
# Provides: template
87,4 → 87,4
;;
esac
 
# End /etc/init.d/template
# End $RC_BASE/init.d/template
/trunk/lfs/lsb-bootscripts/sbin/ifup
1,97 → 1,160
#!/bin/sh
########################################################################
# Begin $NETWORK_DEVICES/ifup
# Begin /sbin/ifdown
#
# Description : Interface Up
#
# Authors : Nathan Coulson - nathan@linuxfromscratch.org
# Kevin P. Fleming - kpfleming@linuxfromscratch.org
# Authors : DJ Lucas - dj@linuxfromscratch.org
#
# Version : 00.00
# Version : 00.02
#
# Notes : the IFCONFIG variable is passed to the scripts found
# in the services directory, to indicate what file the
# service should source to get environmental variables.
#
########################################################################
 
. /lib/lsb/init-functions
. /lib/lsb/init-functions
 
# Collect a list of configuration files for our interface
if [ -n "${2}" ]; then
for file in ${@#$1} # All parameters except $1
do
FILES="${FILES} ${NETWORK_DEVICES}/ifconfig.${1}/${file}"
done
elif [ -d "${NETWORK_DEVICES}/ifconfig.${1}" ]; then
FILES=`echo ${NETWORK_DEVICES}/ifconfig.${1}/*`
else
FILES="${NETWORK_DEVICES}/ifconfig.${1}"
fi
function get_args()
{
if test -z "${1}" ; then
showhelp
exit 1
fi
 
message="Bringing up the ${1} interface..."
while test -n "${1}" ; do
case "${1}" in
-c | --configfile)
check_arg $1 $2
CONFIGFILE="${2}"
shift 2
;;
eth* | iw* | wlan*)
INTERFACE="${1}"
shift 1
;;
-h | --help)
showhelp
exit 0
;;
*)
showhelp
echo "ERROR: '${1}' unknown argument"
echo ""
exit 2
;;
esac
done
}
 
# Process each configruation file
for file in ${FILES}; do
# skip backup files
if [ "${file}" != "${file%""~""}" ]; then
continue
fi
function check_arg()
{
echo "${2}" | grep -v "^-" > /dev/null
if [ -z "${?}" -o ! -n "${2}" ]; then
echo "Error: ${1} requires a valid argument."
exit 2
fi
}
 
if [ ! -f "${file}" ]; then
log_warning_msg
message="${file} is not a network configuration file or directory."
log_warning_msg
function showhelp()
{
echo "`/usr/bin/basename ${0}` brings up a valid network interface."
echo ""
echo "Options:"
echo " -c --configfile The path to an interface configuration file"
echo " If no configuration file is given, all files"
echo " listed in ${NETWORK_DEVICES}/ifconfig.<int> will"
echo " be processed, regarless of the value of ONBOOT"
echo " -h --help Show this help message and exit."
echo ""
echo "Examples:"
echo " `/usr/bin/basename ${0}` eth0 -c ${NETWORK_DEVICES}/ifconfig.eth0/ipv4"
echo " `/usr/bin/basename ${0}` eth0"
echo ""
echo ""
}
 
# Intialize empty variables so that the shell does not polute the script
CONFIGFILE=""
CONFIGDIR=""
INTERFACE=""
 
# Process command line arguments
get_args ${@}
 
# Handle common errors - No need to account for bootscripts, this should not
# happen during boot or shutdown.
if [ "${CONFIGFILE}x" != "x" -a ! -f "${CONFIGFILE}" ]; then
echo "ERROR: ${CONFIGFILE} is not a valid network configuration file."
echo ""
exit 2
fi
 
if [ "${INTERFACE}x" == "x" ]; then
echo "ERROR: No interface was given"
echo ""
exit 2
else
if ! grep "${INTERFACE}" /proc/net/dev 2>&1 > /dev/null; then
echo "ERROR: ${INTERFACE} is not a valid network interface."
echo ""
exit 2
fi
fi
 
(
if [ ! -d "${file}" ]; then
. ${file}
# If a configuration file is present, use it
if [ "${CONFIGFILE}x" != "x" ]; then
. "${CONFIGFILE}"
if [ -x "/lib/network-services/${SERVICE}" ]; then
# do the work
# Check to make sure the interface is up
link_status=`/sbin/ip link show "${INTERFACE}" | \
grep -o "state UP"`
if [ "${link_status}" != "state UP" ]; then
message="Bringing up the ${INTERFACE} interface..."
/sbin/ip link set ${INTERFACE} up
evaluate_retval standard
fi
 
# Will not process this service if started by boot, and ONBOOT
# is not set to yes
if [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then
continue
if IFCONFIG=${CONFIGFILE} \
/lib/network-services/${SERVICE} ${INTERFACE} up; then
mkdir -p "/run/network/ifconfig.${INTERFACE}"
cp "${CONFIGFILE}" "/run/network/ifconfig.${INTERFACE}/"
fi
# Will not process this service if started by hotplug, and
# ONHOTPLUG is not set to yes
if [ "${IN_HOTPLUG}" = "1" -a "${ONHOTPLUG}" != "yes" -a "${HOSTNAME}" != "(none)" ]; then
continue
fi
 
if [ -n "${SERVICE}" -a -x "/lib/network-services/${SERVICE}" ]; then
if [ -z "${CHECK_LINK}" -o "${CHECK_LINK}" = "y" -o "${CHECK_LINK}" = "yes" -o "${CHECK_LINK}" = "1" ]; then
if ip link show ${1} > /dev/null 2>&1; then
link_status=`ip link show ${1}`
if [ -n "${link_status}" ]; then
if ! echo "${link_status}" | grep -q UP; then
ip link set ${1} up
evaluate_retval standard
fi
else
echo "ERROR: Service '${SERVICE}' is not a valid service."
echo ""
exit 2
fi
# No interface configuration file was given
else
# Process all available interface configuration files
CONFIGDIR="/etc/network/ifconfig.${INTERFACE}"
if [ -d "${CONFIGDIR}" ]; then
FILES=`ls "${CONFIGDIR}"`
for CONFIGFILE in ${FILES}
do
(
. "${CONFIGDIR}/${CONFIGFILE}"
if [ -x "/lib/network-services/${SERVICE}" ]; then
# Check to make sure the interface is up
link_status=`/sbin/ip link show "${INTERFACE}" | \
grep -o "state UP"`
if [ "${link_status}" != "state UP" ]; then
message="Bringing up the ${INTERFACE} interface..."
/sbin/ip link set ${INTERFACE} up
evaluate_retval standard
fi
if IFCONFIG="${CONFIGDIR}/${CONFIGFILE}" \
/lib/network-services/${SERVICE} ${INTERFACE} up; then
mkdir -p "/run/network/ifconfig.${INTERFACE}"
cp "${CONFIGDIR}/${CONFIGFILE}" \
"/run/network/ifconfig.${INTERFACE}/"
fi
else
message="${message}Interface ${1} doesn't exist."
log_warning_msg
echo "ERROR: Service '${SERVICE}' is not a valid service."
echo ""
exit 2
fi
fi
IFCONFIG=${file} /lib/network-services/${SERVICE} ${1} up
if [ "${?}" -eq "0" ]; then
if [ ! -d "${file}" -a "${file}" != "${NETWORK_DEVICES}/ifconfig.${1}" ]; then
mkdir -p "/run/network/ifconfig.${1}"
cp "${file}" "/run/network/ifconfig.${1}"
elif [ ! -d "${file}" ]; then
cp "${file}" "/run/network/"
fi
fi
else
echo -e "${FAILURE}Unable to process ${file}. Either"
echo -e "${FAILURE}the SERVICE variable was not set,"
echo -e "${FAILURE}or the specified service cannot be executed."
message=""
log_failure_msg
fi
)
done
 
# End $NETWORK_DEVICES/ifup
)
done
fi
fi
 
/trunk/lfs/lsb-bootscripts/sbin/ifdown
1,98 → 1,176
#!/bin/sh
########################################################################
# Begin $NETWORK_DEVICES/ifdown
# Begin /sbin/ifdown
#
# Description : Interface Down
#
# Authors : Nathan Coulson - nathan@linuxfromscratch.org
# Kevin P. Fleming - kpfleming@linuxfromscratch.org
# Authors : DJ Lucas - dj@linuxfromscratch.org
#
# Version : 00.01
# Version : 00.02
#
# Notes : the IFCONFIG variable is passed to the scripts found
# in the services directory, to indicate what file the
# service should source to get environmental variables.
#
########################################################################
 
. /lib/lsb/init-functions
 
# Collect a list of configuration files for our interface
if [ -n "${2}" ]; then
for file in ${@#$1}; do # All parameters except $1
FILES="${FILES} /run/network/ifconfig.${1}/${file}"
done
elif [ -d "/run/network/ifconfig.${1}" ]; then
FILES=`echo /run/network/ifconfig.${1}/*`
else
FILES="/run/network/ifconfig.${1}"
fi
function get_args()
{
if test -z "${1}" ; then
showhelp
exit 1
fi
 
# Reverse the order configuration files are processed in
for file in ${FILES}; do
FILES2="${file} ${FILES2}"
done
FILES=${FILES2}
while test -n "${1}" ; do
case "${1}" in
-c | --configfile)
check_arg $1 $2
CONFIGFILE="${2}"
shift 2
;;
-f | --force)
FORCE="1"
shift 1
;;
eth* | iw* | wlan*)
INTERFACE="${1}"
shift 1
;;
-h | --help)
showhelp
exit 0
;;
*)
showhelp
echo "ERROR: '${1}' unknown argument"
echo ""
exit 2
;;
esac
done
}
 
# Process each configuration file
for file in ${FILES}; do
# skip backup files
if [ "${file}" != "${file%""~""}" ]; then
continue
fi
function check_arg()
{
echo "${2}" | grep -v "^-" > /dev/null
if [ -z "${?}" -o ! -n "${2}" ]; then
echo "Error: ${1} requires a valid argument."
exit 2
fi
}
 
if [ ! -f "${file}" ]; then
message="${file} is not a network configuration file or directory."
log_warning_msg
function showhelp()
{
echo ""
echo "`/usr/bin/basename ${0}` brings down a valid network interface."
echo ""
echo "Options:"
echo " -c --configfile The path to an interface configuration file"
echo " If no configuration file is given, all files"
echo " listed in /etc/network/ifconfig.<int> will"
echo " be processed, regarless of the value of ONBOOT"
echo " -f --force Flush all IPs and force the interface down."
echo " -h --help Show this help message and exit."
echo ""
echo "Examples:"
echo " `/usr/bin/basename ${0}` eth0 -c /run/network/ifconfig.eth0/ipv4"
echo " `/usr/bin/basename ${0}` eth0 --force -c /run/network/ifconfig.eth0/ipv4"
echo " `/usr/bin/basename ${0}` eth0 --force"
echo " `/usr/bin/basename ${0}` eth0"
echo ""
echo ""
}
 
# Intialize empty variables so that the shell does not polute the script
CONFIGFILE=""
CONFIGDIR=""
INTERFACE=""
FORCE=""
failed=0
 
# Process command line arguments
get_args ${@}
 
# Handle common errors - No need to account for bootscripts, this should not
# happen during boot or shutdown.
if [ "${CONFIGFILE}x" != "x" -a ! -f "${CONFIGFILE}" ]; then
echo "ERROR: ${CONFIGFILE} is not a valid network configuration file."
echo ""
exit 2
fi
 
if [ "${INTERFACE}x" == "x" ]; then
echo "ERROR: No interface was given"
echo ""
exit 2
else
if ! grep "${INTERFACE}" /proc/net/dev 2>&1 > /dev/null; then
echo "ERROR: ${INTERFACE} is not a valid network interface."
echo ""
exit 2
fi
(
if [ ! -d "${file}" ]; then
. ${file}
fi
fi
 
# Will not process this service if started by boot, and ONBOOT
# is not set to yes
if [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then
continue
# If a configuration file is present, use it
if [ "${CONFIGFILE}x" != "x" ]; then
. "${CONFIGFILE}"
if [ -x "/lib/network-services/${SERVICE}" ]; then
# do the work
if IFCONFIG=${CONFIGFILE} \
/lib/network-services/${SERVICE} ${INTERFACE} down; then
rm "${CONFIGFILE}"
fi
 
# Will not process this service if started by hotplug, and
# ONHOTPLUG is not set to yes
if [ "${IN_HOTPLUG}" = "1" -a "${ONHOTPLUG}" != "yes" ]; then
continue
fi
# This will run the service script, if SERVICE is set
if [ -n "${SERVICE}" -a -x "/lib/network-services/${SERVICE}" ]; then
if ip link show ${1} > /dev/null 2>&1
then
IFCONFIG=${file} /lib/network-services/${SERVICE} ${1} down &&
if [ -f "${file}" ]; then
rm ${file}
else
echo "ERROR: Service '${SERVICE}' is not a valid service."
echo ""
exit 2
fi
# No interface configuration file was given
else
# Process all running interface configuration files
CONFIGDIR="/run/network/ifconfig.${INTERFACE}"
if [ -d "${CONFIGDIR}" ]; then
FILES=`ls "${CONFIGDIR}"`
for CONFIGFILE in ${FILES}
do
(
. "${CONFIGDIR}/${CONFIGFILE}"
# No error checking necessary if they are in /run
if IFCONFIG="${CONFIGDIR}/${CONFIGFILE}" \
/lib/network-services/${SERVICE} ${INTERFACE} down; then
rm "${CONFIGDIR}/${CONFIGFILE}"
fi
else
message="Interface ${1} doesn't exist."
log_warning_msg
fi
else
echo -e "${FAILURE}Unable to process ${file}. Either"
echo -e "${FAILURE}the SERVICE variable was not set,"
echo -e "${FAILURE}or the specified service cannot be executed."
message=""
log_failure_msg
)
done
# all running config files processes, set the link down
message="Setting interface ${INTERFACE} down..."
/sbin/ip link set "${INTERFACE}" down
evaluate_retval standard
else
if [ "${FORCE}" != "1" ]; then
echo "ERROR: No configuration files found for ${INTERFACE}."
echo ""
exit 2
fi
)
done
 
if [ -z "${2}" ]; then
link_status=`ip link show $1`
if [ -n "${link_status}" ]; then
if echo "${link_status}" | grep -q UP; then
message="Bringing down the ${1} interface..."
ip link set ${1} down
evaluate_retval standard
fi
fi
fi
if [ "${FORCE}" == "1" ]; then
/sbin/ip addr flush dev "${INTERFACE}" 2>&1 > /dev/null || failed=1
if [ "${failed}" == "1" ]; then
log_failure_msg "Flushing IP addresses from interface ${INTERFACE}..."
echo ""
exit 1
else
log_success_msg "Flushing IP addresses from interface ${INTERFACE}..."
fi
/sbin/ip link set dev "${INTERFACE}" down 2>&1 > /dev/null || failed=1
if [ "${failed}" == "1" ]; then
log_failure_msg "Setting link down for interface ${INTERFACE}..."
echo ""
exit 1
else
log_success_msg "Setting link down for interface ${INTERFACE}..."
fi
fi
 
# End $NETWORK_DEVICES/ifdown
exit "${failed}"
 
/trunk/lfs/lsb-bootscripts/Makefile
1,4 → 1,4
ETCDIR=/etc
ETCDIR=/etc/rc.d
EXTDIR=${DESTDIR}${ETCDIR}
MODE=754
DIRMODE=755
17,16 → 17,16
install -d -m ${DIRMODE} ${EXTDIR}/rc6.d
install -d -m ${DIRMODE} ${EXTDIR}/rcS.d
install -d -m ${DIRMODE} ${EXTDIR}/init.d
install -d -m ${DIRMODE} ${EXTDIR}/default
install -d -m ${DIRMODE} ${EXTDIR}/network
install -d -m ${DIRMODE} ${DESTDIR}/etc/default
install -d -m ${DIRMODE} ${DESTDIR}/etc/network
install -d -m ${DIRMODE} ${DESTDIR}/sbin
install -d -m ${DIRMODE} ${DESTDIR}/lib/lsb
install -d -m ${DIRMODE} ${DESTDIR}/lib/network-services
if [ ${ETCDIR} != /etc ]; then ln -s ${ETCDIR}/init.d ${DESTDIR}/etc/init.d; fi
 
install: create-dirs
install -m ${MODE} etc/init.d/checkfs ${EXTDIR}/init.d/
install -m ${MODE} etc/init.d/cleanfs ${EXTDIR}/init.d/
install -m ${CONFMODE} etc/init.d/lfs-functions ${EXTDIR}/init.d/
install -m ${MODE} etc/init.d/halt ${EXTDIR}/init.d/
install -m ${MODE} etc/init.d/console ${EXTDIR}/init.d/
install -m ${MODE} etc/init.d/localnet ${EXTDIR}/init.d/
45,12 → 45,10
install -m ${MODE} etc/init.d/udev ${EXTDIR}/init.d/
install -m ${MODE} etc/init.d/udev_retry ${EXTDIR}/init.d/
install -m ${CONFMODE} lib/lsb/init-functions ${DESTDIR}/lib/lsb/
if [ ! -f ${EXTDIR}/default/createfiles ]; then install -m ${CONFMODE} etc/default/createfiles ${EXTDIR}/default/; fi
if [ ! -f ${EXTDIR}/default/modules ]; then install -m ${CONFMODE} etc/default/modules ${EXTDIR}/default/; fi
if [ ! -f ${EXTDIR}/default/rc ]; then install -m ${CONFMODE} etc/default/rc ${EXTDIR}/default/; fi
if [ ! -f ${EXTDIR}/default/rc.site ]; then install -m ${CONFMODE} etc/default/rc.site ${EXTDIR}/default/; fi
if [ -f ${EXTDIR}/inittab ]; then install -m ${CONFMODE} ${EXTDIR}/inittab ${EXTDIR}/inittab.bak; fi
install -m ${CONFMODE} etc/inittab ${EXTDIR}/
if [ ! -f ${DESTDIR}/etc/default/createfiles ]; then install -m ${CONFMODE} etc/default/createfiles ${DESTDIR}/etc/default/; fi
if [ ! -f ${DESTDIR}/etc/default/modules ]; then install -m ${CONFMODE} etc/default/modules ${DESTDIR}/etc/default/; fi
if [ ! -f ${DESTDIR}/etc/default/rc ]; then install -m ${CONFMODE} etc/default/rc ${DESTDIR}/etc/default/; fi
if [ ! -f ${DESTDIR}/etc/default/rc.site ]; then install -m ${CONFMODE} etc/default/rc.site ${DESTDIR}/etc/default/; fi
install -m ${MODE} sbin/ifup ${DESTDIR}/sbin/
install -m ${MODE} sbin/ifdown ${DESTDIR}/sbin/
install -m ${MODE} lib/network-services/ipv4-static ${DESTDIR}/lib/network-services/
71,11 → 69,11
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/sysctl
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/udev
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/udev_retry
sed 's@ETCDIR@${ETCDIR}@' -i ${DESTDIR}/etc/default/rc
 
minimal: create-dirs
install -m ${MODE} etc/init.d/checkfs ${EXTDIR}/init.d/
install -m ${MODE} etc/init.d/cleanfs ${EXTDIR}/init.d/
install -m ${CONFMODE} etc/init.d/lfs-functions ${EXTDIR}/init.d/
install -m ${MODE} etc/init.d/halt ${EXTDIR}/init.d/
install -m ${MODE} etc/init.d/localnet ${EXTDIR}/init.d/
install -m ${MODE} etc/init.d/mountfs ${EXTDIR}/init.d/
87,9 → 85,7
install -m ${MODE} etc/init.d/swap ${EXTDIR}/init.d/
install -m ${MODE} etc/init.d/udev ${EXTDIR}/init.d/
install -m ${CONFMODE} lib/lsb/init-functions ${DESTDIR}/lib/lsb/
if [ ! -f ${EXTDIR}/default/rc ]; then install -m ${CONFMODE} default/rc ${EXTDIR}/default/; fi
if [ -f ${EXTDIR}/inittab ]; then install -m ${CONFMODE} ${EXTDIR}/inittab ${EXTDIR}/inittab.bak; fi
install -m ${CONFMODE} etc/inittab ${EXTDIR}/
if [ ! -f ${DESTDIR}/etc/default/rc ]; then install -m ${CONFMODE} default/rc ${DESTDIR}/etc/default/; fi
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/checkfs
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/cleanfs
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/halt
/trunk/lfs/chapter03/packages.xml
187,6 → 187,15
</varlistentry>
 
<varlistentry>
<term>Glib (&glib-version;) - <token>&glib-size;</token>&nbsp;:</term>
<listitem>
<para>Page d'accueil&nbsp;: <ulink url="&glib-home;"/></para>
<para>Téléchargement&nbsp;: <ulink url="&glib-url;"/></para>
<para>Somme de contrôle MD5&nbsp;: <literal>&glib-md5;</literal></para>
</listitem>
</varlistentry>
 
<varlistentry>
<term>Glibc (&glibc-version;) - <token>&glibc-size;</token>&nbsp;:</term>
<listitem>
<para>Page d'accueil&nbsp;: <ulink url="&glibc-home;"/></para>
441,6 → 450,15
<para>Somme de contrôle MD5&nbsp;: <literal>&patch-md5;</literal></para>
</listitem>
</varlistentry>
<varlistentry>
<term>PCRE (&pcre-version;) - <token>&pcre-size;</token>&nbsp;:</term>
<listitem>
<para>Page d'accueil&nbsp;: <ulink url="&pcre-home;"/></para>
<para>Téléchargement&nbsp;: <ulink url="&pcre-url;"/></para>
<para>Somme de contrôle MD5&nbsp;: <literal>&pcre-md5;</literal></para>
</listitem>
</varlistentry>
 
<varlistentry>
<term>Perl (&perl-version;) - <token>&perl-size;</token>:</term>
/trunk/lfs/chapter06/pcre.xml
0,0 → 1,192
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
 
<sect1 id="ch-system-pcre" role="wrap">
<?dbhtml filename="pcre.html"?>
 
<sect1info condition="script">
<productname>pcre</productname>
<productnumber>&pcre-version;</productnumber>
<address>&pcre-url;</address>
</sect1info>
 
<title>PCRE-&pcre-version;</title>
 
<indexterm zone="ch-system-pcre">
<primary sortas="a-PCRE">PCRE</primary>
</indexterm>
 
<sect2 role="package">
<title/>
 
<para>Le paquet <application>PCRE</application> contient
des bibliothèques <foreignphrase>Compatible Regular Expression</foreignphrase>
<application>Perl</application>. Elles sont utiles pour implémenter des motifs d'expression régulière
correspondant à l'utilisation de la même syntaxe et de la même sémantique que
<application>Perl</application> 5.</para>
 
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
 
<seglistitem>
<seg>&pcre-ch6-sbu;</seg>
<seg>&pcre-ch6-du;</seg>
</seglistitem>
</segmentedlist>
 
</sect2>
 
<sect2 role="installation">
<title>Installation de PCRE</title>
 
<para>Préparez la compilation de PCRE&nbsp;:</para>
 
<screen><userinput remap="configure">./configure --prefix=/usr \
--docdir=/usr/share/doc/pcre-&pcre-version; \
--enable-utf8 \
--enable-unicode-properties \
--enable-pcregrep-libz \
--enable-pcregrep-libbz2</userinput></screen>
 
<variablelist>
<title>Voici la signification des options de configuration&nbsp;:</title>
 
<varlistentry>
<term><parameter>--enable-utf8</parameter></term>
<listitem>
<para>Ce paramètre inclut le code pour la gestion des chaînes de
caractères UTF-8 dans la bibliothèque.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>--enable-unicode-properties</parameter></term>
<listitem>
<para>Ce paramètre active le support des propriétés Unicode.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>--enable-pcregrep-lib*</parameter></term>
<listitem>
<para>Ces paramètres ajoute permettent à la bibliothèque PCRE de lire
les fichiers compressés avec <command>gzip</command> et
<command>bzip2</command>.</para>
</listitem>
</varlistentry>
</variablelist>
 
<para>Compilez le paquet&nbsp;:</para>
 
<screen><userinput remap="make">make</userinput></screen>
 
<para>Pour tester les résultats, lancez&nbsp;:</para>
 
<screen><userinput remap="test">make check</userinput></screen>
 
<para>Installez le paquet&nbsp;:</para>
 
<screen><userinput remap="install">make install</userinput></screen>
 
<para>Le binaire <command>grep</command> s'installera dans
<filename class="directory">/bin</filename> et se liera à la bibliothèque
PCRE&nbsp;; déplacez donc la bibliothèque dans <filename class="directory">/lib</filename>&nbsp;:</para>
 
<screen><userinput remap="install">mv -v /usr/lib/libpcre.so.* /lib/ &amp;&amp;
ln -v -sf ../../lib/libpcre.so.0 /usr/lib/libpcre.so</userinput></screen>
 
</sect2>
 
<sect2 id="contents-pcre" role="content">
<title>Contenu de PCRE</title>
 
<segmentedlist>
<segtitle>Programmes installés</segtitle>
<segtitle>Bibliothèques installées</segtitle>
<segtitle>Répertoires installés</segtitle>
 
<seglistitem>
<seg>pcregrep, pcretest et pcre-config</seg>
<seg>libpcre.{so,a}, libpcrecpp.{so,a} et libpcreposix.{so,a}</seg>
<seg>/usr/share/doc/pcre-&pcre-version;</seg>
</seglistitem>
</segmentedlist>
 
<variablelist>
<bridgehead renderas="sect3">Descriptions courtes</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
 
<varlistentry id="pcregrep">
<term><command>pcregrep</command></term>
<listitem>
<para>est un <command>grep</command> qui comprend les expressions régulières
compatibles <application>Perl</application>.</para>
<indexterm zone="ch-system-pcre pcregrep">
<primary sortas="b-pcre">pcregrep</primary>
</indexterm>
</listitem>
</varlistentry>
 
<varlistentry id="pcretest">
<term><command>pcretest</command></term>
<listitem>
<para>Teste une expression régulière compatible <application>Perl</application>.</para>
<indexterm zone="ch-system-pcre pcretest">
<primary sortas="b-pcretest">pcretest</primary>
</indexterm>
</listitem>
</varlistentry>
 
<varlistentry id="pcre-config">
<term><command>pcre-config</command></term>
<listitem>
<para>est utilisé pendant le processus de compilation de programmes en se liant aux
bibliothèques <application>PCRE</application>.</para>
<indexterm zone="ch-system-pcre pcre-config">
<primary sortas="b-pcre-config">pcre-config</primary>
</indexterm>
</listitem>
</varlistentry>
 
<varlistentry id="libpcre">
<term><filename class="libraryfile">libpcre</filename></term>
<listitem>
<para>Fournit des fonctions utiles pour travailler avec des
expressions régulières.</para>
<indexterm zone="ch-system-pcre libpcre">
<primary sortas="c-libpcre*">libpcre*</primary>
</indexterm>
</listitem>
</varlistentry>
 
<varlistentry id="libpcrecpp">
<term><filename class="libraryfile">libpcrecpp</filename></term>
<listitem>
<para>Fournit des fonctions enveloppes C++ pour la bibliothèque
libpcre.</para>
<indexterm zone="ch-system-pcre libpcrecpp">
<primary sortas="c-libpcrecpp*">libpcrecpp*</primary>
</indexterm>
</listitem>
</varlistentry>
 
<varlistentry id="libpcreposix">
<term><filename class="libraryfile">libpcreposix</filename></term>
<listitem>
<para>Fournit des fonctions enveloppes basées sur l'API d'expressions
régulières POSIX.</para>
<indexterm zone="ch-system-pcre libpcreposix">
<primary sortas="c-libpcre*">libpcreposix*</primary>
</indexterm>
</listitem>
</varlistentry>
 
</variablelist>
 
</sect2>
 
</sect1>
/trunk/lfs/chapter06/udev.xml
65,7 → 65,8
<screen><userinput remap="configure">./configure --prefix=/usr \
--sysconfdir=/etc --sbindir=/sbin \
--with-rootlibdir=/lib --libexecdir=/lib/udev \
--disable-extras --disable-introspection</userinput></screen>
--disable-hwdb --disable-udev_acl --disable-introspection \
--disable-keymap</userinput></screen>
 
<variablelist>
<title>Voici la signification des nouvelles options de configure</title>
92,25 → 93,15
</varlistentry>
 
<varlistentry>
<term><parameter>--disable-extras</parameter></term>
<term><parameter>--disable-*</parameter></term>
<listitem>
<para>Cette option empêche Udev d'installer les programmes d'aide
et d'autres qui exigent plus de bibliothèques externes. Ces
bibliothèques ne font pas partie du système LFS. Voir le fichier
<filename>README</filename> d'Udev pour plus d'informations.</para>
</listitem>
<para>Ces options empêchent Udev d'installer les programmes d'aide
et d'autres qui exigent davantage de bibliothèques externes. Ces
bibliothèques ne font pas partie du système LFS de base. Voir le
fichier <filename>README</filename> file d'Udev pour plus d'informations.</para>
</listitem>
</varlistentry>
 
<varlistentry>
<term><parameter>--disable-introspection</parameter></term>
<listitem>
<para>Cette option désactive la fonctionnalité d'introspection
d'Udev, qui dépend de paquets dont l'installation ne fait pas partie du
système LFS de base. Voir le fichier
<filename>README</filename> d'Udev pour plus d'informations.</para>
</listitem>
</varlistentry>
 
</variablelist>
 
<para>Compilez le paquet&nbsp;:</para>
/trunk/lfs/chapter06/glib.xml
0,0 → 1,174
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
 
<sect1 id="ch-system-glib" role="wrap">
<?dbhtml filename="glib.html"?>
 
<sect1info condition="script">
<productname>glib</productname>
<productnumber>&glib-version;</productnumber>
<address>&glib-url;</address>
</sect1info>
 
<title>Glib-&glib-version;</title>
 
<indexterm zone="ch-system-glib">
<primary sortas="a-Glib">Glib</primary>
</indexterm>
 
<sect2 role="package">
<title/>
 
<para>Le paquet <application>GLib</application> contient une bibliothèque core
de bas niveau. C'est utile pour avoir la gestion de structures de données pour C,
des enveloppes de portabilité et des interfaces avec des fonctionnalités en cours d'exécution telles que
la boucle d'un événement, les défilés (threads), le chargement dynamique et
un système objet.</para>
 
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
 
<seglistitem>
<seg>&glib-ch6-sbu;</seg>
<seg>&glib-ch6-du;</seg>
</seglistitem>
</segmentedlist>
 
</sect2>
 
<sect2 role="installation">
<title>Installation de Glib</title>
 
<para>Préparez la compilation de Glib&nbsp;:</para>
 
<screen><userinput remap="configure">PCRE_LIBS="-L/usr/lib -lpcre" PCRE_CFLAGS="-I/usr/include" ./configure --prefix=/usr --sysconfdir=/etc --with-pcre=system</userinput></screen>
 
<variablelist>
<title>Voici la signification des options de configuration&nbsp;:</title>
 
<varlistentry>
<term><parameter>--with-pcre=system</parameter></term>
<listitem>
<para>Il résulte de ce paramètre que la construction utilisera une
version fournie par le système de la bibliothèque PCRE et non une
version interne.</para>
</listitem>
</varlistentry>
</variablelist>
 
<para>Compilez le paquet&nbsp;:</para>
 
<screen><userinput remap="make">make</userinput></screen>
 
<para>À cause de dépendances de modules Perl supplémentaires qui ne sont pas
encore présents (comme desktop-file-utils et DBus), il n'est pas possible de
lancer la suite de tests de Glib.</para>
 
<para>Installez le paquet&nbsp;:</para>
 
<screen><userinput remap="install">make install</userinput></screen>
 
</sect2>
 
<sect2 id="contents-glib" role="content">
<title>Contenu de Glib</title>
 
<segmentedlist>
<segtitle>Installed programs</segtitle>
<segtitle>Installed libraries</segtitle>
<segtitle>Installed directories</segtitle>
 
<seglistitem>
<seg>gio-querymodules, glib-genmarshal, glib-gettextize,
glib-mkenums, gobject-query, gtester et gtester-report</seg>
<seg>libgio-2.0.so, libglib-2.0.so, libgmodule-2.0.so,
libgobject-2.0.so, et libgthread-2.0.so</seg>
<seg>/usr/include/{gio-unix-2.0/gio,glib-2.0/{gio,glib,gobject}},
/usr/lib/{gio/modules,glib-2.0/include},
/usr/share/{gdb/auto-load,glib-2.0/{gdb, gettext/po},gtk-doc/html/{gio,glib,gobject}}</seg>
</seglistitem>
</segmentedlist>
 
<variablelist>
<bridgehead renderas="sect3">Descriptions courtes</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
 
<varlistentry id="gio-querymodules">
<term><command>gio-querymodules</command></term>
<listitem>
<para>est un outil de génération de marshaller de code C pour les
fermetures (closures) GLib.</para>
<indexterm zone="ch-system-glib gio-querymodules">
<primary sortas="b-glib">gio-querymodules</primary>
</indexterm>
</listitem>
</varlistentry>
 
<varlistentry id="glib-gettextize">
<term><command>glib-gettextize</command></term>
<listitem>
<para>est une variant de l'outil d'internationalisation gettext.</para>
<indexterm zone="ch-system-glib glib-gettextize">
<primary sortas="b-glib-gettextize">glib-gettextize</primary>
</indexterm>
</listitem>
</varlistentry>
 
<varlistentry id="glib-mkenums">
<term><command>glib-mkenums</command></term>
<listitem>
<para>est un outil de génération de descriptions enum de langage C.</para>
<indexterm zone="ch-system-glib glib-mkenums">
<primary sortas="b-glib-mkenums">glib-mkenums</primary>
</indexterm>
</listitem>
</varlistentry>
 
<varlistentry id="gobject-query">
<term><command>gobject-query</command></term>
<listitem>
<para>Est un petit outil dessinant une arborescence de types.</para>
<indexterm zone="ch-system-glib gobject-query">
<primary sortas="b-gobject-query">gobject-query</primary>
</indexterm>
</listitem>
</varlistentry>
 
<varlistentry id="gtester">
<term><command>gtester</command></term>
<listitem>
<para>Est un outil de lancement de tests.</para>
<indexterm zone="ch-system-glib gtester">
<primary sortas="b-gtester">gtester</primary>
</indexterm>
</listitem>
</varlistentry>
 
<varlistentry id="gtester-report">
<term><command>gtester-report</command></term>
<listitem>
<para>Est un outil de formatage de rapports de test.</para>
<indexterm zone="ch-system-glib gtester-report">
<primary sortas="b-gtester-report">gtester-report</primary>
</indexterm>
</listitem>
</varlistentry>
 
<varlistentry id="glib">
<term><filename class="libraryfile">Glib libraries</filename></term>
<listitem>
<para>contient une bibliothèque core généraliste de bas niveau.</para>
</listitem>
</varlistentry>
 
</variablelist>
 
</sect2>
 
</sect1>
/trunk/lfs/chapter06/chapter06.xml
29,6 → 29,9
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mpc.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sed.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bzip2.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pcre.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="glib.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pkg-config.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ncurses.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/>
47,7 → 50,6
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="perl.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="autoconf.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="automake.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bzip2.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="diffutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gawk.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="findutils.xml"/>
/trunk/lfs/chapter06/pkg-config.xml
48,9 → 48,14
url="&blfs-root;view/svn/general/popt.html">instructions de construction
de Popt dans BLFS</ulink> avant d'installer Pkg-config.</para></note>
 
<para>Corrigez un problème avec un des tests de Pkg-config&nbsp;:</para>
 
<screen><userinput remap="pre">sed -i -e '21s/EXPECT_RETURN=1/EXPECT_RETURN=0/' check/check-cmd-options</userinput></screen>
 
<para>Préparez la compilation de Pkg-config&nbsp;:</para>
 
<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
<screen><userinput remap="configure">GLIB_LIBS="-L/usr/lib -lglib-2.0" \
GLIB_CFLAGS="-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include" ./configure --prefix=/usr</userinput></screen>
 
<para>Compilez le paquet&nbsp;:</para>
 
/trunk/lfs/general.ent
1,7 → 1,7
<?xml version="1.0" encoding="ISO-8859-1"?>
 
<!ENTITY version "SVN-20110515">
<!ENTITY releasedate "15 mai 2011">
<!ENTITY version "SVN-20110523">
<!ENTITY releasedate "23 mai 2011">
<!ENTITY copyrightdate "1999&ndash;2011">
<!ENTITY milestone "6.9">
<!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" -->
/trunk/lfs/packages.ent
45,10 → 45,10
<!ENTITY binutils-ch6-du "222 Mio">
<!ENTITY binutils-ch6-sbu "2.1 SBU">
 
<!ENTITY bison-version "2.4.3">
<!ENTITY bison-size "1,614 Kio">
<!ENTITY bison-version "2.5">
<!ENTITY bison-size "1,983 Kio">
<!ENTITY bison-url "&gnu;bison/bison-&bison-version;.tar.bz2">
<!ENTITY bison-md5 "c1d3ea81bc370dbd43b6f0b2cd21287e">
<!ENTITY bison-md5 "9dba20116b13fc61a0846b0058fbe004">
<!ENTITY bison-home "&gnu-software;bison/">
<!--
<!ENTITY bison-ch5-du "">
192,6 → 192,14
<!ENTITY gettext-ch6-du "125 Mio">
<!ENTITY gettext-ch6-sbu "5.8 SBU">
 
<!ENTITY glib-version "2.28.6">
<!ENTITY glib-size "6,793 Kio">
<!ENTITY glib-url "http://ftp.gnome.org/pub/gnome/sources/glib/2.28/glib-&glib-version;.tar.bz2">
<!ENTITY glib-md5 "7d8fc15ae70d5111c0cf2a79d50ef717">
<!ENTITY glib-home "http://developer.gnome.org/glib/">
<!ENTITY glib-ch6-du "106 Mio">
<!ENTITY glib-ch6-sbu "1.5 SBU">
 
<!ENTITY glibc-version "2.13">
<!ENTITY glibc-size "15,357 Kio">
<!ENTITY glibc-url "&gnu;glibc/glibc-&glibc-version;.tar.bz2">
313,13 → 321,13
<!ENTITY libtool-ch6-sbu "3.7 SBU">
 
<!ENTITY linux-major-version "2.6">
<!ENTITY linux-minor-version "38">
<!ENTITY linux-patch-version "6">
<!ENTITY linux-version "&linux-major-version;.&linux-minor-version;.&linux-patch-version;">
<!-- <!ENTITY linux-version "&linux-major-version;.&linux-minor-version;"> -->
<!ENTITY linux-size "73,058 Kio">
<!ENTITY linux-minor-version "39">
<!ENTITY linux-patch-version "">
<!-- <!ENTITY linux-version "&linux-major-version;.&linux-minor-version;.&linux-patch-version;">-->
<!ENTITY linux-version "&linux-major-version;.&linux-minor-version;">
<!ENTITY linux-size "74,313 Kio">
<!ENTITY linux-url "&kernel;linux/kernel/v&linux-major-version;/linux-&linux-version;.tar.bz2">
<!ENTITY linux-md5 "e896a3bb3185b8a8af8e2f010f63c02e">
<!ENTITY linux-md5 "1aab7a741abe08d42e8eccf20de61e05">
<!ENTITY linux-home "http://www.kernel.org/">
<!ENTITY linux-ch8-du "540 - 500 Mio">
<!ENTITY linux-ch8-sbu "1.0 - 5.0 SBU">
414,6 → 422,15
<!ENTITY patch-ch6-du "1.9 Mio">
<!ENTITY patch-ch6-sbu "moins de 0.1 SBU">
 
<!ENTITY pcre-version "8.12">
<!ENTITY pcre-size "969 Kio">
<!ENTITY pcre-url "&sourceforge;pcre/pcre-&pcre-version;.tar.bz2">
<!ENTITY pcre-url "">
<!ENTITY pcre-md5 "f14a9fef3c92f3fc6c5ac92d7a2c7eb3">
<!ENTITY pcre-home "http://www.pcre.org/">
<!ENTITY pcre-ch6-du "12 Mio">
<!ENTITY pcre-ch6-sbu "0.4 SBU">
 
<!ENTITY perl-version "5.12.3">
<!ENTITY perl-size "11,759 Kio">
<!ENTITY perl-url "http://www.cpan.org/src/5.0/perl-&perl-version;.tar.bz2">
424,10 → 441,10
<!ENTITY perl-ch6-du "171 Mio">
<!ENTITY perl-ch6-sbu "5.5 SBU">
 
<!ENTITY pkg-config-version "0.25">
<!ENTITY pkg-config-size "966 Kio">
<!ENTITY pkg-config-version "0.26">
<!ENTITY pkg-config-size "387 Kio">
<!ENTITY pkg-config-url "http://pkgconfig.freedesktop.org/releases/pkg-config-&pkg-config-version;.tar.gz">
<!ENTITY pkg-config-md5 "a3270bab3f4b69b7dc6dbdacbcae9745">
<!ENTITY pkg-config-md5 "47525c26a9ba7ba14bf85e01509a7234">
<!ENTITY pkg-config-home "http://pkg-config.freedesktop.org/">
<!ENTITY pkg-config-ch5-du " Mio">
<!ENTITY pkg-config-ch5-sbu " SBU">
521,10 → 538,10
<!ENTITY texinfo-ch6-du "21 Mio">
<!ENTITY texinfo-ch6-sbu "0.3 SBU">
 
<!ENTITY udev-version "168">
<!ENTITY udev-version "170">
<!ENTITY udev-size "584 Kio">
<!ENTITY udev-url "&kernel;linux/utils/kernel/hotplug/udev-&udev-version;.tar.bz2">
<!ENTITY udev-md5 "4a466078532ab5dd5c35acc3ea2ec9a1">
<!ENTITY udev-md5 "6e132d1a3b4dae24dafd2726c5cdd982">
<!ENTITY udev-home "&kernel;linux/utils/kernel/hotplug/udev.html">
<!ENTITY udev-ch6-du "9.3 Mio">
<!ENTITY udev-ch6-sbu "0.2 SBU">
531,7 → 548,7
 
<!ENTITY udev-testfiles-url "http://anduin.linuxfromscratch.org/sources/other/udev-&udev-version;-testfiles.tar.bz2">
<!ENTITY udev-testfiles-size "148 Kio">
<!ENTITY udev-testfiles-md5 "d275d1bd4a515452648d41d3e46cbf05">
<!ENTITY udev-testfiles-md5 "d0af45f57f7cfcd509fc07de2c6508ed">
<!ENTITY udev-testfiles-du "37 Mio">
 
<!ENTITY udev-config "udev-config-20100128"> <!-- Scripts depend on this format -->
/trunk/lfs/appendices/dependencies.xml
690,6 → 690,43
</seglistitem>
</segmentedlist>
 
<!-- Begin Glib dependency info -->
<bridgehead renderas="sect2" id="glib-dep">Glib</bridgehead>
 
<segmentedlist>
<segtitle>&dependencies;</segtitle>
 
<seglistitem>
<seg>Bash, Binutils, Coreutils, Gawk, GCC, Glibc, Grep, Make, PCRE
Sed et Texinfo</seg>
</seglistitem>
</segmentedlist>
 
<segmentedlist>
<segtitle>&testsuites;</segtitle>
 
<seglistitem>
<seg>Aucune</seg>
</seglistitem>
</segmentedlist>
 
<segmentedlist>
<segtitle>&before;</segtitle>
 
<seglistitem>
<seg>Aucune</seg>
</seglistitem>
</segmentedlist>
 
<segmentedlist>
<segtitle>&external;</segtitle>
 
<seglistitem>
<seg>Aucune</seg>
</seglistitem>
</segmentedlist>
 
 
<!-- Begin Glibc dependency info -->
<bridgehead renderas="sect2" id="glibc-dep">Glibc</bridgehead>
 
1516,6 → 1553,43
</seglistitem>
</segmentedlist>
 
<!-- Begin PCRE dependency info -->
<bridgehead renderas="sect2" id="pcre-dep">PCRE</bridgehead>
 
<segmentedlist>
<segtitle>&dependencies;</segtitle>
 
<seglistitem>
<seg>Bash, Binutils, Bzip2, Coreutils, Gawk, GCC, Glibc, Grep, Make, Sed et
Texinfo</seg>
</seglistitem>
</segmentedlist>
 
<segmentedlist>
<segtitle>&testsuites;</segtitle>
 
<seglistitem>
<seg>Aucune</seg>
</seglistitem>
</segmentedlist>
 
<segmentedlist>
<segtitle>&before;</segtitle>
 
<seglistitem>
<seg>Aucune</seg>
</seglistitem>
</segmentedlist>
 
<segmentedlist>
<segtitle>&external;</segtitle>
 
<seglistitem>
<seg>Aucune</seg>
</seglistitem>
</segmentedlist>
 
 
<!-- Begin Perl dependency info -->
<bridgehead renderas="sect2" id="perl-dep">Perl</bridgehead>
 
1558,10 → 1632,10
<segmentedlist>
<segtitle>&dependencies;</segtitle>
 
<seglistitem>
<seg>Bash, Binutils, Coreutils, Diffutils, Gawk, GCC, Glibc, Grep,
Make et Sed</seg>
</seglistitem>
<seglistitem>
<seg>Bash, Binutils, Coreutils, Diffutils, Gawk, GCC, Glib, Glibc,
Grep, Make et Sed</seg>
</seglistitem>
</segmentedlist>
 
<segmentedlist>
/trunk/lfs/appendices/scripts.xml
13,8 → 13,8
<!ENTITY mountfs SYSTEM "mountfs.script">
<!ENTITY mountvirtfs SYSTEM "mountvirtfs.script">
<!ENTITY network SYSTEM "network.script">
<!ENTITY rc SYSTEM "rc.script">
<!ENTITY reboot SYSTEM "reboot.script">
<!ENTITY rc SYSTEM "rc.script">
<!ENTITY sendsignals SYSTEM "sendsignals.script">
<!ENTITY setclock SYSTEM "setclock.script">
<!ENTITY swap SYSTEM "swap.script">
26,6 → 26,7
<!ENTITY createfiles SYSTEM "createfiles.script">
<!ENTITY modules_sys SYSTEM "modules-sysinit.script">
<!ENTITY rc_sys SYSTEM "rc-sysinit.script">
<!ENTITY rc_site SYSTEM "rc-site.script">
<!ENTITY ifup SYSTEM "ifup.script">
<!ENTITY ifdown SYSTEM "ifdown.script">
<!ENTITY ipv4_static SYSTEM "ipv4-static.script">
62,21 → 63,6
<screen>&rc;</screen>
</sect1>
 
<sect1 id="functions" role="wrap">
<title>/etc/rc.d/init.d/functions</title>
<screen>&functions;</screen>
</sect1>
 
<sect1 id="mountvirtfs" role="wrap">
<title>/etc/rc.d/init.d/mountvirtfs</title>
<screen>&mountvirtfs;</screen>
</sect1>
 
<sect1 id="consolelog" role="wrap">
<title>/etc/rc.d/init.d/consolelog</title>
<screen>&consolelog;</screen>
</sect1>
 
<sect1 id="modules" role="wrap">
<title>/etc/rc.d/init.d/modules</title>
<screen>&modules;</screen>
/trunk/lfs/process-scripts.sh
1,20 → 1,20
#!/bin/bash
 
# Boot scripts
for s in bootscripts/lfs/init.d/* \
bootscripts/lfs/sysconfig/* \
bootscripts/lfs/sysconfig/network-devices/* \
bootscripts/lfs/sysconfig/network-devices/services/*
for s in lsb-bootscripts/etc/init.d/* \
lsb-bootscripts/etc/default/* \
lsb-bootscripts/sbin/* \
lsb-bootscripts/lib/network-services/*
do
script=$(basename $s)
# Skip directories
[ $script == 'network-devices' ] && continue
[ $script == 'services' ] && continue
[ $script == 'sbin' ] && continue
[ $script == 'network-services' ] && continue
 
# Disambiguate duplicate file names
[ $s == 'bootscripts/lfs/sysconfig/rc' ] && script='rc-sysinit';
[ $s == 'bootscripts/lfs/sysconfig/modules' ] && script='modules-sysinit';
[ $s == 'lsb-bootscripts/etc/default/rc' ] && script='rc-sysinit';
[ $s == 'lsb-bootscripts/etc/default/modules' ] && script='modules-sysinit';
sed -e 's/\&/\&amp\;/g' -e 's/</\&lt\;/g' -e 's/>/\&gt\;/g' \
-e "s/'/\&apos\;/g" -e 's/"/\&quot\;/g' -e 's/\t/ /g' \