From c36bedfeb9cc74c52a7882777d30a35881d61178 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sat, 12 Mar 2005 19:53:38 +0000 Subject: none --- Hurd/LiveCD.mdwn | 127 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 69 insertions(+), 58 deletions(-) (limited to 'Hurd') diff --git a/Hurd/LiveCD.mdwn b/Hurd/LiveCD.mdwn index 0eda3567..38987e7f 100644 --- a/Hurd/LiveCD.mdwn +++ b/Hurd/LiveCD.mdwn @@ -1,35 +1,45 @@ -## Live-CD +# GNU/Hurd Live-CD -It would be nice if we had a bootable Hurd Live-CD like Knoppix. This could be use by those who want to try out the Hurd before they commit to installing it on their hard disks. And a bootable Hurd CD would enable us to have a native installer instead of relying on Linux. Please add comments and suggestions. +It would be nice if we had a bootable Hurd Live-CD like Knoppix. It would be useful for those who want to try out the Hurd before they commit to installing it on their hard disks. In addition to that, a bootable Hurd CD would enable us to have a native installer instead of relying on Linux. -Here's an outline of the things that need to be done. +Here is an outline of the things that need to be done. Please add your comments and suggestions. -* We need to be able get a bootloader for CDs - * This isn't much of a problem. I've already been successful (see below) in using grub and El-torito HD emulation to boot gnumach off of a CD. There may be some minor tweaking of grub code necessary to detect which device to use for booting (instead of having the user select which device (hd0,hd1,etc.) from the grub menu). +## Requirements Outline -* We need a bootstrap filesystem translator - * This would be something like a statically linked iso9660fs translator. Compiling a statically linked iso9660fs translator is easy enough, though it doesn't boot. I don't currently know whether this is because the translator was never meant to be a bootstrap filesystem, or if there is a simple bug which has never been flushed out because the translator has never been used at boot time before. I've had trouble debugging this problem because I haven't yet figured out a way to use a remote gdb with gnumach. Theoretically you could use the "boot" command to overcome this problem, but "boot" for me mangles the terminal and exits in different manner than an actual boot. +### 1. We need to be able get a bootloader for CDs + +This is not much of a problem. I have already been successful (see below) in using Grub and the El-Torito HD emulation to boot GNUmach off a CD. There may be some minor tweaking of Grub code necessary to detect which device to use for booting (instead of having the user select their device (hd0,hd1,etc.) from the Grub menu). + +### 2. We need a bootstrap filesystem translator + +This would be something like a statically linked iso9660fs translator. Compiling a statically linked iso9660fs translator is easy enough, though it doesn't boot. I don't currently know whether this is because the translator was never meant to be a bootstrap filesystem, or if there is a simple bug which has never been flushed out because the translator has never been used at boot time before. I've had trouble debugging this problem because I haven't yet figured out a way to use a remote gdb with gnumach. Theoretically you could use the "boot" command to overcome this problem, but "boot" for me mangles the terminal and exits in different manner than an actual boot. + +### 3. We need a ramdisk to enable write access + +I think we could fake this with Farid Hajii's [memfs](http://www.fprintf.net/hurd/) translator and writing an ext2 filesystem to it. + +From the mem-fs README... -* We need a ramdisk to enable write access - * I think we could fake this with Farid Hajii's [memfs](http://www.fprintf.net/hurd/) translator and writing an ext2 filesystem to it. From the mem-fs README... > memfs-1 is a translator that provides a memory-based file of fixed size. This file can, just like bigfile, contain a regular filesystem. -* * We could set a mem-fs translator anywhere on the CD you needed write access, including having softlinks to the contents of the root directory and chrooting to this new directory. +We could set a mem-fs translator anywhere on the CD you needed write access, including having softlinks to the contents of the root directory and chrooting to this new directory. + +For a quick and dirty memfs, you can do it right now with the following commands: -* * For a quick and dirty memfs, you can do it right now with the following commands: + # touch ./ramdisk + # touch ./tmpfs + # settrans -a ./ramdisk /hurd/storeio -Tcopy zero:50M + # /sbin/mke2fs -o hurd -b 4096 -F ./ramdisk + # settrans -a tmpfs /hurd/ext2fs.static ./ramdisk + # fsysopts --writable ./tmpfs + # cd tmpfs + # touch somenewfile -> touch ./ramdisk -> touch ./tmpfs -> settrans -a ./ramdisk /hurd/storeio -Tcopy zero:50M -> /sbin/mke2fs -o hurd -b 4096 -F ./ramdisk -> settrans -a tmpfs /hurd/ext2fs.static ./ramdisk -> fsysopts --writable ./tmpfs -> cd tmpfs -> touch somenewfile -> -> > > Here we use two files ramdisk, and tmpfs that are already created on a readonly file system. For illustration purposes, they are touched beforehand. We run an active storeio translator on the ramdisk file to give us 50MB of RAM to work with, and then we make an ext2 filesystem on it. At this point we'd could copy the contents of the /var directory into the tmpfs, and then symlink /var to /tmpfs/var. The same goes for all other mutable dirs. -> > > -> > > This approach of putting an entire ext2 filesystem in a copy zero'd store has some drawbacks listed [here](http://lists.gnu.org/archive/html/bug-hurd/2000-12/msg00073.html). +Here we use two files ramdisk, and tmpfs that are already created on a readonly file system. For illustration purposes, they are touched beforehand. We run an active storeio translator on the ramdisk file to give us 50MB of RAM to work with, and then we make an ext2 filesystem on it. + +At this point we'd could copy the contents of the `/var` directory into the tmpfs, and then symlink `/var` to `/tmpfs/var`. The same goes for all other mutable dirs. + +This approach of putting an entire ext2 filesystem in a copy zero'd store has some drawbacks listed [here](http://lists.gnu.org/archive/html/bug-hurd/2000-12/msg00073.html). Those are the essentials. Here is a list of the things which would be nice to have for a Live-CD. @@ -38,49 +48,43 @@ Those are the essentials. Here is a list of the things which would be nice to ha * Knoppix like script for installing to the hard drive * (add your favorite feature here) -Here's a mailing-list [thread](http://lists.debian.org/debian-hurd/2003/debian-hurd-200308/msg00172.html) discussing some of these issues. +Here is a mailing-list [thread](http://lists.debian.org/debian-hurd/2003/debian-hurd-200308/msg00172.html) discussing some of these issues. -- [[Main/GregBuchholz]] - 21 Oct 2003 -- [[Main/NagromNamreh]] - 29 Jan 2004 ----- - -Recipe for bootable gnumach CD - -In my attempts to get a bootable CD for the Hurd here's the recipe I followed, your's will be similar. I needed a grub-0.92 with a patch from... +## Recipe for bootable gnumach CD - +In my attempts to get a bootable CD for the Hurd here's the recipe I followed, your's will be similar. I needed a grub-0.92, with a patch from , and version 1.16 of mkbimage (I don't exactly remember where I got that from). -...and I needed the version 1.16 of mkbimage (I don't exactly remember where I got that from). You can grab a copy of... +You can grab a copy of it at , which is a gzipped bootable \*.iso with the copy of the patched grub and the version of mkbimage I used. Here's the recipe I followed (under linux). - + # mkdir ./2.88floppy + # mkdir ./isodir + # cp grub/* 2.88floppy/boot/grub/ + # cp grub/* isodir/boot/grub/ + # cd 2.88floppy + # tar -cf ../floppyimg.tar * + # cd .. + # mkbimage -f floppyimg.tar -t 2.88 + # cp 2.88.image isodir/ + # mkisofs -r -b 2.88.image -c boot.catalog -o hurdcd.iso isodir/ + # cdrecord -v speed=4 dev=0,0,0 -data hurdcd.iso -...which is a gzipped bootable \*.iso with the copy of the patched grub and the version of mkbimage I used. Here's the recipe I followed (under linux). - - mkdir ./2.88floppy - mkdir ./isodir - cp grub/* 2.88floppy/boot/grub/ - cp grub/* isodir/boot/grub/ - cd 2.88floppy - tar -cf ../floppyimg.tar * - cd .. - mkbimage -f floppyimg.tar -t 2.88 - cp 2.88.image isodir/ - mkisofs -r -b 2.88.image -c boot.catalog -o hurdcd.iso isodir/ - cdrecord -v speed=4 dev=0,0,0 -data hurdcd.iso - -...That was the recipe for using a floppy image. If you use the "-t hd" switch of mkbimage, you'll get an ext2fs El-Torito HD emulation image that can be any size (I've got one here 300+ MB). You then can use "root (hd0,0)" in grub to boot something. Also, invoking mkbimage with no parameters will give you some additional help messages. +That was the recipe for using a floppy image. If you use the `-t hd` switch of `mkbimage`, you'll get an ext2fs El-Torito HD emulation image that can be any size (I've got one here 300+ MB). You can then use `root (hd0,0)` in Grub to boot something. Also, invoking `mkbimage` with no parameters will give you some additional help messages. -- [[Main/GregBuchholz]] - 05 Nov 2003 ----- +## My recipe for a bootable GNU CD -My recipe for a booting GNU cd +[screenshot](http://24.109.97.177:57777/Screenshot2.png) -[screenshot](http://24.109.97.177:57777/Screenshot2.png)
what you'll need:
+### What you'll need -[stage2\_eltorito](http://24.109.97.177:57777/stage2_eltorito) from [grub 0.95](http://www.gnu.org/software/grub)
a [base system](http://www.update.uu.se/~ams/gnu/gnu-2004-12-04.tar.bz2)
[iso9660fs.static](http://24.109.97.177:57777/iso9660fs.static) or just build your own, it should work with CVS
+* A [stage2\_eltorito](http://24.109.97.177:57777/stage2_eltorito) from [grub 0.95](http://www.gnu.org/software/grub) +* A [base system](http://www.update.uu.se/~ams/gnu/gnu-2004-12-04.tar.bz2) +* [iso9660fs.static](http://24.109.97.177:57777/iso9660fs.static) or just build your own, it should work with CVS -how-to: +### [[Know/HowTo]] # mkdir iso ..(at this point untar or setup base system) @@ -88,11 +92,17 @@ how-to: # cp iso9660fs.static iso/hurd # cp stage2_eltorito iso/boot/grub ..(edit iso/boot/grub/grub.conf) - # mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o livecd.iso iso/ + # mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \ + -boot-load-size 4 -boot-info-table -o livecd.iso iso/ + +**_Note:_** The following files must _NOT_ be symlinks! -note: /boot/gnumach /hurd/iso9660fs.static /hurd/exec and /lib/ld.so.1 must NOT be symlinks! +* `/boot/gnumach` +* `/hurd/iso9660fs.static` +* `/hurd/exec` and +* `/lib/ld.so.1` -contents of grub.conf: +### Contents of grub.conf timeout 60 default 0 @@ -101,9 +111,10 @@ contents of grub.conf: #uppermem 523648 #this may need to be set root (cd) kernel /boot/gnumach root=device:hd2 #set device to your cdrom device - module /hurd/iso9660fs.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) + module /hurd/iso9660fs.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) module /lib/ld.so.1 /hurd/exec $(exec-task=task-create) -- [[Main/AndrewResch]] - 22 Feb 2005 -- cgit v1.2.3