aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/ubinize-image.sh
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2019-11-03 03:18:35 +0100
committerAlexander Couzens <lynxis@fe80.eu>2019-11-03 04:20:21 +0100
commit5625a02e77bd293e999562141aab01746521f30b (patch)
tree9ce5cb5e598a9824e5997a13becff1b8a6a0848a /scripts/ubinize-image.sh
parentfe534392a5f3eb029033318a1957741e54a150d1 (diff)
downloadupstream-5625a02e77bd293e999562141aab01746521f30b.tar.gz
upstream-5625a02e77bd293e999562141aab01746521f30b.tar.bz2
upstream-5625a02e77bd293e999562141aab01746521f30b.zip
ubinize-image: set image sequence from SOURCE_DATE_EPOCH
Set the image sequence number to SOURCE_DATE_EPOCH. If not set, ubinize will use rand() as image sequence. Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Diffstat (limited to 'scripts/ubinize-image.sh')
-rwxr-xr-xscripts/ubinize-image.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/ubinize-image.sh b/scripts/ubinize-image.sh
index d82d81432d..c6f8bcefe5 100755
--- a/scripts/ubinize-image.sh
+++ b/scripts/ubinize-image.sh
@@ -9,6 +9,7 @@ kernel=""
rootfs=""
outfile=""
err=""
+ubinize_seq=""
ubivol() {
volid=$1
@@ -81,6 +82,12 @@ ubilayout() {
[ "$rootfs_type" = "ubifs" ] || ubivol $vol_id rootfs_data "" 1
}
+set_ubinize_seq() {
+ if [ -n "$SOURCE_DATE_EPOCH" ] ; then
+ ubinize_seq="-Q $SOURCE_DATE_EPOCH"
+ fi
+}
+
while [ "$1" ]; do
case "$1" in
"--uboot-env")
@@ -137,8 +144,9 @@ if [ -z "$ubinizecfg" ]; then
fi
ubilayout "$ubootenv" "$rootfs" "$kernel" > "$ubinizecfg"
+set_ubinize_seq
cat "$ubinizecfg"
-ubinize -o "$outfile" $ubinize_param "$ubinizecfg"
+ubinize $ubinize_seq -o "$outfile" $ubinize_param "$ubinizecfg"
err="$?"
[ ! -e "$outfile" ] && err=2
rm "$ubinizecfg"