[syslinux] PATCH: Build floppy image which contains HDT

Kim Mik kimmik999999 at yahoo.co.uk
Sat Oct 3 14:42:55 PDT 2009


This patch builds a floppy image with contains HDT, so users of GRUB or GRUB4DOS can use HDT too, without installing Syslinux.


When you compile Syslinux, this floppy image isn't build automatically.
To build it, runthe following from the extracted Syslinux source:
  $ cd ./com32/hdt
  $ make hdt.img

As suggested by Pierre-Alexandre Meyer, all extra files required for building
the floppy image are in ./com32/hdt/floppy/:
  - hdt.cfg  ==> avaible as syslinux.cfg inside the floppy image
  - mtools.conf ==> Specifies hdt.img as floppy drive for the mtools programs
  - pci.ids (not included, can be downloaded from http://pciids.sourceforge.net)

hdt.c32 doesn't necessarily need the files modules.alias, modules.pcimap and
pci.ids, but in this patch those files are required for building hdt.img.
I did this because else hdt.img didn't build again when you update one of those
3 files, unless you run:

  $ cd ./com32/hdt
  $ make spotless
  $ make hdt.img

I don't know which way is preferred.


- Gert Hulselmans



$ diff -u ./MCONFIG.old ./MCONFIG
--- ./MCONFIG.old    2009-10-03 21:16:38.172614946 +0200
+++ ./MCONFIG    2009-10-03 21:18:26.956615419 +0200
@@ -52,6 +52,8 @@
 RANLIB   = ranlib
 GZIPPROG = gzip
 PNGTOPNM = pngtopnm
+MCOPY    = mcopy
+MFORMAT  = mformat
 
 com32    = $(topdir)/com32



$ diff -u ./com32/hdt/Makefile.old ./com32/hdt/Makefile
--- ./com32/hdt/Makefile.old    2009-09-30 06:32:42.000000000 +0200
+++ ./com32/hdt/Makefile    2009-10-03 23:06:49.356614719 +0200
@@ -27,6 +27,11 @@
 
 OBJS      = $(patsubst %.c,%.o,$(wildcard *.c))
 
+KERNEL_VERSION          ?= $(shell uname -r)
+MODULES_ALIAS_FILE      ?= /lib/modules/$(KERNEL_VERSION)/modules.alias
+MODULES_PCIMAP_FILE     ?= /lib/modules/$(KERNEL_VERSION)/modules.pcimap
+PCI_IDS_FILE            ?= $(PWD)/floppy/pci.ids
+
 all: $(MODULES) $(TESTFILES)
 
 hdt.elf : $(OBJS) $(LIBS) $(C_LIBS)
@@ -39,9 +44,17 @@
     rm -f *.lnx
 
 spotless: clean
-    rm -f *.lss *.c32 *.com
+    rm -f *.lss *.c32 *.com hdt.img
     rm -f *~ \#*
 
 install:
 
 -include .*.d
+
+hdt.img: hdt.c32 floppy/hdt.cfg $(topdir)/mtools/syslinux $(MODULES_ALIAS_FILE) $(MODULES_PCIMAP_FILE) $(PCI_IDS_FILE) floppy/mtools.conf
+    rm -f hdt.img
+    MTOOLSRC=$(PWD)/floppy/mtools.conf $(MFORMAT) -v HDT -f 2880 -C a:
+    $(topdir)/mtools/syslinux hdt.img
+    MTOOLSRC=$(PWD)/floppy/mtools.conf $(MCOPY) hdt.c32 $(MODULES_ALIAS_FILE) $(MODULES_PCIMAP_FILE) $(PCI_IDS_FILE) a:
+    MTOOLSRC=$(PWD)/floppy/mtools.conf $(MCOPY) floppy/hdt.cfg a:syslinux.cfg
+




$ cat ./com32/hdt/floppy/hdt.cfg
DEFAULT hdt
PROMPT 0

LABEL hdt
COM32 hdt.c32
APPEND modules_pcimap=modules.pcimap modules_alias=modules.alias pciids=pci.ids

================================================================================



$ cat ./com32/hdt/floppy/mtools.conf 
# Floppy image for HDT
drive a: file="hdt.img"

================================================================================


Send instant messages to your online friends http://uk.messenger.yahoo.com 




More information about the Syslinux mailing list