2006-03-07 21:02:53 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2006-03-08 21:40:47 +01:00
|
|
|
# $Id$
|
2006-03-07 21:02:53 +01:00
|
|
|
|
|
|
|
###################################
|
|
|
|
### FUNCTIONS ###
|
|
|
|
###################################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------#
|
|
|
|
chapter4_Makefiles() {
|
|
|
|
#----------------------------#
|
2006-03-17 16:39:20 +01:00
|
|
|
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter4${R_arrow}"
|
2006-03-07 21:02:53 +01:00
|
|
|
|
|
|
|
# If /home/lfs is already present in the host, we asume that the
|
|
|
|
# lfs user and group are also presents in the host, and a backup
|
|
|
|
# of their bash init files is made.
|
|
|
|
(
|
|
|
|
cat << EOF
|
|
|
|
020-creatingtoolsdir:
|
|
|
|
@\$(call echo_message, Building)
|
|
|
|
@mkdir -v \$(MOUNT_PT)/tools && \\
|
|
|
|
rm -fv /tools && \\
|
|
|
|
ln -sv \$(MOUNT_PT)/tools / && \\
|
|
|
|
touch \$@
|
|
|
|
|
|
|
|
021-addinguser: 020-creatingtoolsdir
|
|
|
|
@\$(call echo_message, Building)
|
|
|
|
@if [ ! -d /home/lfs ]; then \\
|
|
|
|
groupadd lfs; \\
|
|
|
|
useradd -s /bin/bash -g lfs -m -k /dev/null lfs; \\
|
|
|
|
else \\
|
|
|
|
touch user-lfs-exist; \\
|
|
|
|
fi;
|
|
|
|
@chown lfs \$(MOUNT_PT)/tools && \\
|
2006-03-25 00:04:07 +01:00
|
|
|
chmod a+wt \$(MOUNT_PT)/sources && \\
|
2006-03-07 21:02:53 +01:00
|
|
|
touch \$@
|
|
|
|
|
|
|
|
022-settingenvironment: 021-addinguser
|
|
|
|
@\$(call echo_message, Building)
|
|
|
|
@if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
|
|
|
|
mv -v /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
|
|
|
|
fi;
|
|
|
|
@if [ -f /home/lfs/.bash_profile -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
|
|
|
|
mv -v /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
|
|
|
|
fi;
|
|
|
|
@echo "set +h" > /home/lfs/.bashrc && \\
|
|
|
|
echo "umask 022" >> /home/lfs/.bashrc && \\
|
|
|
|
echo "LFS=/mnt/lfs" >> /home/lfs/.bashrc && \\
|
|
|
|
echo "LC_ALL=POSIX" >> /home/lfs/.bashrc && \\
|
|
|
|
echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/lfs/.bashrc && \\
|
|
|
|
echo "export LFS LC_ALL PATH" >> /home/lfs/.bashrc && \\
|
|
|
|
echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\
|
|
|
|
chown lfs:lfs /home/lfs/.bashrc && \\
|
|
|
|
touch envars && \\
|
|
|
|
touch \$@
|
|
|
|
EOF
|
|
|
|
) >> $MKFILE.tmp
|
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------#
|
|
|
|
chapter5_Makefiles() {
|
|
|
|
#----------------------------#
|
2006-03-10 02:44:55 +01:00
|
|
|
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5${R_arrow}"
|
|
|
|
|
2006-03-07 21:02:53 +01:00
|
|
|
for file in chapter05/* ; do
|
|
|
|
# Keep the script file name
|
|
|
|
this_script=`basename $file`
|
|
|
|
|
|
|
|
# If no testsuites will be run, then TCL, Expect and DejaGNU aren't needed
|
2006-04-07 19:27:23 +02:00
|
|
|
# Fix also locales creation when running chapter05 testsuites (ugly)
|
2006-03-29 06:29:47 +02:00
|
|
|
case "${this_script}" in
|
|
|
|
*tcl) [[ "${TEST}" = "0" ]] && continue ;;
|
|
|
|
*expect) [[ "${TEST}" = "0" ]] && continue ;;
|
|
|
|
*dejagnu) [[ "${TEST}" = "0" ]] && continue ;;
|
|
|
|
*stripping) [[ "${STRIP}" = "0" ]] && continue ;;
|
2006-04-07 19:27:23 +02:00
|
|
|
*glibc) [[ "${TEST}" = "3" ]] && \
|
|
|
|
sed -i 's@/usr/lib/locale@/tools/lib/locale@' $file ;;
|
2006-03-29 06:29:47 +02:00
|
|
|
esac
|
2006-03-29 20:48:47 +02:00
|
|
|
|
2006-03-07 21:02:53 +01:00
|
|
|
# First append each name of the script files to a list (this will become
|
|
|
|
# the names of the targets in the Makefile
|
|
|
|
chapter5="$chapter5 ${this_script}"
|
|
|
|
|
|
|
|
# Grab the name of the target (minus the -pass1 or -pass2 in the case of gcc
|
|
|
|
# and binutils in chapter 5)
|
|
|
|
name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@' -e 's@-pass[0-9]\{1\}@@'`
|
|
|
|
|
|
|
|
# Set the dependency for the first target.
|
|
|
|
if [ -z $PREV ] ; then PREV=022-settingenvironment ; fi
|
|
|
|
|
2006-03-10 15:27:12 +01:00
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
#
|
2006-03-07 21:02:53 +01:00
|
|
|
# Drop in the name of the target on a new line, and the previous target
|
|
|
|
# as a dependency. Also call the echo_message function.
|
|
|
|
wrt_target "${this_script}" "$PREV"
|
|
|
|
|
|
|
|
# Find the version of the command files, if it corresponds with the building of
|
|
|
|
# a specific package
|
|
|
|
vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
|
|
|
|
|
|
|
|
# If $vrs isn't empty, we've got a package...
|
|
|
|
if [ "$vrs" != "" ] ; then
|
|
|
|
if [ "$name" = "tcl" ] ; then
|
2006-03-19 12:14:42 +01:00
|
|
|
FILE="$name$vrs-src.tar.*"
|
2006-03-07 21:02:53 +01:00
|
|
|
else
|
2006-03-19 12:14:42 +01:00
|
|
|
FILE="$name-$vrs.tar.*"
|
2006-03-07 21:02:53 +01:00
|
|
|
fi
|
|
|
|
|
2006-03-10 15:27:12 +01:00
|
|
|
# Insert instructions for unpacking the package and to set the PKGDIR variable.
|
2006-03-07 21:02:53 +01:00
|
|
|
wrt_unpack "$FILE"
|
2006-05-05 19:41:56 +02:00
|
|
|
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name"
|
2006-03-07 21:02:53 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Insert date and disk usage at the top of the log file, the script run
|
|
|
|
# and date and disk usage again at the bottom of the log file.
|
2006-04-07 19:27:23 +02:00
|
|
|
# The changingowner script must be run as root.
|
|
|
|
case "${this_script}" in
|
|
|
|
*changingowner) wrt_run_as_root "${this_script}" "$file" ;;
|
|
|
|
*) wrt_run_as_su "${this_script}" "$file" ;;
|
|
|
|
esac
|
2006-03-07 21:02:53 +01:00
|
|
|
|
|
|
|
# Remove the build directory(ies) except if the package build fails
|
|
|
|
# (so we can review config.cache, config.log, etc.)
|
|
|
|
if [ "$vrs" != "" ] ; then
|
|
|
|
wrt_remove_build_dirs "$name"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Include a touch of the target name so make can check
|
|
|
|
# if it's already been made.
|
|
|
|
echo -e '\t@touch $@' >> $MKFILE.tmp
|
2006-03-10 15:27:12 +01:00
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
|
|
|
#--------------------------------------------------------------------#
|
2006-03-07 21:02:53 +01:00
|
|
|
|
|
|
|
# Keep the script file name for Makefile dependencies.
|
|
|
|
PREV=${this_script}
|
|
|
|
done # end for file in chapter05/*
|
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------#
|
|
|
|
chapter6_Makefiles() {
|
|
|
|
#----------------------------#
|
2006-04-13 22:13:24 +02:00
|
|
|
# Set envars and scripts for iteration targets
|
2006-04-24 20:25:56 +02:00
|
|
|
LOGS="" # Start with an empty global LOGS envar
|
2006-04-12 22:23:12 +02:00
|
|
|
if [[ -z "$1" ]] ; then
|
2006-04-12 21:38:42 +02:00
|
|
|
local N=""
|
|
|
|
else
|
|
|
|
local N=-build_$1
|
|
|
|
local chapter6=""
|
2006-04-13 22:13:24 +02:00
|
|
|
mkdir chapter06$N
|
|
|
|
cp chapter06/* chapter06$N
|
|
|
|
for script in chapter06$N/* ; do
|
2006-04-14 14:02:05 +02:00
|
|
|
# Overwrite existing symlinks, files, and dirs
|
2006-04-13 22:13:24 +02:00
|
|
|
sed -e 's/ln -sv/&f/g' \
|
|
|
|
-e 's/mv -v/&f/g' \
|
2006-04-14 14:02:05 +02:00
|
|
|
-e 's/mkdir -v/&p/g' -i ${script}
|
2006-04-13 22:13:24 +02:00
|
|
|
done
|
2006-04-16 11:57:17 +02:00
|
|
|
# Remove Bzip2 binaries before make install
|
2006-04-14 12:59:33 +02:00
|
|
|
sed -e 's@make install@rm -vf /usr/bin/bz*\n&@' -i chapter06$N/*-bzip2
|
2006-04-14 14:02:05 +02:00
|
|
|
# Let some Udev pre-installation commands to fail
|
|
|
|
sed -e 's@/lib/udev/devices/fd@& || true@' \
|
|
|
|
-e 's/mknod -m.*/& || true/' -i chapter06$N/*-udev
|
2006-04-12 21:38:42 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}"
|
2006-03-29 06:29:47 +02:00
|
|
|
|
2006-04-13 22:13:24 +02:00
|
|
|
for file in chapter06$N/* ; do
|
2006-03-07 21:02:53 +01:00
|
|
|
# Keep the script file name
|
|
|
|
this_script=`basename $file`
|
|
|
|
|
|
|
|
# We'll run the chroot commands differently than the others, so skip them in the
|
|
|
|
# dependencies and target creation.
|
2006-03-29 06:29:47 +02:00
|
|
|
case "${this_script}" in
|
|
|
|
*chroot) continue ;;
|
2006-04-11 22:03:19 +02:00
|
|
|
*stripping*) [[ "${STRIP}" = "0" ]] && continue ;;
|
2006-03-29 06:29:47 +02:00
|
|
|
esac
|
2006-03-07 21:02:53 +01:00
|
|
|
|
2006-04-12 22:23:12 +02:00
|
|
|
# Grab the name of the target
|
|
|
|
name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'`
|
|
|
|
|
|
|
|
# Find the version of the command files, if it corresponds with the building of
|
|
|
|
# a specific package. We need this here to can skip scripts not needed for
|
|
|
|
# iterations rebuilds
|
|
|
|
vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
|
|
|
|
|
|
|
|
if [[ "$vrs" = "" ]] && [[ -n "$N" ]] ; then
|
|
|
|
case "${this_script}" in
|
|
|
|
*stripping*) ;;
|
|
|
|
*) continue ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2006-04-24 20:25:56 +02:00
|
|
|
# Append each name of the script files to a list (this will become
|
|
|
|
# the names of the targets in the Makefile)
|
2006-04-12 21:38:42 +02:00
|
|
|
chapter6="$chapter6 ${this_script}${N}"
|
2006-03-07 21:02:53 +01:00
|
|
|
|
2006-04-24 20:25:56 +02:00
|
|
|
# Append each name of the script files to a list (this will become
|
|
|
|
# the names of the logs to be moved for each iteration)
|
|
|
|
LOGS="$LOGS ${this_script}"
|
|
|
|
|
2006-03-10 15:27:12 +01:00
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
#
|
2006-03-07 21:02:53 +01:00
|
|
|
# Drop in the name of the target on a new line, and the previous target
|
|
|
|
# as a dependency. Also call the echo_message function.
|
2006-04-12 21:38:42 +02:00
|
|
|
wrt_target "${this_script}${N}" "$PREV"
|
2006-03-07 21:02:53 +01:00
|
|
|
|
|
|
|
# If $vrs isn't empty, we've got a package...
|
|
|
|
# Insert instructions for unpacking the package and changing directories
|
|
|
|
if [ "$vrs" != "" ] ; then
|
|
|
|
FILE="$name-$vrs.tar.*"
|
|
|
|
wrt_unpack2 "$FILE"
|
2006-05-05 19:41:56 +02:00
|
|
|
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name"
|
2006-03-07 21:02:53 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# In the mount of kernel filesystems we need to set LFS
|
|
|
|
# and not to use chroot.
|
2006-03-29 06:29:47 +02:00
|
|
|
case "${this_script}" in
|
|
|
|
*kernfs) wrt_run_as_root "${this_script}" "$file" ;;
|
|
|
|
*) wrt_run_as_chroot1 "${this_script}" "$file" ;;
|
|
|
|
esac
|
2006-03-07 21:02:53 +01:00
|
|
|
|
|
|
|
# Remove the build directory(ies) except if the package build fails.
|
|
|
|
if [ "$vrs" != "" ] ; then
|
2006-03-08 21:40:47 +01:00
|
|
|
wrt_remove_build_dirs "$name"
|
2006-03-07 21:02:53 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Include a touch of the target name so make can check
|
|
|
|
# if it's already been made.
|
|
|
|
echo -e '\t@touch $@' >> $MKFILE.tmp
|
2006-03-10 15:27:12 +01:00
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
|
|
|
#--------------------------------------------------------------------#
|
2006-03-07 21:02:53 +01:00
|
|
|
|
|
|
|
# Keep the script file name for Makefile dependencies.
|
2006-04-12 21:38:42 +02:00
|
|
|
PREV=${this_script}${N}
|
|
|
|
# Set system_build envar for iteration targets
|
|
|
|
system_build=$chapter6
|
2006-03-07 21:02:53 +01:00
|
|
|
done # end for file in chapter06/*
|
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------#
|
|
|
|
chapter789_Makefiles() {
|
|
|
|
#----------------------------#
|
2006-03-17 16:30:23 +01:00
|
|
|
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8/9${R_arrow}"
|
2006-03-29 06:29:47 +02:00
|
|
|
|
2006-03-07 21:02:53 +01:00
|
|
|
for file in chapter0{7,8,9}/* ; do
|
|
|
|
# Keep the script file name
|
|
|
|
this_script=`basename $file`
|
|
|
|
|
|
|
|
# Grub must be configured manually.
|
|
|
|
# The filesystems can't be unmounted via Makefile and the user
|
|
|
|
# should enter the chroot environment to create the root
|
|
|
|
# password, edit several files and setup Grub.
|
2006-03-21 14:25:20 +01:00
|
|
|
#
|
2006-03-07 21:02:53 +01:00
|
|
|
# If no .config file is supplied, the kernel build is skipped
|
2006-03-21 14:25:20 +01:00
|
|
|
#
|
|
|
|
case ${this_script} in
|
|
|
|
*grub) continue ;;
|
|
|
|
*reboot) continue ;;
|
2006-03-29 20:48:47 +02:00
|
|
|
*console) continue ;; # Use the file generated by lfs-bootscripts
|
2006-03-21 14:25:20 +01:00
|
|
|
*kernel) [[ -z ${CONFIG} ]] && continue
|
|
|
|
cp ${CONFIG} $BUILDDIR/sources/kernel-config ;;
|
|
|
|
esac
|
2006-03-07 21:02:53 +01:00
|
|
|
|
|
|
|
# First append each name of the script files to a list (this will become
|
|
|
|
# the names of the targets in the Makefile
|
|
|
|
chapter789="$chapter789 ${this_script}"
|
|
|
|
|
2006-03-10 15:27:12 +01:00
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
#
|
2006-03-07 21:02:53 +01:00
|
|
|
# Drop in the name of the target on a new line, and the previous target
|
|
|
|
# as a dependency. Also call the echo_message function.
|
|
|
|
wrt_target "${this_script}" "$PREV"
|
|
|
|
|
|
|
|
# Find the bootscripts and kernel package names
|
2006-03-29 06:29:47 +02:00
|
|
|
case "${this_script}" in
|
|
|
|
*bootscripts)
|
|
|
|
vrs=`grep "^lfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
|
|
|
|
FILE="lfs-bootscripts-$vrs.tar.*"
|
|
|
|
wrt_unpack2 "$FILE"
|
|
|
|
;;
|
|
|
|
*kernel)
|
|
|
|
vrs=`grep "^linux-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
|
|
|
|
FILE="linux-$vrs.tar.*"
|
|
|
|
wrt_unpack2 "$FILE"
|
|
|
|
;;
|
|
|
|
esac
|
2006-03-29 20:48:47 +02:00
|
|
|
|
2006-03-07 21:02:53 +01:00
|
|
|
# Check if we have a real /etc/fstab file
|
2006-03-29 06:29:47 +02:00
|
|
|
case "${this_script}" in
|
|
|
|
*fstab) if [[ -n $FSTAB ]]; then
|
|
|
|
wrt_copy_fstab "${this_script}"
|
|
|
|
else
|
|
|
|
wrt_run_as_chroot2 "$this_script" "$file"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*) wrt_run_as_chroot2 "$this_script" "$file"
|
|
|
|
;;
|
|
|
|
esac
|
2006-03-07 21:02:53 +01:00
|
|
|
|
2006-03-29 06:29:47 +02:00
|
|
|
case "${this_script}" in
|
|
|
|
*bootscripts) wrt_remove_build_dirs "dummy" ;;
|
|
|
|
*kernel) wrt_remove_build_dirs "dummy" ;;
|
|
|
|
esac
|
2006-03-29 20:48:47 +02:00
|
|
|
|
2006-03-07 21:02:53 +01:00
|
|
|
# Include a touch of the target name so make can check
|
|
|
|
# if it's already been made.
|
|
|
|
echo -e '\t@touch $@' >> $MKFILE.tmp
|
2006-03-10 15:27:12 +01:00
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
|
|
|
#--------------------------------------------------------------------#
|
2006-03-07 21:02:53 +01:00
|
|
|
|
|
|
|
# Keep the script file name for Makefile dependencies.
|
|
|
|
PREV=${this_script}
|
|
|
|
done # for file in chapter0{7,8,9}/*
|
2006-04-26 22:24:58 +02:00
|
|
|
|
|
|
|
# Add SBU-disk_usage report target if required
|
|
|
|
if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
|
2006-03-07 21:02:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------#
|
|
|
|
build_Makefile() {
|
|
|
|
#----------------------------#
|
2006-04-29 16:14:45 +02:00
|
|
|
echo "Creating Makefile... ${BOLD}START${OFF}"
|
2006-03-07 21:02:53 +01:00
|
|
|
cd $JHALFSDIR/${PROGNAME}-commands
|
|
|
|
|
|
|
|
# Start with a clean Makefile.tmp file
|
|
|
|
>$MKFILE.tmp
|
|
|
|
|
|
|
|
chapter4_Makefiles
|
|
|
|
chapter5_Makefiles
|
|
|
|
chapter6_Makefiles
|
2006-04-24 20:25:56 +02:00
|
|
|
# Add the iterations targets, if needed
|
2006-04-12 00:06:37 +02:00
|
|
|
[[ "$COMPARE" != "0" ]] && wrt_compare_targets
|
2006-03-07 21:02:53 +01:00
|
|
|
chapter789_Makefiles
|
|
|
|
|
|
|
|
|
|
|
|
# Add a header, some variables and include the function file
|
|
|
|
# to the top of the real Makefile.
|
|
|
|
(
|
|
|
|
cat << EOF
|
|
|
|
$HEADER
|
|
|
|
|
|
|
|
SRC= /sources
|
|
|
|
MOUNT_PT= $BUILDDIR
|
|
|
|
|
|
|
|
include makefile-functions
|
|
|
|
|
|
|
|
EOF
|
|
|
|
) > $MKFILE
|
|
|
|
|
|
|
|
|
|
|
|
# Add chroot commands
|
|
|
|
i=1
|
|
|
|
for file in chapter06/*chroot* ; do
|
|
|
|
chroot=`cat $file | sed -e '/#!\/bin\/sh/d' -e 's@ \\\@ @g' | tr -d '\n' | sed \
|
|
|
|
-e 's/ */ /g' -e 's|\\$|&&|g' -e 's|exit||g' -e 's|$| -c|' \
|
|
|
|
-e 's|"$$LFS"|$(MOUNT_PT)|' -e 's|set -e||'`
|
|
|
|
echo -e "CHROOT$i= $chroot\n" >> $MKFILE
|
|
|
|
i=`expr $i + 1`
|
|
|
|
done
|
|
|
|
|
|
|
|
# Drop in the main target 'all:' and the chapter targets with each sub-target
|
|
|
|
# as a dependency.
|
|
|
|
(
|
|
|
|
cat << EOF
|
|
|
|
all: chapter4 chapter5 chapter6 chapter789
|
|
|
|
@\$(call echo_finished,$VERSION)
|
|
|
|
|
|
|
|
chapter4: 020-creatingtoolsdir 021-addinguser 022-settingenvironment
|
|
|
|
|
|
|
|
chapter5: chapter4 $chapter5 restore-lfs-env
|
|
|
|
|
|
|
|
chapter6: chapter5 $chapter6
|
|
|
|
|
|
|
|
chapter789: chapter6 $chapter789
|
|
|
|
|
|
|
|
clean-all: clean
|
2006-03-29 21:03:55 +02:00
|
|
|
rm -rf ./{lfs-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
|
2006-03-07 21:02:53 +01:00
|
|
|
|
|
|
|
clean: clean-chapter789 clean-chapter6 clean-chapter5 clean-chapter4
|
|
|
|
|
|
|
|
clean-chapter4:
|
|
|
|
-if [ ! -f user-lfs-exist ]; then \\
|
|
|
|
userdel lfs; \\
|
|
|
|
rm -rf /home/lfs; \\
|
|
|
|
fi;
|
|
|
|
rm -rf \$(MOUNT_PT)/tools
|
|
|
|
rm -f /tools
|
|
|
|
rm -f envars user-lfs-exist
|
|
|
|
rm -f 02* logs/02*.log
|
|
|
|
|
|
|
|
clean-chapter5:
|
|
|
|
rm -rf \$(MOUNT_PT)/tools/*
|
|
|
|
rm -f $chapter5 restore-lfs-env sources-dir
|
|
|
|
cd logs && rm -f $chapter5 && cd ..
|
|
|
|
|
|
|
|
clean-chapter6:
|
|
|
|
-umount \$(MOUNT_PT)/sys
|
|
|
|
-umount \$(MOUNT_PT)/proc
|
|
|
|
-umount \$(MOUNT_PT)/dev/shm
|
|
|
|
-umount \$(MOUNT_PT)/dev/pts
|
|
|
|
-umount \$(MOUNT_PT)/dev
|
|
|
|
rm -rf \$(MOUNT_PT)/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}
|
|
|
|
rm -f $chapter6
|
|
|
|
cd logs && rm -f $chapter6 && cd ..
|
|
|
|
|
|
|
|
clean-chapter789:
|
|
|
|
rm -f $chapter789
|
|
|
|
cd logs && rm -f $chapter789 && cd ..
|
|
|
|
|
|
|
|
restore-lfs-env:
|
|
|
|
@\$(call echo_message, Building)
|
|
|
|
@if [ -f /home/lfs/.bashrc.XXX ]; then \\
|
|
|
|
mv -fv /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
|
|
|
|
fi;
|
|
|
|
@if [ -f /home/lfs/.bash_profile.XXX ]; then \\
|
|
|
|
mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
|
|
|
|
fi;
|
|
|
|
@chown lfs:lfs /home/lfs/.bash* && \\
|
|
|
|
touch \$@
|
|
|
|
|
2006-04-08 14:21:34 +02:00
|
|
|
EOF
|
|
|
|
) >> $MKFILE
|
|
|
|
|
2006-03-07 21:02:53 +01:00
|
|
|
# Bring over the items from the Makefile.tmp
|
|
|
|
cat $MKFILE.tmp >> $MKFILE
|
|
|
|
rm $MKFILE.tmp
|
2006-04-29 16:14:45 +02:00
|
|
|
echo "Creating Makefile... ${BOLD}DONE${OFF}"
|
2006-03-07 21:02:53 +01:00
|
|
|
|
2006-04-29 16:14:45 +02:00
|
|
|
}
|
2006-03-07 21:02:53 +01:00
|
|
|
|