bootable image problem

Sergey Lyubka devnull at
Thu Aug 5 06:39:48 PDT 2004

I am trying to create an bootable image, this is a script
that does the job:

==== cut here 

dd if=/dev/zero of=img count=8 bs=1m 2>/dev/null
mdconfig -a -t vnode -u 0 -f img
bsdlabel -Bw $MD
bsdlabel $MD | sed -e '/  c:/{p;s/c:/a:/;}' | bsdlabel -R $MD /dev/stdin
newfs -m 0 -o space -f 512 -b 4096 ${MD}a > /dev/null
mkdir dsk
mount ${MD}a `pwd`/dsk
trap "umount ${MD}a ; mdconfig -d -u 0; rm -rf dsk; " EXIT

cp /boot/kernel/kernel dsk/kernel
mkdir dsk/boot
cp /boot/loader* dsk/boot/

===== cut here

Booting this image with qemu, I see this:
FreeBSD/i386 boot
Default: 0:ad(0,a)/boot/loader
boot: No /boot/loader

Trying to boot /kernel, I see this:
boot: error 12 lba 1008
Invalid format

Any hints ?

More information about the freebsd-current mailing list