[Soekris] Burning Flash Cards

Markus Friedl markus at openbsd.org
Tue Aug 26 11:00:55 UTC 2003


On Mon, Aug 25, 2003 at 03:17:45PM -0400, kfl wrote:
> Thanks for your reply. I do take in account the CHS as you can see at that
> line:
> 
> dd if=/dev/zero of=minibsd-disk.bin bs=512 count=125184
> 
> where count is C*H*S or the sector/units count and is 125184.

no, i think the problem is that the bootloader needs
to know the C/H/S mapping, this is why i'm not using dd, but
something based on this script.  unlike dd it works for all
different flash sizes:

#!/bin/sh
WD=wd1
x=`dmesg|grep "${WD}:.*LBA" |tail -1| sed -n 's/.*LBA, .*MB, \(.*\) cyl, \(.*\) head, \(.*\) sec,.*/\1 \2 \3/p'`
set -- $x; C=$1; H=$2; S=$3; echo $C $H $S
fdisk -c $C -h $H -s $S -e ${WD} << EOF
reinit
w
q
EOF
disklabel -E ${WD} << EOF
z
r
a
a



w
p
q
EOF
newfs r${WD}a; mount /dev/${WD}a /mnt
cp bsd.gz /mnt/bsd; cp bsd.gz /mnt/obsd; cp boot /mnt;
mkdir /mnt/etc; cp etc.boot.conf /mnt/etc/boot.conf
/usr/mdec/installboot -h $H -s $S -v /mnt/boot /usr/mdec/biosboot ${WD}
umount /dev/${WD}a



More information about the Soekris-tech mailing list