Add code to save work at the end of chapter 5

(and finish the rebuild-makefile change)
This commit is contained in:
Pierre Labastie 2020-05-01 14:24:32 +00:00
parent 06eddf40f2
commit f5ecc2838a
5 changed files with 23 additions and 4 deletions

View file

@ -1077,12 +1077,23 @@ menu "System configuration"
endmenu #--- System configuration endmenu #--- System configuration
menu "Advanced Features" menu "Advanced Features"
depends on !BOOK_BLFS depends on !BOOK_BLFS && !REBUILD_MAKEFILE
config REPORT config REPORT
bool "Create SBU and disk usage report" bool "Create SBU and disk usage report"
default y default y
config SAVE_CH5
bool "Save Chapter 5 work"
depends on BOOK_LFS || BOOK_LFS_SYSD
default n
help
Save the state of jhalfs at the end of chapter 5:
if you tick this item, the whole $LFS directory is
saved when chapter 5 is finished. It'll be in an xz
compressed tarball in the $LFS/jhalfs directory
#--- ICA #--- ICA
config COMPARE config COMPARE
bool "Run comparison analysis on final stage" bool "Run comparison analysis on final stage"

View file

@ -100,7 +100,7 @@ chapter5_Makefiles() {
# Initialize the Makefile target: it'll change during chapter # Initialize the Makefile target: it'll change during chapter
# For vanilla lfs, the "changingowner" script should be run as root. So # For vanilla lfs, the "changingowner" script should be run as root. So
# it belongs to the "SUDO" target, with list in the "runasroot" variable. # it belongs to the "SUDO" target, with list in the "runasroot" variable.
# For new lfs, changingowner and kernfs are in "runsaroot", then the following, # For new lfs, changingowner and kernfs are in "runasroot", then the following,
# starting at creatingdirs, are in the "CHROOT" target, in variable "chapter6". # starting at creatingdirs, are in the "CHROOT" target, in variable "chapter6".
# Makefile_target records the variable, not really the target! # Makefile_target records the variable, not really the target!
# We use a case statement on that variable, because instructions in the # We use a case statement on that variable, because instructions in the
@ -441,6 +441,8 @@ build_Makefile() { #
chapter4_Makefiles chapter4_Makefiles
chapter5_Makefiles chapter5_Makefiles
# Add the save target, if needed
[[ "$SAVE_CH5" = "y" ]] && wrt_save_target $Makefile_target
chapter6_Makefiles chapter6_Makefiles
# Add the iterations targets, if needed # Add the iterations targets, if needed
[[ "$COMPARE" = "y" ]] && wrt_compare_targets [[ "$COMPARE" = "y" ]] && wrt_compare_targets

View file

@ -53,7 +53,7 @@ wrt_compare_work() { #
local ITERATION=$1 local ITERATION=$1
local PREV_IT=$2 local PREV_IT=$2
local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \ local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
/sources /root /srv /sys /tmp /tools /usr/local /usr/src" /sources /root /run /srv /sys /tmp /tools /usr/local /usr/src /var"
local ROOT_DIR=/ local ROOT_DIR=/
local DEST_TOPDIR=/${SCRIPT_ROOT} local DEST_TOPDIR=/${SCRIPT_ROOT}

View file

@ -51,7 +51,7 @@ inline_doc
local -r LFS_system="HOSTNAME INTERFACE IP_ADDR GATEWAY PREFIX BROADCAST DOMAIN DNS1 DNS2 FONT KEYMAP LOCAL LOG_LEVEL" local -r LFS_system="HOSTNAME INTERFACE IP_ADDR GATEWAY PREFIX BROADCAST DOMAIN DNS1 DNS2 FONT KEYMAP LOCAL LOG_LEVEL"
# Full list of books settings # Full list of books settings
local -r lfs_PARAM_LIST="$LFS_book $GENERAL_common $LFS_build $LFS_system $ADVANCED_chroot REALSBU $ADVANCED_common" local -r lfs_PARAM_LIST="$LFS_book $GENERAL_common $LFS_build $LFS_system $ADVANCED_chroot REALSBU SAVE_CH5 $ADVANCED_common"
local -r hlfs_PARAM_LIST="$HLFS_book $GENERAL_common $HLFS_build $ADVANCED_chroot $ADVANCED_common" local -r hlfs_PARAM_LIST="$HLFS_book $GENERAL_common $HLFS_build $ADVANCED_chroot $ADVANCED_common"
local -r clfs_PARAM_LIST="$CLFS_book $GENERAL_common $CLFS_build $ADVANCED_chroot $ADVANCED_common" local -r clfs_PARAM_LIST="$CLFS_book $GENERAL_common $CLFS_build $ADVANCED_chroot $ADVANCED_common"
local -r clfs2_PARAM_LIST="$CLFS2_book $GENERAL_common $CLFS2_build $ADVANCED_common" local -r clfs2_PARAM_LIST="$CLFS2_book $GENERAL_common $CLFS2_build $ADVANCED_common"

6
jhalfs
View file

@ -178,6 +178,7 @@ SET_BLOWFISH=${SET_BLOWFISH:=n}
UNICODE=${UNICODE:=n} UNICODE=${UNICODE:=n}
LOCAL=${LOCAL:=n} LOCAL=${LOCAL:=n}
REALSBU=${REALSBU:=n} REALSBU=${REALSBU:=n}
SAVE_CH5=${SAVE_CH5:=n}
if [[ "${NO_PROGRESS_BAR}" = "y" ]] ; then if [[ "${NO_PROGRESS_BAR}" = "y" ]] ; then
# shellcheck disable=SC2034 # shellcheck disable=SC2034
@ -354,6 +355,11 @@ if [[ "$COMPARE" = "y" ]]; then
load_file "${COMMON_DIR}/libs/func_compare.sh" 'Loading compare module' load_file "${COMMON_DIR}/libs/func_compare.sh" 'Loading compare module'
fi fi
# #
# save module
if [[ "$SAVE_CH5" = "y" ]]; then
load_file "${COMMON_DIR}/libs/func_save.sh" 'Loading save module'
fi
#
# optimize module # optimize module
if [[ "$OPTIMIZE" != "0" ]]; then if [[ "$OPTIMIZE" != "0" ]]; then
load_file optimize/optimize_functions 'Loading optimization module' load_file optimize/optimize_functions 'Loading optimization module'