WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to install grub2 to /dev/mmcblk0?  (Read 19438 times)

Offline lemming

  • Newbie
  • *
  • Posts: 37
Re: How to install grub2 to /dev/mmcblk0?
« Reply #15 on: August 14, 2014, 09:08:45 PM »
Thanks coreplayer2. I have used gdisk to create the partitions and it has left a MB before the UEFI-GPT partition It looks like the others are aligned on MiB boundaries.

I am still struggling on a couple of fronts. One is that my Intel NUC PC does not show the UEFI partition in the part of BIOS setup where you select the boot disk under UEFI. I'm sorting this out with Intel (who surprise me with their helpfulness).

The other part is the grub.cfg file.
In one post by Juanito he gives the example thus:

search --no-floppy --fs-uuid --set=root 74d071dc-a992-4493-8b54-168fb79897dd

menuentry "rootfs64" {
  linux /boot/vmlinuz64 quiet noswap tce=UUID=74d071dc-a992-4493-8b54-168fb79897dd waitusb=10:UUID=74d071dc-a992-4493-8b54-168fb79897dd tz=GMT-4 blacklist=bcma blacklist=ssb blacklist=b43 text
  initrd /boot/rootfs.gz /boot/modules64.gz
}

In the help/description of the UEFI grub module in tce-ab it has the following:

menuentry "core" {
  linux (hd1,gpt2)/boot/vmlinuz64 quiet noswap tce=sdb2 tz=GMT-4 blacklist=bcma blacklist=ssb blacklist=b43 t
ext
  initrd (hd1,gpt2)/boot/corepure64.gz
}

Which is the best way to go with a /dev/mmcblk0?
In the Juantio example, is the UUID of the GPT partition, or the linux partition holding the kermel and disk image, or the whole device?   
Is this UUID got from using "blkid" or using gdisk.  Gdisk produces five different IDs as listed below

gdisk -l
Disk identifier (GUID): 3E7C2A8E-AE5D-4DC4-A137-B8F03BB6E418

gdisk -i option

first partition
Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)
Partition unique GUID: 0859BC6C-FAEE-431F-BF79-EBA98A19222E

second partition
Partition GUID code: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (Linux filesystem)
Partition unique GUID: 3B29B2C3-4BC6-473A-B18B-E8429D52A3B8

Then there is the sixth one given by blkid.

Which one should I use?

In the line, " initrd (hd1,gpt2)/boot/corepure64.gz" above (which I think defines /dev/sdb2) what would be the equivalent for the second partition of /dev/mmcblk0 ?

« Last Edit: August 14, 2014, 09:15:27 PM by lemming »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: How to install grub2 to /dev/mmcblk0?
« Reply #16 on: August 14, 2014, 11:41:38 PM »
In the Juantio example, is the UUID of the GPT partition, or the linux partition holding the kermel and disk image, or the whole device?   
Is this UUID got from using "blkid" or using gdisk.

It's the uuid of the linux partition from blkid.

Offline lemming

  • Newbie
  • *
  • Posts: 37
Re: How to install grub2 to /dev/mmcblk0?
« Reply #17 on: August 17, 2014, 04:56:59 AM »
Too many variables with the Intel NUC so I have switched to a laptop with a USB stick instead as apparently others have had success with this setup. Once I get this going I will go back to the NUC.

Using the following grub.cfg:

menuentry "core" {
linux (hd0,2)/boot/vmlinuz64 noswap tce=sdb2 tz=GMT-4 blacklist=bcma blacklist=ssb blacklist=b43 text
initrd (hd0,2)/boot/corepure64.gz
}

I get the grub menu, but when I select the "core" option, the screen clears and I get:

error: no suitable video mode found.
Booting in blind mode.

And then it freezes.

I just want to run in text mode with no X so what do I need to add to the menuentry above to get it to work? I thought the "text" at the end of the kernel line would set the video mode to something basic.

EDIT I've since tried inserting vga=791 to no avail.


« Last Edit: August 17, 2014, 05:11:24 AM by lemming »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: How to install grub2 to /dev/mmcblk0?
« Reply #18 on: August 17, 2014, 08:48:38 AM »
You could try:
Code: [Select]
loadfont unicode
insmod efi_gop
set gfxterm=auto
terminal_output gfxterm

..before the "menuentry" line.

Note that you'll need to copy /usr/local/share/grub/unicode.pf2 to /mnt/wherever/EFI/BOOT/grub/fonts

Offline lemming

  • Newbie
  • *
  • Posts: 37
Re: How to install grub2 to /dev/mmcblk0?
« Reply #19 on: August 17, 2014, 11:37:49 PM »
Thanks Juanito. Its up and going now. The unicode.pf2 was already there so I did not need to copy it.

I have been experimenting with the different menuentry methods such as the "(hd0,2)" vs the UUID method.
In one of your previous posts you had the line, "search --no-floppy --fs-uuid --set=root e94de7a3-149b-4554-bc02-6129467534a9"

Is the "--set=root e94d...." correct or should the equals sign be the other side of "root", i.e.  "--set root=e94d..."

Also some posts have had the the partition listed as "(hd1,gpt2)" or "(hd1,msdos5)".  Where does the name gpt2 or msdos5 come from?
I have tried labelling my partitions and using the label instead of numbers but that doesn't work.

Is there a http server for Corepure64?



Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: How to install grub2 to /dev/mmcblk0?
« Reply #20 on: August 18, 2014, 12:35:43 AM »
"--set root=e94d..."

..is the correct one - well spotted :)

"gpt2" or "msdos5" are the partition name, not the label - I recall coreplayer2 had made a couple of posts on now to use labels with grub2. You could also take a look at the documentation for more details:

http://www.gnu.org/software/grub/manual/grub.html

I don't believe there's an http server extension for corepure64
« Last Edit: August 18, 2014, 01:01:32 AM by Juanito »

Offline lemming

  • Newbie
  • *
  • Posts: 37
Re: How to install grub2 to /dev/mmcblk0?
« Reply #21 on: August 18, 2014, 09:09:37 PM »
Thanks Juanito.
I've had a bit more of a look around and it seems that you were right with the "--set=root e94d...." as other sites have this layout. It just looks odd.

Re the gpt2 and msdos5; I thought that it was something that the user set on the partition like a label. I cannot find these partition names anywhere in parted, gparted or gdisk. It would seem that only grub can "see" these names on the partitions. My pure Ubuntu laptop (partitioned and formatted with Ubuntu utils) shows up with msdosx partitions even though it has never had a MS OS on it. The only way to know which partition is which is to do an ls, in grub, on each one.

I was trying to use this nomenclature in grub.cfg for my mmcblk0 drive and assumed that gpt and msdos only applied to /dev/sda..sdx drives. I now see that the mmcblk0p1 and 2 are showing up as gpt1 and gpt2 respectively. Although ls in grub shows only (hd0), (hd0,gpt1) and (hd0,gpt2) I can use (hd0,1) and (hd0,2), respectively, instead for these same partitions. 
« Last Edit: August 20, 2014, 01:01:20 AM by lemming »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to install grub2 to /dev/mmcblk0?
« Reply #22 on: August 18, 2014, 09:24:09 PM »
the blkid command will show you the partition UUID.