diff --git a/CLFS/master.sh b/CLFS/master.sh index 7d35997..d3f7cb6 100755 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -991,6 +991,7 @@ $HEADER SRC= /sources MOUNT_PT= $BUILDDIR +PKG_LST= $PKG_LST MAKE_PID=\`pidof make | cut -d " " -f1\` include makefile-functions diff --git a/HLFS/master.sh b/HLFS/master.sh index f2bd4d7..c72b7d7 100755 --- a/HLFS/master.sh +++ b/HLFS/master.sh @@ -142,7 +142,7 @@ chapter5_Makefiles() { # Bootstrap or temptools phase esac # Insert instructions for unpacking the package and to set the PKGDIR variable. case $this_script in - *binutils* ) + *binutils* ) wrt_unpack "$FILE" 1 ;; # Do not delete an existing package directories *) wrt_unpack "$FILE" ;; @@ -154,7 +154,7 @@ chapter5_Makefiles() { # Bootstrap or temptools phase *binutils* ) # Dump the path to sources directory for later removal ( cat << EOF - @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\ + @ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\ echo "\$(MOUNT_PT)\$(SRC)/\$\$ROOT" >> sources-dir EOF ) >> $MKFILE.tmp @@ -434,7 +434,7 @@ chapter7_Makefiles() { # Create a bootable system.. kernel, bootscripts..e *bootscripts*) ( cat << EOF - @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\ + @ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\ rm -r \$(MOUNT_PT)\$(SRC)/\$\$ROOT @rm -r \`cat sources-dir\` && \\ rm sources-dir @@ -483,6 +483,7 @@ $HEADER SRC= /sources MOUNT_PT= $BUILDDIR +PKG_LST= $PKG_LST MAKE_PID=\`pidof make | cut -d " " -f1\` include makefile-functions diff --git a/LFS/master.sh b/LFS/master.sh index c58dffb..498254c 100755 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -355,6 +355,7 @@ $HEADER SRC= /sources MOUNT_PT= $BUILDDIR +PKG_LST= $PKG_LST MAKE_PID=\`pidof make | cut -d " " -f1\` include makefile-functions diff --git a/common/common-functions b/common/common-functions index 860c38a..e82870d 100644 --- a/common/common-functions +++ b/common/common-functions @@ -247,14 +247,14 @@ wrt_unpack() { # Unpack and set 'ROOT' var #----------------------------------# local FILE=$1 local optSAVE_PREVIOUS=$2 - + if [ "${optSAVE_PREVIOUS}" != "1" ]; then wrt_remove_existing_dirs "$FILE" fi ( cat << EOF @\$(call unpack,$FILE) - @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\ + @ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\ echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)/\$\$ROOT" > envars && \\ chown -R lfs \$(MOUNT_PT)\$(SRC)/\$\$ROOT EOF @@ -274,7 +274,7 @@ wrt_unpack2() { # ( cat << EOF @\$(call unpack2,$FILE) - @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\ + @ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\ echo "export PKGDIR=\$(SRC)/\$\$ROOT" > envars EOF ) >> $MKFILE.tmp @@ -293,7 +293,7 @@ wrt_unpack3() { # ( cat << EOF @\$(call unpack3,$FILE) - @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\ + @ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\ echo "export PKGDIR=\$(SRC)/\$\$ROOT" > envars EOF ) >> $MKFILE.tmp @@ -412,7 +412,7 @@ wrt_remove_build_dirs() { # local name=$1 ( cat << EOF - @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\ + @ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\ rm -r \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\ if [ -e \$(MOUNT_PT)\$(SRC)/$name-build ]; then \\ rm -r \$(MOUNT_PT)\$(SRC)/$name-build; \\ @@ -428,7 +428,7 @@ wrt_remove_build_dirs2() { # local name=$1 ( cat << EOF - @ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\ + @ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\ rm -r \$(SRC)/\$\$ROOT && \\ if [ -e \$(SRC)/$name-build ]; then \\ rm -r \$(SRC)/$name-build; \\ diff --git a/common/config b/common/config index 7a01da1..e0f18ea 100644 --- a/common/config +++ b/common/config @@ -91,6 +91,9 @@ RUN_FARCE=0 JHALFSDIR=$BUILDDIR/jhalfs LOGDIR=$JHALFSDIR/logs +#--- File listing package contents (from where package sources dir is extracted) +PKG_LST=unpacked + #--- ICA report log directory ICALOGDIR=$LOGDIR/ICA diff --git a/common/makefile-functions b/common/makefile-functions index e0975d6..c3fc21a 100644 --- a/common/makefile-functions +++ b/common/makefile-functions @@ -17,17 +17,17 @@ endef define unpack @cd $(MOUNT_PT)$(SRC) && \ - tar -xvf `ls -t $(1) | head -n1` > /tmp/unpacked + tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST) endef define unpack2 @cd $(MOUNT_PT)$(SRC) && \ - /tools/bin/tar -xvf `ls -t $(1) | head -n1` > /tmp/unpacked + /tools/bin/tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST) endef define unpack3 @cd $(SRC) && \ - tar -xvf `ls -t $(1) | head -n1` > /tmp/unpacked + tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST) endef define echo_report