Create a bootable HD

To install Bering-uClibc on an IDE device, proceed as follows:

You have to make sure your IDE device has a first bootable partition and is DOS formatted.

Warning

Be careful: you will be destroying any pre-existing data !

Replace initrd.lrp on your Bering-uClibc floppy with initrd_ide_cd.lrp and boot from that floppy.

Keep a second floppy with the hdsupp.lrp package around and insert this floppy after boot.

After login mount the new floppy with hdsupp.lrp, install hdsupp.lrp, partition and format your IDE disk:

mount /dev/fd0 /mnt
cp /mnt/hdsupp.lrp /
cd /
lrpkg -i hdsupp
fdisk /dev/hda

Create an empty DOS partition table (using the 'o' command), create a primary partition and make that bootable (using the 'a' command). Save your changes with 'w'.

Format the IDE device:

mkfs.msdos /dev/hda1

and create a Master Boot Record:

dd if=/usr/sbin/mbr.bin of=/dev/hda bs=512 count=1

Now you can install syslinux; issue the following command:

syslinux [-s] /dev/hda1

The -s flag might be required for syslinux to work with old buggy BIOSes. See the syslinux web site for more instructions.

Umount the floppy with hdsupp.lrp, reinsert your boot floppy and mount it:

mount /dev/fd0u1680 /mnt

Once this is done, the steps for Bering-uClibc 2.1 and previous versions and Bering-uClibc 2.2 and later versions are different.

Bering-uClibc 2.1 and earlier versions

For Bering-uClibc 2.1 and earlier versions edit the syslinux.cfg file in /mnt and change the "boot" and "PKGPATH" entries to point to your harddisk. It will look like:

display syslinux.dpy
timeout 0
default linux initrd=initrd.lrp init=/linuxrc rw root=/dev/ram0 boot=/dev/hda1:msdos PKGPATH=/dev/hda1
   LRP=root,etc,loc

Once you have finished with your floppy preparation, copy all the files from it except ldlinux.sys (which is created by syslinux) to the IDE device that you prepared earlier. You should now be able to boot from the IDE device. Once again be careful not to copy ldlinux.sys from the floppy otherwise your disk won't be bootable and you will have to go over the installation of syslinux on your hard disk again.

An alternative methode is to prepare and load the packages onto your disk with pxeinstall.tgz described in the next chapter. Besides it's pretty fast, once you've setup the environment, it is especially useful if your router has no floppy drive.

Bering-uClibc 2.2 and later versions

For Bering-uClibc 2.2 and later versions edit syslinux.cfg and change the LEAFCFG variable to point to your harddisk:

display syslinux.dpy
timeout 0
default linux initrd=initrd.lrp init=/linuxrc rw root=/dev/ram0 LEAFCFG=/dev/hda1:msdos

Edit leaf.cfg and add your packages to LRP and change PKGPATH to point to your harddisk.

LRP="root config etc local modules iptables dnsmasq keyboard shorwall ulogd libz mawk libssl libm ezipupd dropbear webconf ppp pppoe libpcap"
PKGPATH=/dev/hda1:msdos
syst_size=8M
log_size=2M

If you have declared two partitions on your harddisk, and intend to use the second partition for backups, you have to add the second partition in the PKGPATH variable:

LRP="root config etc local modules iptables dnsmasq keyboard shorwall ulogd libz mawk libssl libm ezipupd dropbear webconf ppp pppoe libpcap"
PKGPATH=/dev/hda2:msdos,/dev/hda1:msdos
syst_size=8M
log_size=2M

Note

The order in PKGPATH is important!

Your second partition has to be the first entry to load the stored configuration, or partial backup, after the original (unconfigured) package.

Once you have finished with your floppy preparation, copy all the files from it EXCEPT ldlinux.sys (which is created by syslinux) to the IDE device that you prepared earlier. You should now be able to boot from the IDE device. Once again be careful not to copy ldlinux.sys from the floppy otherwise your disk won't be bootable and you will have to go over the installation of syslinux on your hard disk again.

An alternative methode is to prepare and load the packages onto your disk with pxeinstall.tgz described in the next chapter. Besides it's pretty fast, once you've setup the environment, it is useful if your router has no floppy drive.