[syslinux] booting a dos floppy from a disk image over pxe

Helmut Hullen Hullen at t-online.de
Mon Apr 2 01:45:00 PDT 2012


Hallo, geert,

Du meintest am 02.04.12:

> I'm trying to boot a dos floppy stored on a disk image which is
> initially loaded over pxe using memdisk.
> I've created the disk image as follows:

> dd if=/dev/zero of=$IMGLOCATION/$IMGNAME bs=$(( 1024 * 1024 ))
> count=20 LOOPDEV=$(losetup --show -f $IMGLOCATION/$IMGNAME)
> MAJOR_MINOR=$(ls -l $LOOPDEV|awk '{print $5$6}'|sed 's/,/:/')
> DMSIZE=$(( $(ls -l $IMGLOCATION/$IMGNAME|awk '{print $5}') / 512 ))
> echo 0 $DMSIZE linear $MAJOR_MINOR 0|dmsetup create hdz
> fdisk /dev/mapper/hdz<<EOT
> n
> p
> 1


> t
> 6
> a
> 1
> w
> EOT
> kpartx -a /dev/mapper/hdz
> mkdosfs /dev/mapper/hdz1

> Then I put a dosfloppy image and memdisk on the image:

> mount /dev/mapper/hdz1 /mnt/
> mkdir -p /mnt/boot/grub
> cp dos622.IMA /mnt/boot/
> cp /usr/lib/syslinux/memdisk /mnt/boot

> /mnt/boot/grub/grub.cfg contains:
> linux16 /boot/memdisk
> initrd16 /boot/dos622.IMA
> boot

> and I install grub:

> grub-install --root-directory=/mnt /dev/dm-0

> This works perfectly on a virtualbox installation, I get a dos
> environment with a C: disk.

Why these circumstances?

My usual way:

Put the floppy disk into the drive

  mkdir -p /tftpboot/images
  dd if=/dev/fd0 of=/tftpboot/images/myspecial.img

for PXE-Boot:

  additional entry p.e. in "/tftpboot/pxelinux.cfg/default"

LABEL myspecial
    MENU LABEL myspecial
    kernel memdisk
    append initrd=images/myspecial.img



Viele Gruesse!
Helmut



More information about the Syslinux mailing list