WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: UEFI Boot  (Read 95535 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: UEFI Boot
« Reply #15 on: June 13, 2012, 05:50:55 PM »
It doesn't get as far as grub, that's why I was thinking efibootmgr was required, but maybe there's a way to do it from the uefi setup on the dell if I can figure out what exactly to enter...

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: UEFI Boot
« Reply #16 on: June 13, 2012, 08:35:59 PM »
Some progress  :)

The dell setup allows you to create a uefi boot order and to specify a file - entering \\EFI\\BOOT\\BOOTX64.EFI boots from a usb stick to the grub-efi menu

From the grub command menu the following works:
Code: [Select]
insmod efi_gop gfxterm font videotest videoinfo
loadfont unicode
videoinfo
videotest
..and I get the expected ouput (as far as I know) from videotest/videoinfo

So I've managed to move from "missing operating system" to "booting a command list", but then the boot hangs without error message.

Hopefully this is just a grub.cfg issue :P

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: UEFI Boot
« Reply #17 on: June 14, 2012, 02:41:56 AM »
I guess I have to start by saying this system works, every time on my macbook pro

Booting the ISO directly within this construct works flawlessly with Ubuntux64 v12.04  or Mintx64 v13  (both efi aware kernels, with the iso renamed boot.iso) using BOOTX64.EFI from the "ISO-2-USB EFI-Booter for Mac 0.01" archive

A USB partitioned with GPT, formatted with FAT32, (and NO boot flag) and the following directory/file structure

/EFI/BOOT/
/EFI/BOOT/boot.iso
/EFI/BOOT/bootx64.efi


This will always be detected by the quirky Mac EFI BIOS which displays a USB bootable system in the option key invoked menu, and never ever fails to boot.   rEFIt not required, neither is grub2 required to be installed to the partition's boot sector.     The above two items is all that is needed.

Well, this is one method.
« Last Edit: June 14, 2012, 02:46:58 AM by coreplayer2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: UEFI Boot
« Reply #18 on: June 14, 2012, 03:49:21 AM »
Some of my observations, an efi BIOS expects to find required config files in a specific location, eg.

bootx64.efi  in /EFI/BOOT/

A  bootx64.efi file located as above will always be detected and displayed in the efi boot options menu.

A configuration file can be co located with bootx64.efi  and may be named grub.conf

normally the grub efi configuration file is named grub.cfg and is located at

/boot/grub/

either one appears to function,

Each distribution has compiled their version of grub efi not only with different versions of grub but with various options and modules.    selecting TAB at the grub command line shows modules that are available to manually load the kernel and initrd.

 This is about as far as I've managed to go with booting any kernel.   manually loading the kernel, initrd and boot parameters at the grub command line,  though have yet to complete the boot process I think due to core not having vesa or the preferred Xfbdev loaded.

However when ever I try to use the grub.cfg file the path gets lost somewhere between set root='(hd0,msdos1)'/boot/core.gz and the kernel boot parameters.. 
Strange that I can proceed further when entered manually than when using the cfg file..

Have also found that remastering tinycore with core64 and vmlinuz64 is a lot more challenging than I'd like.
« Last Edit: June 14, 2012, 04:36:14 AM by coreplayer2 »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: UEFI Boot
« Reply #19 on: June 14, 2012, 06:26:06 AM »
The uefi boot is finding grub.cfg since it complains about a typo that I made in the file and then proceeds further when I correct it.

Since I'm not getting the "blind boot" message, I've made some progress on the video front, but obviously not as far as seeing error messages once the kernel starts to boot - more trial and error obviously required...

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: UEFI Boot
« Reply #20 on: June 14, 2012, 01:55:36 PM »
So am curious, what is your USB directory structure??

 In most documentation I've read on efi and grub booting the recommended structure is

/EFI/BOOT/
/EFI/BOOT/boot.iso
/EFI/BOOT/bootx64.efi

/boot/grub2/grub.cfg


Strange thing is, Ive seen cfg files in several locations and still function.  In one distribution (maybe Fedora) they have duplicates in a couple of locations. ie one each in the above structure.  Reading the grub info it appears the conf is an old format included perhaps only for rescue mode??  ok I'm done with conf  am working only with the new cfg format from now on

Am going to have to read the source more..
« Last Edit: June 14, 2012, 02:35:35 PM by coreplayer2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: UEFI Boot
« Reply #21 on: June 14, 2012, 02:51:10 PM »
ok, I think the only thing left is configure, compile, make grub config on the actual efi environment.  brb

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: UEFI Boot
« Reply #22 on: June 14, 2012, 04:48:45 PM »
Juanito
you might find this interesting, that is if you don't have it already..  http://www.gnu.org/software/grub/manual/grub.html#Command_002dline-and-menu-entry-commands

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: UEFI Boot
« Reply #23 on: June 15, 2012, 06:31:20 AM »
So am curious, what is your USB directory structure??

/EFI/BOOT/BOOTX64.EFI [grub-efi created BOOTX64.EFI rather than grub.efi as soon as I used gdisk]
/EFI/BOOT/grub/grub.cfg
/EFI/BOOT/grub/x86_64/*mod
/EFI/BOOT/grub/fonts/unicode.pf2

All I did was create /EFI/BOOT, "grub-install" did the rest.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: UEFI Boot
« Reply #24 on: June 16, 2012, 12:38:03 AM »
According to the manual,  the default structure is

/EFI/BOOT/BOOTX64.EFI
/BOOT/grub/grub.img
/BOOT/grub/grub.cfg
/BOOT/grub/x86_64/*mod
/BOOT/grub/fonts.pf2


Having said that, when the grub search feature is enabled I think grub can find any required files.  the BOOTX64.EFI file can be built complete with all the cfg, *mod, and img files internally..


Meanwhile, any luck yet??


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: UEFI Boot
« Reply #25 on: June 17, 2012, 03:54:16 AM »
cracked it - and posting from an efi usb stick boot on a dell latitude e6220 8)

The problem might have been that the usb stick had one of those u3 partitions not readily visible to linux - neither u3-tool nor full-fat hdparm wanted to remove it, but I found a windows tool that seems to have done the trick. The problem may also have been that I did not load Xorg-7.6 and graphics-3.0.21-tinycore "onboot" and thus I was not getting any display previously.

Used gdisk to create 2 partitions:
Code: [Select]
$ gdisk -l /dev/sdb
GPT fdisk (gdisk) version 0.6.11
l
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdb: 2006673 sectors, 979.8 MiB
Logical sector size: 512 bytes
Disk identifier (GUID): 7CF13D85-1AA7-427F-990C-F31663DCD1F0
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 2006639
Partitions will be aligned on 2-sector boundaries
Total free space is 0 sectors (0 bytes)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34          245793   120.0 MiB   EF00  EFI System
   2          245794         2006639   859.8 MiB   0700  Linux/Windows data

and:
Code: [Select]
$ sudo mkfs.vfat /dev/sdb1
$ sudo mke2fs /dev/sdb2

Used grub from bzr of a few days ago:
Code: [Select]
$ sudo grub-install --target=x86_64-efi --boot-directory=/mnt/sdb1/EFI/BOOT --efi-directory=/mnt/sdb1 --removable..note that this will create /EFI/BOOT and copy files as follows:

/EFI/BOOT/BOOTX64.EFI
/EFI/BOOT/grub/grubenv
/EFI/BOOT/grub/x86_64-efi/*mod
/EFI/BOOT/grub/fonts/unicode.pf2
/EFI/BOOT/grub/locale

Used the following:
Code: [Select]
$ cat /mnt/sdb1/EFI/BOOT/grub/grub.cfg

menuentry "core" {
  linux (hd1,gpt2)/boot/vmlinuz quiet noswap tce=sdb2 tz=GMT-4 blacklist=bcma blacklist=ssb blacklist=b43 text
  initrd (hd1,gpt2)/boot/core.gz
}
..I didn't bother loading fonts, efi_gop, gfxterm, etc and things still seem to have worked.

In the F2 dell menu, you need to change from legacy (bios) boot to uefi, create a boot entry and navigate to /EFI/BOOT/BOOTX64.EFI - somewhat annoyingly it doesn't seem to remember this across boots...
« Last Edit: June 17, 2012, 04:48:48 AM by Juanito »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: UEFI Boot
« Reply #26 on: June 17, 2012, 04:42:47 AM »
Congrats!!!  Good job  Buy that man a beer :)

Ok am going to duplicate this and hopefully make an image of the whole package :)

BTW  FB driver works in efi mode and is what I've been using on all macs


Interesting partition table, two partitions??  how about one??  like one gpt?

Looks like I've been using the wrong grub version, looking at the directory structure and considering I've entered manually the boot commands manually but getting only as far as loading the initrd which is where the process fails for me..

But hey Great Job Juanito, thanks so much for making progress
« Last Edit: June 17, 2012, 04:59:40 AM by coreplayer2 »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: UEFI Boot
« Reply #27 on: June 17, 2012, 04:54:33 AM »
Hmm - 'doesn't want to boot on the mac mini though  :(

On the bright side powering on with the <alt gr> key pressed brings up an icon for a removable efi device and grub-efi starts and accepts commands.

Since videoinfo works, but videotest doesn't work, I'm wondering if there's some kind of video issue that prevents the mac mini usb stick boot.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: UEFI Boot
« Reply #28 on: June 17, 2012, 04:58:16 AM »
how about the FB

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: UEFI Boot
« Reply #29 on: June 17, 2012, 05:09:37 AM »
I've entered these commands manually at the grub prompt

  linux (hd1,gpt2)/boot/vmlinuz
  initrd (hd1,gpt2)/boot/core.gz

and got a response like  "Loading Kernel"

yet the process seems to hang up after "Loading initrd"

I didn't have any driver though not Xvesa or XFBdev, so maybe that was the problem.  Have been meaning to try an older tc version, one before the core so that all components needed to boot were present..