From: Alexander Couzens Date: Sun, 3 Nov 2019 02:18:35 +0000 (+0100) Subject: ubinize-image: set image sequence from SOURCE_DATE_EPOCH X-Git-Tag: v21.02.0-rc1~4658 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=5625a02e77bd293e999562141aab01746521f30b;p=openwrt%2Fopenwrt.git 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 --- 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"