os-prober: possible for the syslinux bootloader?

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
User avatar
francois
Contributor
Contributor
Posts: 6445
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

os-prober: possible for the syslinux bootloader?

Post#1 by francois » 18 Sep 2014, 20:16

Trying to understand os-prober in grub2, I learned that some fedora folks in 2011 has adapted that debian-ubuntu tool proper to grub2, to fedora and grub legacy:
http://hedayatvk.wordpress.com/2011/02/ ... os-prober/

os-prober detects other linux system and windows on your linux box. It exists for slackware 14.1 for the two architectures, here is the 64 bit:
http://slackware.cs.utah.edu/pub/slackw ... 6_64-1.txz

I am going to see if I cannot adapt it to syslinux. If you are interested, just join in.
Prendre son temps, profiter de celui qui passe.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: os-prober: possible for the syslinux bootloader?

Post#2 by brokenman » 19 Sep 2014, 02:31

For a 16Kb package it is pretty good. It correctly found most OSs on my system with the exception of porteus and the default bootx64.efi file (in my case it is rEFInd).

Code: Select all

root@porteus:/home/guest# os-prober 
  No volume groups found
/dev/sda11:Gentoo Base System release 2.2:Gentoo:linux
/dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
/dev/sda6:Slackware Linux (Slackware 14.1):Slackware:linux
/dev/sda9:Gentoo Base System release 2.2:Gentoo1:linux
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
francois
Contributor
Contributor
Posts: 6445
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: os-prober: possible for the syslinux bootloader?

Post#3 by francois » 19 Sep 2014, 16:56

@brokenman:
There is more to it, Hedayat the author just took the script of os-prober, and modified it to generate grub1 menu.lst, which are quite akin to syslinux menu entries:
http://hedayatvk.wordpress.com/2011/02/ ... os-prober/
modify grub2’s os_prober script to generate menu entries for Grub1, the script is here :
http://hedayat.fedorapeople.org/scripts ... -prober.sh

I don't get it why for now, but I am unable to get it running on my linuxbox. Sometimes I am so linux unwise. Maybe you could find a way to get it running.

The script which is called grub1-other-os-prober.sh will work given you have the latest version of os-prober.txz installed on the system. It will give the following output on my system:

Code: Select all

root@porteus:~/Desktop/tmp/777# ./grub1-other-os-prober.sh
  No volume groups found
Found elementary OS Luna (0.2) on /dev/sda2
title elementary OS, with Linux 3.2.0-67-generic-pae (on /dev/sda2)
grep: /boot/grub/device.map: No such file or directory
        root (,1)
        kernel /boot/vmlinuz-3.2.0-67-generic-pae root=UUID=3e91dea6-a4a8-47a6-b6a9-9ee4391caee3 ro quiet splash $vt_handoff
        initrd /boot/initrd.img-3.2.0-67-generic-pae
title elementary OS, with Linux 3.2.0-67-generic-pae (recovery mode) (on /dev/sda2)
grep: /boot/grub/device.map: No such file or directory
        root (,1)
        kernel /boot/vmlinuz-3.2.0-67-generic-pae root=UUID=3e91dea6-a4a8-47a6-b6a9-9ee4391caee3 ro recovery nomodeset
        initrd /boot/initrd.img-3.2.0-67-generic-pae
title elementary OS, with Linux 3.2.0-51-generic-pae (on /dev/sda2)
grep: /boot/grub/device.map: No such file or directory
        root (,1)
        kernel /boot/vmlinuz-3.2.0-51-generic-pae root=UUID=3e91dea6-a4a8-47a6-b6a9-9ee4391caee3 ro quiet splash $vt_handoff
        initrd /boot/initrd.img-3.2.0-51-generic-pae
title elementary OS, with Linux 3.2.0-51-generic-pae (recovery mode) (on /dev/sda2)
grep: /boot/grub/device.map: No such file or directory
        root (,1)
        kernel /boot/vmlinuz-3.2.0-51-generic-pae root=UUID=3e91dea6-a4a8-47a6-b6a9-9ee4391caee3 ro recovery nomodeset
        initrd /boot/initrd.img-3.2.0-51-generic-pae
Found Bodhi 2.4.0 (12.04) on /dev/sda7
title Bodhi Linux, with Linux 3.8.0-19-generic (on /dev/sda7)
grep: /boot/grub/device.map: No such file or directory
        root (,6)
        kernel /boot/vmlinuz-3.8.0-19-generic root=UUID=ee218332-3e92-4133-a1df-fcbeb2d9911e ro splash quiet $vt_handoff
        initrd /boot/initrd.img-3.8.0-19-generic
title Bodhi Linux, with Linux 3.8.0-19-generic (recovery mode) (on /dev/sda7)
grep: /boot/grub/device.map: No such file or directory
        root (,6)
        kernel /boot/vmlinuz-3.8.0-19-generic root=UUID=ee218332-3e92-4133-a1df-fcbeb2d9911e ro recovery nomodeset
        initrd /boot/initrd.img-3.8.0-19-generic
root@porteus:~/Desktop/tmp/777#
It has found the other instances of linux installations on my box, that is elementary and bodhi linux. But the output has some little errors.

However, it could be improved with as search function looking into the /etc/grub.d/40_custom files, where I had set grub2 for my porteus installations or simply by looking in my grub legacy menu.lst files.

With some little improvements, it could yield the necessary information missing to grubconfig which is a grub legacy installer with a deficient os-prober for grub2 os installations.
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 6445
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: os-prober: possible for the syslinux bootloader?

Post#4 by francois » 20 Sep 2014, 00:43

Here is the menu.lst built by grubconfig:

Code: Select all

# GRUB configuration file '/boot/grub/menu.lst'.
# generated by 'grubconfig'.  Fri Sep 19 20:37:03 2014
#
# The backup copy of the MBR for drive '/dev/sda' is
# here '/boot/grub/mbr.sda.9207'.  You can restore it like this.
# dd if=mbr.sda.9207 of=/dev/sda bs=512 count=1
#
# Start GRUB global section
#timeout 30
#color light-gray/blue black/light-gray
# End GRUB global section
# Linux bootable partition config begins
  title Linux on (/dev/sda2)
  root (hd0,1)
  kernel /boot/vmlinuz root=/dev/sda2 ro vga=normal
# Linux bootable partition config ends
# Linux bootable partition config begins
  title Linux on (/dev/sda5)
  root (hd0,4)
  kernel /boot/vmlinuz root=/dev/sda5 ro vga=normal
# Linux bootable partition config ends
# Linux bootable partition config begins
  title Linux on (/dev/sda6)
  root (hd0,5)
  kernel /boot/vmlinuz root=/dev/sda6 ro vga=normal
# Linux bootable partition config ends
# Linux bootable partition config begins
  title Linux on (/dev/sda7)
  root (hd0,6)
  kernel /boot/vmlinuz root=/dev/sda7 ro vga=normal
# Linux bootable partition config ends
# Other bootable partition config begins
  title Windows on (/dev/sdb1)
  map (hd0) (hd1)
  map (hd1) (hd0)
  rootnoverify (hd1,0)
  makeactive
  chainloader +1
# Other bootable partition config ends
title --- For help press 'c', type: 'help'
root (hd0)
title --- For usage examples, type: 'cat /boot/grub/grub.txt'
root (hd0)
Prendre son temps, profiter de celui qui passe.

Post Reply