Possible to recreate an arm6l device?
CamDavidsonPilon opened this issue ยท 7 comments
Hey, very useful package, team!
I'm wondering what part of this stack might need to change to build for an arm6 architecture? (We want to be able to build Rpi Zero images)
Here's what I attempted: I changed the EDITBASE_ARCH
to armv6l
, and running the run
command did produce an output.img
, but custom scripts didn't execute.
So,
- using the Raspberry Pi OS lite as the
input.img
, - global-replace of
armv7l
toarmv6l
in this repo, - Adding
EDITBASE_ARCH=armv6l
to myconfig.local
- with custom script:
set -x
set -e
export LC_ALL=C
source /common.sh
install_cleanup_trap
touch /home/pi/test.txt
uname -m > /home/pi/test.txt
echo $(uname -m) | cat
- running
docker build
and then thedocker run
command in the README,
Everything in the output looks like armv6l
(not unexpected) until the custom script, which writes out armv7l
to the terminal and to the file (I can enter_image
no problem, and running uname -m
also gives armv7l
).
Hey @CamDavidsonPilon the 32bit Raspberry Pi OS image is designed to support both CPU architectures. So you can boot any Pi image on Pi4 as well as on a Pi Zero running the older v6 architecture.
When it comes to modifying an image, the platform/CPU architecture you are doing that on does not matter it will not break anything in terms of compatibility with the Pi Zero.
Analogous you could boot an image with a Pi4 (which uses an ARMv8 SoC), make modifications, install new software and then boot the exact same image on a Pi Zero and run the newly installed software there.
They have chosen armv6 as the baseline for this reason so apt will only pull binaries for that platform. Even if you want to compile something it does not matter if you run on v6 or v7 as you will define this with the -march flag anyway and the toolchain used is the same for either architecture, all the ARM 32bit architectures are lumped together when it comes to tooling.
armv7 emulates better on x86 afaik so I think keeping to that architecture would be sensible.
Thank you @timonsku, that summed up my limited understanding of the architecture zoo better than I could have ๐ That should hopefully clear this up @CamDavidsonPilon?
That should hopefully clear this up @CamDavidsonPilon?
I think! I'm a bit of a novice at architectures, but I think I have a good enough mental model now to solve my problem :)
great! If you run into any issues let me know and we can probably solve it
I'm a bit of a novice at architectures,
Honestly, that makes two of us, I know enough to fiddle stuff together, but that's about it.