Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Storing additional files in EEPROM #613

Open
hailfinger opened this issue Sep 30, 2024 · 3 comments
Open

Feature request: Storing additional files in EEPROM #613

hailfinger opened this issue Sep 30, 2024 · 3 comments

Comments

@hailfinger
Copy link

hailfinger commented Sep 30, 2024

Describe the bug

The recently added cacertder option enables storing a CA Certificate DER encoded file in the EEPROM. This is a really nice feature and conceptually similar to a use case I'm facing:
Sometimes, in an IoT fleet a SD card may die (age, temperature, ...) and the cryptographic key material and device configuration stored on it is gone as well. It would be cool if there was an option to store such info in the EEPROM so people could just put in a new SD card, use automatic HTTP boot to write an SD card image, then the newly written SD card image could restore device-specific data.

Alternatives: Non-key configuration data could theoretically be retrieved via https by the newly written image, however making cryptographic keys available for download is not exactly a best practice.

A single file with 4-8 kB size would suffice in my case (archive of keys+config).

Steps to reproduce the behaviour

Let a SD card die, use a blank SD card to re-provision a Pi 4B based IoT device via the awesome HTTP boot feature.

Device (s)

Raspberry Pi 4 Mod. B

Bootloader configuration.

[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0

On some devices, IMAGER_REPO_URL is set to provide a custom image for writing to the SD card.

System

No response

Bootloader logs

No response

USB boot

No response

NVMe boot

No response

Network (TFTP boot)

No response

@dividuum
Copy link

Not the requested solution, but the boot loader config supports comments afaik, so you could embed it as a base64 blob in there like this:

# f00base64doobdedoob

@timg236
Copy link
Collaborator

timg236 commented Oct 1, 2024

Yes mime-encoded blobs in the config file is the way to go here.
Arbitrary user-data blobs in the SPI firmware was been ruled out because it limits the ability to do A/B booting and adds a lot of complexity to upgrades. However, we might be able to increase the config size limit to 16KB on Pi5 without too much difficulty.

@hailfinger
Copy link
Author

Yes mime-encoded blobs in the config file is the way to go here. Arbitrary user-data blobs in the SPI firmware was been ruled out because it limits the ability to do A/B booting and adds a lot of complexity to upgrades. However, we might be able to increase the config size limit to 16KB on Pi5 without too much difficulty.

Thanks @dividuum @timg236 , I will try that.

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

No branches or pull requests

3 participants