Live data from Hacker News

The chroot Technique – a Swiss army multitool for Linux systems

livesys.se

91–100 of 123 posts

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

#92
post #57

It's kind of funny to see this being called a technique. It has been something I've done so many times to impressive results. To me, it's just something you can do, among a million other things, if you know enough about Linux.

"Technique" is a term for "something you can do, among a million other things, if you know enough about X".

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

#93

With qemu-user and binfmt you can even chroot into foreign CPU architectures, which is a handy thing to have when you mount your phone's eMMC to fix a hacking session gone wrong. Though these days you may want to look into things like systemd-nspawn instead of plain chroot.

> 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?

Yeah, that’s how we customize the NVidia Orin BSP before flashing it. Untar the rootfs onto a fast x86-64 machine, chroot into it, and use qemu-user to run a bunch of Arm commands and build some stuff. Way easier than trying to set up a cross-compiler toolchain.

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

#94
post #36

Earlier quoted context omitted.

Come to FreeBSD, we have just that - jails.

yup! FreeBSD jails are essentially what OP wants with chroot++. I was pretty puzzled when Docker and LXC came around as this whole new thing believed to have "never been done before"; FreeBSD had supported a very similar concept for years before security groups were added in Linux. Jails and ezjail were stellar to make mini no-overhead containers when running various services on a server. Being able to archive them a…

Solaris Zones too. Absolute magic, many years before Docker and friends.

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

#95

With qemu-user and binfmt you can even chroot into foreign CPU architectures, which is a handy thing to have when you mount your phone's eMMC to fix a hacking session gone wrong. Though these days you may want to look into things like systemd-nspawn instead of plain chroot.

Of course you don't need it, but if you're into docker images, docker or podman can be configured to use QEMU when running a container too.

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

#96
post #4

I actually wish that instead of docker & etc we had just gotten a better chroot... Or maybe just a new kernel syscall that is chroot()++.

How do you imagine a "better chroot" would differ from a Docker container? Seems to me like that's exactly what Docker is.

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

#99
post #6

Earlier quoted context omitted.

Gentoo’s stage3 would like to say a word

Debian's debootstrap would also like to participate in this discussion

Debootstrap is for installing a minimal system into a dir from another running system (so only useful in the setup phase), whereas arch-chroot is used to access an already installed system (e.g. when booting off a USB stick to fix something). They're not the same thing. The debootstrap-like tool in arch is called pacstrap.
Post reply on HN