From 0f1f27dc0f37ee7ec4b11908ca569d0e0194e0be Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 3 May 2020 12:19:42 +0000 Subject: Use version specific cache dirs Each version needs a separate package cache since package file names aren't unique between versions. --- build.sh | 2 +- scripts/build_rootfs.sh | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 60c24af..cefbf12 100755 --- a/build.sh +++ b/build.sh @@ -262,7 +262,7 @@ build_tarball() { esac fi - $cmd $rootfs $opts -o $tarball --disable-services="sysfixtime sysntpd led" --arch=${arch} --subarch=${subarch} --packages="${allpkgs}" --files="${files}" + $cmd $rootfs $opts -o $tarball --disable-services="sysfixtime sysntpd led" --arch=${arch} --subarch=${subarch} --version=${ver} --packages="${allpkgs}" --files="${files}" } build_metadata() { diff --git a/scripts/build_rootfs.sh b/scripts/build_rootfs.sh index b7ee533..dd8ca1d 100755 --- a/scripts/build_rootfs.sh +++ b/scripts/build_rootfs.sh @@ -3,12 +3,13 @@ set -e usage() { - echo "Usage: $0 [-a|--arch ] [-d|--disable-services ] [-s|--subarch ] [-o|--output ] [-p|--packages ] [-f|--files ] [-m|--metadata ] [-u|--upgrade] " + echo "Usage: $0 [-a|--arch ] [-v|--version ] [-d|--disable-services ] [-s|--subarch ] [-o|--output ] [-p|--packages ] [-f|--files ] [-m|--metadata ] [-u|--upgrade] " exit 1 } arch=x86 subarch=64 +version= packages= dst_file=/dev/stdout files= @@ -17,12 +18,14 @@ metadata= metadata_dir= upgrade= -temp=$(getopt -o "a:d:o:p:s:f:m:u:" -l "arch:,disable-services:,output:,packages:,subarch:,files:,metadata:,upgrade,help" -- "$@") +temp=$(getopt -o "a:d:o:p:s:f:m:u:v:" -l "arch:,disable-services:,output:,packages:,subarch:,files:,metadata:,upgrade,version:,help" -- "$@") eval set -- "$temp" while true; do case "$1" in -a|--arch) arch="$2"; shift 2;; + -v|--version) + version="$2"; shift 2;; -d|--disable-services) services="$2"; shift 2;; -s|--subarch) @@ -46,7 +49,7 @@ while true; do esac done -if [ $# -ne 1 ]; then +if [ $# -ne 1 -o -z "$version" ]; then usage fi @@ -55,7 +58,7 @@ base=`basename $src_tar` dir=/tmp/build.$$ files_dir=files/ instroot=$dir/rootfs -cache=dl/packages/$arch/$subarch +cache=dl/packages/$version/$arch/$subarch test -e $cache || mkdir -p $cache OPKG="env LD_PRELOAD= IPKG_NO_SCRIPT=1 IPKG_INSTROOT=$instroot $SDK/staging_dir/host/bin/opkg -o $instroot --cache $cache" -- cgit v1.2.3