https://wiki.preterhuman.net/index.php?title=The_Hurd_Installation_Guide&feed=atom&action=historyThe Hurd Installation Guide - Revision history2024-03-28T13:36:17ZRevision history for this page on the wikiMediaWiki 1.35.0https://wiki.preterhuman.net/index.php?title=The_Hurd_Installation_Guide&diff=14562&oldid=prevNetfreak: Created page with "<pre> The Hurd Installation Guide This document aims to provide an easy and relatively painless set of instructions on how to get the Hurd up..."2020-07-29T22:01:41Z<p>Created page with "<pre> The Hurd Installation Guide This document aims to provide an easy and relatively painless set of instructions on how to get the Hurd up..."</p>
<p><b>New page</b></p><div><pre><br />
The Hurd Installation Guide<br />
<br />
This document aims to provide an easy and relatively painless set of<br />
instructions on how to get the Hurd up and running with a minimum<br />
amount of effort.<br />
<br />
1. Overview Where we are going<br />
2. Real Estate or Finding A Home Finding a Home<br />
3. The Boot Loader Getting Grub<br />
4. Cross Install Cross Installing the Hurd<br />
5. Booting the Hurd <br />
6. Native Install Finishing the Installation<br />
7. Configuration Making the System Usable<br />
8. Final Words The FAQ<br />
9. Works Cited Referenced Materials<br />
_________________________________________________________________<br />
<br />
<br />
1. Overview<br />
<br />
The Debian GNU Hurd distribution, unlike distributions of other<br />
operating systems, does not have a nice installation program. One day<br />
it will and maybe you will help design and implement it; however,<br />
until that day, installing the GNU Hurd requires another operating<br />
system, specifically, another Unix-like system(1). Users have<br />
indicated successful installations using different flavors of<br />
GNU/Linux as well as the BSDs. The minimum requirements of the<br />
bootstrap operating system are the ability: to create an ext2 file<br />
system; to extract a tar archive on to it; and to install GNU Grub.<br />
<br />
The GNU Hurd is similar in nature to any Unix-like system: after<br />
logging in, the user is presented with a shell and the familiar Unix<br />
VFS, virtual filesystem. Although GNU tries to be POSIX compliant, it<br />
is not Unix. The Hurd builds upon many of the Unix concepts and<br />
extends them to either add new functionality or to fix what has been<br />
perceived as flaws in the original design. The most noticeable<br />
difference is translators, user space programs which interact with the<br />
VFS. These filesystems do not live living in the kernel nor do they<br />
need to be run as root; they only need access to the backing store and<br />
the mount point. Another difference is that processes, rather having a<br />
single user identity fixed at creation time, have identity tokens<br />
which are disjoint from the process, i.e. they may be added with the<br />
appropriate permission from an authority or destroyed.<br />
<br />
Being familiar with the Unix environment is an imperative for feeling<br />
at ease in GNU. Having experience with the Debian tools will also<br />
prove invaluable to the configuration and maintenance of a GNU/Hurd<br />
box.<br />
<br />
This guide endeavors to make installing the Hurd as painless a process<br />
as possible. If there are errors, they are most certainly the<br />
author's. Please report them, along with any other suggestions or<br />
criticisms, to him; all are gladly accepted.<br />
_________________________________________________________________<br />
<br />
<br />
2. Real Estate or Finding A Home<br />
<br />
If you do not have an available partition or an extra hard drive, this<br />
can be the longest step. In this case, you will need to repartition<br />
the hard drive. One solution is to use GNU's partition editor, Parted.<br />
It features not only basic partition editing but also partition<br />
resizing and moving functionality. It can be found at<br />
http://www.gnu.org/software/parted. The manual is quite complete and<br />
includes several tutorials.<br />
<br />
The Hurd can only support partition sizes of up to approximately two<br />
gigabytes; anything larger than this will not work. This limitation is<br />
due to a design decision that was made several years ago in which the<br />
filesystem server maps the entire filesystem into virtual memory. As<br />
the amount of virtual memory available on an ia32 is only four<br />
gigabytes of which Mach allocates three gigabytes to the application<br />
and, of that, a significant portion is reserved for the code, the<br />
stack and the heap, the final, maximum contiguous virtual memory area<br />
that remains is generally about two gigabytes. This limitation is<br />
scheduled to be removed.<br />
<br />
Having said that, a single two gigabyte filesystem is more than enough<br />
for a working system. Many, however, prefer at least two filesystems:<br />
a root filesystem and a second for `/home'. This latter scheme is<br />
highly advised for developers: compiling the Hurd can take up quite a<br />
bit of space.<br />
<br />
The Hurd supports several extensions to the ext2fs filesystem format.<br />
Foremost among these are passive translators and a fourth set of<br />
permission bits for unknown users (users without an identity--not the<br />
other user). To use these extensions, the owner of the partition must<br />
be set to hurd. mke2fs, unless specifically overridden on the command<br />
line, will set the owner to whatever operating system it is running<br />
on. As the Hurd will diligently respect this setting, care must be<br />
taken to set this appropriately or the Hurd will fail in subtle ways.<br />
Be aware that even if a file system is owned by a particular operating<br />
system, others may still use it; they just may not be able to use<br />
certain extensions.<br />
<br />
To create a filesystem, use mke2fs and pass it `-o hurd' to designate<br />
the Hurd as the owner of the new file system. For instance, assuming<br />
the parition is `/dev/hda2':<br />
<br />
<br />
# mke2fs -o hurd /dev/hda2<br />
<br />
3. The Boot Loader<br />
<br />
Unlike GNU/Linux and the BSDs, the Hurd does not have its own boot<br />
loader; any boot loader that supports the multiboot standard can be<br />
used to load the Hurd. At the moment, there is only one project which<br />
that satisfies these requirements: Grub, the GRand Unified Boot<br />
loader.<br />
<br />
A word about Grub. Unlike traditional boot loaders on the x86, such as<br />
LILO, Grub is very powerful. It has a command line interface, bootp,<br />
dummy terminal support and a plethora of other features. In addition,<br />
it can boot most any operating system. If you have ever booted an<br />
alpha or sparc, you will understand what Grub can do. Therefore, do<br />
not be scared: Grub is better. You will like it. You will not go back.<br />
<br />
To find Grub, visit http://www.gnu.org/software/grub/. Here, there is<br />
a source tarball and a floppy image. If you choose to download the<br />
tarball, it is a normal configure, make and make install. Included is<br />
a wonderfully complete manual on how Grub works. Read it. If, on the<br />
other hand, you choose to download the floppy image, it is sufficient<br />
to dump it to a floppy disk to get a working Grub, for example:<br />
<br />
<br />
# dd if=grub-boot-image of=/dev/fd0<br />
<br />
You can always install Grub onto your hard drive at a later date.<br />
_________________________________________________________________<br />
<br />
4. Cross Install<br />
<br />
The next step is to download the base system at:<br />
ftp://alpha.gnu.org/gnu/hurd/contrib/marcus/gnu-latest.tar.gz.<br />
<br />
The tarball is setup to extract everything into the current directory.<br />
After the filesystem is mounted, the archive can be extracted.<br />
Assuming that the filesystem is on `/dev/hda2', the mount point is<br />
`/gnu' and archive is in current user's home directory, the following<br />
is required:<br />
<br />
<br />
# mount -t ext2 /dev/hda2 /gnu<br />
# cd /gnu<br />
# tar --same-owner -xvzpf ~/gnu-latest.tar.gz<br />
_________________________________________________________________<br />
<br />
5. Booting the Hurd<br />
<br />
All is now in readiness to boot the Hurd for the first time. After<br />
verifying that the Grub boot disk is in the drive, reboot. If all goes<br />
well, either a Grub menu or command line will be displayed. If<br />
presented with a menu, press c to go to the command line.<br />
<br />
First, GNU Mach needs to be loaded. This requires knowing the<br />
filesystem and the path to GNU Mach. Grub uses a partition<br />
nomenclature that is a bit different from both Linux and the Hurd:<br />
both IDE and SCSI drives are named `(hdN,M)'. N is the drive number<br />
(zero based) as enumerated by the BIOS. That is, Grub makes no<br />
distinction between IDE and SCSI disks. M identifies the partition on<br />
the drive. It is also zero based index. If this sounds confusing,<br />
relax: Grub is also helpful.<br />
<br />
To determine on which filesystem a particular file resides, Grub<br />
provides the find command. When this command is issued along with a<br />
filename, Grub searches on each filesystem for the specified file and<br />
prints where it was found. For example, to search for the kernel,<br />
`/boot/gnumach.gz':<br />
<br />
<br />
grub> find /boot/gnumach.gz<br />
(hd0,0)<br />
<br />
Here, Grub is indicates that `/boot/gnumach.gz' is on `(hd0,0)'.<br />
<br />
Before loading the kernel, at least one option, the root partition,<br />
must be specified on the command line. This will be used by the Hurd<br />
itself (i.e. not Grub). As such, it must be in terms that the Hurd can<br />
understand.<br />
<br />
GNU Mach enumerates disks starting at zero. IDE drives are prefixed<br />
with hd, while SCSI disks are prefixed with sd. Like Linux, drives are<br />
number by their position on the controller. For instance, the primary<br />
master is hd0 and the secondary slave is hd3. Partitions use the BSD<br />
slice naming convention and append sM to the drive name to indicate a<br />
given partition. Note that M is a one, not zero, based index. The<br />
slice number is simple to calculate: just increment what was used for<br />
Grub by one.<br />
<br />
Since the Hurd has not yet been configured, it must be started in<br />
single user mode. Adding a `-s' to the kernel command line is all that<br />
is required.<br />
<br />
Assuming that the first drive (i.e. `(hd0)') is the master on the<br />
secondary controller, we would have:<br />
<br />
<br />
grub> kernel (hd0,0)/boot/gnumach.gz root=device:hd2s1 -s<br />
[Multiboot-elf, ...]<br />
<br />
Next, the root filesystem server and the exec server must be loaded.<br />
This is done using Grub's boot module capability. The ${var} are<br />
filled in by GNU Mach. The arguments are used by the Hurd to indicate<br />
what type of information is being provided. Since the ext2fs command<br />
line is very long, it can be broken up by escaping the newline<br />
character in the normal Unix fashion. Be sure that there is not space<br />
after the slash at the end of each line. Also be sure to differentiate<br />
{ and } from ( and ).<br />
<br />
<br />
grub> module (hd0,0)/hurd/ext2fs.static \<br />
--multiboot-command-line=${kernel-command-line} \<br />
--host-priv-port=${host-port} \<br />
--device-master-port=${device-port} \<br />
--exec-server-task=${exec-task} -T typed ${root} \<br />
$(task-create) $(task-resume)<br />
[Multiboot-module 0x1c4000, 0x2cfe6a bytes]<br />
grub> module (hd0,0)/lib/ld.so.1 /hurd/exec $(exec-task=task-create)<br />
[Multiboot-module 0x494000, 0x27afe bytes]<br />
<br />
Once the GNU Hurd is running, process can be automated by adding the<br />
appropriate commands to Grub's `/boot/grub/menu.lst' configuration<br />
file.<br />
<br />
The GNU Hurd can be now booted:<br />
<br />
<br />
grub> boot<br />
<br />
Sit back and watch the messages. This is actually more important than<br />
most people believe: there is a bug in GNU Mach whereby hitting a key<br />
during the boot process causes the kernel to panic.<br />
<br />
If the Hurd fails to boot, it could be due to shared IRQs: GNU Mach<br />
does not play well with these. You can verify your situation by<br />
looking at, for instance, the `/proc/interrupts' file under GNU/Linux.<br />
Also, as GNU Mach does not support loadable kernel modules, many of<br />
the drivers are compiled into the default kernel. If there are old<br />
peripherals, this can be a problem: a device may incorrectly respond<br />
to a probe intended for a completely unrelated device and thereby<br />
cause a crash. Building a new kernel with only the required device<br />
drivers will usually solve this problem. GNU Mach is easily cross<br />
compiled. If you are running Debian, try installing the `gcc-i386-gnu'<br />
package.<br />
<br />
If this does not help, explore the resources listed at the end of this<br />
document. Finally, ask on the appropriate mailing list.<br />
_________________________________________________________________<br />
<br />
6. Native Install<br />
<br />
Once you are presented with a shell prompt, and any time that the the<br />
Hurd is in single user mode, it is necessary to set the terminal type:<br />
<br />
<br />
# export TERM=mach<br />
<br />
Be warned that CONTROL-C and family will not work in single user mode.<br />
<br />
We can now run the native-install script. This will configure the<br />
packages and set up several important translators:<br />
<br />
<br />
# ./native-install<br />
<br />
Before the script terminates, it will indicate that it needs to be run<br />
a second time. Follow its instructions and reboot using the reboot<br />
command. Again, go into single user mode and run ./native-install.<br />
_________________________________________________________________<br />
<br />
<br />
7. Configuration<br />
<br />
7.1 The Network<br />
<br />
To configure the network, the pfinet translator must be configured.<br />
This is done using the settrans command to attach a translator to a<br />
given filesystem node. When programs access the node by, for example<br />
sending an RPC, the operating system will transparently start the<br />
server to handle the request.<br />
<br />
<br />
# settrans -fgap /servers/socket/2 /hurd/pfinet -i eth0 \<br />
-a a.b.c.d -g e.f.g.h -m i.j.k.l<br />
<br />
Here, settrans is passed several options. The first two, `fg', force<br />
any existing translator to go away. The next two, `ap', make both<br />
active and passive translators. By making the translator active, we<br />
will immediately see any error messages on `stderr'. The latter, saves<br />
the translator and arguments in the node so it can be transparently<br />
restarted later (i.e. making the setting persistent across reboots).<br />
The options are followed by the node to which the translator is to be<br />
attached, then the program (i.e. translator) to run and any arguments<br />
to give it. The `-i' option is the interface pfinet will listen on,<br />
`-a' is the ip address, `-g' is the gateway and `-m' is the network<br />
mask.<br />
<br />
Be sure to add name servers to your `/etc/resolv.conf' file:<br />
<br />
<br />
nameserver 192.168.1.1<br />
<br />
To test the configuration, ping -c2 gateway. The `-c' is important to<br />
limit the number of pings; recall, CONTROL-C does not work in single<br />
user mode.<br />
<br />
DHCP does not yet work on the Hurd. This is due to limitations of<br />
pfinet: it is based on the Linux' TCP/IP code and unable to listen on<br />
`0.0.0.0'.<br />
<br />
Help on settrans can be obtained by passing it the `--help' option.<br />
Help on a specific translator can be gotten by invoking it from the<br />
command line with the same argument, e.g.:<br />
<br />
<br />
# /hurd/pfinet --help<br />
<br />
As there can be a lot of output, consider piping this through a pager<br />
such as less.<br />
_________________________________________________________________<br />
<br />
<br />
7.2 Other File Systems<br />
<br />
Next, edit `/etc/fstab' to add any additional filesystems as well as<br />
swap space. It is very important that swap space be used; the Hurd<br />
will be an order of magnitude more stable. Note that the Hurd can<br />
transparently share a swap partition with Linux but will happily page<br />
to any device including a raw partition such as your home partition.<br />
By default, nano is the only editor installed by the the base<br />
distribution.<br />
<br />
Here is an example `/etc/fstab' file:<br />
<br />
<br />
# <file system> <mount point> <type> <options> <dump> <pass><br />
/dev/hd2s1 / ext2 rw 0 1<br />
/dev/hd2s2 /home ext2 rw 0 2<br />
/dev/hd2s3 none swap sw 0 0<br />
<br />
Remember to create any devices using the MAKEDEV command:<br />
<br />
<br />
# cd /dev<br />
# ./MAKEDEV hd2s1 hd2s2 hd2s3<br />
<br />
To mount an nfs filesystem, /hurd/nfs translator is used. When run as<br />
non-root, the translator will connect to the server using a port above<br />
1023. By default, GNU/Linux will reject this. To tell GNU/Linux to<br />
accept connections originating from a non-reserved port, add the<br />
`insecure' option to the export line. Here is an example<br />
`/etc/exports' file assuming the client's ip address is `192.168.1.2':<br />
<br />
<br />
/home 192.168.1.2(rw,insecure)<br />
<br />
To mount this from a Hurd box and assuming that nfs server's ip<br />
address is `192.168.1.1':<br />
<br />
<br />
# settrans -cgap /mount/point /hurd/nfs 192.168.1.1:/home<br />
_________________________________________________________________<br />
<br />
<br />
7.3 Rebooting<br />
<br />
Finally, reboot into multiuser mode, i.e. in the same way single user<br />
mode was brought up minus the `-s' option when loading the kernel. For<br />
details, refer to See section 5. Booting the Hurd.<br />
<br />
Happy Hacking!<br />
_________________________________________________________________<br />
<br />
<br />
8. Final Words<br />
<br />
8.1 Documentation<br />
<br />
To understand the Hurd, start with the home page on Debian's site:<br />
http://www.debian.org/ports/hurd/ and GNU's site: http://hurd.gnu.org.<br />
<br />
Also consider reading the source code and writing more documentation.<br />
_________________________________________________________________<br />
<br />
<br />
8.2 The Grub Menu<br />
<br />
Having to always load the kernel by hand can be very tedious. Edit the<br />
`/boot/grub/menu.lst' and tailor it appropriately; booting will become<br />
much quicker and easier.<br />
_________________________________________________________________<br />
<br />
<br />
8.3 Adding Devices<br />
<br />
By default, only a few devices are created in the `/dev' directory.<br />
Use the MAKEDEV script to create any needed device nodes.<br />
_________________________________________________________________<br />
<br />
<br />
8.4 Installing More Packages<br />
<br />
There are several ways to add packages. Downloading and using dpkg -i<br />
works but is very inconvenient. The easiest method is to use apt-get.<br />
Edit `/etc/apt/sources.list' and add the following two entries:<br />
<br />
<br />
deb ftp://alpha.gnu.org/gnu/hurd/debian unstable main<br />
deb ftp://ftp.debian.org/debian unstable main<br />
<br />
ftp://alpha.gnu.org contains packages that have hacks or patches that<br />
have not yet been integrated upstream. There are no mirror sites. To<br />
use a local Debian mirror, visit<br />
http://www.debian.org/distrib/ftplist.<br />
<br />
If GNU Mach does not recognize your network card or you use a modem,<br />
the only way to upgrade will be to download the packages and then<br />
transfer them to the GNU Hurd system. The easiest way to do this is to<br />
use apt off-line. Refer to `/usr/share/doc/apt/offline' for detailed<br />
instructions.<br />
_________________________________________________________________<br />
<br />
8.5 XFree86<br />
<br />
XFree86 has been ported and all video cards, which it supports that do<br />
not require a kernel module should work.<br />
<br />
First, set up the keyboard translator:<br />
<br />
<br />
# cd /dev<br />
# ./MAKEDEV kbd<br />
<br />
And then the mouse translator. For a serial port mouse, run the<br />
following replace `com0' with the appropriate communication port:<br />
<br />
<br />
# settrans /dev/mouse /hurd/mouse --device=com0 --protocol=microsoft<br />
<br />
Make sure that `/dev/com0' actually exists. If it does not, create it<br />
using MAKEDEV in the usual fashion.<br />
<br />
PS/2 so not require a device node. It is simple a matter of:<br />
<br />
<br />
# settrans /dev/mouse /hurd/mouse --protocol=ps/2<br />
<br />
Other mice can be used; run `/hurd/mouse' with the `--help' option for<br />
details.<br />
<br />
You will need several X packages. x-window-system-core, rxvt and twm<br />
or fvwm are a good start.<br />
<br />
Debconf can be used to configure XFree86, however, it is not Hurd<br />
aware and the configuration file will need to be tweaked. Change the<br />
pointer section to read:<br />
<br />
<br />
Section "Pointer"<br />
Protocol "osmouse"<br />
Device "/dev/mouse"<br />
EndSection<br />
<br />
`Emulate3Buttons' may be optionally added. Nothing else will work.<br />
<br />
The GNU Hurd does not use ld.so.conf. Since `/X11R6/lib' is not in the<br />
default library search path, it is necessary to add the following to<br />
either `/etc/profile' or each user's `.profile':<br />
<br />
<br />
export LD_LIBRARY_PATH=/X11R6/lib:$LD_LIBRARY_PATH<br />
<br />
Finally, run startx.<br />
<br />
There are several caveats to be aware of. xterm does not work<br />
correctly as it is SETGID (and thus ignores LD_LIBRARY_PATH and fails<br />
to load the appropriate shared libraries); try rxvt. update-menu has<br />
not yet been ported. As such, there are no fine Debian menus. Although<br />
a pthreads implementation exists not all pthread packages have been<br />
ported: do not expect Gnome and KDE to work.<br />
_________________________________________________________________<br />
<br />
<br />
8.6 Virtual Terminals<br />
<br />
The Hurd does not have virtual terminals although it is in<br />
development. Use the screen package in the interim.<br />
_________________________________________________________________<br />
<br />
<br />
8.7 Mailing Lists<br />
<br />
1. debian-hurd@debian.org Discussion on the Hurd as it relates to<br />
Debian.<br />
1. Archive: http://lists.debian.org/#debian-hurd<br />
2. web-hurd@gnu.org Development of the Hurd web pages at<br />
http://hurd.gnu.org.<br />
1. Archive: http://mail.gnu.org/pipermail/web-hurd/<br />
3. help-hurd@gnu.org Help on the Hurd in general.<br />
1. Archive: http://mail.gnu.org/pipermail/help-hurd/<br />
4. bug-hurd@gnu.org Bug reports and general development. Send patches<br />
here.<br />
1. Archive: http://mail.gnu.org/pipermail/bug-hurd/<br />
_________________________________________________________________<br />
<br />
<br />
8.8 Other Resources<br />
<br />
The Hurd Wiki, http://hurd.gnufans.org/bin/view/Hurd/WebHome, answers<br />
commonly addressed problems that new users face.<br />
_________________________________________________________________<br />
<br />
<br />
9. Works Cited<br />
<br />
"The Easy Guide to Installing Hurd on a Linux Box" Copyright (C) 1999<br />
Matthew Vernon matthew@debian.org.<br />
http://www.pick.ucam.org/~mcv21/hurd.html<br />
_________________________________________________________________<br />
<br />
<br />
Footnotes<br />
<br />
(1)<br />
<br />
Philip Charles has created a set of CDs (available at<br />
http://www.debian.org/ports/hurd/hurd-cd) which contains a live Debian<br />
GNU/Linux system thereby arguably eliding this requirement, however,<br />
we maintain that this is functionally equivalent.<br />
_________________________________________________________________<br />
<br />
<br />
Table of Contents<br />
<br />
1. Overview<br />
2. Real Estate or Finding A Home<br />
3. The Boot Loader<br />
4. Cross Install<br />
5. Booting the Hurd<br />
6. Native Install<br />
7. Configuration<br />
<br />
7.1 The Network<br />
7.2 Other File Systems<br />
7.3 Rebooting<br />
<br />
8. Final Words<br />
8.1 Documentation<br />
8.2 The Grub Menu<br />
8.3 Adding Devices<br />
8.4 Installing More Packages<br />
8.5 XFree86<br />
8.6 Virtual Terminals<br />
8.7 Mailing Lists<br />
8.8 Other Resources<br />
<br />
9. Works Cited<br />
_________________________________________________________________<br />
<br />
Short Table of Contents<br />
<br />
1. Overview<br />
2. Real Estate or Finding A Home<br />
3. The Boot Loader<br />
4. Cross Install<br />
5. Booting the Hurd<br />
6. Native Install<br />
7. Configuration<br />
8. Final Words<br />
9. Works Cited<br />
_________________________________________________________________<br />
<br />
About this document<br />
<br />
This document was generated by Neal H. Walfield on January, 21 2003<br />
using texi2html<br />
<br />
_________________________________________________________________<br />
<br />
This document was generated by Neal H. Walfield on January, 21 2003<br />
using texi2html<br />
</pre><br />
<br />
[[Category:How-To]]</div>Netfreak