diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2018-02-27 16:55:49 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2018-02-27 16:55:49 +0100 |
commit | 21a376ecd52874d4abb6ea31b4f3b3267023ac64 (patch) | |
tree | e7a522899124bdffb7e0410ef17330e92b8b0480 | |
parent | 551b469484ce2d0947bbde6f37e0c65c77304992 (diff) |
Upgrade installed packages
-rwxr-xr-x | build_rootfs.sh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/build_rootfs.sh b/build_rootfs.sh index 5b9f3c3..aa93849 100755 --- a/build_rootfs.sh +++ b/build_rootfs.sh @@ -15,8 +15,10 @@ base=`basename $src_tar` dir=/tmp/build.$$ files_dir=files/ instroot=$dir/rootfs +cache=dl/packages/$ARCH/$SUBARCH -OPKG=$SDK/staging_dir/host/bin/opkg +test -e $cache || mkdir -p $cache +OPKG="$SDK/staging_dir/host/bin/opkg -o $instroot --cache $cache" export IPKG_INSTROOT=$instroot unpack() { @@ -67,7 +69,7 @@ add_files() { add_package() { local ipkg=$1 - $OPKG -o $instroot install $ipkg + $OPKG install $ipkg } add_packages() { @@ -77,10 +79,20 @@ add_packages() { done } +update_packages() { + $OPKG update + local upgradable="$($OPKG list-upgradable|cut -d ' ' -f 1)" + for pkg in $upgradable; do + echo Upgrading $pkg + $OPKG upgrade $pkg + done +} + unpack add_files $files_dir $instroot add_file $metadata $metadata_dir $dir add_files templates/ $dir/templates/ add_packages bin/packages/${ARCH}/${SUBARCH} +update_packages pack #pack_squashfs |