diff --git a/CLFS/master.sh b/CLFS/master.sh index 73176c8..0a4254d 100644 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -357,17 +357,13 @@ chroot_Makefiles() { # # Insert instructions for unpacking the package and changing directories # if [ "$pkg_tarball" != "" ] ; then - case $this_script in - *util-linux) ROOT_Unpack "$pkg_tarball" ;; - *) CHROOT_Unpack "$pkg_tarball" ;; - esac + CHROOT_Unpack "$pkg_tarball" [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name" fi # # Select a script execution method case $this_script in - *kernfs) wrt_RunAsRoot "${this_script}" "${file}" ;; - *util-linux) ROOT_RunAsRoot "${file}" ;; + *kernfs) wrt_RunAsRoot "${file}" ;; *) CHROOT_wrt_RunAsRoot "${file}" ;; esac # @@ -456,8 +452,8 @@ boot_Makefiles() { # case $this_script in # The following 2 scripts are defined in the /boot directory but need # to be run as a root user. Set them up here but run them in another phase - *changingowner*) wrt_RunAsRoot "${this_script}" "${file}" ;; - *devices*) wrt_RunAsRoot "${this_script}" "${file}" ;; + *changingowner*) wrt_RunAsRoot "${file}" ;; + *devices*) wrt_RunAsRoot "${file}" ;; *fstab*) if [[ -n "$FSTAB" ]]; then LUSER_wrt_CopyFstab else diff --git a/CLFS2/master.sh b/CLFS2/master.sh index 50962fa..bb95d18 100644 --- a/CLFS2/master.sh +++ b/CLFS2/master.sh @@ -391,7 +391,7 @@ bootable_Makefiles() { # LUSER_wrt_RunAsUser "${file}" fi ;; - *chowning) wrt_RunAsRoot "${this_script}" "${file}" + *chowning) wrt_RunAsRoot "${file}" ;; *) LUSER_wrt_RunAsUser "${file}" ;; diff --git a/CLFS3/master.sh b/CLFS3/master.sh index 148f775..74f750f 100644 --- a/CLFS3/master.sh +++ b/CLFS3/master.sh @@ -385,7 +385,7 @@ bootable_Makefiles() { # LUSER_wrt_RunAsUser "${file}" fi ;; - *chowning) wrt_RunAsRoot "${this_script}" "${file}" + *chowning) wrt_RunAsRoot "${file}" ;; *) LUSER_wrt_RunAsUser "${file}" ;; diff --git a/HLFS/master.sh b/HLFS/master.sh index 7353115..7f9fbb6 100644 --- a/HLFS/master.sh +++ b/HLFS/master.sh @@ -362,7 +362,7 @@ chapter6_Makefiles() { # sysroot or chroot build phase # In the mount of kernel filesystems we need to set HLFS and not to use chroot. case "${this_script}" in *kernfs* | *changingowner*) - wrt_RunAsRoot "${this_script}" "${file}" + wrt_RunAsRoot "${file}" ;; *) # The rest of Chapter06 CHROOT_wrt_RunAsRoot "${file}" diff --git a/LFS/master.sh b/LFS/master.sh index 22a56e4..5ab772f 100644 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -136,7 +136,7 @@ chapter5_Makefiles() { # and date and disk usage again at the bottom of the log file. # The changingowner script must be run as root. case "${this_script}" in - *changingowner) wrt_RunAsRoot "${this_script}" "$file" ;; + *changingowner) wrt_RunAsRoot "$file" ;; *) LUSER_wrt_RunAsUser "$file" ;; esac @@ -252,7 +252,7 @@ chapter6_Makefiles() { # In the mount of kernel filesystems we need to set LFS # and not to use chroot. case "${this_script}" in - *kernfs) wrt_RunAsRoot "${this_script}" "$file" ;; + *kernfs) wrt_RunAsRoot "$file" ;; *) CHROOT_wrt_RunAsRoot "$file" ;; esac diff --git a/common/libs/func_wrt_Makefile b/common/libs/func_wrt_Makefile index f102c80..bfdcbbb 100644 --- a/common/libs/func_wrt_Makefile +++ b/common/libs/func_wrt_Makefile @@ -125,28 +125,6 @@ EOF #======== UNPACK ======= -#----------------------------------# -ROOT_Unpack() { # An alias, for clairity -#----------------------------------# - local FILE=$1 - local optSAVE_PREVIOUS=$2 - - if [[ "${optSAVE_PREVIOUS}" != "1" ]]; then -( -cat << EOF - @\$(call remove_existing_dirs,$FILE) -EOF -) >> $MKFILE.tmp - fi - -( -cat << EOF - @\$(call unpack,$FILE) - @\$(call get_pkg_root_LUSER) -EOF -) >> $MKFILE.tmp -} - #----------------------------------# LUSER_wrt_unpack() { # Unpack and set 'ROOT' var #----------------------------------# @@ -213,7 +191,7 @@ CHROOT_wrt_test_log() { # local TESTLOGFILE=$1 ( cat << EOF - @echo "export TEST_LOG=/\$(SCRIPT_ROOT)/test-logs/$TESTLOGFILE" >> envars && \\ + @echo "export TEST_LOG=\$(crTESTLOGDIR)/$TESTLOGFILE" >> envars && \\ echo "\$(nl_)\`date\`\$(nl_)" >test-logs/$TESTLOGFILE EOF ) >> $MKFILE.tmp @@ -228,12 +206,10 @@ EOF wrt_RunAsRoot() { # Some scripts must be run as root.. #----------------------------------# local MOUNT_ENV - local this_script=$1 - local file=$2 + local file=$1 case ${PROGNAME} in lfs ) MOUNT_ENV="LFS" ;; - blfs ) MOUNT_ENV="BLFS" ;; clfs ) MOUNT_ENV="CLFS" ;; clfs2 ) MOUNT_ENV="CLFS" ;; clfs3 ) MOUNT_ENV="CLFS" ;; @@ -249,18 +225,6 @@ EOF ) >> $MKFILE.tmp } -#----------------------------------# -ROOT_RunAsRoot() { # -#----------------------------------# - local file=$1 -( -cat << EOF - @( time { source envars && \$(CMDSDIR)/$file >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\ - \$(PRT_DU_CR) >>logs/\$@ -EOF -) >> $MKFILE.tmp -} - #----------------------------------# LUSER_wrt_RunAsUser() { # Execute script inside time { }, footer to log file #----------------------------------# @@ -280,7 +244,7 @@ CHROOT_wrt_RunAsRoot() { # local file=$1 ( cat << EOF - @( time { source envars && \$(crCMDSDIR)/$file >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\ + @( time { source envars && \$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\ \$(PRT_DU_CR) >>logs/\$@ EOF ) >> $MKFILE.tmp