Creating "unpacked" inside souces dir instead /tmp and referencing it via envar.

This commit is contained in:
Manuel Canales Esparcia 2006-06-01 18:42:08 +00:00
parent 5842156609
commit 82eb8c1420
6 changed files with 18 additions and 12 deletions

View file

@ -991,6 +991,7 @@ $HEADER
SRC= /sources
MOUNT_PT= $BUILDDIR
PKG_LST= $PKG_LST
MAKE_PID=\`pidof make | cut -d " " -f1\`
include makefile-functions

View 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

View file

@ -355,6 +355,7 @@ $HEADER
SRC= /sources
MOUNT_PT= $BUILDDIR
PKG_LST= $PKG_LST
MAKE_PID=\`pidof make | cut -d " " -f1\`
include makefile-functions

View file

@ -254,7 +254,7 @@ wrt_unpack() { # Unpack and set 'ROOT' var
(
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; \\

View file

@ -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

View file

@ -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