Jump to content











Photo
- - - - -

noobie need to change title on grub2 also using grub4dos HD


  • Please log in to reply
29 replies to this topic

#1 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 27 September 2015 - 08:46 AM

hello,

 

I have two hard drives that work together to boot 5 OS's.

the first hard drive is sata and has three OS's and grub2 installed.

the second hard drive is IDE and has grub4dos with xp and tinycore. 

all OS's boot up fine and work perfectly, but I would like to edit the text on the screens regarding xp and tinycore.

 

 

when the computer boots up, first I get the bios splash screen, then I get the first grub screen.  listed among the entries is this:

 

Microsoft Windows XP Professional (on /dev/sda1)

 

I would rather have it say this:

 

choose between XP Professional and tinycore

 

 

when I select the xp entry, I come to another screen.  here is everything that is said on that screen:

------------------------------------------------------------------------------------------------------------------------------------

please select the operating system to start

Microsoft Windows XP Professional

grub4dos

 

use the up and down arrows to move the highlight to your choice

press enter to choose

for troubleshooting and advance startup options for windows, press F8

------------------------------------------------------------------------------------------------------------------------------------

 

I would like to change

grub4dos

to say

tinycore

 

 

there is one more screen that I will present to provide clarity.  there is nothing wrong with this screen:

------------------------------------------------------------------------------------------------------------------------------------

GRUB4DOS 0.4.5b 2011-09-28, Mem: 637K/3061M/0M, End 353105 

 

Tiny Core

Windows XP

 

use the up and down keys to highlight an entry.  press enter or 'b' to boot.  press 'e' to edit the commands before booting or 'c' for a command line.

-------------------------------------------------------------------------------------------------------------------------------------

 

 

I have already read so many tutorials that my head hurts and I have attempted to fix this myself.  obviously it didn't work.  I need some expert guidance with this.  it would be much appreciated.

 

 

 



#2 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 27 September 2015 - 11:06 AM

I have already read so many tutorials that my head hurts and I have attempted to fix this myself.  obviously it didn't work.  I need some expert guidance with this.  it would be much appreciated.

Well, it seems like you have not entirely clear your current boot sequence.

 

The first screen you see is likely to be the one coming from the grub2.

The settings are then in file boot.cfg (likely in a \boot\\grub\ directory ) on the SATA disk (which is set as the first boot device in your BIOS) 

That entry simply chainloads the IDE disk MBR.

That MBR is the "standard" XP one that chainloads the active partition VBR.

The VBR is the "standard" XP one that chainloads the NTLDR.

The NTLDR loads the BOOT.INI file which contains what you see on screen as:

Microsoft Windows XP Professional

grub4dos

 

 

 

When you choose the "Microsoft Windows XP Professional" entry it will boot XP.

When you choose the grub4dos one, it chainloads grldr (one of the grub4dos files) which loads the settings contained in menu.lst, i.e. menu.lst contains the settings that you see on screen as 

Tiny Core
Windows XP

 

 

So, your boot sequence is:

SATA MBR->grub2->choice in grub.cfg-> IDE MBR->Active partition VBR->NTLDR->choice in BOOT.INI->grldr->choice in menu.lst

Now, when you choose in the last screen "Windows XP" you "go back" to NTLDR, and you loop to ->NTLDR->choice in BOOT.INI->grldr->choice in menu.lst

when you instead choose "Tiny Core" you directly load the OS.

 

To boot the XP you need anyway to go through the "NTLDR->choice in BOOT.INI", but if you have just a single choice in BOOT.INI it will load directly to XP.

 

If you do not use grub4dos, in your setup is not needed, you could add to the grub2 grub.cfg an entry to directly boot Tiny Core and remove the entry for grub4dos from BOOT.INI.

 

I hope that I did not further confuse you. :unsure:

 

:duff:

Wonko



#3 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 27 September 2015 - 01:47 PM

 

The first screen you see is likely to be the one coming from the grub2.

The settings are then in file boot.cfg (likely in a \boot\\grub\ directory ) on the SATA disk (which is set as the first boot device in your BIOS)

yes, grub2 is installed on linux lite which is ubuntu, so the file is /boot/grub/grub.cfg.  on line 217 I changed 'Microsoft Windows XP Professional (on /dev/sda1)' to 'choose between XP professional and tinycore', saved, and ran update-grub in terminal, but still was unable to affect the menu entry.  below is parts of the grub.cfg file that I thought were relevant.  I hope I didn't cut anything out that was needed.


menuentry 'Description:    Linux Lite 2.0 GNU/Linux' --class description_ --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-435899ab-62c3-4c92-85e3-d0768d2ae4b2' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos7'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos7 --hint-efi=hd1,msdos7 --hint-baremetal=ahci1,msdos7  435899ab-62c3-4c92-85e3-d0768d2ae4b2
    else
      search --no-floppy --fs-uuid --set=root 435899ab-62c3-4c92-85e3-d0768d2ae4b2
    fi
    linux    /boot/vmlinuz-3.13.0-24-generic root=UUID=435899ab-62c3-4c92-85e3-d0768d2ae4b2 ro  quiet splash $vt_handoff
    initrd    /boot/initrd.img-3.13.0-24-generic
}
submenu 'Advanced options for Description:    Linux Lite 2.0 GNU/Linux' $menuentry_id_option 'gnulinux-advanced-435899ab-62c3-4c92-85e3-d0768d2ae4b2' {
    menuentry 'Description:    Linux Lite 2.0 GNU/Linux, with Linux 3.13.0-24-generic' --class description_ --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-24-generic-advanced-435899ab-62c3-4c92-85e3-d0768d2ae4b2' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos7 --hint-efi=hd1,msdos7 --hint-baremetal=ahci1,msdos7  435899ab-62c3-4c92-85e3-d0768d2ae4b2
        else
          search --no-floppy --fs-uuid --set=root 435899ab-62c3-4c92-85e3-d0768d2ae4b2
        fi
        echo    'Loading Linux 3.13.0-24-generic ...'
        linux    /boot/vmlinuz-3.13.0-24-generic root=UUID=435899ab-62c3-4c92-85e3-d0768d2ae4b2 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-3.13.0-24-generic
    }
    menuentry 'Description:    Linux Lite 2.0 GNU/Linux, with Linux 3.13.0-24-generic (recovery mode)' --class description_ --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-24-generic-recovery-435899ab-62c3-4c92-85e3-d0768d2ae4b2' {
        recordfail
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos7 --hint-efi=hd1,msdos7 --hint-baremetal=ahci1,msdos7  435899ab-62c3-4c92-85e3-d0768d2ae4b2
        else
          search --no-floppy --fs-uuid --set=root 435899ab-62c3-4c92-85e3-d0768d2ae4b2
        fi
        echo    'Loading Linux 3.13.0-24-generic ...'
        linux    /boot/vmlinuz-3.13.0-24-generic root=UUID=435899ab-62c3-4c92-85e3-d0768d2ae4b2 ro recovery nomodeset
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-3.13.0-24-generic
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry 'Memory test (memtest86+)' {
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos7'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos7 --hint-efi=hd1,msdos7 --hint-baremetal=ahci1,msdos7  435899ab-62c3-4c92-85e3-d0768d2ae4b2
    else
      search --no-floppy --fs-uuid --set=root 435899ab-62c3-4c92-85e3-d0768d2ae4b2
    fi
    knetbsd    /boot/memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos7'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos7 --hint-efi=hd1,msdos7 --hint-baremetal=ahci1,msdos7  435899ab-62c3-4c92-85e3-d0768d2ae4b2
    else
      search --no-floppy --fs-uuid --set=root 435899ab-62c3-4c92-85e3-d0768d2ae4b2
    fi
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Microsoft Windows XP Professional (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-68D492BDD4928CC6' {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  68D492BDD4928CC6
    else
      search --no-floppy --fs-uuid --set=root 68D492BDD4928CC6
    fi
    parttool ${root} hidden-
    drivemap -s (hd0) ${root}
    chainloader +1
}
menuentry 'Windows 7 (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-D2A4CCA0A4CC8905' {
    insmod part_msdos
    insmod ntfs
    set root='hd1,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  D2A4CCA0A4CC8905
    else
      search --no-floppy --fs-uuid --set=root D2A4CCA0A4CC8905
    fi
    parttool ${root} hidden-
    chainloader +1
}
menuentry 'Slackware Linux (Slackware 14.1) (on /dev/sdb5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-cef55db5-e514-49c8-bf74-32bbf1872905' {
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  cef55db5-e514-49c8-bf74-32bbf1872905
    else
      search --no-floppy --fs-uuid --set=root cef55db5-e514-49c8-bf74-32bbf1872905
    fi
    linux /boot/vmlinuz root=/dev/sdb5
}
submenu 'Advanced options for Slackware Linux (Slackware 14.1) (on /dev/sdb5)' $menuentry_id_option 'osprober-gnulinux-advanced-cef55db5-e514-49c8-bf74-32bbf1872905' {
    menuentry 'Slackware Linux (Slackware 14.1) (on /dev/sdb5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz--cef55db5-e514-49c8-bf74-32bbf1872905' {
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  cef55db5-e514-49c8-bf74-32bbf1872905
        else
          search --no-floppy --fs-uuid --set=root cef55db5-e514-49c8-bf74-32bbf1872905
        fi
        linux /boot/vmlinuz root=/dev/sdb5
    }
    menuentry 'Slackware Linux (Slackware 14.1) (on /dev/sdb5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz--cef55db5-e514-49c8-bf74-32bbf1872905' {
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  cef55db5-e514-49c8-bf74-32bbf1872905
        else
          search --no-floppy --fs-uuid --set=root cef55db5-e514-49c8-bf74-32bbf1872905
        fi
        linux /boot/vmlinuz root=/dev/sdb5
    }
    menuentry 'Slackware Linux (Slackware 14.1) (on /dev/sdb5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge-smp-3.10.17-smp--cef55db5-e514-49c8-bf74-32bbf1872905' {
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  cef55db5-e514-49c8-bf74-32bbf1872905
        else
          search --no-floppy --fs-uuid --set=root cef55db5-e514-49c8-bf74-32bbf1872905
        fi
        linux /boot/vmlinuz-huge-smp-3.10.17-smp root=/dev/sdb5
    }
}


That entry simply chainloads the IDE disk MBR.

That MBR is the "standard" XP one that chainloads the active partition VBR.

The VBR is the "standard" XP one that chainloads the NTLDR.

The NTLDR loads the BOOT.INI file which contains what you see on screen as:

Microsoft Windows XP Professional

grub4dos

 

I will show you what is in the xp boot.ini file:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional"/noexecute=optin/fastdetect
C:\grldr=grub4dos

 

 

and menu.lst from xp at C:\menu.lst

 

 

default 0
timeout -1

title Tiny Core
root (hd0,1)
kernel /boot/vmlinuz quiet tce=sda2 home=sda2 opt=sda2 norestore
initrd /boot/core.gz

title Windows XP
root (hd0,0)
makeactive
chainloader +1

 

When you choose the "Microsoft Windows XP Professional" entry it will boot XP.

When you choose the grub4dos one, it chainloads grldr (one of the grub4dos files) which loads the settings contained in menu.lst, i.e. menu.lst contains the settings that you see on screen as

Tiny Core
Windows XP

yes.  everything here is fine.

 

 

So, your boot sequence is:

SATA MBR->grub2->choice in grub.cfg-> IDE MBR->Active partition VBR->NTLDR->choice in BOOT.INI->grldr->choice in menu.lst

Now, when you choose in the last screen "Windows XP" you "go back" to NTLDR, and you loop to ->NTLDR->choice in BOOT.INI->grldr->choice in menu.lst

when you instead choose "Tiny Core" you directly load the OS.

 

To boot the XP you need anyway to go through the "NTLDR->choice in BOOT.INI", but if you have just a single choice in BOOT.INI it will load directly to XP.

 

If you do not use grub4dos, in your setup is not needed, you could add to the grub2 grub.cfg an entry to directly boot Tiny Core and remove the entry for grub4dos from BOOT.INI.

agreed.  somehow I got this to work reliably and I have plans to clone the xp partition to pair with another distro.  there are problems playing video with tinycore.  I like to keep a flexible setup so I have options available.  if only I knew how to use this stuff instead of getting lucky and getting it to work.  I am really hoping that I can become good at using grub4dos.  it appears to be the best boot loader/manager.

 

so I am guessing from your reply that the following files possibly need to be edited.

1. linux lite /boot/grub/grub.cfg
2. xp boot.ini

3. xp C:\menu.lst
is this correct?

 

thanks for the reply, wonko  :)
 

 



#4 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 27 September 2015 - 03:37 PM

so I am guessing from your reply that the following files possibly need to be edited.
1. linux lite /boot/grub/grub.cfg
2. xp boot.ini
3. xp C:\menu.lst
is this correct?
 
thanks for the reply, wonko  :)

Yep :).
The only issue with grub2 (which is otherwise an exceptionally good boot manager/bootloader) is that little by little the syntax of its configuration file has been overcomplicated, to the point that it is hardly "human readable" (let alone editable) and I have seen more than one distro recommending to never tough the grub.cfg and rely to some "automagic" program included in the distro itself.
However the entry you are interested in is:
 

menuentry 'Microsoft Windows XP Professional (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-68D492BDD4928CC6' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 68D492BDD4928CC6
else
search --no-floppy --fs-uuid --set=root 68D492BDD4928CC6
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1
}

That you should leave "as is" (though of course you can change the "description line"), the same effect of that would be rendered in GRUB (original) or grub4dos by:

menu Microsoft Windows XP Professional (on /dev/sda1)
root (hd0,0)
chainloader +1

My previous guess was wrong, it seems like your first disk (hd0) is the IDE device, on which you have (at least) two partitions, a first one (which would be (hd0,0) in grub/grub4dos and 'hd0,1' or 'hd0,msdos1' in grub2, and /dev/sda1 in Linux) NTFS formatted containing XP and a second one (which would be (hd0,1) in grub/grub4dos and 'hd0,2' or 'hd0,msdos2' in grub2 and /dev/sda2 in Linux) and the above entry chainloads the VBR of the first partition (not the MBR).
 
So, the matter is now to translate the simple entry in grub4dos menu.lst:
 

title Tiny Core
root (hd0,1)
kernel /boot/vmlinuz quiet tce=sda2 home=sda2 opt=sda2 norestore
initrd /boot/core.gz

to the  syntax grub2 uses (besides the overcomplex, particular way that Ubuntu "automagic" tool creates entry in grub.cfg), but essentially this should do:

menuentry 'Tiny Core' {
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
linux /boot/vmlinuz quiet tce=sda2 home=sda2 opt=sda2 norestore
initrd /boot/core.gz
}

Try adding the above to grub.cfg, this should allow you to boot directly the Tiny Core from grub2 menu.
Then (if it works) you can leave the grub4dos menu.lst "as is" (though there should be no actual need to makeactive the partition), I would rather suggest:
 

default 0
timeout -1

title Tiny Core
root (hd0,1)
kernel /boot/vmlinuz quiet tce=sda2 home=sda2 opt=sda2 norestore
initrd /boot/core.gz

title Windows XP
root (hd0,0)
chainloader /ntldr

 
And reduce the timeout in BOOT.INI to something like 2 or 3:
 

[boot loader]
timeout=2
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional"/noexecute=optin/fastdetect
C:\grldr=grub4dos


:duff:
Wonko



#5 alacran

alacran

    Frequent Member

  • Advanced user
  • 360 posts
  •  
    Mexico

Posted 28 September 2015 - 01:20 AM

@ ejames82

 

From info in your first post, change in grub.cfg this:

EDIT: Change in grub.cfg do not work.

 

menuentry 'Choose between XP Professional and Tinycore (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-68D492BDD4928CC6' {
insmod part_msdos
insmod ntfs

set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 68D492BDD4928CC6
else
search --no-floppy --fs-uuid --set=root 68D492BDD4928CC6
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1
}

 

And just change boot.ini to this:

 

[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional"/noexecute=optin/fastdetect
c:\grldr="Tinycore"

 

It can say "Tinycore" or any name you want, it's only a label, I use "Other options"

 

Changes in red.

 

EDIT: Change in grub.cfg do not work.

 

alacran


Edited by alacran, 28 September 2015 - 09:59 AM.


#6 alacran

alacran

    Frequent Member

  • Advanced user
  • 360 posts
  •  
    Mexico

Posted 28 September 2015 - 09:46 AM

My suggested change in grub.cfg line 217 do not work, in your post you didn't paste your grub.cfg since the first line, here are the first lines:

 

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

 

So I think it is not going to let us change it, as I assume it regenerates.

 

I also have a multibooting PC.

 

To let you know my HDD partitions:

 

Sata 500 GB HDD MBR Formated

 

Frirst Primary partition NTFS XP and Win7 boot files and folders.

 

Second Primary partition NTFS Win7 x64

 

Third Primary partition NTFS Documents - Folder Isos with some WinPe.iso's booting them with grubfordos called from Win7 bootmanager, and some *.VHD's on this partition root, that bootmanager boots directly.

 

Extended Partition:

 

First Logical partition ext4 with Linux Lite on it

 

Second Logical partition Swap

 

Line 217 for mine is:

 

menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-6EC8010BC800D36F' {

 

This is my grub.cfg (Full copy):

 

Spoiler

 

But the other change I suggested for your boot.ini is fine, and it works.

 

alacran



#7 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 28 September 2015 - 10:38 AM

hello alacran,

 

I notice you just posted.

I have a reply ready.  let me post it and then I will focus on your post.

 

thanks



#8 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 28 September 2015 - 10:46 AM

hello wonko and alacran,



@wonko,
 

    The only issue with grub2 (which is otherwise an exceptionally good boot manager/bootloader) is that little by little the syntax of its configuration file has been overcomplicated, to the point that it is hardly "human readable" (let alone editable) and I have seen more than one distro recommending to never tough the grub.cfg and rely to some "automagic" program included in the distro itself.

 


1. what would these programs be called?  if I tried to search for them, what would I enter into the dialog box?, perhaps 'grub2 editor?

2. I, being a noob, can see the benefit of such a program.  it may help to understand what is in the menu.lst and why.  also, what is likely to work from past success and fail because of error.

   

However the entry you are interested in is:
     
    menuentry 'Microsoft Windows XP Professional (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-68D492BDD4928CC6' {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 68D492BDD4928CC6
    else
    search --no-floppy --fs-uuid --set=root 68D492BDD4928CC6
    fi
    parttool ${root} hidden-
    drivemap -s (hd0) ${root}
    chainloader +1
    }

 

yep.  as I previously stated, I tried this, but since I know this was the correct plan, (probably just an error or oversight in the way the change was applied, for example I should have been regular user instead of root or vice-versa), I will attack this issue once again.  I hope you stick around and I will definitely post all info, error or fix.
 

That you should leave "as is" (though of course you can change the "description line"), the same effect of that would be rendered in GRUB (original) or grub4dos by:

    menu Microsoft Windows XP Professional (on /dev/sda1)
    root (hd0,0)
    chainloader +1

 


it's like you said earlier.  grub2 is so complicated compared to grub-legacy.  being a noob, I prefer the simple appearance of grub-legacy as I actually have made changes to grub-legacy and they were easy and permanent.

   

My previous guess was wrong, it seems like your first disk (hd0) is the IDE device, on which you have (at least) two partitions, a first one (which would be (hd0,0) in grub/grub4dos and 'hd0,1' or 'hd0,msdos1' in grub2, and /dev/sda1 in Linux) NTFS formatted containing XP and a second one (which would be (hd0,1) in grub/grub4dos and 'hd0,2' or 'hd0,msdos2' in grub2 and /dev/sda2 in Linux) and the above entry chainloads the VBR of the first partition (not the MBR).

 


ahh, the change of numbering scheme from grub-legacy to grub2.  I wonder what their reason was for this change?

here I ran some commands that may clarify what I have here:

ed@ed-5310S:~$ sudo sfdisk -l -uM

Disk /dev/sda: 9729 cylinders, 255 heads, 63 sectors/track
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sda1   *     0+ 36310- 36311-  37182411    7  HPFS/NTFS/exFAT........36gb........68D492BDD4928CC6........XP Pro
/dev/sda2     36310+ 75320- 39010-  39945622+  83  Linux........39gb........tinycore
/dev/sda3     75320+ 76316-   997-   1020127+  82  Linux swap / Solaris........1gb........
/dev/sda4         0      -      0          0    0  Empty

Disk /dev/sdb: 30401 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sdb1   *     0+ 117185- 117186- 119997486    7  HPFS/NTFS/exFAT........117gb........win7........D2A4CCA0A4CC8905
/dev/sdb2     117186+ 238474  121289- 124198913    f  W95 Ext'd (LBA)........121gb........
/dev/sdb3         0      -      0          0    0  Empty
/dev/sdb4         0      -      0          0    0  Empty
/dev/sdb5     117187  167186  50000   51200000   83  Linux........50gb........salix........cef55db5-e514-49c8-bf74-32bbf1872905
/dev/sdb6     167188  169183   1996    2043904   82  Linux swap / Solaris........2gb........
/dev/sdb7     169185  236567- 67383-  69000000   83  Linux........67gb........linux-lite........435899ab-62c3-4c92-85e3-d0768d2ae4b2
/dev/sdb8     236569  238474   1906    1951744   82  Linux swap / Solaris........2gb........

Disk /dev/sdc: 121601 cylinders, 255 heads, 63 sectors/track
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sdc1         1  953868  953868  976760832    7  HPFS/NTFS/exFAT........1tb........data-only........04E8D6E603A8FF54
/dev/sdc2         0      -      0          0    0  Empty
/dev/sdc3         0      -      0          0    0  Empty
/dev/sdc4         0      -      0          0    0  Empty

ed@ed-5310S:~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0  74.5G  0 disk
├─sda1   8:1    0  35.5G  0 part
├─sda2   8:2    0  38.1G  0 part
└─sda3   8:3    0 996.2M  0 part
sdb      8:16   0 232.9G  0 disk
├─sdb1   8:17   0 114.4G  0 part
├─sdb2   8:18   0     1K  0 part
├─sdb5   8:21   0  48.8G  0 part
├─sdb6   8:22   0     2G  0 part [SWAP]
├─sdb7   8:23   0  65.8G  0 part /
└─sdb8   8:24   0   1.9G  0 part [SWAP]
sdc      8:32   0 931.5G  0 disk
└─sdc1   8:33   0 931.5G  0 part
sr0     11:0    1  1024M  0 rom  

ed@ed-5310S:~$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Sep 28 02:11 04E8D6E603A8FF54 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Sep 28 02:11 10527be4-d18d-4f63-980a-4964c423a744 -> ../../sdb6
lrwxrwxrwx 1 root root 10 Sep 28 02:11 435899ab-62c3-4c92-85e3-d0768d2ae4b2 -> ../../sdb7
lrwxrwxrwx 1 root root 10 Sep 28 02:11 68D492BDD4928CC6 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep 28 02:11 78d94e61-ae58-43fe-ac6e-65ea8b32860f -> ../../sda3
lrwxrwxrwx 1 root root 10 Sep 28 02:11 8081adc7-bd85-429e-8b90-a183b2817f45 -> ../../sdb8
lrwxrwxrwx 1 root root 10 Sep 28 02:11 c3318e90-aec7-4f64-8780-e87f22483c7a -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep 28 02:11 cef55db5-e514-49c8-bf74-32bbf1872905 -> ../../sdb5
lrwxrwxrwx 1 root root 10 Sep 28 02:11 D2A4CCA0A4CC8905 -> ../../sdb1


 

So, the matter is now to translate the simple entry in grub4dos menu.lst:

    title Tiny Core
    root (hd0,1)
    kernel /boot/vmlinuz quiet tce=sda2 home=sda2 opt=sda2 norestore
    initrd /boot/core.gz

to the  syntax grub2 uses (besides the overcomplex, particular way that Ubuntu "automagic" tool creates entry in grub.cfg), but essentially this should do:

    menuentry 'Tiny Core' {
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos2'
    linux /boot/vmlinuz quiet tce=sda2 home=sda2 opt=sda2 norestore
    initrd /boot/core.gz/boot/initrd.img-3.13.0-24-generic
    }

Try adding the above to grub.cfg, this should allow you to boot directly the Tiny Core from grub2 menu.
Then (if it works) you can leave the grub4dos menu.lst "as is" (though there should be no actual need to makeactive the partition), I would rather suggest:

 default 0
    timeout -1

    title Tiny Core
    root (hd0,1)
    kernel /boot/vmlinuz quiet tce=sda2 home=sda2 opt=sda2 norestore
    initrd /boot/core.gz

    title Windows XP
    root (hd0,0)
    chainloader /ntldr

And reduce the timeout in BOOT.INI to something like 2 or 3:
 
    [boot loader]
    timeout=2
    default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
    [operating systems]
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional"/noexecute=optin/fastdetect
    C:\grldr=grub4dos

 

I will try it for a couple of reasons:
1. will it work?
2. will I be successful in editing the file (this is the bigger question)?
I know I can always change it back.  also, as mentioned earlier, I am not sure if I want to keep tinycore, or I can always clone the xp and tinycore to a larger hard drive and add another OS or more.   that's why I like to keep my options open.

And, if it doesn't work, I'll bet we can figure out why and fix it.  :)

I DO like the timeout change in the boot.ini.  it was at 30.  changed to 3 will be good.



@alacran,

the windows boot.ini edits should be a breeze, the linux edits I have difficulty with.  I will try it.  nice job highlighting with the red.  it definitely drives the point home.



thank you for the replies.



#9 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 28 September 2015 - 11:00 AM

alacran,

 

yes.  I see exactly all that you are saying.  there IS a way to make that edit to the grub.cfg file.  that is the key.  I tried it once or twice, then when it didn't work I thought that I was doing something wrong (or not doing something I should have).  now I know that I was definitely on the right track.

 

as you probably noticed, I use linux lite myself, and I am able to access the xp boot.ini files from there.  I didn't try to edit (yet), but my guess is that I can also edit permanently from linux lite.  no need to reboot.

 

thanks for the reply.  it's good to hear from you.



#10 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 28 September 2015 - 12:57 PM

I made changes to the /etc/grub.d/osprober_30 file with gedit as root

 

I recommend making a backup copy of this file before editing

 

around line 150 of the file, I did the following:

 

 

---------------------------------------------------------------------------------------------------------------

#  if [ -z "${LONGNAME}" ] ; then
#    LONGNAME="${LABEL}"
#  fi


if [ "${LONGNAME}" = "Microsoft Windows XP Professional (on /dev/sda1)" ] ; then
  LONGNAME="choose between xp pro and tinycore"
elif [ -z "${LONGNAME}" ] ; then
  LONGNAME="${LABEL}"
fi

-----------------------------------------------------------------------------------------------------------------------

 

Microsoft Windows XP Professional (on /dev/sda1)

is what I didn't want

choose between xp pro and tinycore

is what I wanted

 

I also put hashes, commenting out, the previous three lines above it

 

first, I will reboot, if that doesn't work, I will check that my changes are still saved.  if so, then I will try:

sudo update-grub

and see if that works

 

I got the info from here:

http://ubuntuforums....d.php?t=1287602

about 1/4 of the way down the page



#11 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 28 September 2015 - 01:09 PM

no change in the grub menu, but no changes in the 30_os-prober file either.

 

now I will run update-grub

sudo update-grub

need to be root to run this.

 

when I run in the terminal this was the output:

 

ed@ed-5310S:~$ sudo update-grub
[sudo] password for ed:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-24-generic
Found initrd image: /boot/initrd.img-3.13.0-24-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Microsoft Windows XP Professional on /dev/sda1
Found Windows 7 (loader) on /dev/sdb1
Found Slackware Linux (Slackware 14.1) on /dev/sdb5
done
ed@ed-5310S:~$

it doesn't look promising so far.  I was hoping to already see a change.

I will see what rebooting does and report.



#12 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 28 September 2015 - 02:42 PM

Most probably I have not been clear (or explicit) enough. :unsure:

Due to the (stupid) way grub2 is now configured on most distro's, changes (direct changes) to grub.cfg are "temporary" as some "automatic system" operations may be triggered by some events, including the running of the update-grub.

Still direct edits are the easiest way to test an entry.

Once become certain that the added (or modified) entry works as expected, it is needed to make it "permanent" (actually scripting it in such a way that any run of "update-grub" will re-create it).

This is complex, and needs a minimal background on scripting, but it is all in all doable, Dedoimedo :worship: has a nice step-by-step tutorial on the matter:

http://www.dedoimedo...ers/grub-2.html

 

:duff:

Wonko


  • alacran likes this

#13 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 28 September 2015 - 03:48 PM

hello wonko,

 

 

I have some news to report.  after failing to make the proper edit in 30_os-prober, I also tried to edit the /boot/grub/grub.cfg file.  I was able to edit it and save it easily enough, and IT WORKS  :) :) , but as soon as I run the next update, or update-grub, the old entry will return.  I thought I followed the tutorial as explained.  I planned on doing more digging, but I have to work tomorrow and I am out of time, at least for today.  I have to admit, though, that the edit was no big deal at all, and editing it when needed wouldn't be so bad.  I plan on using grub2 and grub4dos frequently, so I have to keep trying to find the way.

 

I was able to edit the timeout from 10 to -1 at /etc/default/grub and run update-grub to make a permanent change, but to change title entries, I am finding out, is a different matter entirely.

 

the edits you suggested two posts ago would suffer the same fate.  updates will change them back.

 

it may not be such a bad idea to use an 'automagic' program (just temporarily).  just to run diff on the files (before and after) and see what it changes.  it will be on files in /etc/grub.d and /boot/grub/grub.cfg  even after seeing the differences in them I probably wouldn't understand why, but someone out there (probably you) :), would explain it.

 

I am familiar with the dedomeido tutorials (both grub and grub2).  they specifically say (as you mentioned earlier) that they don't recommend editing grub.cfg 'manually'.

 

I don't want to fall asleep in the chair again today.  I will be back.  thanks again.

 

 



#14 alacran

alacran

    Frequent Member

  • Advanced user
  • 360 posts
  •  
    Mexico

Posted 28 September 2015 - 04:45 PM

@ Wonko

 

The page in your link has very good info, just quick read it and keept the link for future needs.

 

BTW Linux Lite v2.6 uses Grub 2 v2.02 Beta 2 as boot loader, same as Ubuntu 14.04.3 LTS.

 

Thanks a lot.

 

alacran



#15 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 29 September 2015 - 01:45 PM

I installed grub customizer and would like to share what I learned from it.  the only task that I asked it to do was change the title from
Microsoft Windows XP Professional (on /dev/sda1)
to
choose between xp pro and tinycore
the first section is the original 30_os-prober file as it appears after fresh install with my OS's entered.
the second is the result of the title change.  a file renamed to
30_os-prober_proxy

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#! /bin/sh
set -e

# grub-mkconfig helper script.
# Copyright © 2006,2007,2008,2009  Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.

prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
quick_boot="1"

export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"

. "${datarootdir}/grub/grub-mkconfig_lib"

found_other_os=

adjust_timeout () {
  if [ "$quick_boot" = 1 ] && [ "x${found_other_os}" != "x" ]; then
    cat << EOF
set timeout_style=menu
if [ "\${timeout}" = 0 ]; then
  set timeout=10
fi
EOF
  fi
}

if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
  exit 0
fi

if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then
  # missing os-prober and/or linux-boot-prober
  exit 0
fi

OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
if [ -z "${OSPROBED}" ] ; then
  # empty os-prober output, nothing doing
  exit 0
fi

osx_entry() {
    found_other_os=1
    if [ x$2 = x32 ]; then
        # TRANSLATORS: it refers to kernel architecture (32-bit)
    bitstr="$(gettext "(32-bit)")"
    else
        # TRANSLATORS: it refers to kernel architecture (64-bit)
    bitstr="$(gettext "(64-bit)")"
    fi
    # TRANSLATORS: it refers on the OS residing on device %s
    onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
        cat << EOF
menuentry '$(echo "${LONGNAME} $bitstr $onstr" | grub_quote)' --class osx --class darwin --class os \$menuentry_id_option 'osprober-xnu-$2-$(grub_get_device_id "${DEVICE}")'  {
EOF
    save_default_entry | grub_add_tab
    prepare_grub_to_access_device ${DEVICE} | grub_add_tab
    cat << EOF
        load_video
        set do_resume=0
        if [ /var/vm/sleepimage -nt10 / ]; then
           if xnu_resume /var/vm/sleepimage; then
             set do_resume=1
           fi
        fi
        if [ \$do_resume = 0 ]; then
           xnu_uuid ${OSXUUID} uuid
           if [ -f /Extra/DSDT.aml ]; then
              acpi -e /Extra/DSDT.aml
           fi
           if [ /kernelcache -nt /System/Library/Extensions ]; then
              $1 /kernelcache boot-uuid=\${uuid} rd=*uuid
           else
              $1 /mach_kernel boot-uuid=\${uuid} rd=*uuid
              if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
                xnu_mkext /System/Library/Extensions.mkext
              else
                xnu_kextdir /System/Library/Extensions
              fi
           fi
           if [ -f /Extra/Extensions.mkext ]; then
              xnu_mkext /Extra/Extensions.mkext
           fi
           if [ -d /Extra/Extensions ]; then
              xnu_kextdir /Extra/Extensions
           fi
           if [ -f /Extra/devprop.bin ]; then
              xnu_devprop_load /Extra/devprop.bin
           fi
           if [ -f /Extra/splash.jpg ]; then
              insmod jpeg
              xnu_splash /Extra/splash.jpg
           fi
           if [ -f /Extra/splash.png ]; then
              insmod png
              xnu_splash /Extra/splash.png
           fi
           if [ -f /Extra/splash.tga ]; then
              insmod tga
              xnu_splash /Extra/splash.tga
           fi
        fi
}
EOF
}

used_osprober_linux_ids=

wubi=

for OS in ${OSPROBED} ; do
  DEVICE="`echo ${OS} | cut -d ':' -f 1`"
  LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
  LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
  BOOT="`echo ${OS} | cut -d ':' -f 4`"
  if UUID="`${grub_probe} --target=fs_uuid --device ${DEVICE%@*}`"; then
    EXPUUID="$UUID"

    if [ x"${DEVICE#*@}" != x ] ; then
      EXPUUID="${EXPUUID}@${DEVICE#*@}"
    fi

    if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" -a "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then
      echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2
      continue
    fi
  fi

  BTRFS="`echo ${OS} | cut -d ':' -f 5`"
  if [ "x$BTRFS" = "xbtrfs" ]; then
    BTRFSuuid="`echo ${OS} | cut -d ':' -f 6`"
    BTRFSsubvol="`echo ${OS} | cut -d ':' -f 7`"
  fi

  if [ -z "${LONGNAME}" ] ; then
    LONGNAME="${LABEL}"
  fi

  gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2

  case ${BOOT} in
    chain)

      case ${LONGNAME} in
    Windows*)
      if [ -z "$wubi" ]; then
        if [ -x /usr/share/lupin-support/grub-mkimage ] && \
           /usr/share/lupin-support/grub-mkimage --test; then
          wubi=yes
        else
          wubi=no
        fi
      fi
      if [ "$wubi" = yes ]; then
        echo "Skipping ${LONGNAME} on Wubi system" >&2
        continue
      fi
      ;;
      esac

      found_other_os=1
      onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
      cat << EOF
menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
EOF
      save_default_entry | grub_add_tab
      prepare_grub_to_access_device ${DEVICE} | grub_add_tab

      if [ x"`${grub_probe} --device ${DEVICE} --target=partmap`" = xmsdos ]; then
      cat << EOF
    parttool \${root} hidden-
EOF
      fi

      case ${LONGNAME} in
    Windows\ Vista*|Windows\ 7*|Windows\ Server\ 2008*)
    ;;
    *)
      cat << EOF
    drivemap -s (hd0) \${root}
EOF
    ;;
      esac

      cat <<EOF
    chainloader +1
}
EOF
    ;;
    efi)

    found_other_os=1
    EFIPATH=${DEVICE#*@}
    DEVICE=${DEVICE%@*}
    onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
      cat << EOF
menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' {
EOF
      save_default_entry | sed -e "s/^/\t/"
      prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"

      cat <<EOF
    chainloader ${EFIPATH}
}
EOF
    ;;
    linux)
      if [ "x$BTRFS" = "xbtrfs" ]; then
         LINUXPROBED="`linux-boot-prober btrfs ${BTRFSuuid} ${BTRFSsubvol}  2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
      else
         LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
      fi
      prepare_boot_cache=
      boot_device_id=
      is_top_level=true
      title_correction_code=
      OS="${LONGNAME}"

      for LINUX in ${LINUXPROBED} ; do
        LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
        LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
        LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
        LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
        LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
        LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`"

        if [ -z "${LLABEL}" ] ; then
          LLABEL="${LONGNAME}"
        fi

    if [ "${LROOT}" != "${LBOOT}" ]; then
      LKERNEL="${LKERNEL#/boot}"
      LINITRD="${LINITRD#/boot}"
    fi

    if [ -z "${prepare_boot_cache}" ]; then
      prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | grub_add_tab)"
      [ "${prepare_boot_cache}" ] || continue
    fi

    found_other_os=1
    onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
    recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true
    counter=1
    while echo "$used_osprober_linux_ids" | grep 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id' > /dev/null; do
        counter=$((counter+1));
    done
    if [ -z "$boot_device_id" ]; then
        boot_device_id="$(grub_get_device_id "${DEVICE}")"
    fi
    used_osprober_linux_ids="$used_osprober_linux_ids 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id'"

    if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
            cat << EOF
menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
EOF
        save_default_entry | grub_add_tab
        printf '%s\n' "${prepare_boot_cache}"
        cat <<  EOF
    linux ${LKERNEL} ${LPARAMS}
EOF
            if [ -n "${LINITRD}" ] ; then
          cat << EOF
    initrd ${LINITRD}
EOF
            fi
        cat << EOF
}
EOF
        echo "submenu '$(gettext_printf "Advanced options for %s" "${OS} $onstr" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {"
        is_top_level=false
    fi
    title="${LLABEL} $onstr"
        cat << EOF
    menuentry '$(echo "$title" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-$LKERNEL-${recovery_params}-$boot_device_id' {
EOF
    save_default_entry | sed -e "s/^/$grub_tab$grub_tab/"
    printf '%s\n' "${prepare_boot_cache}" | grub_add_tab
    cat <<  EOF
        linux ${LKERNEL} ${LPARAMS}
EOF
        if [ -n "${LINITRD}" ] ; then
            cat << EOF
        initrd ${LINITRD}
EOF
        fi
        cat << EOF
    }
EOF
    if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
        replacement_title="$(echo "Advanced options for ${OS} $onstr" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
        quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"
        title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
        grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")"
    fi
      done
      if [ x"$is_top_level" != xtrue ]; then
      echo '}'
      fi
      echo "$title_correction_code"
    ;;
    macosx)
      if [ "${UUID}" ]; then
    OSXUUID="${UUID}"
    osx_entry xnu_kernel 32
    osx_entry xnu_kernel64 64
      fi
    ;;
    hurd)
      found_other_os=1
      onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
      cat << EOF
menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class hurd --class gnu --class os \$menuentry_id_option 'osprober-gnuhurd-/boot/gnumach.gz-false-$(grub_get_device_id "${DEVICE}")' {
EOF
      save_default_entry | grub_add_tab
      prepare_grub_to_access_device ${DEVICE} | grub_add_tab
      grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
      mach_device="`echo "${grub_device}" | sed -e 's/(\(hd.*\),msdos\(.*\))/\1s\2/'`"
      grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
      case "${grub_fs}" in
    *fs)    hurd_fs="${grub_fs}" ;;
    *)    hurd_fs="${grub_fs}fs" ;;
      esac
      cat << EOF
    multiboot /boot/gnumach.gz root=device:${mach_device}
    module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
            --multiboot-command-line='\${kernel-command-line}' \\
            --host-priv-port='\${host-port}' \\
            --device-master-port='\${device-port}' \\
            --exec-server-task='\${exec-task}' -T typed '\${root}' \\
            '\$(task-create)' '\$(task-resume)'
    module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
}
EOF
    ;;
    minix)
      cat << EOF
menuentry "${LONGNAME} (on ${DEVICE}, Multiboot)" {
EOF
         save_default_entry | sed -e "s/^/\t/"
         prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
     cat << EOF
    multiboot /boot/image_latest
}
EOF
    ;;
    *)
      echo -n "  "
      # TRANSLATORS: %s is replaced by OS name.
      gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&2
    ;;
  esac
done

adjust_timeout
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/os-prober' | /etc/grub.d/bin/grubcfg_proxy "+*
+#text
+'Microsoft Windows XP Professional (on /dev/sda1)'~2b5da0e66f682682ab64a30e1286567f~ as 'choose between xp pro and tinycore'
+'Windows 7 (loader) (on /dev/sdb1)'~8a426db0d310977a04a667d6c3a766eb~
+'Slackware Linux (Slackware 14.1) (on /dev/sdb5)'~572e60b31cca0e3b9049c048e398f067~
+'SUBMENU' as 'Advanced options for Slackware Linux (Slackware 14.1) (on /dev/sdb5)'{+'Advanced options for Slackware Linux (Slackware 14.1) (on /dev/sdb5)'/*, +'Advanced options for Slackware Linux (Slackware 14.1) (on /dev/sdb5)'/'Slackware Linux (Slackware 14.1) (on /dev/sdb5)'~1a51882577964f77de17dd643b40b1f5~, +'Advanced options for Slackware Linux (Slackware 14.1) (on /dev/sdb5)'/'Slackware Linux (Slackware 14.1) (on /dev/sdb5)'~1a51882577964f77de17dd643b40b1f5~, +'Advanced options for Slackware Linux (Slackware 14.1) (on /dev/sdb5)'/'Slackware Linux (Slackware 14.1) (on /dev/sdb5)'~94a83f7ee16d0793f1fd670120142117~}
"
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 



#16 alacran

alacran

    Frequent Member

  • Advanced user
  • 360 posts
  •  
    Mexico

Posted 30 September 2015 - 01:18 AM

This is grub customizer page:    https://launchpad.net/grub-customizer

 

And this is Download page:    https://launchpad.ne...grub-customizer

 

Our friend ejames82 forgot to put a link.

 

@ ejames82

 

Good finding, I'll download and try it, thanks.

 

I think it is a good idea if you put those very long text strings inside Spoiler(s), (Select special BBCode and then in it select Spoiler and you paste your info), you can split your info in 2 or more if required, that way your post look cleaner and easy to read.  Take it the good way, this is not no criticize, just trying to give you an idea.

 

alacran



#17 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 30 September 2015 - 03:15 PM

thanks alacran.  I will try to go back and edit.



#18 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 30 September 2015 - 03:30 PM

@wonko,

 

it turns out the dedoimedo tutorial points you to another webpage that instructs you to do the same thing I did in post #10.  I looked it over and even tried it a second time with no success.  the grub-customizer isn't such a bad thing.  I would have preferred to edit the file myself without having to install something for the job.  I have to admit that running update-grub doesn't change it back, so it's actually brilliant.

uninstalling grub2 and reinstalling grub-legacy would be an option to consider if I knew more about how the update process would affect it. 

thanks for the help.  this is a great forum.



#19 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 30 September 2015 - 04:47 PM

Yep. :)

The whole issue is the (did I say stupid?) mechanism GRUB2 is configured for (actually the stupidity is just in the way it is implemented).

Basically when you run update-grub (which is mandatory every time you update the kernel) the whole set of scripts is run, implying the re-detection of whatever was auto-detected before, re-setting the "default" menu entry labels and removing anything that was not previously autodetected.

The net effect is that in order to have something "permanent" it must actually be re-done through the scripts (or a tool like the grub-customizer :thumbsup: which has however it's own quirks/flaws is needed in order to do the "scripting").

 

For a BIOS (not UEFI) motherboard/PC, it would make much more sense (or at lest it does to me) to use grub4dos as primary bootmanager, as it would be able to load directly most Linux installs (besides the GRUB2 and *any* MS operating system loader) but of course then you would need to manually upgrade the configuration when something changes.

 

:duff:

Wonko



#20 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 01 October 2015 - 05:33 PM

yes, you did say stupid.  
do you have any idea what would happen if I purged grub2 and installed grub4dos (assuming I could do so successfully.  it took me 2 days of trial and effort to get it to work before), then ran 'sudo apt-get update'?  would there be problems with grub4dos?  would the update work as intended?  would there be any unwanted behavior that you can think of?
I am thinking of a safe way to try this.  like cloning this hard drive then using the clone to see if it will work.  if it goes wrong I  can stil revert back to the original hard drive.
the worst part about the move to grub2 is, I don't think you can find a distro that has decent support with grub-legacy installed.
thanks for the reply.
 



#21 alacran

alacran

    Frequent Member

  • Advanced user
  • 360 posts
  •  
    Mexico

Posted 01 October 2015 - 05:51 PM

Maybe you can install Grub2 on the partition where you have Linux Lite and GruforDos as the primary loader at MBR or just call it from Boot manager or boot.ini (your actual configuration), as you prefer and then call Grub2 just to boot Linux Lite or another distro using Grub2 as loader or just use your actual menu.lst entrance for Linux Lite

 

alacran



#22 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 02 October 2015 - 01:31 AM

hello alacran,

 

all I should need to do is put the files for grub4dos on the linux lite at root along with grldr and the appropriate menu.lst.  I think the grub4dos prompts to install at the mbr when it's installed and points the boot process at a partition (it's been a long time since I used it)  then boot to the linux lite live cd and remove grub2 and install the grub4dos.  of course, for me, much easier said than done.  I can't imagine it going perfectly on the first try.  I will probably have to come here crying for help.  :)

 

thanks for the reply



#23 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 October 2015 - 02:56 PM

Maybe some "generic" historical info may help.

The "default" (designed/intended) way to boot a PC is the following:

BIOS->MBR->Active Partition Boot Sector

The code in the MBR traditionally has been a simple snippet of code capable of parsing the partition table (also inside the MBR) , choose the partition entry marked as "active" or "boot" (by the value 0x80 in the appropriate field) and pass control to the boot sector of the partition (volume) which normally contained some OS specific code to chainload the OS system files (example MS-DOS IO.SYS) or a specific OS loader (example NT/2K/XP NTLDR or Linux LiLo).

GRUB (the real thing, now senselessly renamed GRUB legacy), grub4dos and GRUB2 (now senselessly renamed GRUB) can be installed to the MBR or to the PBR.

In case the code is installed to the MBR the booting is:

BIOS->"special" MBR (often using additional "hidden sectors)->GRUB (or grub4dos or GRUB2) code->configuration file choice (menu.lst or grub.cfg)->OS system file(s) or loader

In case the code is installed to the PBR the booting is:

BIOS->"normal" MBR -> Active Partition Boot Sector (PBR)->GRUB (or grub4dos or GRUB2) code->configuration file choice (menu.lst or grub.cfg)->OS system file(s) or loader

 

All of these bootmanagers can be pretty much be chainloaded from one to another, the first one that comes out when booting is the "primary" boot manager, which seemingly in your case is GRUB2, which seems like having been installed to the MBR.

 

Your original configuration seems thus like having:

  1. GRUB2 as primary boot manager
  2. NTLDR as secondary boot manager (accessed by a choice in the grub.cfg)
  3. grub4dos as tertiary boot manager (accessed by a choice in BOOT.INI)

The net effect was that to load something through grub4dos you need to make two choices.

 

Now, what I suggested you was to reverse the "priority" and make grub4dos the "primary" boot manager.

The GRUB2 can be installed/re-installed to the PBR of the volume that actually is used by one of your "main" Linux OS.

The grub4dos can be installed either directly tothe MBR (+ a few hidden sectors) or to another volume (active partition) bootsector using a "normal" MBR code.

This way you could have:

BIOS->MBR->grub4dos->menu.lst choices->*anything*

or

BIOS->MBR->PBR->grub4dos->menu.lst choices->*anything*

On the menu.lst you could have three entries (one for each Linux OS you have already in the GRUB2 grub.cfg, but completely bypassing the GRUB2) + 1 for the XP (and since the NTLDR would be in this case only used as OS loader, your BOOT.INI could have just one entry for the XP, and thus no "choices" to select from) + 1 for the Tinycore, and finally one more to directly chainload the GRUB2 (in case of need).

 

In practice, there would be no difference when choosing one of the three "main" Linux OSes, one choice less when booting XP, two choices less when booting the Tinycore.

 

:duff:

Wonko 



#24 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 18 October 2015 - 08:46 AM

hello,
 
sorry for the absense.  things that needed doing at home.
 

 

@wonko,

 

would you be offended if I inquired at other forums concerning my reply in post #10 ?   I thoroughly read the dedomeido tutorials you provided and as I mentioned earlier, the grub2 tutorial points to another tutorial in which I did exactly what was instructed.  I just don't see how it didn't work.  maybe someone else would see something we don't or ask a question about permissions which would bring to light possible reasons why I failed.  possibly even bringing forth a solution which I would be glad to post here.  I would share anything of benefit.  I have a history with permission problems, especialy with linux.  I have found other sites that claim that same fix is supposed to work.

anyway, I always ask before going to other sites, so as to show respect and gratitude. 

 

it would be really nice if I was actually able to change the title on grub2, and could conclude this thread as solved.

 

I actually have more to report, but I intend to start a new thread to keep things organized.  I was able to clone the hard drive with grub2 and I replaced grub2 with grub-legacy.  I am not too far into it, yet,and I will post everything that happens here.  if there was only more time in the day.  :)  I hope you keep an eye on both threads and I really appreciate your help.

 

I did not abandon the thread.  it'll take me a while, but I will be back. 



#25 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 18 October 2015 - 09:59 AM

NO prob whatever :), as a matter of fact the good Linux guys may provide you with the right kind of info as after all they should be fighting all day with GRUB2 mechanisms, and should be familiar with editing/changing it, essentially it is just a matter of learning some shell scripting syntax and put the changes in the "right" file.

 

Though personally I wouldn't even think of using nowadays (2015) GRUB (the one now stupidly renamed "legacy") but would rather use grub4dos, which offers a "superset" of GRUB capabilities (all the same ones in GRUB+all the new features of grub4dos).

 

In terms of evolution you might think at GRUB as an early primate, grub4dos as it's evolution into a human being and at GRUB2 as a different evolution path that led to a (very intelligent but somehow alien looking ;)) giant octopus :whistling:, or if you prefer GRUB:grub4dos=Ford Model T:Porsche 911, and GRUB:GRUB2=Ford Model T:Space Shuttle :unsure:.

 

:duff:

Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users