![]() |
|
|
This is a copy of an article in AUUGN, the journal of AUUG. It may be of help if you're having trouble burning CDs or DVDs under FreeBSD.
This is the first electronic edition of AUUGN. It's available primarily on DVD, though we'll probably put the content up on the web site at a later date.
For some time we've been distributing CDs with the paper version of AUUGN. Making these CDs is a relatively simple matter, involving steps 1 and 5 of the list below: we copy an ISO, burn it on a CD-R and send it to the replicators, who often manage to make a readable version for redistribution.
With the new version of AUUGN, we can no longer do that. We need to put our own content on top of an existing distribution. In this issue, the base distribution is Fedora Core 4 for i386. The basic process involved:
Mount the ISO as a vnode device. This is under FreeBSD:
# kldload md load the kld module if necessary kldload: can't load md: File exists this happens if it is already loaded or in the kernel # mdconfig -a -t vnode -f iso-image configure the device md0 this is the name assigned # mount -t cd9660 /dev/md0 /mnt mount it # mkdir /spool/data/FC4-i386 # cd /mnt; tar cf - . | (cd /spool/data/FC4-i386 && tar xvf -) copy the complete tree # umount /mnt no longer need the old ISO image: umount # mdconfig -d -u 0 and unconfigure itUnder Linux you could use a loopback device. If neither of these options were available, I would have had to burn a DVD and mount it.
Add the content we needed, including the other distributions. This is pretty straightforward.
Build a new ISO, using this script. It is not FreeBSD-specific.
Burn the ISO, also using this script.
None of this seems very difficult, but the devil was in the detail. Read on if you're interested in the gory details.
Further investigation showed that the image had been written to a Joliet file system as a single file, not quite what I was looking for. Presumably there's a 2 GB limit on file sizes, so the file system couldn't handle the size of this file.That was all I had time for that weekend. The following week I find:Obviously I could go back and RTFM to find out how to do it correctly, but during discussions on IRC, Daniel O'Connor recommended k3b, which, it turns out, I had installed in March, though I didn't mention it in my diary. It's menu-driven, but I think burning CDs or DVDs is one case where that makes sense. What makes less sense is yet another example of breaking file system hierarchies:
This is yet another example of a small window (took up much less than half the height or width of the screen) with gratuitous scroll bars, and in this case, for some reason, unnecessarily large text (the images are reduced in size; click on them to see the original size). Not as if it could deal with text of that size:
After cleaning away the bottom and expanding the window, I got:
What's Home? Root? They're inventions of k3b and bear no relationship to the file systems on the machine. The closest I could imagine are the directories /home and /root, both in the root file system. But they're not: other things were missing. By trial and error I found that Root is the root file system (/). But why has it been put on the same level as Home? And what is Home, anyway? I really had to go looking and comparing file names to work out what it is. It's not /home, which looks like this:
=== grog@teevee (/dev/ttypa) /spool/data 1 -> ls /home Makefile Sysconfig Sysconfig.old grogIt's not /home/grog either:=== grog@teevee (/dev/ttypa) /spool/data 2 -> ls /home/grog 1.adv Makefile.virgin 1024x576 RCS 10ct: README.LEMIS 1122 Rebekka 1122u W 12-days-of-christmas X.README 12-days-of-christmas.c.commentary XFree.oldmail 2a.adv a.out 2andy address.tex 2b.adv calendarInstead, it's /root:=== grog@teevee (/dev/ttypa) /spool/data 3 -> ls /root 1024x576 axhome nsmail Mail build-kernel pr2send Make.log crontab rebuild Makefile dead.letter root News dobackups sd0label RCS emacs ssh TMDA_DELIVERY_FAILURE extract-updates tmp XEphem indent version XF86Config.new mail xorg.conf.new XF86Config.new.older merge-updates XF86Config.older mntThat is unbelievably confusing. Two “folders”, one called Root which is really /, and the other called Home which is really /root, both put at the same level. Why do people do this? It makes it so much more difficult to understand. It's also worth mentioning that the current working directory (/spool/data, where I keep the ISO images) is missing from this view, which makes the whole thing relatively useless.
Finally got the thing running, and that at least works quite nicely, despite a particularly irritating habit the program has of automatically raising itself whenever the cursor is passed over it. At least the DVD was written correctly, though I was a little confused by the fact that at the end of the burning session I couldn't mount the DVD: it had been automatically ejected. But the DVD was OK, something that in the past has been a real issue with Fedora, so I suppose I can learn to live with the strangenesses.
The real problem, it seems, was that I didn't understand the boot process well enough. Instead of blindly copying what I had been told a couple of times, I put in only those options that made sense—to me. Still later, I find:Saturday, 25 June 2005
Spent some time today working on AUUGN, which is now due to come out on DVD. We seem to have plenty of space, and it looks as if we'll end up with Fedora Core 4, OpenSolaris, the Lions Book and the complete sources to the Sixth Edition of UNIX. The only problem is how to burn the DVD: it's basically supposed to be a modified Fedora DVD, but I don't know how to get it to boot. Didn't even make it that far with my attempts to burn with k3b, though; I take back those nice things I said about it last weekend. Today, for no apparent reason, it had modified its already tiny URL window to be exactly 7 overlarge characters wide. You'll need to select on this image to see anything even marginally useful:There seems to be no way to influence text or window sizes. It also wasn't able to burn anything this time; whether due to incorrect usage or stupidity, I don't know, but the whole thing looks like a triumph of eye candy over functionality.
Sunday, 26 June 2005
More work on bootable DVDs today. Learnt a number of things about the bootstraps, notably that they're not like the first-level bootstrap on disks: they know something about the files on the DVD, so one size does not fit all. Tried with a script in the FreeBSD source tree, which built a “bootable” DVD, but the result was:Building the boot loader arguments Looking up /BOOT/LOADER... File not found Looking up /boot/loader... File not found Boot failedThose files are right for FreeBSD, but not for Linux.Next did some googling and found an article How to make a bootable Fedora ISO, which sounds pretty much like what I want. It refers to a directory isolinux, which really exists on the DVD, but the contents are:
=== root@teevee (/dev/ttyp6) /spool/data 113 -> l FC4-i386/isolinux/ total 8 -r--r--r-- 1 root wheel 2880 Jun 7 08:31 TRANS.TBL -r--r--r-- 1 root wheel 2048 Jun 7 08:31 boot.cat -rw-r--r-- 1 root wheel 292 Jun 7 08:09 boot.msg -rw-r--r-- 1 root wheel 1034 Jun 7 08:09 general.msg -rw-r--r-- 2 root wheel 4492627 Jun 7 08:09 initrd.img -r--r--r-- 1 root wheel 10424 Jun 7 08:24 isolinux.bin -r-xr-xr-x 1 root wheel 595 Jun 7 08:09 isolinux.cfg -r--r--r-- 1 root wheel 94600 Jun 7 08:09 memtest -rw-r--r-- 1 root wheel 788 Jun 7 08:09 options.msg -rw-r--r-- 1 root wheel 872 Jun 7 08:09 param.msg -rw-r--r-- 1 root wheel 490 Jun 7 08:09 rescue.msg -rw-r--r-- 1 root wheel 549 Jun 7 08:09 snake.msg -rw-r--r-- 1 root wheel 5692 Jun 7 08:09 splash.lss -rw-r--r-- 2 root wheel 1702587 Jun 7 08:09 vmlinuzThe problem is that isolinux.bin is the bootstrap, and for ISO 9660 images it should be a floppy image. It's obviously wrong. I tried padding it out to 1.4MB, but the result was that the system halted after loading it: clearly not the right bootstrap.So where's it hidden? Conventional wisdom says that the bootstrap should be in the directory tree, and the burning software won't accept anything else, but I can't find any file on the disk which is exactly 1.44 or 2.88 MB in size. Maybe I'll have to extract it from the DVD with dd. There, at any rate, isoinfo helps:
=== root@teevee (/dev/ttyp6) /spool/data 119 -> isoinfo -d -i FC4-i386-DVD.iso CD-ROM is in ISO 9660 format System id: LINUX Volume id: FC/4 i386 DVD #9 Volume set id: Publisher id: Data preparer id: Application id: FC/4 i386 Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 1343058 El Torito VD version 1 found, boot catalog is in sector 270 Joliet with UCS level 3 found Rock Ridge signatures version 1 found Eltorito validation header: Hid 1 Arch 0 (x86) ID '' Key 55 AA Eltorito defaultboot header: Bootid 88 (bootable) Boot media 0 (No Emulation Boot) Load segment 0 Sys type 0 Nsect 4 Bootoff 10F 271I suppose Bootoff is a sector number, but the format is strange.Burning DVDs is still a gamble. burncd still fails:
=== root@teevee (/dev/ttyp5) /spool/data 10 -> burncd -f /dev/acd0 dvdrw AUUGN-26-1 fixate next writeable LBA 0 writing from file AUUGN-26-1 size 3049120 KB written this track 1568 KB (0%) total 1568 KB only wrote -1 of 32768 bytes: Device busyOnce I build an ISO image, k3b will still burn it for me. While it was doing so, I took the opportunity to look at it with ps -ww. The command it used was:
/usr/local/bin/growisofs -Z /dev/cd0=AUUGN-26-1 -use-the-force-luke=notray -use-the-force-luke=tty -speed=2.4“-use-the-force-luke”? The man page just says
There're several undocumented options commonly denoted with -use-the-force-luke prefix. Some of them serve debugging purposes. Some require certain knowledge about recording process or even OS kernel internals and as being such can induce confusing behaviour. Some are to be used in very specific situations better recognized by front-ends or automated scripts. Rationale behind leaving these options undocumented is that those few users who would actually need to use them directly can as well consult the source code or obtain specific instructions elsewhere.What a way to use software! In any case, heavily modified the FreeBSD burn script and came up with my own script which seems to do things without as much pain as “user friendly” programs like k3b.
The script didn't work correctly at the time, but the link above is to an updated version that does work, and that was used to burn this DVD.Monday, 27 June 2005
Sent a message out to the Australian Linux groups today about my DVD boot problems, and in the evening got a reply from Glen Turner pointing to the problem: turned out that the bootstrap was correct after all, but that I had a bug in my burn script (now corrected): there are at least two kinds of bootstrap you can put in an ISO image. The older style is the El Torito bootstrap, effectively an image of a floppy. The other is a native bootstrap, which can be of any length. That's what I wanted, and you specify it with the -no-emul-boot option.
Not that that removed all problems: after that I could run the bootstrap, but it failed again:
ISOLINUX 3.08 2005-05-19 isolinux: Image checksum error, sorry...More head-scratching to do there. I may actually have to install Fedora Core 4 to do it right.
That's the current state of affairs. The mkcd script on this DVD reflects it. If you use it and run into trouble with it, or fix bugs, please let me know.Saturday, 9 July 2005
Back to looking at AUUGN this morning, and finally got it to create a bootable disk. As so often, I had been looking in the wrong place, and the real issue was the combination of boot parameters for mkisofs. To make matters worse, Glen Turner had given me the correct parameters last week:Give this a go: mkisofs -J Joliet extensions -R Rock Ridge extensions -v Verbose -T Generate TRANS.TBL for Joliet -m TRANS.TBL Ignore any existing TRANS.TBL -o disc1.iso Output -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 Completely bogus for bad BIOSs -pad Bogosity for Linux bugs -boot-info-table Patch isolinux.bin with ElTorrito magic disc1/ InputOf these, the ones that made the difference were the -boot-load-size 4 -boot-info-table, but I needed Krzysztof Krawczyk to remind me. Updated my mkcd script to do this automatically; I'm sure it will need more tweaking next time I try to build a bootable CD or DVD for a different operating system.
Greg's diary | Greg's photos | Greg's links | Greg's home page | |
$Id: making-AUUGN.html,v 1.5 2008/12/18 23:49:58 grog Exp $ |