Skip to content

Instantly share code, notes, and snippets.

@agners
Created January 30, 2023 14:10
Show Gist options
  • Save agners/3268b161b719a7d9c3cc8cc04b4acc4d to your computer and use it in GitHub Desktop.
Save agners/3268b161b719a7d9c3cc8cc04b4acc4d to your computer and use it in GitHub Desktop.
Get Raspberry Pi EEPROM version (CM4/RPi4, inspired by https://github.com/raspberrypi/rpi-eeprom/blob/master/rpi-eeprom-update)
#!/bin/sh
DT_BOOTLOADER_TS=${DT_BOOTLOADER_TS:-/proc/device-tree/chosen/bootloader/build-timestamp}
BOOTLOADER_CURRENT_VERSION=$(printf "%d" "0x$(od "${DT_BOOTLOADER_TS}" -v -An -t x1 | tr -d ' ' )")
date -u "-d@${BOOTLOADER_CURRENT_VERSION}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment