summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh3
-rwxr-xr-xscripts/build_rootfs.sh13
2 files changed, 12 insertions, 4 deletions
diff --git a/build.sh b/build.sh
index 0d4b24d..800e410 100755
--- a/build.sh
+++ b/build.sh
@@ -155,6 +155,9 @@ build_procd() {
build_tarball() {
export SDK="$(pwd)/${sdk}"
local opts="-m $metadata"
+ if test ${ver} != snapshot; then
+ opts="$opts --upgrade"
+ fi
fakeroot scripts/build_rootfs.sh $rootfs $opts -o $lxc_tar --arch=${arch} --subarch=${subarch} --packages="${packages}" --files="${files}"
}
diff --git a/scripts/build_rootfs.sh b/scripts/build_rootfs.sh
index 7f7c575..fe21df9 100755
--- a/scripts/build_rootfs.sh
+++ b/scripts/build_rootfs.sh
@@ -3,7 +3,7 @@
set -e
usage() {
- echo "Usage: $0 [-a|--arch <arch>] [-s|--subarch <subarch>] [-o|--output <dst file>] [-p|--packages <packages>] [-f|--files <files>] [-m|--metadata <metadata.yaml>] <src tar>"
+ echo "Usage: $0 [-a|--arch <arch>] [-s|--subarch <subarch>] [-o|--output <dst file>] [-p|--packages <packages>] [-f|--files <files>] [-m|--metadata <metadata.yaml>] [-u|--upgrade] <src tar>"
exit 1
}
@@ -14,8 +14,9 @@ dst_file=/dev/stdout
files=
metadata=
metadata_dir=
+upgrade=
-temp=$(getopt -o "a:o:p:s:f:m:" -l "arch:,output:,packages:,subarch:,files:,metadata:,help" -- "$@")
+temp=$(getopt -o "a:o:p:s:f:m:u:" -l "arch:,output:,packages:,subarch:,files:,metadata:,upgrade,help" -- "$@")
eval set -- "$temp"
while true; do
case "$1" in
@@ -33,6 +34,8 @@ while true; do
metadata=`basename $2`
metadata_dir=`dirname $2`
shift 2;;
+ -u|--upgrade)
+ upgrade=1; shift 1;;
--help)
usage;;
--)
@@ -122,7 +125,7 @@ add_packages() {
update_packages() {
$OPKG update
- local upgradable="$($OPKG list-upgradable|cut -d ' ' -f 1)"
+ local upgradable="$($OPKG list-upgradable|grep -e '^.* - .* - .*'|cut -d ' ' -f 1)"
for pkg in $upgradable; do
echo Upgrading $pkg
$OPKG upgrade $pkg
@@ -144,7 +147,9 @@ if test -n "$metadata"; then
fi
add_files templates/ $dir/templates/
add_packages bin/packages/${arch}/${subarch}
-update_packages
+if test -n "$upgrade"; then
+ update_packages
+fi
install_packages "$packages"
add_files $files_dir $instroot
if test -n "$files"; then