Live data from Hacker News

The chroot Technique – a Swiss army multitool for Linux systems

livesys.se

121–123 of 123 posts

Re: The chroot Technique – a Swiss army multitool for Linux systems

#121

Earlier quoted context omitted.

This is very cool! I had no idea you could chroot into different architectures.

Well technically you can't, in the sense that chroot has no idea you're doing it... the magic of binfmt support in the kernel (setup for qemu by the post-install script for qemu-user-static I believe) basically lets you run any architecture's binary that qemu-user-* supports just by trying to execute it natively, it basically just translates the execution of "./other-arch-cmd" into "qemu-user-static ./other-arch-cmd"…

Thank you. That makes sense. Even though there is a translation layer via qemu-user-static, still having the facilities to have that transparently is very fantastic. And also very fascinating and a revelation to learn about for a bearded old timer like me who has never seen it before.

Re: The chroot Technique – a Swiss army multitool for Linux systems

#122
post #72

Earlier quoted context omitted.

> you can even chroot into foreign CPU architectures, which is a handy thing to have when you mount your phone's eMMC This sounds very interesting! What's the scenario where you'd do this? Would you be, for example, emulating an ARM processor with qemu on an x86 computer and chrooting into Android on an eMMC?

I've done this to build custom RPi images. Way faster than trying to build on a low power ARM platform, and way less fragile than cross compilers.

Same here, and it is blazingly fast for me running on a M2 macbook air using macOS built in virtulization framework to run an arm64 Debian.

Probably even faster on Asahi Linux, but having both macOS and a fast Debian at the same time is soo neat :)

Re: The chroot Technique – a Swiss army multitool for Linux systems

#123
post #72

Earlier quoted context omitted.

I've done this to build custom RPi images. Way faster than trying to build on a low power ARM platform, and way less fragile than cross compilers.

Same here, and it is blazingly fast for me running on a M2 macbook air using macOS built in virtulization framework to run an arm64 Debian. Probably even faster on Asahi Linux, but having both macOS and a fast Debian at the same time is soo neat :)

Perhaps it's fast because M2 is already arm64.
Post reply on HN