Jump to content











Photo
- - - - -

Detect syslinux 3 / syslinux 4


  • Please log in to reply
18 replies to this topic

#1 Thibaut

Thibaut

    Member

  • Developer
  • 32 posts
  •  
    France

Posted 20 January 2011 - 10:23 AM

Hi there,

Is there any simple way to automatically detect which version of syslinux is used in an ISO ?

By simple I mean :
  • looking to filenames (would be great)
  • reading content in some files
  • any other options ?
I would like to add this feature to LinuxLive USB Creator to be able to automatically select the best option.

Thank you for your help !

#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15153 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 January 2011 - 10:46 AM

There is a string in plain text in isolinux.bin, examples:

ISOLINUX 3.82 2009-06-09 .. Copyright (C) 1994-2009 H. Peter Anvin et al

ISOLINUX 4.00 4.00-pre24 .. Copyright (C) 1994-2010 H. Peter Anvin et al

I guess that easiest would be to search with gsar (or similar) for a hex string of:

49 53 4F 4C 49 4E 55 58 20

and next character(s) up to the dot are Major version, like:

49 53 4F 4C 49 4E 55 58 20 33 2E -> ISOLINUX 3.


49 53 4F 4C 49 4E 55 58 20 34 2E -> ISOLINUX 4.


:confused1:
Wonko

#3 Thibaut

Thibaut

    Member

  • Developer
  • 32 posts
  •  
    France

Posted 20 January 2011 - 10:51 AM

If only all the answers could be so clear and relevant !

Thanks Wonko, i'm coding this right now.

#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15153 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 January 2011 - 11:09 AM

If only all the answers could be so clear and relevant !

Sometimes answers also depend on how well and clearly a question is asked :confused1: :confused1:


Thank Wonko, i'm coding this right now.

You are welcome. :yawn:

:cheers:
Wonko

#5 Thibaut

Thibaut

    Member

  • Developer
  • 32 posts
  •  
    France

Posted 20 January 2011 - 12:58 PM

Done ! I compiled my little test and you can download it there : AutoDetect Syslinux

What it does

You select a folder containing ISOs (even if they are in subfolders) and it tells you if it's using Syslinux 3 or syslinux 4.

It's released under GPL v3 and source code is included. Have fun !


I will try to include this code in next beta of LinuxLive USB Creator.

#6 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1062 posts
  •  
    Belgium

Posted 20 January 2011 - 03:30 PM

Detecting only the major version number isn't very usefull.
Syslinux requires that COM32 modules are used with the same version (major + minor) as the version of ISOLINUX or the installed version of SYSLINUX.

So COM32 modules of v3.68 don't work reliable with Syslinux v3.86 or vice versa.

#7 Thibaut

Thibaut

    Member

  • Developer
  • 32 posts
  •  
    France

Posted 20 January 2011 - 03:54 PM

I think that I've never had issues when using the same major version (I tried on 300 different ISOs)

#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15153 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 January 2011 - 04:20 PM

Detecting only the major version number isn't very usefull.

If I got right the general idea, it was to identify WHICH (Major) version was ALREADY inside a (hopefully WORKING) distro's .iso.
If the developer of the .iso "mixed" COM32 versions I guess it was his/her problem, (and the .iso wouldn't work even before being added to a multi-boot something). :cheers:

Anyway getting also first two characters after the dot shouldn't be a problem....

:cheers:
Wonko

#9 Thibaut

Thibaut

    Member

  • Developer
  • 32 posts
  •  
    France

Posted 20 January 2011 - 04:24 PM

The idea is to extract an ISO to the key then syslinux it to be able to boot. Which , I think, is quite a standard procedure.

I've never heard of com32 modules having to be replaced but maybe it's just my ignorance.

#10 Thibaut

Thibaut

    Member

  • Developer
  • 32 posts
  •  
    France

Posted 04 February 2011 - 09:53 AM

Thanks to this topic, the latest Beta version of LinuxLive USB Creator now features a clever auto-detection of syslinux 3/4 in order to use the good one. Posted Image

#11 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1062 posts
  •  
    Belgium

Posted 04 February 2011 - 11:25 AM

Detection of of COM32® can be done, by looking at the first 5 bytes:
http://bootinfoscrip...280404570661dc4

Syslinux detection is also added (installed Syslinux, not by looking at ldlinux.sys files).

Git summary of boot_info_script:
http://bootinfoscrip...cript;a=summary

#12 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 04 February 2011 - 02:41 PM

...I've never heard of com32 modules having to be replaced but maybe it's just my ignorance.

You'll hear of it when things don't work and someone asks, "Are the COM32[R] modules from the same version as the ISOLINUX?" This has proved to be the cause for many problems. :whistling:

#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15153 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 February 2011 - 03:05 PM

You'll hear of it when things don't work and someone asks, "Are the COM32[R] modules from the same version as the ISOLINUX?" This has proved to be the cause for many problems. :cheers:


Can we conventionally call checking that the right COM32 module is used "preventive whining :cheers: reduction" and just do it? :whistling:

You know, a lot like the Nike's Motto:

Just do it!


:w00t:

:cheers:
Wonko

#14 Thibaut

Thibaut

    Member

  • Developer
  • 32 posts
  •  
    France

Posted 04 February 2011 - 09:08 PM

Most (if not all) tutorials on the internet does not say anything about using the exact same version of syslinux.

What kind of errors do you get from using wrong versions of COM32 modules ?

If you are just talking about Syslinux 4 COM32 modules not backward compatible with syslinux3, it's already been taking care of.

If not then I will need an extra portion of code in LiLi to replace any COM32 module with its matching version (not that easy). Unless you have better ideas ?

#15 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 04 February 2011 - 09:57 PM

Most (if not all) tutorials on the internet does not say anything about using the exact same version of syslinux.

If that's been your experience, then that could also have been the experience of others... Which might explain why it is a fairly common error!

What kind of errors do you get from using wrong versions of COM32 modules ?

Mystery errors. "But it just was working yesterday, all I did was change a filename!" "The same COM32 module works when I copy it to another partition!" The errors could really be anything; the versions really need to match.

If you are just talking about Syslinux 4 COM32 modules not backward compatible with syslinux3, it's already been taking care of.

If not then I will need an extra portion of code in LiLi to replace any COM32 module with its matching version (not that easy). Unless you have better ideas ?

It's more than just major version. If you do not match versions, you risk encountering errors. Anything else is good luck, in that something hasn't changed enough to cause a problem.

#16 Thibaut

Thibaut

    Member

  • Developer
  • 32 posts
  •  
    France

Posted 30 May 2011 - 08:39 AM

Thanks to your help, LinuxLive USB Creator 2.8 Beta is now automatically choosing best version of syslinux (3/4) AND replacing modules with the matching version.

#17 steve6375

steve6375

    Platinum Member

  • Developer
  • 7157 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 30 May 2011 - 02:47 PM

I was using the iGel syslinux Universal Desktop Converter last week and copying it to a USB Flash drive and neither syslinux.exe 3 or 4 worked. There was a version of syslinux.exe included with the iGel ZIP download (see http://sites.google..../tutorials/igel for details) and when I used that version it did boot correctly. Your version detect program returns v3 on the iGel ISO and the chain.c32 file does contain the correct 5 bytes for version 3, yet it does not boot correctly. The only syslinux version that does seem to work is the one included with the iGel download.Posted Image
The syslinux.sys file in the iGel boot files, contains the 'SYSLINUX 3.63' string if that helps any? So does this mean that testing the Major version is not good enough after all?
P.S. I tried using the archived version of syslinux.exe v3.63 but this also did not work, so maybe the iGel syslinux.exe is a modified 'special' one - the iGel version of syslinux.exe has a size of 27648 bytes.

#18 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 30 May 2011 - 04:10 PM

...So does this mean that testing the Major version is not good enough after all?...

In regards to COMBOOT32[R] modules, yes. As IceCube mentioned, major and minor. And if you are compiling the code yourself, match files from the very same build.

(For best results.)

#19 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1062 posts
  •  
    Belgium

Posted 30 May 2011 - 08:35 PM

The syslinux.sys file in the iGel boot files, contains the 'SYSLINUX 3.63' string if that helps any? So does this mean that testing the Major version is not good enough after all?
P.S. I tried using the archived version of syslinux.exe v3.63 but this also did not work, so maybe the iGel syslinux.exe is a modified 'special' one - the iGel version of syslinux.exe has a size of 27648 bytes.

Looking at the screenshot of the Syslinux boot screen of iGel, the original Syslinux v3.63 is not used. This Syslinux v3.63 is patched with gfxboot (Ubuntu used it also for a lot of their releases (Ubuntu 10.10 has a newer Syslinux version with a separate gfxboot.c32 module, if I remember right)).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users