Jump to content











Photo
- - - - -

Grub4dos and Syslinux menu file format


  • Please log in to reply
5 replies to this topic

#1 xpt

xpt

    Frequent Member

  • Advanced user
  • 135 posts
  •  
    Canada

Posted 3 weeks ago

I remember reading somewhere that Grub4dos can read the Syslinux menu format boot entries, and would like to confirm that. 

 

Say I have a menu.conf file for Syslinux, can I use it as it for Grub4dos as-is without any changes, or there are some minor incompatibilities that I have to tweak before use? 

 

I.e., can I just use 

configfile  /boot/extlinux/default.conf

after some Grub4dos specific setup? Here is the content of my /boot/extlinux/default.conf file:

 

 LABEL UM18R1
        MENU LABEL UbuntuMate ^Bionic, UM18R1
        MENU DEFAULT
        KERNEL /vmlinuz
        APPEND initrd=/initrd.img root=UUID=d1e44cce-4a67-4ca2-bc4e-b376250d08b6 ro net.ifnames=0 --

 

(My extlinux is unable to boot my Linux Kernel any more and I still don't know why, so I'm thinking to give Grub4dos a try instead, to boot up my Linux Kernel)

 

Thanks



#2 steve6375

steve6375

    Platinum Member

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

Posted 3 weeks ago

Not heard of this, although I did come across a  syslinux module or command (??) in a recent version of grub2 which I think could handle syslinux cfg files...

 

You could simply translate it manually into grub4dos-speak.

find --set-root --devices=h /vmlinux
kernel /vmlinux root=UUID=d1e44cce-4a67-4ca2-bc4e-b376250d08b6 ro net.ifnames=0 --
initrd /initrd.img
boot

You may need to change the paths  for vmlinux and initrd.img depending on what folder they are in.

 

You can always install grub4dos to a USB drive, boot off the USb drive to the grub4dos console and type in the commands



#3 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 3 weeks ago

I would have said that the menu for syslinui is syslinux. cfg and not menu.conf, but maybe it depends on some version.

 

But I would go a tad bit further, translating them is normally very easy, to the point that at the time I put together an half-@§§ed as usual translating batch (which of course does not cover *every* possibility):

http://reboot.pro/to...-grub4dos-menu/

latest (still unfinished) is here:

http://reboot.pro/to...s-menu/?p=57521

and there is also a (probably "better") python script:

http://reboot.pro/to...es-to-grub4dos/

 

Nowadays, given the capabilities of grub4dos batch language it should be possible to write a grub4dos !BAT to do the same as the above, possibly even better.

 

The "manual way" explained (hopefully, but only for Linux entries):

http://reboot.pro/to...-tftpd32/page-2

http://reboot.pro/to...tpd32/?p=136697

 

 

 

:duff:

Wonko



#4 xpt

xpt

    Frequent Member

  • Advanced user
  • 135 posts
  •  
    Canada

Posted 3 weeks ago

Thank you all!

 

 I can't find where it says that Grub4dos can read the Syslinux menu format boot entries any more -- too many trials, and too many reboots have made it impossible for me to find it now. 

 

Anyway, I've found a wonderful article that is on this exact topic, and I'm glad to be re-posting it here, from https://www.rmprepus...inload-syslinux. Guess who wrote it at the first place?

 

 

Convert a syslinux.cfg file to a menu.lst file
 
This is taken from a post by Wonko the Sane (aka jaclaz)
 
Example syslinux/isolinux entry
 
label parted magic
kernel images/pmagic/bzImage
append noapic initrd=images/pmagic/initramfs root=/dev/ram0 init=/linuxrc ramdisk_size=100000
 
 
When converted to grub4dos we get:
 
title parted magic
kernel /images/pmagic/bzImage noapic root=/dev/ram0 init=/linuxrc ramdisk_size=100000
initrd /images/pmagic/initramfs
 
label becomes title
The initrd command must be used to specify the initial ram filesystem loader file.
 
kernel remains kernel followed by the path to the kernel file
There is no direct equivalent to the append command in grub4dos, because grub4dos it parses ANYTHING after the kernel file, as parameters to be passed to the Linux kernel (same thing append does) but you need to remove the initrd parameter from the kernel parameter list.
 
After a grub4dos command there should be a space (and NOT an = sign, though it's parser allows it).
 
A file or device in grub4dos is always a "qualified" path, when you write /images/pmagic/bzImage you are actually writing ()/images/pmagic/bzImage or in "pseudocode" <current root>/images/pmagic/bzImage. Say that your current root is (pd), then by writing /images/pmagic/bzImage you are actually writing (pd)/images/pmagic/bzImage and of course if you omit the leading slash what you get makes NO sense (pd)images/pmagic/bzImage
 
WARNING: If the menu.lst is not working correctly, make sure you have the correct <cr><lf> characters between each line. If you have use Windows cut-and-paste to copy lines from a web page or from a syslinux or isolinux menu, you can often find that you have invisible characters in your menu.lst file. It may appear OK in Notepad but not in Notepad++. Verify that your menu.lst commands are OK, by running grub4dos and highlighting the menu entry you want to look at, then press e to edit the menu entry - check that the menu lines are correct and identical to the lines in your menu.lst file. This has happened to me several times when copying from a linux file to a standard text file!


#5 ady

ady

    Frequent Member

  • Advanced user
  • 164 posts

Posted 3 weeks ago

In addition to Wonko's methods, UBCD includes "syslinux2grub4dos.cmd", which actually just uses "syslinux2grub4dos.sh". I have to admit that some versions are "better" than others, and it might need some additional touches in order to be more useful outside UBCD's main tools.

GRUB2 indeed includes 3 "syslinuxcfg.mod" modules (1 module per supported platform). YMMV.



#6 xpt

xpt

    Frequent Member

  • Advanced user
  • 135 posts
  •  
    Canada

Posted 3 weeks ago

Ah, thanks for the add on, Ady -- it must be GRUB2 that I saw which can read the Syslinux menu format boot entries then. 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users