WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to install/setup the Grub2 bootloader on CorePlus ??  (Read 6637 times)

Offline Len E.

  • Newbie
  • *
  • Posts: 22
How to install/setup the Grub2 bootloader on CorePlus ??
« on: December 02, 2017, 11:28:13 PM »
Hi Juanito:

I hope this catches your attention because your name is on the grub2-multi.tcz extension description.

After installing the extension, I executed the mount and grub-install commands shown in the "how to"
instructions.   (I'm using partition sda3 on my test machine).

I checked the /mnt/sda3/boot/grub directory, but no grub.cfg was created.

From an online Grub 2.02 manual, I found a description of the grub-mkconfig command which usually creates grub.cfg.
Accordingly, I entered       sudo grub-mkconfig -o /boot/grub/grub.cfg

I got the following error message:

/usr/local/sbin/grub-probe: error:  failed to get canonical path of 'rootfs'

Please advise on what to do.

Thanks !
Len E.
« Last Edit: December 02, 2017, 11:31:02 PM by Len E. »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15230
Re: How to install/setup the Grub2 bootloader on CorePlus ??
« Reply #1 on: December 03, 2017, 01:40:34 AM »
The info file assumes that you would create grub.cfg manually - there are several examples if this in the forum.

I may be mistaken, but I'd guess that you are missing something in the grub-mkconfig command (which I've never used)?

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: How to install/setup the Grub2 bootloader on CorePlus ??
« Reply #2 on: December 03, 2017, 01:42:47 AM »
As previously mentioned, simply installing grub2 will not create a boot config file and even if asked of grub the installer may not even find the core files either..    So it's easiest to create a config file using the mkconfig commands if you wish to add windows and other linux distro to the menu options.  Remember the tinycore entries may be best created manually.

Here's an example off one of my PC's with some superfluous menu items removed for simplicity..
Code: [Select]
insmod part_msdos
insmod fat
insmod ext2
loadfont unicode
set gfxterm=auto
terminal_output gfxterm
GRUB_GFXMODE=1900X1200X16
GRUB_GFXPAYLOAD_LINUX=keep

#Timeout for menu
set default=3
set timeout=20


menuentry "*** TC-8-x86 (Xvesa on Samsung)" {
search --no-floppy --fs-uuid --set=root 196fcfb2-bd37-495d-b855-41f08201be7d
linux /linux/vmlinuz-4817 vmalloc=256MB tz=GMT loglevel=3 waitusb=5:UUID="196fcfb2-bd37-495d-b855-41f08201be7d" tce=UUID="196fcfb2-bd37-495d-b855-41f08201be7d"/tc8-x86 opt=UUID="196fcfb2-bd37-495d-b855-41f08201be7d" home=UUID="196fcfb2-bd37-495d-b855-41f08201be7d" lst=onboot_x86_Xvesa.lst mydata=mydata_tc8x86.Vesa
initrd /linux/rootfs-821.gz /linux/modules-4817.gz
}

menuentry "*** TC-8-x86 (Xorg on Samsung)" {
search --no-floppy --fs-uuid --set=root 196fcfb2-bd37-495d-b855-41f08201be7d
linux /linux/vmlinuz-4817 vmalloc=256MB tz=GMT loglevel=3 waitusb=5:UUID="196fcfb2-bd37-495d-b855-41f08201be7d" tce=UUID="196fcfb2-bd37-495d-b855-41f08201be7d"/tc8-x86 opt=UUID="196fcfb2-bd37-495d-b855-41f08201be7d" home=UUID="196fcfb2-bd37-495d-b855-41f08201be7d" lst=onboot_x86_Xorg.lst mydata=mydata_tc7x86.Xorg blacklist=snd_usb_audio
initrd /linux/rootfs-821.gz /linux/modules-4817.gz
}

menuentry "*** TC-8-Core64 (on Samsung)" {
search --no-floppy --fs-uuid --set=root 196fcfb2-bd37-495d-b855-41f08201be7d
linux /linux/vmlinuz64-4817 tz=GMT loglevel=3 waitusb=5:UUID="196fcfb2-bd37-495d-b855-41f08201be7d" tce=UUID="196fcfb2-bd37-495d-b855-41f08201be7d"/tc8-x86 opt=UUID="196fcfb2-bd37-495d-b855-41f08201be7d" home=UUID="196fcfb2-bd37-495d-b855-41f08201be7d" lst=onboot_Core64.lst blacklist=snd_usb_audio
initrd /linux/rootfs-821.gz /linux/modules64-4817.gz
}

menuentry "*** TC-8-Corepure64 (on Samsung)" {
search --no-floppy --fs-uuid --set=root 196fcfb2-bd37-495d-b855-41f08201be7d
linux /linux/vmlinuz64-4817 noswap tz=GMT loglevel=3 waitusb=5:UUID="196fcfb2-bd37-495d-b855-41f08201be7d" tce=UUID="196fcfb2-bd37-495d-b855-41f08201be7d"/tc8-x86_64 opt=UUID="196fcfb2-bd37-495d-b855-41f08201be7d" home=UUID="196fcfb2-bd37-495d-b855-41f08201be7d" lst=onboot_CorePure64.lst mydata=mydataCorePure64 blacklist=snd_usb_audio
initrd /linux/rootfs64-821.gz /linux/modules64-4817.gz
}

menuentry "Windows (on SSD)" --class windows --class os {
insmod part_msdos
insmod ntfs
insmod ntldr
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 8C3A96F13A96D812
ntldr /bootmgr
}

menuentry "Windows BackUp (on Seagate HDD)" --class windows --class os {
insmod part_msdos
insmod ntfs
insmod ntldr
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root EE26108A261055C5
ntldr /bootmgr
}

menuentry "System restart" {
echo "System rebooting..."
reboot
}

You'll need to edit the menu item header
and the --set=root  will need to be amended with the UUID for the drive and /or partition where core files and kernel are installed
also the paths to the core + kernel files will need to be ammended
also tce, home and Opt UUID's will need to be updated with the correct partition UUID

I rarely get it right the first boot..  good luck


Oh and the
Code: [Select]
failed to get canonical path of 'rootfs'error message I believe comes from the fact that required partition's are not mounted (iirc)
« Last Edit: December 03, 2017, 01:44:21 AM by coreplayer2 »

Offline jopema

  • Newbie
  • *
  • Posts: 9
Re: How to install/setup the Grub2 bootloader on CorePlus ??
« Reply #3 on: October 08, 2018, 05:50:03 AM »
Perfect, this is the info I was looking for =0)

Please be patient now with a newbie question : Is it possible setting root at boot of the TCL without specifying UUID or hd1.2 ? My strategy is to have a generic boot process and just drop in updated kernels core.gz and vmlinuz without changing anything else on the drive, and with grub2 on a micro flash drive I assume I can have multiboot tcl / windows without changing uefi/legacy boot in bios.
 
Question 2: I noticed in example above the location of usb flash drive is hardcoded as hd0.1 in grub.cfg. Is grub file location persistent for removable usb/devices ? Is it possible the hd0.1 location may vary depending on which usb port and order usb devices are inserted at computer ? (My concern is that my TCL/usb flash drive may not work in other computers if hardcoding location of files).

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: How to install/setup the Grub2 bootloader on CorePlus ??
« Reply #4 on: October 08, 2018, 11:08:37 AM »
Replacing files won't change the UUID.

I believe the boot device is always treated as the first one among all boot loaders.
Download a copy and keep it handy: Core book ;)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: How to install/setup the Grub2 bootloader on CorePlus ??
« Reply #5 on: October 08, 2018, 11:58:31 AM »
Question 2: I noticed in example above the location of usb flash drive is hardcoded as hd0.1 in grub.cfg. Is grub file location persistent for removable usb/devices ? Is it possible the hd0.1 location may vary depending on which usb port and order usb devices are inserted at computer ? (My concern is that my TCL/usb flash drive may not work in other computers if hardcoding location of files).


I think we answered these questions at you're other thread..
http://forum.tinycorelinux.net/index.php/topic,22277.msg139447.html#msg139447

And where do you see a USB drive ID hard coded as hd0.1 ?? 

search --no-floppy --fs-uuid --set=root 196fcfb2-bd37-495d-b855-41f08201be7d
Will set this drive as root (1st drive)

waitusb=5:UUID="196fcfb2-bd37-495d-b855-41f08201be7d"
Will pause the boot process until this specified drive has initiated

tce=UUID="196fcfb2-bd37-495d-b855-41f08201be7d"/tc8-x86
This bootcode informs TC where to find the tce/extensions required by this boot.cfg entry.    In this case i changed the name "tce" to "tc8-x86", so this needs to be specified, otherwise not.

« Last Edit: October 08, 2018, 12:09:15 PM by coreplayer2 »

Offline scuz

  • Newbie
  • *
  • Posts: 10
Re: How to install/setup the Grub2 bootloader on CorePlus ??
« Reply #6 on: August 11, 2025, 06:08:11 AM »
i like persistance
mount -o loop iso_path i use /iso/CorePlus-16.1.iso on 1st parition  /mnt/folder name i use /mnt/x
mnt/x will be read only copy it to i use /mnt/boot then i rname x in /boot to coreplus
rename the cde folder to tce in the i use /boot/coreplus

Code: [Select]
menuentry "coreplus iso cde>tce  " {
   load_video
   insmod lvm
   insmod gzio
   insmod part_msdos
   insmod ext2
   insmod part_gpt
   set root='hd0,msdos1'
#  search --no-floppy --label A1EXT2 --set=root
    echo 'setting up isofile ...'
    set iso_path="/iso/CorePlus-16.1.iso"
#  search --set=root --file $iso_path
    echo 'setting up loopback'
    loopback loop (hd0,msdos1)/${iso_path}
    echo 'booting vmlinuz ...'
    linux (loop)/boot/vmlinuz iso=/mnt/sda1/${iso_path} loglevel=3 waitusb=5  showapps desktop=icewm  tce=sda1/boot/coreplus/tce noutc
    echo 'initrd ...'
    initrd (loop)/boot/core.gz
}
menuentry "coreplus iso syslinux memdisk cd>tce tab edit boot options  loglevel=3 waitusb=5  showapps desktop=icewm  tce=sda1/boot/coreplus/tce  " {
   load_video
   insmod lvm
   insmod gzio
  insmod part_gpt
   insmod part_msdos
   insmod ext2
   set root='hd0,msdos1'
#  search --no-floppy --label A1EXT2 --set=root
    echo 'setting up isofile ...'
    set iso_path="/img/CorePlus-16.1.iso"
#  search --set=root --file $iso_path
#    echo 'setting up loopback'
#    loopback loop (hd0,msdos1)/${iso_path}
    echo 'booting vmlinuz ...'
    linux16 /img/memdisk raw
    echo 'initrd ...'
    initrd16 /img/CorePlus-16-1.iso

}

you can use the set root or search lines (that i # have disabled)
i keep my CorePluse-16.1.iso on first partion in /iso folder
i use both insod part_msdos & insmod part_gpt 
« Last Edit: August 11, 2025, 08:26:01 AM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12214
Re: How to install/setup the Grub2 bootloader on CorePlus ??
« Reply #7 on: August 11, 2025, 08:28:17 AM »
Hi scuz

Please use  Code Tags  when posting commands and responses seen in a terminal. To use  Code Tags  click on the  #  icon
above the reply box and paste your text between the  Code Tags  as shown in this example:

Quote
[code][   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517[/code]

It will appear like this in your post:
Code: [Select]
[   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517

Code Tags  serve as visual markers between what you are trying to say and the information you are posting. They also preserve
spacing so column aligned data displays properly. Code tags also automatically add horizontal and or vertical scrollbars
to accommodate long lines and listings.

Offline scuz

  • Newbie
  • *
  • Posts: 10
Re: How to install/setup the Grub2 bootloader on CorePlus ??
« Reply #8 on: August 11, 2025, 10:44:30 AM »
non iso boot

Code: [Select]
menuentry "coreplus sda1 cde>tce" {
    load_video
    insmod gzio
insmod part_msdos
        insmod part_gpt
insmod lvm
insmod ext2
set root='hd0,msdos1'
 #  search --no-floppy --label A1EXT2  --set=root
    echo 'booting vmlinuz ...'
    linux /boot/coreplus/boot/vmlinuz iso=/mnt/sda1/${iso_path} loglevel=3 waitusb=5  showapps desktop=icewm  tce=sda1/boot/coreplus/tce
    echo 'initrd ...'
    initrd /boot/coreplus/boot/core.gz
« Last Edit: August 12, 2025, 03:08:13 AM by Juanito »