summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2020-05-03 12:19:42 +0000
committerMikael Magnusson <mikma@users.sourceforge.net>2020-05-03 21:35:18 +0000
commit0f1f27dc0f37ee7ec4b11908ca569d0e0194e0be (patch)
treecab3c1508989c65e44d0e1a35d3e1cc1e7ad0f51
parentccce3798e192bffec76bdee6e308b3eeabf0964d (diff)
Use version specific cache dirs
Each version needs a separate package cache since package file names aren't unique between versions.
-rwxr-xr-xbuild.sh2
-rwxr-xr-xscripts/build_rootfs.sh11
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 <arch>] [-d|--disable-services <services>] [-s|--subarch <subarch>] [-o|--output <dst file>] [-p|--packages <packages>] [-f|--files <files>] [-m|--metadata <metadata.yaml>] [-u|--upgrade] <src tar>"
+ echo "Usage: $0 [-a|--arch <arch>] [-v|--version <version>] [-d|--disable-services <services>] [-s|--subarch <subarch>] [-o|--output <dst file>] [-p|--packages <packages>] [-f|--files <files>] [-m|--metadata <metadata.yaml>] [-u|--upgrade] <src tar>"
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"