Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am attempting to cross install linux on a router board(soekris net4521) from my workstation. The media is a compact flash card. I am having difficulty getting lilo installed.
I have made a bootstrap linux install on the cf drive which is mounted from /dev/sdd on /home/me/target.
The primary issue seems to be that in target /dev there are no hd* devices. This my first cross install so I don't know if this is expected or not, and all of the guides I have seen suggest to use grub, which has some issues with my disk geometry. As a result, It was advised that I use lilo instead. I tried to install lilo two ways:
first try, "chroot"
Code:
lxion:~$sudo chroot target /bin/bash
root:/# mount -a
root:/# lilo -C /etc/lilo.conf
Fatal: stat /dev/sdd: No such file or directory
hmmm. no luck there. Even though the cf drive is mounted on /dev/sdd iny workstation file system it doesn't show up in the chroot'ed file system /dev...
second try, "external"
Code:
lxion:~$sudo lilo -C target/etc/lilo.conf
Warning: LBA32 addressing assumed
Warning: The boot sector and map file are on different disks.
Warning: no PROMPT with SERIAL; setting DELAY to 20 (2 seconds)
Fatal: Illegal 'root=' specification: /dev/hda1
I see that I did something bad with the map file, it should be going on what ever is to be /dev/hda1. I know for sure that when the router boots it's bios reports the cf disk as /dev/hda so I am hesitant to change this...
Now, I have exhausted the options that I know of, and google didn't turn up any thing too useful
this is my lilo.conf
Code:
# NOTE: boot and disk below must be set to wherever your distro
# is currently mounted (while you're installing LILO). Don't mess
# with anything else unless you really know what you're doing.
boot = /dev/sdd
disk = /dev/sdd
bios = 0x80
delay = 1
serial=0,9600n8
image = /boot/vmlinuz-2.6.22-14-generic
root = /dev/hda1
append="console=ttyS0,9600n8"
label = soekris-2.6.22-14
read-only
The primary issue seems to be that in target /dev there are no hd* devices. This my first cross install so I don't know if this is expected or not, ...
If your target system is using a recent 2.6 kernel then it is to be expected. This is because recent 2.6 kernel dynamically create such things at boot time with udev.
The first thing you might try is using the -r option with LILO:
Code:
lilo -r target
I don't know if this will work. The documentation says this causes lilo to chroot into the target evironment. If it means that literally, then of course it will fail for the same reason it failed when you manually chrooted. However, if lilo does the dirty work itself, then it might work.
Quote:
Even though the cf drive is mounted on /dev/sdd iny workstation file system it doesn't show up in the chroot'ed file system /dev...
chroot does that. In the chrooted environment, it doesn't know anything about your "main" /dev directory. If my above suggestion fails, you could manually create a /dev/sdd on your target system:
Code:
mknod -m 660 target/dev/sdd [major minor]
Replace [major minor] with the major and minor device numbers you need. I suggest you just get these from
Code:
ls -l /dev/sdd
(That way neither you nor I have to figure out what those things actually mean! )
After you have installed LILO, you might want to delete /dev/sdd on your target system. (Although my guess is it doesn't matter.)
Are you tied to LILO? Or can you switch to GRUB? I use GRUB to boot from compact flash on several embedded systems we use here. One advantage to GRUB is that you can specify a "--root-directory" option if you use the "grub-install" script. Also, "grub-install" supports a "--recheck" option to detect the BIOS drive order.
I started with grub, but it didn't play nice with my disk geometry (well to be true this was probably the fault of the soekris's bios not reading the drive params, c/h/s, correctly) and I was advised to try lilo...
I am attempting to cross install linux on a router board(soekris net4521) from my workstation. The media is a compact flash card. I am having difficulty getting lilo installed.
Another trick I use is to use "dd" and "cat" to combine a bootloader and partition table. If you have a machine setup to boot from "/dev/hda1" with LILO, you can use "dd" to get just the LILO section of the MBR using
Code:
# dd if=/dev/hda of=lilo.mbr bs=1 count=446
That will read just the first 446 bytes of the MBR on "/dev/hda" and save it to "lilo.mbr". Then you get the partition table from your "/dev/sdd" device using
That skips over the bootloader on the compact flash (probably garbage) and saves just the partition table to "table.mbr". You can glue them together using
Code:
# cat lilo.mbr table.mbr > boot.mbr
Then you install the shiny new MBR using
Code:
# dd if=boot.mbr of=/dev/sdd bs=512 count=1
I use this method to replace GRUB with NTLDR, or vice versa.
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.