Creating "unpacked" inside souces dir instead /tmp and referencing it via envar.
This commit is contained in:
parent
5842156609
commit
82eb8c1420
6 changed files with 18 additions and 12 deletions
|
@ -991,6 +991,7 @@ $HEADER
|
|||
|
||||
SRC= /sources
|
||||
MOUNT_PT= $BUILDDIR
|
||||
PKG_LST= $PKG_LST
|
||||
MAKE_PID=\`pidof make | cut -d " " -f1\`
|
||||
|
||||
include makefile-functions
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -355,6 +355,7 @@ $HEADER
|
|||
|
||||
SRC= /sources
|
||||
MOUNT_PT= $BUILDDIR
|
||||
PKG_LST= $PKG_LST
|
||||
MAKE_PID=\`pidof make | cut -d " " -f1\`
|
||||
|
||||
include makefile-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; \\
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in a new issue