Bernd Blaauw
2013-Aug-09 15:24 UTC
[syslinux] com32 module compatibility between 5.x versions
H. Peter Anvin schreef op 9-8-2013 7:37:> Sorry. If you are substituting any files you should substitute them all.I assume it's not possible to store a copy of the LDLINUX.SYS binary at the end or inside of either ISOLINUX.BIN or LDLINUX.C32 then? Then at least it could be extracted, for those distributions not having LDLINUX.SYS / SYSLINUX(64).EXE present on their CD. Having ISOLINUX.BIN working on FAT and NTFS instead of only ISO9660 impossible as well I guess (as that's LDLINUX.SYS' specialisation). Bernd
Pete Batard
2013-Aug-09 17:54 UTC
[syslinux] com32 module compatibility between 5.x versions
On 2013.08.09 16:24, Bernd Blaauw wrote:>> Sorry. If you are substituting any files you should substitute them all. > > I assume it's not possible to store a copy of the LDLINUX.SYS binary at > the end or inside of either ISOLINUX.BIN or LDLINUX.C32 then?That's good thinking, and would indeed be great help. 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. Also, if the best answer I get is that I'll just have to be creative with trying to compensate for the version lockdown, could I at least get an answer to my question of how one can determine the exact version of a .c32 file? Regards, /Pete
Gene Cumm
2013-Aug-09 18:18 UTC
[syslinux] com32 module compatibility between 5.x versions
On Fri, Aug 9, 2013 at 1:54 PM, Pete Batard <pete at akeo.ie> wrote:> Also, if the best answer I get is that I'll just have to be creative with > trying to compensate for the version lockdown, could I at least get an > answer to my question of how one can determine the exact version of a .c32 > file?In general, no. There's a magic number but only indicates the major version. Specific COM32 files do utilize the build data but to my knowledge, only 2. Specific to ldlinuxc32, I also don't know if there is a way. It would be nice if this were embedded into the COM32 header format (version number and the string). -- -Gene
Rich Mahn
2013-Aug-09 19:23 UTC
[syslinux] com32 module compatibility between 5.x versions
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.Pete, 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 USB. # 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 them. 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 MENU SEPARATOR 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 /dev/sdX4'. # 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 Rich
H. Peter Anvin
2013-Aug-10 00:55 UTC
[syslinux] com32 module compatibility between 5.x versions
On 08/09/2013 08:24 AM, Bernd Blaauw wrote:> H. Peter Anvin schreef op 9-8-2013 7:37: > >> Sorry. If you are substituting any files you should substitute them all. > > I assume it's not possible to store a copy of the LDLINUX.SYS binary at > the end or inside of either ISOLINUX.BIN or LDLINUX.C32 then? Then at > least it could be extracted, for those distributions not having > LDLINUX.SYS / SYSLINUX(64).EXE present on their CD.Not really. ldlinux.sys isn't just an ordinary file, it really needs to be installed with the Syslinux installer. -hpa
Pete Batard
2013-Aug-10 01:16 UTC
[syslinux] com32 module compatibility between 5.x versions
On 2013.08.10 01:55, H. Peter Anvin wrote:>> I assume it's not possible to store a copy of the LDLINUX.SYS binary at >> the end or inside of either ISOLINUX.BIN > > Not really. ldlinux.sys isn't just an ordinary file, it really needs to > be installed with the Syslinux installer.My application already its own version of the Syslinux installer [1], and simply requires the relevant ldlinux.sys file to be provided. At the moment, I embed ldlinux.sys from Syslinux 4.06 and 5.10 [2]. If ldlinux.sys was present in any shape of form on future 5.x based ISOLINUX images (such as appended at the end of isolinux.bin), I could simply pick up that file, and install it as if it had been embedded in the app. Regards, /Pete [1] https://github.com/pbatard/rufus/blob/master/src/syslinux.c [2] https://github.com/pbatard/rufus/tree/master/res/syslinux