FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 08-15-2008, 02:28 PM
Urs Thuermann
 
Default debootstrap and GRUB bootloader

I want to build a Debian system using debootstrap and install that on
a Compact Flash card for an x86 embedded system.

I have created and mounted a fresh file system on a logical volume
which I install the new Debian system into using debootstrap. That
works fine and I can chroot into the new system and install some more
package using aptitude. This is done by a simple shell script:

#!/bin/sh
mkfs /dev/vg0/cu
mount /dev/vg0/cu cu
debootstrap lenny cu
cp config/etc/hostname cu/etc
cp config/etc/fstab cu/etc
...
chroot cu <<EOF
mount /proc
mount /dev/pts
mount -t sysfs sysfs /sys
aptitude update
aptitude install -y -R iproute less wpasupplicant ferm tcpdump ppp
pciutils openssh-{client,server} telnet ftp hdparm bridge-utils
bzip2 file dnsutils dhcp3-server bind9 ntp ntpdate grub
umount /sys
umount /dev/pts
umount /proc
EOF

I then copy the file system image onto the Compact Flash card using dd

# umount /dev/vg0/cu
# dd if=/dev/vg0/cu of=/dev/sdb1

But then, installing the GRUB bootloader fails:

# mount /dev/sdb1 /mnt
# chroot /mnt
# mknod /dev/sdb b 8 16
# mknod /dev/sdb1 b 8 17
# ls -A /boot
# grub-install /dev/sdb
Searching for GRUB installation directory ... found: /boot/grub
The file /boot/grub/stage1 not read correctly.
# ls -AF /boot
grub/
# ls -lAF /boot/grub
total 212
-rw-r--r-- 1 root root 197 Aug 15 14:15 default
-rw-r--r-- 1 root root 15 Aug 15 14:15 device.map
-rw-r--r-- 1 root root 8704 Aug 15 14:15 e2fs_stage1_5
-rw-r--r-- 1 root root 8544 Aug 15 14:15 fat_stage1_5
-rw-r--r-- 1 root root 9568 Aug 15 14:15 jfs_stage1_5
-rw-r--r-- 1 root root 7904 Aug 15 14:15 minix_stage1_5
-rw-r--r-- 1 root root 10720 Aug 15 14:15 reiserfs_stage1_5
-rw-r--r-- 1 root root 512 Aug 15 14:15 stage1
-rw-r--r-- 1 root root 128616 Aug 15 14:15 stage2
-rw-r--r-- 1 root root 10280 Aug 15 14:15 xfs_stage1_5
# cat /boot/grub/device.map
(hd0) /dev/sdb
#

So grub-install copies all stage* to /boot/grub and correctly creates
the devices.map file, but seems to have some problem with the stage1
bootloader. I have also strace(1)ed the call to grub-install but
couldn't find out the problem.

I have also checked the MBR of /dev/sdb an there is no GRUB bootloader
installed.

So what can I do to complete the bootloader install? What does the
error message

The file /boot/grub/stage1 not read correctly.

mean? I think simply copying stage1 to /dev/sdb manually, i.e.

# dd if=/dev/stage1 of=/dev/sdb bs=446

won't work since, AFAIK, the MBR must contain the references (block
numbers) to the stage1_5 loaders.

urs


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 08-25-2008, 03:42 PM
Osamu Aoki
 
Default debootstrap and GRUB bootloader

I may be wrong but ...

On Fri, Aug 15, 2008 at 04:28:03PM +0200, Urs Thuermann wrote:
> I want to build a Debian system using debootstrap and install that on
> a Compact Flash card for an x86 embedded system.
>
> I have created and mounted a fresh file system on a logical volume
> which I install the new Debian system into using debootstrap. That
> works fine and I can chroot into the new system and install some more
> package using aptitude. This is done by a simple shell script:
>
> #!/bin/sh
> mkfs /dev/vg0/cu

So it is flat ext3 across flash. Usualy, you parttion them like
harddisk and make filesystem on the first and only partition /dev/sda1.

Osamu


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 12:36 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org