summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Mubashshir <ahm@jadupc.com>2023-06-07 19:35:22 +0600
committerLibravatar Mubashshir <ahm@jadupc.com>2023-06-07 19:35:22 +0600
commitb140574a55e6db181ac321a560e52c73323e4a68 (patch)
treed7174933a814f4698f6096a6d78f677709c8bfd3
parentae9bb0c7b4a55756f703e49a581f228956ab13d4 (diff)
downloadpatches-b140574a55e6db181ac321a560e52c73323e4a68.tar.gz
patches-b140574a55e6db181ac321a560e52c73323e4a68.zip
armbian2shopno: Automated image versioning
Signed-off-by: Mubashshir <ahm@jadupc.com>
-rw-r--r--patch/armbian2shopno8
1 files changed, 8 insertions, 0 deletions
diff --git a/patch/armbian2shopno b/patch/armbian2shopno
index ff5cf19..c047e18 100644
--- a/patch/armbian2shopno
+++ b/patch/armbian2shopno
@@ -1,4 +1,10 @@
#!/bin/sh
+VERSION=4.11
+BOARD=$(
+ xargs -0 printf '%s\n' < /sys/firmware/devicetree/base/model |
+ xargs printf '%s\n' | tail -n2 | tr -d '[:space:][:punct:]'
+)
+
if [ "$(id -u)" -gt 0 ]; then
echo "Run with sudo..." >&2
exit
@@ -36,3 +42,5 @@ if dpkg -s armbian-bullseye-desktop-xfce > /dev/null 2>&1; then
apt purge -y armbian-bullseye-desktop-xfce
fi
apt install -y base-files shopno-os-base shopno-os-apt-notifier shopno-os-log-sync
+
+date "+$VERSION-$BOARD-%Y%m%d" | tee /etc/img-release | xargs -0 printf 'Build version: %s\n'