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:
parent
fe534392a5
commit
5625a02e77
@ -9,6 +9,7 @@ kernel=""
|
|||||||
rootfs=""
|
rootfs=""
|
||||||
outfile=""
|
outfile=""
|
||||||
err=""
|
err=""
|
||||||
|
ubinize_seq=""
|
||||||
|
|
||||||
ubivol() {
|
ubivol() {
|
||||||
volid=$1
|
volid=$1
|
||||||
@ -81,6 +82,12 @@ ubilayout() {
|
|||||||
[ "$rootfs_type" = "ubifs" ] || ubivol $vol_id rootfs_data "" 1
|
[ "$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
|
while [ "$1" ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"--uboot-env")
|
"--uboot-env")
|
||||||
@ -137,8 +144,9 @@ if [ -z "$ubinizecfg" ]; then
|
|||||||
fi
|
fi
|
||||||
ubilayout "$ubootenv" "$rootfs" "$kernel" > "$ubinizecfg"
|
ubilayout "$ubootenv" "$rootfs" "$kernel" > "$ubinizecfg"
|
||||||
|
|
||||||
|
set_ubinize_seq
|
||||||
cat "$ubinizecfg"
|
cat "$ubinizecfg"
|
||||||
ubinize -o "$outfile" $ubinize_param "$ubinizecfg"
|
ubinize $ubinize_seq -o "$outfile" $ubinize_param "$ubinizecfg"
|
||||||
err="$?"
|
err="$?"
|
||||||
[ ! -e "$outfile" ] && err=2
|
[ ! -e "$outfile" ] && err=2
|
||||||
rm "$ubinizecfg"
|
rm "$ubinizecfg"
|
||||||
|
Loading…
Reference in New Issue
Block a user