armbian_build/packages/bsp/common/usr/lib/armbian/armbian-apt-updates
Igor Pečovnik f416c35c16
Adding minimal image (#1504)
* Minimal build setup (#1463)
* Netplan folder check & armbian-tools dependency on expect (and tcl) solved (#1464)
* Prevent netplan configration if it is not installed
* Resolved expect dependecy of armbian-tools
* More packages added for armbian-tools
* Added python3-apt and rsyslog to minimal installation
* Debootstrap variant doesn't play nice. We loose networking and it affects standard builds as well. Removing.
* Python-to-Bash conversion (#1470)
* Remove python3-apt dependency from BSP package, fix netplan error also on Disco and putting back varint=minbase ... tested Disco, Bionic
* Distinguish package list: *-minimal.list and *-desktop.list
* Enable Wireguard back which was removed by mistake. https://github.com/armbian/build/issues/1471
* Having minbase debootstrap variant for all will require further adjustements with current package base - backward compatibility. Minimal image is now Python free but need further testings ...
* Add wireless-regdb and crda to the pakage base, fix Ubuntu keyring warning while debootstrap.
* Add figlet to sort out missing fonts
* Moving few packages here and there. Bugfix when creating a cache package list
* Manually compared base images - they are the same with small insignificant difference. Minimal image has to be futher tuned
* Adjustements for bash powered lsb_release, adding some needed packages
* Fixed (no) network problems on Bionic/Disco
* Add rsync to debootstrap_list and few minor fixes
* Adjust text in lsb_release
* Olimex Micro A20: fix wrong boot config
* Remove duplicate depenedency
* Odroid C1: adjust kernel config
2019-08-16 19:21:12 +02:00

56 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
#
# 40-updates - create the list of packages for update with caching
# Copyright (c) 2015 Arkadiusz Raj
#
# Author: Arkadiusz Raj arek.raj@gmail.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
lock_file='/var/run/armbian-motd-updates.lock'
if { set -C; 2>/dev/null >${lock_file}; }; then
trap "rm -f ${lock_file}" EXIT
else
exit 0
fi
# give up if packages are broken
[[ ! $(dpkg -l | grep ^..r) ]] && exit 0
myfile="/var/cache/apt/archives/updates.number"
# update procedure
DISTRO=$(lsb_release -c | cut -d ":" -f 2 | tr -d '[:space:]') && DISTRO=${DISTRO,,}
# run around the packages
upgrades=0
security_upgrades=0
while IFS= read -r LINE; do
# increment the upgrade counter
(( upgrades++ ))
# keep another count for security upgrades
[[ ${LINE} == *"${DISTRO}-sec"* ]] && (( security_upgrades++ ))
done < <(apt-get upgrade -s -qq | sed -n '/^Inst/p')
cat >|${myfile} <<EOT
NUM_UPDATES="${upgrades}"
NUM_SECURITY_UPDATES="${security_upgrades}"
DATE="$(date +"%Y-%m-%d %H:%M")"
EOT
exit 0