mirror of
https://github.com/linuxboot/heads.git
synced 2025-02-20 09:16:21 +00:00
flash.sh: persist serial in cbfs
Librem devices store their serial number as a text file in cbfs; persist this across flashes. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
This commit is contained in:
parent
e8e1032027
commit
a27affcc7d
@ -43,6 +43,12 @@ flash_rom() {
|
||||
preserve_rom /tmp/${CONFIG_BOARD}.rom \
|
||||
|| die "$ROM: Config preservation failed"
|
||||
fi
|
||||
# persist serial number from CBFS
|
||||
if cbfs -r serial_number > /tmp/serial 2>/dev/null; then
|
||||
echo "Persisting system serial"
|
||||
cbfs -o /tmp/${CONFIG_BOARD}.rom -d serial_number 2>/dev/null || true
|
||||
cbfs -o /tmp/${CONFIG_BOARD}.rom -a serial_number -f /tmp/serial
|
||||
fi
|
||||
|
||||
flashrom $FLASHROM_OPTIONS -w /tmp/${CONFIG_BOARD}.rom \
|
||||
|| die "$ROM: Flash failed"
|
||||
|
Loading…
x
Reference in New Issue
Block a user