Linux on more than one PC104 won't boot - Embedded

This is a discussion on Linux on more than one PC104 won't boot - Embedded ; Help! I have a port of Debian Sarge running from compact flash on a PC104 board. Everything is great. But now my boss wants to support another PC104 board that maps the compact flash to a different ide interface. So ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Linux on more than one PC104 won't boot

  1. Linux on more than one PC104 won't boot

    Help!

    I have a port of Debian Sarge running from compact flash on a PC104
    board. Everything is great. But now my boss wants to support another
    PC104 board that maps the compact flash to a different ide interface.
    So first board the CF is on IDE0,1(/dev/hdb), the second board is
    mapped to IDE1,0 (/dev/hdc).

    How can I use the same distribution (same CF card) on both boards
    without editing the boot=/dev/hdb1 and fstab entry's. There must be a
    way to detect what drive is the first in the system (hdb or hdc) and
    tell grub or fstab to use that instead.

    If I could solve the fstab problem at least I could edit the boot
    parameter in grub and be able to boot the CF card on a different PC
    without first modifying the card.

    thanks for your help.

    David Tucker


  2. Re: Linux on more than one PC104 won't boot

    Hello,

    > I have a port of Debian Sarge running from compact flash on a PC104
    > board. Everything is great. But now my boss wants to support another
    > PC104 board that maps the compact flash to a different ide interface.
    > So first board the CF is on IDE0,1(/dev/hdb), the second board is
    > mapped to IDE1,0 (/dev/hdc).
    >

    That is no big problem, because you can append a /root/ directive to the
    kernel, where to find the root filesystem. In my case this is root=/dev/hda2
    (which works because lilo maps these old names, too).

    > How can I use the same distribution (same CF card) on both boards
    > without editing the boot=/dev/hdb1 and fstab entry's. There must be a
    > way to detect what drive is the first in the system (hdb or hdc) and
    > tell grub or fstab to use that instead.
    >

    If you can tell grub per board (instead of per compact flash card), it would
    be easy. Otherwise you could try to boot from both devices - if booting from
    hdb fails, try booting from hdc. Another idea might be to create two boot
    menu entries for which root partition to use.

    Otherwise my idea would be to create an initrd (or initramfs), which detects
    the device after booting (trying to mount) and then switch the root device
    over and continues booting.

    > If I could solve the fstab problem at least I could edit the boot
    > parameter in grub and be able to boot the CF card on a different PC
    > without first modifying the card.
    >

    I use devfs for my experiments with linux (but i486 architecture). Then I
    get a /dev/root device as my root filesystem. This I simply add to the
    /etc/fstab and everything is done; I don't need any direct reference to
    /dev/ide/host0/bus0/target0/lun0/part2 (in my case). LILO finds itself in
    the mbr...



  3. Re: Linux on more than one PC104 won't boot

    Thanks,

    It looks like udev has replaced devfs for the 2.6 kernel. So I will
    give that a try.

    In grub (hd0) maps to the first drive available. not just IDE0,0 Is
    there no way to map that back into a /dev/hdx reference? it sure would
    be nice if I could do this without editing grub (but not the end of the
    world)

    David


  4. Re: Linux on more than one PC104 won't boot

    Ok, found a better solution, You can give your partitions 'labels'
    (using e2label for ext2/3) and thain in your fstab just replace
    /dev/hdx1 with LABEL=WHATEVER. This works like a dream, its exactly
    what I was looking for.

    In theory this works for the root=/dev/hdx1 parameter as well just
    replace with root=LABEL=WHATEVER Sadly it does not seem to work on
    Debian.

    David Tucker


+ Reply to Thread