[bug#63527,0/3] Initial attempt at rumpdisk support for the Hurd.

Message ID cover.1684177770.git.janneke@gnu.org
Headers
Series Initial attempt at rumpdisk support for the Hurd. |

Message

Janneke Nieuwenhuizen May 15, 2023, 7:35 p.m. UTC
Hi!

Some time ago we kind of promised to move forward with the Hurd[0] and while
we have had this pretty neat "childhurd" feature for some time[1], to really
do that we should get it to boot on real iron.  An important ingredient to
make that happen made it into Hurd upstream over a year ago[2]: rumpdisk
support making use of the NetBSD rumpkernel[3].

Building this rumpkernel is a bit tricksy, Debian uses an import of the NetBSD
git archive[4] --which is quite large--with some twenty-odd custom patches[5].
Some of us asked bug-hurd to document their rumpkernel support[6] or distribute
it in a less Debian-centric and more usual way to make it more digestible for
other parties (such as Guix) to adopt, but that was rejected at the time[7].

Inspired by Josselin Poiret's recent Hurd updates[8] our chats on IRC and
especially their succes in getting it to boot again on master[9], I decided to
just take the easiest route possible and build the rumpkernel from Debian's
salsa package git archive and its patch series.

The good news is that with this patch series the Hurd now has two additional
servers: pci.arbiter and rumpdisk.  Sadly, it currently hangs for me on

--8<---------------cut here---------------start------------->8---
start: pci.arbiter:
--8<---------------cut here---------------end--------------->8---

Anyway, while this builds, we probably do not want to rely on Debian's
packaging support in this way but I'm also not sure what would be a better
course of action right now.  Other than asking bug-hurd again to create an
upstream for their code outside/independent of their packaging.

Help and thoughts much appreciated!

See also:

    https://gitlab.com/janneke/guix/-/tree/wip-hurd

Greetings,
Janneke

PS: I build it like this

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix system image -t hurd-qcow2 gnu/system/examples/bare-hurd.tmpl
--8<---------------cut here---------------end--------------->8---

and start it doing

--8<---------------cut here---------------start------------->8---
guix shell qemu -- qemu-system-i386                     \
-m 1024                                                 \
--enable-kvm                                            \
--device rtl8139,netdev=net0                            \
--netdev user,id=net0,hostfwd=tcp:0.0.0.0:11022-:2222   \
--snapshot                                              \
--hda /gnu/store/0zmdmjafmz0hgzw3gszl38nd0n2bblq9-disk-image
--8<---------------cut here---------------end--------------->8---

[0] https://guix.gnu.org/en/blog/2020/deprecating-support-for-the-linux-kernel/
[1] https://guix.gnu.org/en/blog/2020/childhurds-and-substitutes/
[2] https://archive.fosdem.org/2022/schedule/event/dzammit/
[3] https://wiki.netbsd.org/rumpkernel
[4] https://salsa.debian.org/hurd-team/rumpkernel
[5] https://salsa.debian.org/hurd-team/rumpkernel/-/tree/master/debian/patches
[6] https://lists.gnu.org/archive/html/bug-hurd/2022-02/msg00020.html
[7] https://lists.gnu.org/archive/html/bug-hurd/2022-02/msg00051.html
[8] https://mail.gnu.org/archive/html/guix-patches/2023-03/msg01597.html
[9] https://issues.guix.gnu.org/63501

Janneke Nieuwenhuizen (3):
  DRAFT gnu: Add rumpkernel.
  gnu: hurd: Add rumpkernel.
  DRAFT system: hurd: Boot with pci.arbiter and rumpdisk.

 gnu/packages/hurd.scm | 232 +++++++++++++++++++++++++++++++++++++++++-
 gnu/system.scm        |  26 ++++-
 2 files changed, 248 insertions(+), 10 deletions(-)


base-commit: 555a41f31c9ec9f4344d00beb94f663b44017019
  

Comments

Janneke Nieuwenhuizen May 16, 2023, 1:48 p.m. UTC | #1
Hi,

Our patches for the rumpkernel crossbuild have been accepted upstream

    https://lists.gnu.org/archive/html/bug-hurd/2023-05//msg00276.html

which makes our rumpkernel package a lot nicer.  I suggest using the Debian
Salsa rumpkernel package as upstream for now until development has stabilized.

The pci.arbiter and rumpdisk are now also built statically and the .STATIC
variants are used for grub.cfg.  A copy/pasto was fixed for the grub.cfg.

Sadly, we only get just a little bit further, boot now hangs like this for me:

    start pci.arbiter: pci pci.arbiter: Starting the PCI system: Gratuitous error

Greetings,
Janneke

Janneke Nieuwenhuizen (3):
  gnu: Add rumpkernel.
  gnu: hurd: Add rumpkernel.
  DRAFT system: hurd: Boot with pci.arbiter and rumpdisk.

 gnu/local.mk                                  |   1 +
 gnu/packages/hurd.scm                         | 225 +++++++++++++++++-
 .../patches/rumpkernel-cross-build.patch      | 153 ++++++++++++
 gnu/system.scm                                |  25 +-
 4 files changed, 394 insertions(+), 10 deletions(-)
 create mode 100644 gnu/packages/patches/rumpkernel-cross-build.patch


base-commit: 555a41f31c9ec9f4344d00beb94f663b44017019
  
Janneke Nieuwenhuizen May 18, 2023, 8:45 a.m. UTC | #2
So, good progress and amazing news since the v2 series:

    * Add libpciaccess-0.17, and
    * Use that for the Hurd,
    * Actually setup translators for pci.arbiter and rumpdisk,
    * For QEMU update the memory-size to 2048MB, and
    * Suggest to do so in our bare-hurd.tmpl example, and
    * It boots! \o/

I had a lot of kind debugging help from Samuel Thibault and Sergey Bugaev on
libera.chat #hurd (https://logs.guix.gnu.org/hurd/2023-05-17.log#132259) as
well as on the bug-hurd list
(https://lists.gnu.org/archive/html/bug-hurd/2023-05//msg00326.html) to get
here, thank you!

With https://issues.guix.gnu.org/63501 by Josselin Poiret being merged
yesterday and this patch series we now have Rumpkernel/rumpdisk support for
the Hurd!

I've now succesfully been doing something like

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix system image -t hurd-raw gnu/system/examples/bare-hurd.tmpl
guix shell qemu -- qemu-system-i386                     \
-m 4096                                                 \
--enable-kvm                                            \
--device rtl8139,netdev=net0                            \
--netdev user,id=net0,hostfwd=tcp:0.0.0.0:11022-:2222   \
--snapshot                                              \
--no-reboot                                             \
--hda /gnu/store/r5dpblnfsj08jh3hdmn8s6l9xaczwn65-disk-image
--8<---------------cut here---------------end--------------->8---

and ssh into the Hurd VM again.

(Should we update the the Childhurds blogpost too, it suggest -m 512
 https://guix.gnu.org/en/blog/2020/childhurds-and-substitutes/?)

Greetings,
Janneke

Janneke Nieuwenhuizen (7):
  gnu: Add libpciaccess-0.17.
  gnu: hurd: Update libpciaccess to 0.17.
  gnu: Add rumpkernel.
  gnu: hurd: Add rumpkernel.
  hurd-boot: Setup pci-arbiter and rumpdisk translators.
  services: childhurd: Bump default qemu memory to 2048MB.
  system: hurd: Boot with pci.arbiter and rumpdisk.

 gnu/build/hurd-boot.scm            |  10 +-
 gnu/packages/hurd.scm              | 231 ++++++++++++++++++++++++++++-
 gnu/packages/xorg.scm              |  17 +++
 gnu/services/virtualization.scm    |   4 +-
 gnu/system.scm                     |  25 +++-
 gnu/system/examples/bare-hurd.tmpl |   4 +-
 6 files changed, 271 insertions(+), 20 deletions(-)


base-commit: 5b700945fb0b33eec410de8979cae2fbf0d4f118
  
Janneke Nieuwenhuizen May 18, 2023, 9:38 a.m. UTC | #3
Most everything mentioned in the v3 patch series still holds, apart from the
little fact that the rumpkernel will panic unless we use the complete time
patches from Debian Salsa glibc package management, as was discussed/suggested
on IRC by youpi:

    https://logs.guix.gnu.org/hurd/2023-05-17.log#150916

So one additional patch for cross-glibc, no changes in any of the patches
since v3.

Greetings,
Janneke

Janneke Nieuwenhuizen (8):
  gnu: glibc: Update time patches for the Hurd.
  gnu: Add libpciaccess-0.17.
  gnu: hurd: Update libpciaccess to 0.17.
  gnu: Add rumpkernel.
  gnu: hurd: Add rumpkernel.
  hurd-boot: Setup pci-arbiter and rumpdisk translators.
  services: childhurd: Bump default qemu memory to 2048MB.
  system: hurd: Boot with pci.arbiter and rumpdisk.

 gnu/build/hurd-boot.scm                       |  10 +-
 gnu/local.mk                                  |   2 +
 gnu/packages/cross-base.scm                   |  34 ++-
 gnu/packages/hurd.scm                         | 231 +++++++++++++++++-
 ...bc-2.35-hurd-clock_gettime_monotonic.patch | 137 +++++++++++
 ...glibc-2.35-hurd-clock_t_centiseconds.patch |  63 +++++
 gnu/packages/xorg.scm                         |  17 ++
 gnu/services/virtualization.scm               |   4 +-
 gnu/system.scm                                |  25 +-
 gnu/system/examples/bare-hurd.tmpl            |   4 +-
 10 files changed, 504 insertions(+), 23 deletions(-)
 create mode 100644 gnu/packages/patches/glibc-2.35-hurd-clock_gettime_monotonic.patch
 create mode 100644 gnu/packages/patches/glibc-2.35-hurd-clock_t_centiseconds.patch


base-commit: 5b700945fb0b33eec410de8979cae2fbf0d4f118