How can I determine what version of the firmware will be installed by running rpi-update, without making any modifications to the installation?
2 Answers
rpi-update currently defaults to installing the firmware found in the head commit of the master branch of the http://github.com/Hexxeh/rpi-firmware repository. In order to find the build time and version of this (or any) firmware, one can fetch start.elf or start_x.elf and use strings:
strings start.elf | grep VC_BUILD_ID
VC_BUILD_ID_USER: dc4
VC_BUILD_ID_TIME: 14:42:19
VC_BUILD_ID_BRANCH: master
VC_BUILD_ID_TIME: Apr 21 2015
VC_BUILD_ID_HOSTNAME: dc4-XPS13-9333
VC_BUILD_ID_PLATFORM: raspberrypi_linux
VC_BUILD_ID_VERSION: 2d5ad04b63af4233440c3f7c8587108223201102 (clean)
Note that there will be a few minutes difference between the VC_BUILD_ID_TIME of start.elf and start_x.elf with the same VC_BUILD_ID_VERSION. This is due to them being built one after the other, from the same sources.
- 804
- 7
- 17
This is from the rpi-update (a bash script in /usr/bin) that shipped in the raspbian 2015-01-31 image, but I do not think it changes that much and it works to give a revision number. The value written to .firmware_revision is from here:
GITREV=$(curl -s ${REPO_API} | awk '{ if ($1 == "\"sha\":") { print substr($2, 2, 40) } }')
FW_REV=${FW_REV:-${GITREV}}
$REPO_API is https://api.github.com/repos/Hexxeh/rpi-firmware/git/refs/heads/master, which returns a hunk of json like this:
{
"ref": "refs/heads/master",
"url": "https://api.github.com/repos/Hexxeh/rpi-firmware/git/refs/heads/master",
"object": {
"sha": "5b0cbedacf45e111f02d925fa5b1cec9041fb279",
"type": "commit",
"url": "https://api.github.com/repos/Hexxeh/rpi-firmware/git/commits/5b0cbedacf45e111f02d925fa5b1cec9041fb279"
}
}
This is from git itself, which produces that sha hash. It's sort of obvious from the awk line that's what's being extracted, but to demonstrate, just run:
curl -s https://api.github.com/repos/Hexxeh/rpi-firmware/git/refs/heads/master | awk '{ if ($1 == "\"sha\":") { print substr($2, 2, 40) } }'
I just got back 5b0cbedacf45e111f02d925fa5b1cec9041fb279. So there you go.
- 60,325
- 17
- 117
- 234