Take control over the environment#34
Merged
samueldr merged 19 commits intoTow-Boot:developmentfrom Jun 26, 2021
Merged
Conversation
e44da51 to
b74b27e
Compare
b74b27e to
eb50719
Compare
Merged
Contributor
Author
|
I think this breaks Looks like it needs environment TODO
|
eb50719 to
5735bb6
Compare
Seems there's no issues with the boards we target
This is because we'll be renaming the outputs. Serves no purpose to have a step in `preInstall` just to rename inputs we'd list in `filesToInstall. Additionally, not in this change, we'll be naming the outputs according to a variant identifier. Harder to do nicely within Nix.
The main difference is that it uses an area in the SPI Flash to save and read the environment.
Main gotcha here is that the `spi` variant will, subtly, provide a different binary!
5735bb6 to
bf59d67
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a weird name. But saying it "fixes
saveenvissues" is too diminutive. But hey, closes #19!What this changes
Environment
Two broad strokes. For release
002of Tow-Boot, we will only support environment in the SPI Flash for builds installed to the SPI Flash.Firmware installed to a shared storage media, starting with
002up to later will not allow saving the environment.To reduce confusion, a Tow-Boot install will strictly only use the environment in the same storage it is installed into. This means that SPI-installed firmware will read/save to the SPI Flash. Not implemented yet, but using the shared storage strategy, only when installed to a protective partition will Tow-Boot read/save the environment.
Variants
Since we need to change how the firmware acts depending on where it is installed, it was deemed the easiest method to just build different binaries. So we're now producing "variants", which in turn affect the configuration slightly. These are somewhat different from "simple" feature flags, as we are changing a fundamental property of the firmware.
It's not expected we'll gain many more variants. In fact the only one I expect to add is
mmcwhich (using the U-Boot nomenclature) will use the partition from the shared storage media to manage the environment.In other words, variants right now are strictly dealing with where the environment is read and saved.
File names and structure
It was coming, but since we needed to change file names for variants, I'm implementing the changes here. All files now report as "Tow-Boot". It apparently caused mild confusion in some users that the files were named "u-boot". Additionally, files are now stored in directories,
configfor the variant configuraiotns, andbinariesfor the "irrlevant to most users" files.The main stars, the disk images, are at the root of the result.
Future changes
Environment with shared storage
As stated previously "only when installed to a protective partition will Tow-Boot read/save the environment."
This requires some development. There are no environment saving strategies that allows this to work in a safe manner.
Since we want to save to the same partition Tow-Boot is installed into, we need the environment "in MMC". With that strategy, only an offset to a hardcoded mmc device is supported. This means that using Tow-Boot on an SD card would save the environment to an arbitrary offset on the internal MMC storage, which is likely to break things! So we'll need to track the mmc device the system booted from. Additionally, it would be better if we'd instead be able to work with partitions, and offsets internal to the partition, instead of raw device offsets. This way it is more likely we don't need to implement platform-specific differences.
Using the "in FAT" strategy for the Raspberry Pi family of hardware might work... Except that it is unclear what happens when booting from USB. It will require extensive testing.