WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: dual/multi boot, grub-mkconfog and os-prober  (Read 125 times)

Offline clauder

  • Newbie
  • *
  • Posts: 11
dual/multi boot, grub-mkconfog and os-prober
« on: August 26, 2020, 10:02:09 AM »
My goal is to determine if I can have a TC installation that supports multiple (at least dual) OSes / boot partitions using grub2, while having TC's partition as the main OS.

After perusing by running TC installation and the forum here, I have the following observations
1 - /boot/grub/grub.cfg generated by grub-install does not appear to have been generated using grub-mkconfig. I came to this conclusion by the fact that the output of grub-mkconfig is vastly different then grub.cfg generated after running grub-install.
2 - The output of grub-mkconfig includes NO menuentry so it does not appear to be able to even simply boot TC in single boot
3 - /usr/local/etc/grub.d/30_os-prober needs os-prober and/or linux-boot-prober and terminates if it can not find either. Both are missing from my running TC so grub-mkconfig is not able to find other OSes.

My conclusion is that TC can not support booting from different partitions / OSes, unless by manually building grub.cfg.

Am I missing something?

Offline GNUser

  • Hero Member
  • *****
  • Posts: 628
Re: dual/multi boot, grub-mkconfog and os-prober
« Reply #1 on: August 26, 2020, 10:32:55 AM »
Hi, clauder. You do not have to manually edit grub.cfg to boot TCL from different partitions/OSes.

Grub2 has a nice feature: It is hardwired to parse /boot/grub/custom.cfg at boot time, and to append that file's menuentries to the boot menu.

If it's not TCL that controls grub2:
Say you dual-boot Devuan and TCL and Devuan controls the boot menu. You can boot TCL by creating /boot/grub/custom.cfg (in Devuan) with something like this (the root line needs to match your setup, of course):

Code: [Select]
menuentry 'TinyCoreLinux' {
        set root=(ahci0,msdos2)
        linux /boot/vmlinuz64
        initrd /boot/corepure64.gz
}

No need to run update-grub or grub-mkconfig after creating custom.cfg--grub2 will automatically parse the file at boot time :)

HTH
« Last Edit: August 26, 2020, 10:45:56 AM by GNUser »

Offline GNUser

  • Hero Member
  • *****
  • Posts: 628
Re: dual/multi boot, grub-mkconfog and os-prober
« Reply #2 on: August 26, 2020, 10:38:41 AM »
That being said, TCL is my main OS. My TCL partition is the one that controls the grub2 menu. So here is another approach:

If TCL controls grub2:
It's probably easiest to just have a minimal /boot/grub/grub.cfg in your TCL partition. That's all I use, personally. My grub.cfg looks like this:

Code: [Select]
set timeout=3

menuentry 'TinyCore 11' {
set root=(ahci0,msdos3)
linux /boot/vmlinuz64 tce=sda3/tce opt=sda3 tz=EST+5EDT,M3.2.0/2,M11.1.0/2 syslog lang=en_US.UTF-8 user=bruno loglevel=0 host=x200 blacklist=pcspkr
initrd /boot/corepure64.gz
}

menuentry 'Devuan ASCII' {
set root=(ahci0,msdos1)
linux /vmlinuz root=/dev/sda1 quiet
initrd /initrd.img
}

I'll be happy to help further if you have any questions. Just let me know.
« Last Edit: August 26, 2020, 10:50:48 AM by GNUser »

Offline jazzbiker

  • Sr. Member
  • ****
  • Posts: 317
Re: dual/multi boot, grub-mkconfog and os-prober
« Reply #3 on: August 26, 2020, 11:36:57 AM »
My conclusion is that TC can not support booting from different partitions / OSes, unless by manually building grub.cfg.

Hi, clauder!
I think You are right, and it is by design. Look at the project home page:

About Our Project
Our goal is the creation of a nomadic ultra small graphical desktop operating system capable of booting from cdrom, pendrive, or frugally from a hard drive.

Robert Shingledecker, December 01, 2008

Bootlader, kernel and system all can be placed on separate physical drives, including network ones. Every os-prober is built using some assumptions, but TinyCore don't intends to put any limitations upon Your desired system architecture, remaining minimalistic and top flexible.

I can mention, that system configurating script (tc-config) apply certain attempts to resolve undefined tce location according to the environment, present at boot time.

Have a nice Core!
« Last Edit: August 26, 2020, 11:46:54 AM by jazzbiker »