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>
This commit is contained in:
Alexander Couzens 2019-11-03 03:18:35 +01:00
parent fe534392a5
commit 5625a02e77
No known key found for this signature in database
GPG Key ID: C29E9DA6A0DF8604

View File

@ -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"