Small changes.
This commit is contained in:
parent
e2dfa2c90f
commit
cbad1f5860
1 changed files with 34 additions and 52 deletions
|
@ -2,12 +2,9 @@
|
||||||
|
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
###################################
|
#########################################
|
||||||
### FUNCTIONS ###
|
### LFS MAKEFILE GENERATION FUNCTIONS ###
|
||||||
###################################
|
#########################################
|
||||||
|
|
||||||
|
|
||||||
#############################################################
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------#
|
#----------------------------#
|
||||||
|
@ -60,12 +57,12 @@ EOF
|
||||||
) > $MKFILE.tmp
|
) > $MKFILE.tmp
|
||||||
|
|
||||||
chapter4=" 04_02-creatingtoolsdir 04_03-addinguser 04_04-settingenvironment"
|
chapter4=" 04_02-creatingtoolsdir 04_03-addinguser 04_04-settingenvironment"
|
||||||
|
PREV=04_04-settingenvironment
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------#
|
#----------------------------#
|
||||||
chapter5_Makefiles() {
|
chapter5_Makefiles() { #
|
||||||
#----------------------------#
|
#----------------------------#
|
||||||
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5 ( LUSER ) ${R_arrow}"
|
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5 ( LUSER ) ${R_arrow}"
|
||||||
|
|
||||||
|
@ -81,19 +78,13 @@ chapter5_Makefiles() {
|
||||||
*stripping) [[ "${STRIP}" = "n" ]] && continue ;;
|
*stripping) [[ "${STRIP}" = "n" ]] && continue ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# First append each name of the script files to a list (this will become
|
# Append the script name to the chapter dependencies list
|
||||||
# the names of the targets in the Makefile
|
# The changingowner script need be run as root into the SUDO target
|
||||||
# DO NOT append the changingowner script, it need be run as root.
|
|
||||||
# A hack is necessary: create script in chap5 BUT run as a dependency for
|
|
||||||
# SUDO target
|
|
||||||
case "${this_script}" in
|
case "${this_script}" in
|
||||||
*changingowner) runasroot="$runasroot ${this_script}" ;;
|
*changingowner) runasroot="$runasroot ${this_script}" ;;
|
||||||
*) chapter5="$chapter5 ${this_script}" ;;
|
*) chapter5="$chapter5 ${this_script}" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Set the dependency for the first target.
|
|
||||||
if [ -z $PREV ] ; then PREV=04_04-settingenvironment ; fi
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------#
|
#--------------------------------------------------------------------#
|
||||||
# >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
# >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
||||||
#--------------------------------------------------------------------#
|
#--------------------------------------------------------------------#
|
||||||
|
@ -109,8 +100,7 @@ chapter5_Makefiles() {
|
||||||
*) wrt_RunScript "$file" ;;
|
*) wrt_RunScript "$file" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Include a touch of the target name so make can check
|
# Write the target entry footer.
|
||||||
# if it's already been made.
|
|
||||||
wrt_touch
|
wrt_touch
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------#
|
#--------------------------------------------------------------------#
|
||||||
|
@ -124,7 +114,7 @@ chapter5_Makefiles() {
|
||||||
|
|
||||||
|
|
||||||
#----------------------------#
|
#----------------------------#
|
||||||
chapter6_Makefiles() {
|
chapter6_Makefiles() { #
|
||||||
#----------------------------#
|
#----------------------------#
|
||||||
|
|
||||||
# Set envars and scripts for iteration targets
|
# Set envars and scripts for iteration targets
|
||||||
|
@ -151,9 +141,8 @@ chapter6_Makefiles() {
|
||||||
# Keep the script file name
|
# Keep the script file name
|
||||||
this_script=`basename $file`
|
this_script=`basename $file`
|
||||||
|
|
||||||
# We'll run the chroot commands differently than the others, so skip them in the
|
# Chroot commands are set as envars in the Makefile header.
|
||||||
# dependencies and target creation.
|
# Skip linux-headers in iterative builds.
|
||||||
# Skip also linux-headers in iterative builds.
|
|
||||||
case "${this_script}" in
|
case "${this_script}" in
|
||||||
*chroot) continue ;;
|
*chroot) continue ;;
|
||||||
*stripping*) [[ "${STRIP}" = "n" ]] && continue ;;
|
*stripping*) [[ "${STRIP}" = "n" ]] && continue ;;
|
||||||
|
@ -171,9 +160,8 @@ chapter6_Makefiles() {
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Append each name of the script files to a list (this will become
|
# Append the script name to the chapter dependencies list
|
||||||
# the names of the targets in the Makefile)
|
# The kernfs script need be run as root into the SUDO target
|
||||||
# The kernfs script must be run as part of SUDO target.
|
|
||||||
case "${this_script}" in
|
case "${this_script}" in
|
||||||
*kernfs) runasroot="$runasroot ${this_script}" ;;
|
*kernfs) runasroot="$runasroot ${this_script}" ;;
|
||||||
*) chapter6="$chapter6 ${this_script}" ;;
|
*) chapter6="$chapter6 ${this_script}" ;;
|
||||||
|
@ -193,8 +181,8 @@ chapter6_Makefiles() {
|
||||||
wrt_TouchTimestamp
|
wrt_TouchTimestamp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# In the mount of kernel filesystems we need to set LFS
|
# Run the script.
|
||||||
# and not to use chroot.
|
# The kernfs script must be run as root.
|
||||||
case "${this_script}" in
|
case "${this_script}" in
|
||||||
*kernfs) wrt_RunAsRoot "$file" ;;
|
*kernfs) wrt_RunAsRoot "$file" ;;
|
||||||
*) wrt_RunScript "$file" ;;
|
*) wrt_RunScript "$file" ;;
|
||||||
|
@ -205,8 +193,7 @@ chapter6_Makefiles() {
|
||||||
wrt_LogNewFiles "$name"
|
wrt_LogNewFiles "$name"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Include a touch of the target name so make can check
|
# Write the target entry footer.
|
||||||
# if it's already been made.
|
|
||||||
wrt_touch
|
wrt_touch
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------#
|
#--------------------------------------------------------------------#
|
||||||
|
@ -220,8 +207,9 @@ chapter6_Makefiles() {
|
||||||
done # end for file in chapter06/*
|
done # end for file in chapter06/*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#----------------------------#
|
#----------------------------#
|
||||||
chapter78_Makefiles() {
|
chapter78_Makefiles() { #
|
||||||
#----------------------------#
|
#----------------------------#
|
||||||
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8 ( BOOT ) ${R_arrow}"
|
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8 ( BOOT ) ${R_arrow}"
|
||||||
|
|
||||||
|
@ -234,13 +222,15 @@ chapter78_Makefiles() {
|
||||||
# If no .config file is supplied, the kernel build is skipped
|
# If no .config file is supplied, the kernel build is skipped
|
||||||
case ${this_script} in
|
case ${this_script} in
|
||||||
*grub) continue ;;
|
*grub) continue ;;
|
||||||
*fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
|
*fstab) [[ -n "${FSTAB}" ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
|
||||||
*kernel) [[ -z ${CONFIG} ]] && continue
|
*kernel) [[ -z "${CONFIG}" ]] && continue
|
||||||
cp ${CONFIG} $BUILDDIR/sources/kernel-config ;;
|
cp ${CONFIG} $BUILDDIR/sources/kernel-config ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# First append each name of the script files to a list (this will become
|
# If building a package, grab the phase name to be used with INSTALL_LOG
|
||||||
# the names of the targets in the Makefile
|
name=`grep "^PKG_PHASE=" ${file} | sed -e 's@PKG_PHASE=@@'`
|
||||||
|
|
||||||
|
# Append the script name to the chapter dependencies list
|
||||||
chapter78="$chapter78 ${this_script}"
|
chapter78="$chapter78 ${this_script}"
|
||||||
|
|
||||||
#--------------------------------------------------------------------#
|
#--------------------------------------------------------------------#
|
||||||
|
@ -251,14 +241,12 @@ chapter78_Makefiles() {
|
||||||
# as a dependency. Also call the echo_message function.
|
# as a dependency. Also call the echo_message function.
|
||||||
wrt_target "${this_script}" "$PREV"
|
wrt_target "${this_script}" "$PREV"
|
||||||
|
|
||||||
# For bootscripts and kernel, start INSTALL_LOG if requested
|
# Touch timestamp file if installed files logs will be created.
|
||||||
case "${this_script}" in
|
if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
|
||||||
*bootscripts | *kernel ) if [ "${INSTALL_LOG}" = "y" ] ; then
|
wrt_TouchTimestamp
|
||||||
wrt_TouchTimestamp
|
fi
|
||||||
fi ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Check if we have a real /etc/fstab file
|
# Check if we have a real /etc/fstab file and run the scripts
|
||||||
case "${this_script}" in
|
case "${this_script}" in
|
||||||
*fstab) if [[ -n $FSTAB ]]; then
|
*fstab) if [[ -n $FSTAB ]]; then
|
||||||
wrt_CopyFstab
|
wrt_CopyFstab
|
||||||
|
@ -268,17 +256,12 @@ chapter78_Makefiles() {
|
||||||
*) wrt_RunScript "$file" ;;
|
*) wrt_RunScript "$file" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "${this_script}" in
|
# Write installed files log
|
||||||
*bootscripts) if [ "${INSTALL_LOG}" = "y" ] ; then
|
if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
|
||||||
wrt_LogNewFiles "lfs-bootscripts"
|
wrt_LogNewFiles "$name"
|
||||||
fi ;;
|
fi
|
||||||
*kernel) if [ "${INSTALL_LOG}" = "y" ] ; then
|
|
||||||
wrt_LogNewFiles "linux"
|
|
||||||
fi ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Include a touch of the target name so make can check
|
# Write the target entry footer.
|
||||||
# if it's already been made.
|
|
||||||
wrt_touch
|
wrt_touch
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------#
|
#--------------------------------------------------------------------#
|
||||||
|
@ -292,7 +275,6 @@ chapter78_Makefiles() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------#
|
#----------------------------#
|
||||||
build_Makefile() { #
|
build_Makefile() { #
|
||||||
#----------------------------#
|
#----------------------------#
|
||||||
|
|
Reference in a new issue