- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| base_sys | ||
| shared-gnu-hacks/etc/portage | ||
| .gitignore | ||
| COPYING | ||
| default.config | ||
| mkhurd.sh | ||
| mkhurd64.sh | ||
| README.md | ||
| TODO.md | ||
gentoo-hurd
Scripts to build a Gentoo GNU/Hurd bootable image.
Very much work-in-progress and subject to change.
TODO
See TODO.
Instructions
sys-devel/crossdev and sys-apps/merge-usr are required.
config file lives in default.config.
Preparation
# emerge --sync # lots of recent changes
# emerge --update sys-devel/crossdev # lots of recent changes
# emerge --noreplace app-eselect/eselect-repository && eselect repository create crossdev
# crossdev -t i686-gnu -oS gentoo # x86_64-gnu works too
Creating the actual image
Prime the sysroot (/usr/i686-gnu or /usr/x86_64-gnu) with workarounds
and needed packages:
# mkdir /root/hurd/mnt-i686 # or /root/hurd/mnt-x86_64, as appropriate (configurable via TARGET)
# ./mkhurd.sh prepare
Create the hurd.ext2 image itself:
# ./mkhurd.sh create
Replace with ./mkhurd64.sh for x86_64.
Using it
As a QEMU image (preferred method)
The script can start QEMU for you with ./mkhurd.sh qemu, or run:
$ qemu-system-i386 -drive file=hurd-i686-preview.qcow2,format=qcow2 -m 2G -net user,hostfwd=tcp:127.0.0.1:2222-:2222 -net nic,model=ne2k_pci --enable-kvm -M q35
To log in, input login root, then use gnuhurdrox as the password. Upon logging in,
you can run ./setup-net.sh and /etc/init.d/sshd restart to get SSH. Connect
via ssh -p 2222 root@127.0.0.1 on your host.
Using real hardware (experimental, here be dragons!)
As the produced hurd.ext2 is a disk image containing the base system, you can clone it in a real hard drive using dd by running:
# dd if="<path to the image>"/hurd.ext2 of="<path to the hard drive>"
Layout
mkhurd*.sh
mkhurd.sh and mkhurd64.sh are entry points, accepting arguments:
- prepare (prime the sysroot)
- create (create ext2 image; unmounts when done)
- mount (mount the image for manual inspection)
- boot/test/qemu (launch QEMU)
- unmount (unmount the image)
Hack directories
i686-gnu-hacks and x86_64-gnu-hacks are for workarounds that get
rsync-ed over to the sysroot upon prepare. The same applies for
shared-gnu-hacks which is for all arches.
base_sys directory
base_sys is copied with rsync over to the image upon create. base_sys/_errata.sh
has fixups which should only apply to the target, not to the sysroot.
base_sys.custom directory (optional)
If base_sys.custom exists, it will also be copied to the target upon create.
Use this to add personal customisations like additional users, SSH keys, etc.
Links
Useful tools and scripts to scavenge from:
- https://salsa.debian.org/hurd-team/crosshurd
- https://github.com/flavioc/cross-hurd
- https://ctrl-c.club/~giggles/projects/hurd84/index.html
Debian repos:
Guix:
Previous Gentoo work: