WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: how to setup grub2 to boot dCore from HD?  (Read 3521 times)

Offline krooooo

  • Jr. Member
  • **
  • Posts: 66
how to setup grub2 to boot dCore from HD?
« on: December 19, 2015, 02:33:20 AM »
Hi, I'm a newbie...

I boot VM from dCore-trusty.iso and then fdisk /dev/sda, make a new partition and make it bootable, and then mkfs.ext4 then reboot then tce-setdrive then sce-import "grub2" then sce-load then "sudo grub-install --root-derctory=/mnt/sda1 /dev/sda", after reboot, I saw grub>

But, the manual :
    set root=(hd1,msdos1)
    kernel /vmlinuz-trusty
    initrd /dCore-trusty.gz
    boot
(http://wiki.tinycorelinux.net/dcore:usb_installation_test-drive) can not be used here, error...

how to do then?

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: how to setup grub2 to boot dCore from HD?
« Reply #1 on: December 19, 2015, 06:46:46 AM »
Hi krooooo. I am not familiar with VM, so not sure if this helps. This boots my dCore install from hard drive using Grub2. This menuentry is placed in /etc/grub.d/40_custom, then run  sudo update-grub  which updates /boot/grub/grub.cfg. It might be more useful if you fully describe the error.
Code: [Select]
menuentry "dCore" {
set root=(hd1,1)
linux /dCore/boot/vmlinuzjessie nozswap showapps tce=sdb4 desktop=fluxbox
initrd /dCore/boot/dCorejessie.gz
}

Offline krooooo

  • Jr. Member
  • **
  • Posts: 66
Re: how to setup grub2 to boot dCore from HD?
« Reply #2 on: December 20, 2015, 02:57:13 AM »
Hi nitram

the partition only contain "vmlinuz-trusty" and "dCore-trusty.gz", no etc/, no boot/...

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: how to setup grub2 to boot dCore from HD?
« Reply #3 on: December 20, 2015, 03:09:15 AM »
The way i understand it the partition that boots vmlinuz-trusty and dCore-trusty.gz essentially becomes read-only. So actual system files need to be located on another partition. So in my grub2 example above, the boot kernel and base file system (vmlinuzjessie and dCorejessie.gz) are installed in sdb1 (hd1,1), while the tce directory is located in sdb4 (tce=sdb4 boot code).

Upon first boot you need to specify the tce drive if not already specified in a boot code:
http://tinycorelinux.net/dCore/x86/README/README-1st.txt

You might also find these links handy:
http://tinycorelinux.net/dCore/x86/README/

Again, not familiar with VM.

Offline krooooo

  • Jr. Member
  • **
  • Posts: 66
Re: how to setup grub2 to boot dCore from HD?
« Reply #4 on: December 20, 2015, 10:35:31 AM »
Hi nitram

use grub2 to boot dCore maybe is not a good idea, the guide (http://wiki.tinycorelinux.net/dcore:usb_installation_test-drive) is based on grub but I installed grub2, so that should be "linux /vmlinuz" (not "kernel /vmlinuz", I am a poor newbie, lost lots of time to google...) and, because of ram-fs , exec "update-grub" always got error:"failed to get canonical path of 'rootfs'"....

I uninstall grub and install extlinux, and then mkdir -p /mnt/sda1/boot/extlinux
then extlinux -i /mnt/sda1/boot/extlinux
then dd if=/usr/share/syslinux/mbr.bin of=/dev/sda bs=512 count=1
after edit extlinux.conf and reboot, OK! into dCore!

 :'(
« Last Edit: December 20, 2015, 10:37:11 AM by krooooo »

Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
Re: how to setup grub2 to boot dCore from HD?
« Reply #5 on: December 20, 2015, 10:38:28 AM »
Sorry for the error in that wiki article! Indeed, the Grub2 command should be ''linux'' instead of ''kernel''. I have corrected it in the wiki. Apart from that I imagine your approach should work.

Cheers!
sm

Offline krooooo

  • Jr. Member
  • **
  • Posts: 66
Re: how to setup grub2 to boot dCore from HD?
« Reply #6 on: December 20, 2015, 11:58:29 AM »
Hi sm8ps

If use grub2, every time boot system must type:

    set root=(hd0,msdos1)
    linux /vmlinuz-trusty
    initrd /dCore-trusty.gz
    boot

Is there a way to config grub2 to get boot into system automatic??exec "update-grub" in dCore system always got error:"failed to get canonical path of 'rootfs'"....

Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
Re: how to setup grub2 to boot dCore from HD?
« Reply #7 on: December 20, 2015, 03:50:46 PM »
I recall going through quite some troubles and lots of Internet research while dealing with the interplay of the boot-loaders. The USB stick I used had Syslinux installed in the end. However, the first boot was performed from Grub(2) installed on my laptop. VMs were not on my radar at all so that method won't work.

Personally, I prefer Extlinux for its ease of use. If it works for you as I understand from your second previous post then that is fine.

The wiki article is not quite clear, indeed. Probably it would be better to install Extlinux on the USB-stick straight away. The easiest would be if one could use the same boot-loader as the one of a standard Linux installation. However, I do not see any way for achieving this with Grub2 without creating the bloated infrastructure in the file system. I will soon tend to the article.