|
Because the CF card is formatted FAT, we can use either Loadlin or SysLinux to boot the filesystem image. I'll be using SysLinux as it should work for any distribution. I'd recommend against trying to use grub or lilo to boot the cf card, as neither seem to want to work, so just leave the CF card as FAT and stick with loadlin or syslinux. If anyone gets lilo or grub to work reliably please let me know. First up, we need to install the CF card, so we can copy files onto it. I usually put it as the secondary master with no other devices on that channel, as some disks don't seem to like it. Under linux it should be /dev/hdc. Leave your hard drive where it is, probably the primary master (/dev/hda) Grab a copy of syslinux from syslinux.zytor.com - you can setup the CF disk from either DOS or Linux. There are ample instructions on the syslinux site, so I won't duplicate them here. I use syslinux /dev/hdc1 Now create a mount point and mount the CF disk with mkdir /tmp/cf mount /dev/hdc1 /tmp/cf Now all we need is to create a syslinux.cfg file on the cf disk and copy the filesystem image across. create a file /tmp/cf/syslinux.cfg as below DEFAULT Lite PROMPT 1 IMPLICIT 0 TIMEOUT 150 LABEL Lite KERNEL vmlinuz APPEND initrd=lite.gz ramdisk=100000 rw root=/dev/ramNote the ramdisk size in the syslinux.cfg is the same as the size of the filesystem image we created. Now copy a kernel to the disk, this assumes you are using slackware. cp /boot/vmlinuz /tmp/cfAnd finally copy the compressed image across cp /tmp/lite.gz /tmp/cfNow check the first partition on the CF card is marked as bootable, using fdisk root@lite:~# fdisk /dev/hdc Command (m for help): p Disk /dev/hdc: 256 MB, 256376832 bytes 16 heads, 32 sectors/track, 978 cylinders Units = cylinders of 512 * 512 = 262144 bytes Device Boot Start End Blocks Id System /dev/hdc1 * 1 977 250096 6 FAT16 Command (m for help): q root@lite:~#Now its all ready for booting. Turn off the computer, move the CF card to the primary master, and reboot.... What you do from here is up to you. There is a lot of tweaking, and setting up still to do, but you should have a basic working bootable Compact Flash card. All of the instructions can be put in a script, so you can automate the whole process, but remember to keep the edited copies of fstab, rc.S and syslinux.cfg so you don't have to re-edit them each time.
Copying and Editing Files << Setup CF Card |
|||
© 2003-2010 silent.gumph.org |