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