-
Notifications
You must be signed in to change notification settings - Fork 499
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
Export to .img for embedded computers #440
Comments
Needs more info
|
More info you shall have! Put it above for easy reference. Also, here is another account of some folks pursuing the same thing: |
This should be moved to Buildkit repo. We are open to adding more exporters if they don't add significant maintenance cost and the contributor is willing to fix the bugs later. Another possibility is to define API so that container images can be used as exporters so they can define a custom behavior, similar to frontends support. Some of it you can already do today, eg you can create img file inside your build and export with a local exporter. But with a custom exporter, this could be done more efficiently. |
If you want a fairly clear and detailed look at how I'm doing it currently, here is a link to my build script. Please feel free to move the issue, I will of course follow it. https://github.com/faddat/sos/blob/no-kernel/build.sh Because I do want this to be a binary free affair, I will be looking into what the Docker - exporter binary in the toolbox folder does. Other than that, it is a somewhat straightforward although complex process of:
And after that you have a bootable raspberry pi image. It's pretty cool. Not only is it pretty cool, it's actually a great deal faster than the current standard for building these images. Recently, I decomposed this process into a couple of images docker.io/faddat/sos-base
docker.io/faddat/sos
docker.io/faddat/starport
All right so that is my roundup. I broke it up so that it could be faster and also so that I can build images for many devices in SOS and then also build images for many devices in Starport. |
Moving to buildkit |
Hi, I just used buildx to replace a copy-binfmt system found at https://github.com/pikvm/os.
https://github.com/faddat/os/tree/real-starport/starport
And at this point, all I'm really doing is building a wrapper around buildx.
It may make sense to investigate a direct "export to .img" feature that initially just targets arm64 pi 3 and 4 and branches outward from there into more devices-- I reckon this would be great for ecosystem growth.
Needs more info
Is it a raw image format?
Yes, I think so. Here is how we are creating the image now:
https://github.com/faddat/spos/blob/76f8d720e0b67412814f7f9f7e9590b5ee30eb48/build.sh#L60-L108
What's the file system?
200 MB boot partition (FAT)
Rest of image is / (EXT4)
Does it have a partition table? If so, is it GPT? Or MBR?
I think mklabel msdos means MBR, right? Not 100% sure.
Does it contain kernel? What about boot loader?
bootloader
kernel: Arch linux arm's aarch64 build pretty much runs mainline.
I copy arch linux arm into the image like:
https://github.com/faddat/spos/blob/76f8d720e0b67412814f7f9f7e9590b5ee30eb48/Dockerfile#L12-L13
Does that help? Making these images is pretty tough now, but I reckon some automation could make it very easy and expand what can be done with device/application specific images.
The text was updated successfully, but these errors were encountered: