Draft: debvm-run: support hurd
Would it be funny if debvm-run could run a disk image for hurd?
This is just a placeholder MR as it is still blocked by a few patches to be integrated so that it's possible to create a chrootless hurd image. So far, I just added a working qemu cmdline so that future-me knows what to do. There are a few issues.
- should debvm-create support hurd as well? If yes, it should probably run mmdebstrap chrootless wrapped inside another mmdebstrap which would add significantly to the complexity of debvm-run i think. Maybe mmdebstrap should contain that complexity instead?
- extracting the mach kernel means that one has to know its version as there is no symlink to
/boot/gnumach-1.8-486.gz - in addition to the kernel, at least /hurd/ext2fs.static and /hurd/exec.static also have to be copied to the outside -- more complexity
I have no personal use for hurd. I just find it interesting to get working.
What do you think?
EDIT: relevant tips for hurd in qemu: https://darnassus.sceen.net/~hurd-web/hurd/running/qemu/
EDIT2:
The current version does not do any sandwiching. The user is expected to run debvm in the sandwiching method of choice, be it inside a docker, podman, gitlab-runner, systemd-nspawn or without a chroot by using unshare or mmdebstrap --unshare-helper.
This is semi-blocked on having DPKG_ROOT support in openssh which would be nice for the testcases.
Auto-login is disabled right now as with the getty line in /etc/inittab one gets "getty[585]: Bad syntax". According to @sthibault it may just be that this feature isn't implemented yet in hurd.
Issue: debvm-create is not told the architecture (mmdebstrap is) and without trying to parse mmdebstrap arguments, debvm-create cannot know whether it should now create an ext4 image (for linux) or an ext2 image (for hurd)
This is a POC and many things are hidden behind a if false and hurd-amd64 isn't in. But with the changes in this MR I can do:
mmdebstrap --unshare-helper bin/debvm-create --output /tmp/rootfs.ext2 --release=unstable --initsystem=sysv -- --mode=chrootless --architecture=hurd-i386 http://ftp.ports.debian.org/debian-ports/ "deb http://ftp.ports.debian.org/debian-ports/ unreleased main"
bin/debvm-run -i /home/josch/tmp/rootfs.ext2
From there I can manually log in as root with no password.