[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: creating Hurd chroots on Linux using DPKG_ROOT chrootless mode



Hello,

Johannes Schauer Marin Rodrigues, le dim. 19 nov. 2023 07:45:16 +0100, a ecrit:
> So I downloaded
> https://cdimage.debian.org/cdimage/ports/stable/hurd-i386/debian-hurd.img.tar.gz
> and extracted /boot/gnumach-1.8-486.gz from it. I tried the following but it
> seems to get stuck and only prints "Booting from ROM...":
> 
>     qemu-system-i386 \
>         -m 1G \
>         -kernel gnumach-1.8-486.gz \
>         -append root=device:hd0s2 \
>         -drive file=debian-hurd-20210812.img,format=raw
> 
> What am I missing so that I can boot Hurd using qemu without grub?

Various things :)

- qemu doesn't seem to properly detect gzipped files, so you need to
  gunzip gnumach first

- apparently, booting gnumach with qemu-system-i386 broke at some point
  without -enable-kvm, so it is needed (and recommended anyway for
  speed), or qemu-system-x86_64

- gnumach itself doesn't contain any ext2fs driver or anything to load
  binaries, so this needs to be loaded like grub would. You can fetch
  /hurd/ext2fs.static and /hurd/exec.static from the image (e.g. into
  /tmp), and add:

--initrd '/tmp/ext2fs.static --multiboot-command-line=${kernel-command-line} --host-priv-port=${host-port} --device-master-port=${device-port} --exec-server-task=${exec-task} -T typed ${root} $(task-create) $(task-resume),/tmp/exec.static $(exec-task=task-create)'

So in the end this works for me:

qemu-system-i386 -enable-kvm -m 1G \
	-kernel /tmp/gnumach-1.8-486 \
	-append root=device:hd0s2 \
	--initrd '/tmp/ext2fs.static --multiboot-command-line=${kernel-command-line} --host-priv-port=${host-port} --device-master-port=${device-port} --exec-server-task=${exec-task} -T typed ${root} $(task-create) $(task-resume),/tmp/exec.static $(exec-task=task-create)' \
	-drive file=debian-hurd-20210812.img,format=raw

Samuel


Reply to: