RUN_MODE := $(shell . functions/version && check_hvlinux_version)
ifeq ($(RUN_MODE),HOST)
- STAGES := "0 1"
+ STAGES := 0 1
else ifeq ($(RUN_MODE),NATIVE)
- STAGES := "2 3 4 5"
+ STAGES := 2 3 4 5
else
$(error Unable to determine run mode.)
endif
endif
all:
- @echo "Stages: $(STAGES)"
@for k in $(STAGES); do \
make -C stage$${k} $(MAKECMDGOALS); \
done
echo
}
+
+# This function will exit if the stage is already completed
+check_completed_stage()
+{
+ if [ -f ${LFS_LOG_DIR}/stage-completed ]; then
+ echo "${LFS_STAGE} completed"
+ exit 0
+ else
+ return 0
+ fi
+}
+
+write_completed_stage()
+{
+ touch ${LFS_LOG_DIR}/stage-completed
+}
+
+display_stage_build_stats()
+{
+ echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
+}
{
local CFG_DIR="../config"
- if [ -f ${CFG_DIR}/${HV_VER_FILE} ]; then
- echo "Version file already created"
- return 0
- fi
-
- echo "Create new hvlinux-version file"
+ if [ ! -f ${CFG_DIR}/${HV_VER_FILE} ]; then
+ echo "Create new hvlinux-version file"
- if [ ! -x /usr/bin/uuidgen ]; then
- echo "Error, missing /usr/bin/uuidgen program"
- exit 1
- fi
+ if [ ! -x /usr/bin/uuidgen ]; then
+ echo "Error, missing /usr/bin/uuidgen program"
+ exit 1
+ fi
- cat > ${CFG_DIR}/${HV_VER_FILE} <<EOF
+ cat > ${CFG_DIR}/${HV_VER_FILE} <<EOF
# Do not edit this file.
# This file is autogenerated by the HVLinux build system
EOF
- echo "HVUUID=$(uuidgen)" >> ${CFG_DIR}/${HV_VER_FILE}
+ echo "HVUUID=$(uuidgen)" >> ${CFG_DIR}/${HV_VER_FILE}
+ fi
# Copy local file to destination LFS partition
mkdir -pv ${LFS}/etc
init_log_file
+# This function will exit if the stage is already completed
+check_completed_stage
+
rscr mult "Performing pre-install" pre-install
rscr mult "Creating HVLinux version file" create-version
# directory of the user.
su - lfs -c "cd ${PWD}; ./hv-install-2"
-echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
+write_completed_stage
+display_stage_build_stats
exit 0
init_log_file
+# This function will exit if the stage is already completed
+check_completed_stage
+
rscr mult "Performing pre-install" pre-install
# Logging-in as 'lfs' user, and executing the hv-install-2 script. The
su - lfs -c "cd ${PWD}; ./hv-install-2"
rscr mult "Performing post-install" post-install
-
-echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
+write_completed_stage
+display_stage_build_stats
exit 0
# Change the ownership for ${LFS} and its subdirectories
chown -Rv root:root ${LFS}
+write_completed_stage
+
exit $?
echo "You must now compile a new kernel (go to /usr/src/linux)."
echo "After that, you can reboot and try your new system."
+write_completed_stage
+
exec /bin/bash --login
ipkg ${FREETYPE}
ipkg ${FONTCONFIG}
-echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h"
+write_completed_stage
+display_stage_build_stats
exit $?
ipkg -m acnb ${WINDOWMAKER}
ipkg ${WINDOWMAKER_EXTRA}
+write_completed_stage
+display_stage_build_stats
+
exit $?
rscr mult "Performing post-install" cis-post-install
+write_completed_stage
+display_stage_build_stats
+
exit $?
ipkg_gnome ${EVOLUTION} "--with-nss-includes=/usr/include/nss --with-nspr-includes=/usr/include/nspr --with-openldap=yes --with-krb5=/usr"
ipkg_gnome ${EVOLUTION_EXCHANGE}
+write_completed_stage
+display_stage_build_stats
+
exit $?