LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Closed Thread
  Search this Thread
Old 01-20-2008, 01:48 PM   #1
santana
Member
 
Registered: Sep 2004
Distribution: FC, ubuntu, OpenSuse
Posts: 112

Rep: Reputation: 16
lilo cross install


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
can you advise?

thanks
Burlen
 
Old 01-20-2008, 03:37 PM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by santana View Post
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.)
 
Old 01-20-2008, 03:50 PM   #3
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by santana View Post
can you advise?
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.
 
Old 01-20-2008, 03:58 PM   #4
santana
Member
 
Registered: Sep 2004
Distribution: FC, ubuntu, OpenSuse
Posts: 112

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by David1357 View Post
Are you tied to LILO? Or can you switch to GRUB?
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...
 
Old 01-20-2008, 05:21 PM   #5
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by santana View Post
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
Code:
# dd if=/dev/sdd of=table.mbr skip=446 bs=1 count=66
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.
 
Old 01-21-2008, 01:55 AM   #6
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
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.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lilo cross install santana Linux - Laptop and Netbook 3 01-20-2008 03:08 PM
Cent OS install on an Optiplex 320... installed lilo... need help with lilo.conf hcervan Linux - Newbie 7 01-18-2008 08:07 AM
lilo ntldr missing after running lilo after slackware install SeriousArnoud Slackware 1 08-16-2005 09:07 AM
Lilo lost, Install disk failing to restore Lilo on dual boot? Dobie Linux - Newbie 2 05-05-2004 05:00 PM
I install Slackware on small HDD with LILO, can't boot LILO? kleptophobiac Slackware 4 08-10-2003 04:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration