Hi Stephen On 5/14/07, Stephen Fry <[EMAIL PROTECTED]> wrote:
I then realised that the configuration for the root device must be in flash somewhere, so I thought I'd try flash-kernel to update the kernel and initramfs. (BTW how does it know what to mount as the root file system? I assumed that doing update-initramfs read the /etc/fstab and stored it somewhere??).
The script /usr/share/initramfs-tools/hooks/nslu2 is run when updating the initramfs. In that script, there is code to read /etc/fstab and write the root device listed in the fstab to a file called conf/param.conf in the initramfs. For instance, I have an NSLU2 with the root partition in an LVM logical volume. The fstab line for my root device is /dev/mapper/vg0-root / ext3 defaults,errors=remount-ro 0 1 and the contents of param.conf that is generated by update-initramfs is $ cat conf/param.conf ROOT=/dev/mapper/vg0-root (To see the above file, I unpacked my initramfs [1].) This script (param.conf), when executed by the call_scripts function (in scripts/functions in the initramfs), sets the ROOT parameter, which is used by the mountroot function (in scripts/local in the initramfs). For your system (root partition on a RAID device), I think (but I have not tried it) that putting /dev/md5 in your fstab, running update-initramfs and flash-kernel would work once you set the rootdelay parameter (see below).
I haven't checked yet but would the flash-kernel overwrite the change to the root delay in the apex environment?
No, flash-kernel doesn't touch /dev/mtdblock2, which is where APEX is stored. To add the rootdelay parameter to the kernel command line, follow the instructions at http://www.nslu2-linux.org/wiki/Debian/ChangeKernelCommandLine I have found that to use a root partition in an LVM logical volume on a USB disk, a rootdelay parameter of 10 seconds works well (it can probably be less, but this has never failed for me). It should work for a root partition on a RAID1 device on USB disks, because the delay is only required to give the USB disks a chance to register with the kernel (see scripts/init-premount/udev in your initramfs). mountroot, mentioned above is called after the scripts in scripts/init-premount/udev. Let me know how it goes, and if I should make any changes to these instructions. As you pointed out, the bits about modifying fstab, and running update-initramfs and flash-kernel, should be added to the wiki page. It is from emails such as this one that most of the wiki pages I write are developed. I may finally get round to finishing the NSLU2 root on LVM/RAID page with the help this email thread :-) Gordon [1] http://kernel-handbook.alioth.debian.org/ch-initramfs.html -- Gordon Farquharson -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

