[syslinux] com32 module compatibility between 5.x versions

Rich Mahn rich at lat.com
Fri Aug 9 12:23:59 PDT 2013

Pete Batard <pete at akeo.ie> wrote:

> On 2013.08.09 16:24, Bernd Blaauw wrote:
> >> Sorry.  If you are substituting any files you should substitute them all.
> >
> From where I stand, the idea that someone using an ISO will only ever
> use it in optical media mode (either real or emulated) is a thing of
> the past.
> These days, you can be almost certain that someone will attempt to use
> a bootable ISO to create a bootable USB. So if the bootable system
> installed on the ISO took that into consideration from the get go,
> that would help a lot.


  I do this all the time.  I put a number of ISOs on my USB--several
versions each of Fedora, Centos, PartedMagic, AVG, SystemRescueCD, and
others.  Putting just one distribution on it should be easier.  But if
you want to have several, this is how I do it:

1.  grab the syslinux distribution you want to use--probably the latest
    is best.  Create a bootable USB from this distribution.  If the USB
    is /dev/sdc, you should be able to use:

    # mkdiskimage -4 /dev/sdc 0 64 32
    # syslinux /dev/sdc4

2.  mount the USB and create a directory on it.  I use the name
    'sysl_files'.  copy all the *.com, *.c32 and memdisk from the
    distribution to the 'sysl_files' directory.  You might want to add
    the *.bin files as well, just so you'll have easy access to them if
    you need them.

    # mount /dev/sdc4 /mnt/USB
    # mkdir /mnt/USB/sysl_files
    # cp *.com *.c32 *.bin memdisk /mnt/USB/sysl_files

3.  Copy the ldlinux.c32, [vesa]menu.c32 to the root directory on the

    # cp /mnt/USB/sysl_files/ldlinux.c32 /mnt/USB
    # cp /mnt/USB/sysl_files/*menu.c32 /mnt/USB

4.  Since I have several distributions, I create a separate directory
    for each.  So for example, I would create a directory PM1 for my
    first PartedMagic distribution, which I will use as an example here.
    So mount the CD and copy all the files to the PM1 directory.  For
    PartedMagic, you don't need all the files.  Just the ones in the
    'boot' and 'pmagic' directories.

    # mkdir /mnt/USB/PM1
    # cp -a /mnt/CD/boot /mnt/CD/pmagic /mnt/USB/PM1

5.  remove all the *.com, *.c32, and memdisk files that are in the PM1
    directory (and subdirectories) except for the ones you don't have
    replacements for in the sysl_files directory.

    # find /mnt/CD/PM1 -name '*.c32' -exec rm '{}' ';'
    # find /mnt/CD/PM1 -name '*.com' -exec rm '{}' ';'
    # find /mnt/CD/PM1 -name 'memdisk' -exec rm '{}' ';'

6.  to simplify things, move all the files from the PM1/boot/syslinux
    subdirectory to the PM1 directory.  you can then remove the
    PM1/boot/syslinux subdirectory.  The reason for this is that it
    makes the changes to the syslinux.cfg file much easier.  If you are
    only going to have one distribution on the USB, you can put
    everything in the root partition and it becomes much simpler.

    # mv /mnt/USB/PM1/boot/syslinux/* /mnt/USB/PM1
    # rm /mnt/USB/PM1/boot/syslinux

7.  Next you need to edit the syslinux.cfg file.  Some distributions use
    the isolinux.cfg file on CDs, others use syslinux.cfg.  Which ever
    one it is, it's the same changes that need to be made.

    -  insert 'PATH /sysl_files' as the first line.
    -  change all the absolute pathnames to relative pathnames.  If you
       just use one distribution and put it in the root directory, you
       don't need to do this.  For PartedMagic with the changes to locations
       of files described above, this means the following:
       -  remove '/boot/syslinux/' from beginning of path names
       -  remove '/' from the beginning of all other absolute path names

    PartedMagic needs some extra parameters to show where the 'pmagic'
    directory is when it boots, so for PartedMagic, you need to:

    -  add 'directory=PM1' in all the APPEND lines that have "pmagic/" in

    For SystemRescue you would add 'subdir=SRDIR'.  Many distributions
    don't require anything extra.  The magical incantation is specific
    to each distribution.

8.  This fixes the PM1 directory to be bootable on the USB, so you just
    need one more thing.  In the root directory add a stanza like this
    to your syslinux.cfg file:

    LABEL   PM1
    MENU LABEL Parted Magic 2013-0228
    CONFIG      PM1/syslinux.cfg
    APPEND      PM1

    If your distribution uses isolinux.cfg instead, then, of course,
    you would use that in your CONFIG line.

9.  unmount your USB and try booting it.

I can't say this will handle your situation, but I hope this at least
outlines an approach that might work.  One nice thing about this
approach is that you can switch syslinux distributions just by changing
files in the 'sysl_files' directory.  You could even have several
syslinux distributions in different directories and all you would have
to do to change which syslinux you are using is change the names of the
directories so sysl_files is the one you want to use, copy the
ldlinux.c32 and [vesa]menu.c32 to the root directory, and run 'syslinux

# rm -rf /mnt/USB/sysl_files
# cp -r  /mnt/USB/sysl_files_6_01 /mnt/USB/sysl_files
# cp /mnt/USB/sysl_files/ldlinux.c32 /mnt/USB
# cp /mnt/USB/sysl_files/*menu.c32 /mnt/USB
# umount /mnt/USB
# syslinux /dev/sdX4


More information about the Syslinux mailing list