## Optional package bootCD v.0.4 for fli4l 2.0.4

### Table of content:

1. Introduction
2. Modified Files (in regard to fli4l base packer)
3. Usage
4. CD Burning
5. Frequently asked questions - FAQs
6. Third party software
7. Links

### Introduction

This optional package for the fli4l project provides some scripts and modified files to create a bootable CD rather than a boot floppy for setting up e.g. an ISDN router.
Beside the fact, that a CD has a much higher capacity than a floppy, the boot process is usually also much faster when booting from a recent CD drive, e.g. down to 10-30 seconds even with a large configuration instead of somtimes several minutes with floppy disk even though configuration was minimalistic.
The package comes with a modified root filesystems which incorporates the neccessary modules in oder to access a CD just after boot (ide-cd.o, cdrom.o for cdrom access and isofs.o for access to the filesystem used on CDs). As of now, only booting from ATAPI (i.e. CDrom drives connected to the IDE bus) is supported, as access to SCSI drives would mean to include lots of modules for all the different types of SCSI adapters around (thus blowing up things quite a lot) whereas some tiny modules do suffice to achieve this for ATAPI drives. Moreover ATAPI drives are quite cheap in comparison to SCSI drives and the basic intension of fli4l is to be run on low-cost, somewhat outdated hardware anyway. So if you own a SCSI drive only but would like to boot from CD, better consider getting an old ATAPI drive instead of adding SCSI modules to this package.

### Modified Files (in regard to fli4l base packer)

The files in this package follow the directory standard as defined by the fli4l project, however some files will be modified as follows:

img/rootfscd.gz | root filesystem with CD boot related modules and modified startup script (/etc/rc)
img/syslinuxcd.cfg | sylinux configuration with specification of CD rom drive
opt/etc/rc.local | modified in respect to appropriate generation of fstab
mkclean.{sh|.bat} | will clean up also files related to boot CD creation

If you intend to use this package together with the hd package (for installation onto a harddisk), make sure that you also unpack the file `hd_update.zip` located in the root directory of the fli4l tree after you unpacked the hd package. This will additionaly modify the following files of the hd package:

config/hd.txt | new setting HDINSTALL_MOUNT_BOOT hat determines whether the boot partition should be mounted after harddisk installation. (for harddisk installation, the parameter MOUNT_BOOT of the base fli4l package must be set set to 'ro' or 'rw', but not to 'no', because the files could not be copied to the harddisk otherwise. however, setting HDINSTALL_MOUNT_BOOT='no' will allow to install fli4l on a harddisk, but have the boot partition not mounted afterwards when finally booting from harddisk)
config/hd.txt | comprises check for HDINSTALL_MOUNT_BOOT
opt/hd.txt | CD rom related modules skipped, as they already must be on the root filesystem, anyway
opt/files/usr/sbin/setup | allows also installation from boot CD to harddisk

### Usage

1. After you unpacked the package into the fli4l tree, configure the files in `config/` as usual.
2. (Optional)
   If you have the hd package installed, make sure you also unpacked `hd_update.zip` and configured `config/hd.txt`. Note, that unpacking this archive will overwrite some files that coe with this package, so make backup copies if you want to keep the original files.
   There's an additional parameter for the updated files from the hd package: `HDINSTALL_MOUNT_BOOT='no'` (or `'rw'` or `'ro'`)
   will override the setting of MOUNT_BOOT in `config/base.txt`. The reason for this is, that installtion to a harddisk requires `MOUNT_BOOT='ro'` or `MOUNT_BOOT''rw'`, because the setup script needs to copy files from there to the harddisk. The config (which is located on the boot filesystem) file will be copied as well from there. So whatever you chose for `MOUNT_OPT`, if will also apply for the final installation on harddisk. Setting `HDINSTALL_MOUNT_BOOT` to something different however will override `MOUNT_OPT`, thus although you have chosen to mount boot during installation to harddisk, the boot partition will not be mounted afterwards.
3. (Optional)
   If you want a special CD drive to be used, change the parameter `"cd=auto"` in `img/syslinuxcd.cfg` to the drive you'd like to be used.
   `cd=/dev/hda` if it's master on first IDE channel,
   `cd=/dev/hdb` if it's slave on first IDE channel,
   `cd=/dev/hdc` if it's master on second IDE channel,
   `cd=/dev/hdd` if it's slave on second IDE channel.
   Otherwise the CD will be sought for automaticaly in the follwoing
   order: hdc, hdb, hdd, hda
4. For Linux, run the script `mkcd.sh`, for Windows invoke `mkcd.bat`. These scripts will first perform as usual the check of the config files and create the files needed for creating a boot floppy.
   Note, that you will need a formatted 1.44MB floppy for this purpose
   From this boot floppy a floppy image will be read which is neccessary for bootable CDs. After the floppy image has been created, a CD iso image which comprises this floppy image as well as all files neccessary for starting the router software will be created in `img/fli4l.iso`.
5. The script will then ask you, if you want to burn this image to a blank CD immediately, for details see the section CD buring, below.

If you are using Linux, and if you once started the `mkcd.sh` script, you can skip the (rather slow) generation of the boot floopy, provided you have root privileges, because in that case the next time you want to create a CD image, the former floppy image will be mounted as a loopback device and the modified configuration will be written to the image directly rather than first writing it to floppy and then reading the whole floppy to a file.
However, if you have not root privileges or if you use Windows to create the image, you'll have no choice and the floppy will be generated each time you call the script. The reason for this is, that mounting files as loopback devices is usually allowed for the root user only in Linux on the one hand and accessing images in this way is not supported in Windws at all.
There are three parameters that control the behaviour of these scripts:
[-g] This forces the generation of a new floppy image, even if the former one could be used.
[-s] This creates a "slow, stupid and secure" version of the syslinux loader. Use this if you have a somewhat broken machine and the usual way fails for you.
[config-directory] This uses a different directory where config files are sought for rather then the default "config" directory.

### CD burning

The creation of the CD image as well as the actual burning process is provided by means of third party software, see this section for details.
To find out if your CD recorder is supported, check the list of supported drives on Jörg Schilly's page.
After he script created a CD image, your system will be scanned by CDRECORD for drives, the list of drives will be presented to you, e.g.

    scsibus1:
    0,0,0   100) '        ' 'OME-W141        ' '1.40' Removable CD-ROM
    0,1,0   101) 'DM126D  ' 'DVDROM '01/01/29' '1.1C' Removable CD-ROM
    :
    :

and you will be prompted to choose a drive from the list which should be used to burn the CD image to a blank medium. Please enter the three-digit id of your drive here, e.g. "0,0,0".
If you do not want to burn the image, e.g. because you prefer to burn it with a piece of software of your choice, then abort this prompt by pressing Ctr-C. Otherwise prior to actual burning, a write simulation will be performed. If write simulation succeeds, you'll be prompted again for the actual write process, otherwise the script will fail.

### FAQs

Q: I always get the error message "Windows was not able to gain exclusive access to the floppy drive" - so what's wrong ?
A: Apparently you use windows 2000 or NT - the access restrictions are much more rigid that e.g. for win 98 or 95. I hav eno key why this happens sometimes, however what fails is the installation of the bootloader syslinux (that's the part thet make the floppy a bootable one). Fortunatelly I found out that does not happen neccessarily, thus trying again and again and pressing the "Cancel" button of the dialog window that pops up should help. If someone kows a more elegant way to overcome this, lease send me a note: a.pogoda@web.de Furthermore this problem seems to happen less frequently if you call the script from inside a DOS box rather than just clicking on its icon (which however is more convenient - sure). Moreover you'll be able to call the script with optional parameters when doing so. Another solution to this is to use windows 95 or 98 (or XP - can someone prove this ?)
Q: I always got the message ""Error writing or reading the floppy disk maybe the disk is full-try to select fewer options in configuration and try again" - what can I do ?
A: Apparently you still use the very first version of the bootCD package. It suffered from the fact that the tool which is used to create the floppy image inside the mkcd script, apparently created the image in read-only mode the first time you invoked the script. If you ivoke it again, the tool is unable to overwrite it. Either get a recent version of the bootCD package or delete the file "img/cd/boot.img" manually before invokation of mkcd.
Q: There' splenty of space on the CD in contrast to boot floppy. Therefore I installed some 1000 optinal packages. Now there's a lack of storage space on the ramdisk when fli4l starts up - what's the way round this ?
A: Obviously the size of the ramdisk is to small - you can adjust it with the "RAMSIZE" parameter in "config/base.txt". Most of the files from optional packages do not reside inseide the ramdisk that contains the rootfs but into a seperate one. Then symbolic links are created in the rootfs to these optional files. So in most cases it should be sufficient to set RAMSIZE to some larger value, e.g. 4096 (4MB), 8192 (8MB) etc. If there's a need for quite a lot of links on the rootfs or if you installed packages which force files to reside inside the rootfs rather than the optional ramdisk, then even this can fail. For this reason there's an optional switch "-l" to the mkcd script which will cause the script to use a 32MB version of the root filesystem instead of the default one. Of course you have to make sure that the amount of physical memory in the fli4l box you use is sufficiently large for the ramdisk, so you should have something like 64MB or more. If the default rootfs is too small for your needs, but the 32MB version is too large for your physical memmory, it's up on you to create a customized rootfs. You'll find valuable information on the fli4l homepage regarding this issue (http://fli4l.sf.net);
Q: Why does the skript always create this nasty floppy image - can I prevent it from doing so ?
A: Yes and No - In the stoneage of PCs in the early 1980s there was no way to make a PC boot from a CD - mostly because CDs did no exist at all. So when the CDs came up and people wanted to boot from these just as they did with floppy disks, there was an agreement that the BIOS should read a special floppy image file on bootable CDs, load it into memory and treat it just as it treats real floppies. For this reason the script needs to create a raw copy of a bootable floppy that will be located on the CD image afterwards. Finally the CD image wil be burned on a CD medium. When the PC boots from such a CD, it extracts the floppy image, maps it into RAM and treats it as decribed above. There's no elegant way to access and modify such images under windows so the script will always create by writing files onto a floppy and creating a raw image afterwards. In Linux theres a concept called loopback-devices that allows for the mounting and access to such images. The drawback with this is that you must have superuser privileges to do so. So if you want to avod the long lasting procedure, make sure that you become root before you invoke the mkcd.sh script. Note however, that the very first time you invoke it, an floppy disk is neccessary regardless whether you're superuser or not, because a first image must be created. Subsequent invokation will then use the image created before.
Q: Okay, if it's really neccessary to create a floppy image because it must reside o the CD, how is it possible that there fit more on the CD than there was space on the floppy ?
A: The reason for this is, that not all of the files the fli4l box needs to startup must be located for the actal boot procedure. For this, onl the bootloader, the linux kernel and the root filesystem must be located on the floppy. The rest - that's the opt.tgz archive that contains all the optional files - may safely reside on the actual CD rather than in the floppy image. So the majority of a huge configuration is this archive - its size may vary from several hundreds of kB up to mayn MB. Fortunatelly ther's plenty of space on CDs, so this should be sufficient even if your configuration cause many optional files to be included into this archive.
Q: If I try to actually burn the CD, the program Cdrecord won't get started.
A: (contributed by Oliver Frank)
...
I recently installed your opt-package using a fresh w2k environment and I noticed that Cdrecord won't start up because probably the wnaspi32.dll was not found in the system. Due to license issues, this dll is not included into M$ products and even a nero demo installation won#t succeed without prior downloading of this file from somewhere else :)
Apparently Nero & Co. search all the directories below C: but Cdrecord (still) does not so and considers only the standard locations for dll's.
Description:
first installed cdrwin (demo) -> aspi error message
test: installed nero (demo) -> aspi error message
copied wnaspi32.dll from some place into the cdrwin directory -> all burning programs functioning perfectly except cdrecord..
...

### Third party software

This package contains some third-party programs to create a CD image and to actually write it to a blank medium and to perform the script communication.

1. CDRTOOLS - binary windows version 1.11a12 (Author: J”rg Schilling), see
   `http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private`
   for the lastest version. CDRTOOLS are under the GPL, see licence details.
   You'll find find binaries of `mkisocd` and `cdrecord` in the `windows/` directory. For a list of supported CD recorders search the linke above. For licence details, see here
2. GETVAR.EXE - form the citrix multi tools (Author: Eric Thurber), see
   `http://www.oregonclassifieds.net`
   for the lastest version.

### Links

http://fli4l.sf.net/ http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private http://www.oregonclassifieds.net/

Author: A. Pogoda
Datum: Feb. 25th 2002
Modified: Apr. 05th 2002
Modified: May 23rd 2002
Modified: Aug. 19th 2002