Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Update to always pull latest raspberry pi firmware from github using API #15

Merged
merged 2 commits into from
May 24, 2020

Conversation

brian-provenzano
Copy link
Contributor

@brian-provenzano brian-provenzano commented May 9, 2020

What was changed / proposed change

Currently reving the firmware for the raspberrypi requires manually updating the script. This PR would instead use the github api to always pull the latest firmware tarball eliminating this need.

Update

Per comment , added the ability to user select raspberry pi firmware version via an environment variable RASPBERRY_PI_FIRMWARE

  • If unset, the script uses a known good version ( set as DEFAULT_GOOD_PI_VERSION in the script)
  • Set to latest which instructs the script to always pull the latest version for the raspberry pi fimrware repo (e.g. export RASPBERRY_PI_FIRMWARE=latest)
  • Set to a specific version which instructs the script to use that version (e.g. export RASPBERRY_PI_FIRMWARE="1.20200212")

@brian-provenzano brian-provenzano force-pushed the auto-pull-latest-firmware branch from 01d8bd5 to 3ba4008 Compare May 9, 2020 02:54
@brian-provenzano brian-provenzano force-pushed the auto-pull-latest-firmware branch from 3ba4008 to cd86a27 Compare May 9, 2020 15:46
@sgielen
Copy link
Owner

sgielen commented May 11, 2020

Thank you @brian-provenzano, this is nice and well-written.

Even though pulling the latest firmware is very unlikely to ever fail, considering the well-tested nature of the raspberry pi firmware, I'd still like to make this behaviour optional and to use a "known-good" firmware by default. This way, people can use the latest firmware easily if they want to, or use a known-good firmware otherwise.

Could you make this change? For example, we could add a RASPBERRY_PI_FIRMWARE environment variable, that could be:

  • unset, in which case it is initialized to a known good version,
  • set by the caller to some version they want, or
  • set to "latest" in which case your code checks if jq is available and pulls the latest tag.

Bonus points if you could add this behaviour to the README as well. :)

Also, I have one more request: I have some instructions here on compiling kernel modules for the kernel shipped within the raspberry pi firmware, but those instructions use a hard-coded firmware version. I'd like to read the firmware version from the disk somehow when k3os is running. I think the tarball contains it, but we might not copy it to the boot. This is totally optional, and I'll merge your PR if you don't feel like adding it, but if you could take a look whether we could include that version in the image somehow, that'd be cool :)

@brian-provenzano
Copy link
Contributor Author

Thank you @brian-provenzano, this is nice and well-written.

Even though pulling the latest firmware is very unlikely to ever fail, considering the well-tested nature of the raspberry pi firmware, I'd still like to make this behaviour optional and to use a "known-good" firmware by default. This way, people can use the latest firmware easily if they want to, or use a known-good firmware otherwise.

Could you make this change? For example, we could add a RASPBERRY_PI_FIRMWARE environment variable, that could be:

* unset, in which case it is initialized to a known good version,

* set by the caller to some version they want, or

* set to "latest" in which case your code checks if `jq` is available and pulls the latest tag.

Bonus points if you could add this behaviour to the README as well. :)

OK, I can look into this. I'll try to scrape together some time in the next week.

Also, I have one more request: I have some instructions here on compiling kernel modules for the kernel shipped within the raspberry pi firmware, but those instructions use a hard-coded firmware version. I'd like to read the firmware version from the disk somehow when k3os is running. I think the tarball contains it, but we might not copy it to the boot. This is totally optional, and I'll merge your PR if you don't feel like adding it, but if you could take a look whether we could include that version in the image somehow, that'd be cool :)

I might save this one for another time if that is OK. Probably better if it is a change of its own anyway. :)

@brian-provenzano
Copy link
Contributor Author

Thank you @brian-provenzano, this is nice and well-written.

Even though pulling the latest firmware is very unlikely to ever fail, considering the well-tested nature of the raspberry pi firmware, I'd still like to make this behaviour optional and to use a "known-good" firmware by default. This way, people can use the latest firmware easily if they want to, or use a known-good firmware otherwise.

Could you make this change? For example, we could add a RASPBERRY_PI_FIRMWARE environment variable, that could be:

* unset, in which case it is initialized to a known good version,

* set by the caller to some version they want, or

* set to "latest" in which case your code checks if `jq` is available and pulls the latest tag.

Bonus points if you could add this behaviour to the README as well. :)

Made the above change and also updated the README to reflect the new feature.
I'm no the greatest bash scripter, so let me know if this works :)

@brian-provenzano brian-provenzano force-pushed the auto-pull-latest-firmware branch 3 times, most recently from e620df6 to df7e16d Compare May 17, 2020 02:18
@brian-provenzano brian-provenzano force-pushed the auto-pull-latest-firmware branch from df7e16d to cc1e45f Compare May 17, 2020 17:05
@sgielen sgielen merged commit d130d12 into sgielen:master May 24, 2020
@sgielen
Copy link
Owner

sgielen commented May 24, 2020

Thanks a lot @brian-provenzano !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants