Discussion:
Scripts to build a Hurd distro
David Michael
2015-01-04 22:40:03 UTC
Permalink
Hi,

I've uploaded updates to my Hurd build scripts for Fedora 21, so I
thought I'd send a note about it in case it helps anyone else out there
who is interested in building Hurd outside Debian. (The project has
actually bloated into a fairly complete distro itself at this point.)
It can be downloaded from https://github.com/dm0-/gnuxc . Here are some
nifty things it can do:

* It runs GNU dmd as PID 1, with service definitions like mcron, lsh,
syslog, and the Hurd console client.

* It includes a Linux-libre kernel with a statically linked QEMU so that
it is still possible to boot Hurd virtually on machines with
unsupported hardware. (I use this for a Live CD type of setup and EFI
booting.)

* It has a Guile/Make file to bootstrap and build all the cross-compiler
RPMs in parallel with proper dependency tracking.

* It can use your CPU to heat your home or office.

An old dual-core MacBook Air takes about four hours to build the entire
OS and cross-compilers from scratch (including the huge packages like
IceCat), e.g. with "time (make -f setup-sysroot.scm -j8 && gmake -j8)".
It builds faster on systems with more CPU cores due to parallelizing
everything.

This is still mostly a learning experience for myself with a lot of
things I have yet to correct, so it should be considered far from
stable. Nevertheless, you might find something useful in there.

Happy hacking.

David
Justus Winter
2015-01-08 12:59:01 UTC
Permalink
Hi David :)

Quoting David Michael (2015-01-04 23:40:03)
Post by David Michael
I've uploaded updates to my Hurd build scripts for Fedora 21, so I
thought I'd send a note about it in case it helps anyone else out there
who is interested in building Hurd outside Debian. (The project has
actually bloated into a fairly complete distro itself at this point.)
It can be downloaded from https://github.com/dm0-/gnuxc . Here are some
* It runs GNU dmd as PID 1, with service definitions like mcron, lsh,
syslog, and the Hurd console client.
* It has a Guile/Make file to bootstrap and build all the cross-compiler
RPMs in parallel with proper dependency tracking.
* It can use your CPU to heat your home or office.
Most impressive!

For someone who isn't a Fedora user, is there an image I can download
and just boot to play around with? Also, do you hang out with the
Guix people? If not, you should ;). Also, are you in #hurd?
Post by David Michael
* It includes a Linux-libre kernel with a statically linked QEMU so that
it is still possible to boot Hurd virtually on machines with
unsupported hardware. (I use this for a Live CD type of setup and EFI
booting.)
Heh, nice hack. Note though that for the Hurd, booting from a CD
isn't much different than booting from a hard drive. grub-mkrescue
creates bootable cd/hd/usb images, from there on it's just a matter of
bootstrapping the Hurd the same way it is done for a normal
installation. Of course then you have iso9660fs as rootfs, which is
readonly, which causes problems for the "userland" bootstrap.

Cheers,
Justus
David Michael
2015-01-08 22:56:13 UTC
Permalink
Hi,

On Thu, Jan 8, 2015 at 7:59 AM, Justus Winter
Post by Justus Winter
Hi David :)
Quoting David Michael (2015-01-04 23:40:03)
Post by David Michael
I've uploaded updates to my Hurd build scripts for Fedora 21, so I
thought I'd send a note about it in case it helps anyone else out there
who is interested in building Hurd outside Debian. (The project has
actually bloated into a fairly complete distro itself at this point.)
It can be downloaded from https://github.com/dm0-/gnuxc . Here are some
* It runs GNU dmd as PID 1, with service definitions like mcron, lsh,
syslog, and the Hurd console client.
* It has a Guile/Make file to bootstrap and build all the cross-compiler
RPMs in parallel with proper dependency tracking.
* It can use your CPU to heat your home or office.
Most impressive!
For someone who isn't a Fedora user, is there an image I can download
and just boot to play around with? Also, do you hang out with the
Guix people? If not, you should ;). Also, are you in #hurd?
Sorry, I don't have a clean image ready for distribution at the
moment. Maybe I could build one and upload it somewhere over the
weekend.

I don't tend to use IRC on any regular basis, and although I follow
Guix development, I'm not really involved.
Post by Justus Winter
Post by David Michael
* It includes a Linux-libre kernel with a statically linked QEMU so that
it is still possible to boot Hurd virtually on machines with
unsupported hardware. (I use this for a Live CD type of setup and EFI
booting.)
Heh, nice hack. Note though that for the Hurd, booting from a CD
isn't much different than booting from a hard drive. grub-mkrescue
creates bootable cd/hd/usb images, from there on it's just a matter of
bootstrapping the Hurd the same way it is done for a normal
installation. Of course then you have iso9660fs as rootfs, which is
readonly, which causes problems for the "userland" bootstrap.
Thanks, I'll have to look into grub-mkrescue for booting options.

Linux-libre here is useful beyond just booting, though, like for cases
where I boot a Hurd SD card on a machine that relies on a USB3 network
adapter which only even had a Linux driver for a year or two. QEMU
can present Hurd with a boring old rtl8139 NIC that it knows how to
use, so networking is still functional. In this case, Linux-libre is
basically just the world's most inefficient hardware abstraction
layer.

Usable read-only root is also something I'd like to have eventually.
The build system currently puts tmpfs translators on /tmp and some
/var directories with a dumb script a la systemd-tmpfiles, but this
approach is not very complete at this point.

Thanks.

David
David Michael
2015-01-13 04:50:28 UTC
Permalink
Post by David Michael
Sorry, I don't have a clean image ready for distribution at the
moment. Maybe I could build one and upload it somewhere over the
weekend.
I've uploaded a disk image and screenshots here: http://dm0.me/projects/gnuxc/

David
Justus Winter
2015-01-13 10:16:47 UTC
Permalink
Quoting David Michael (2015-01-13 05:50:28)
Post by David Michael
I've uploaded a disk image and screenshots here: http://dm0.me/projects/gnuxc/
I'm very impressed, nice to see another Hurd distribution :)

Some thoughts:

* I do not like the login shell. Ymmv, but it exposes quite a bit of
system state to an unauthenticated user. We have `utils/loginpr.sh'
for a more traditional alternative.

* What's with process 8? Its parent is dmd, and it might be a fork
lingering around.

* When I tried the QEMU-based mode, I couldn't see the guests GRUB, it
looks like qemu was run with -curses saying `XXX graphical mode'.

* You are missing out on our DDE-based drivers, which is entirely our
fault for not having it in Hurd proper :(

* I wonder why your image is that big. `df' says that 4G are used,
that sounds like a lot. Also, why doesn't `df' show the root
filesystem when invoked without parameters? Funny. Also, use
`zerofree' before compressing and distributing an image.

Good stuff!

Justus
David Michael
2015-01-13 19:59:42 UTC
Permalink
On Tue, Jan 13, 2015 at 5:16 AM, Justus Winter
Post by Justus Winter
* When I tried the QEMU-based mode, I couldn't see the guests GRUB, it
looks like qemu was run with -curses saying `XXX graphical mode'.
The included QEMU is patched to draw directly to the Linux
framebuffer, and it falls back to "-display curses" to give a text
console if the graphics device isn't supported. Graphical displays
should work with i915, radeon, nouveau, and qxl drivers, so you can
add "-vga qxl" if you're testing in QEMU.

The "graphical mode" screen was probably the GRUB menu. I'll make
GRUB detect the "-display curses" fallback and use a VGA text menu for
the next update.
Post by Justus Winter
* I wonder why your image is that big. `df' says that 4G are used,
that sounds like a lot. Also, why doesn't `df' show the root
filesystem when invoked without parameters? Funny. Also, use
`zerofree' before compressing and distributing an image.
I think the image size is mostly due to IceCat (and everything else)
being built for development and debugging. Disk usage and build times
nearly doubled when I added IceCat. It has two directories in
/usr/lib at almost a gigabyte each.

Aside from a handful of native compiles, everything was installed to a
zero-filled raw image, but I'll try zerofree and maybe replace the
image if it helps compression.

I've also noticed the other issues you mentioned, but they haven't
gotten priority yet. I'll continue poking at the system and hopefully
get around to them.

Thanks for checking it out.

David
Samuel Thibault
2015-01-27 23:37:06 UTC
Permalink
Nice work! :)

Samuel

Continue reading on narkive:
Loading...