I have another thread going about the network chips (ethernet and wireless), and the utter lack of support of them on nearly all live linux cds... but I don't want to get into that here.

This laptop ships with Windows 8, which sucks, but since I will need to support it, I want to keep it. It does not come with a windows 8 install disk, instead relying upon the ever-popular restore partition.

The system is partitioned using UEFI/GPT. The one disk that would boot this laptop is the latest parted magic disk. I used that to set up my partitions, so it looks like this:

I was able to boot the latest gentoo minimal install disk by putting it on a flash drive using unetbootin.

I then copied over all the files necessary to install gentoo from another pc, and put them into /usr/portage/distfiles. I followed the Gentoo Handbook up through section 9. Then I tried to switch over to the Gentoo Wiki for grub2 -- and everything came to a screeching halt.

The only way I can boot my laptop to anything other than windows 8, is to use the legacy boot in the bios -- NOT UEFI. Since I cannot put grub2 on my hard disk without booting to a UEFI boot disk, I am halted. I tried a system rescue disk both on usb and on CD and neither will boot. Using the usb, I get the grub2 menu, but any option I choose takes me to a black screen where it hangs. The CD won't even get me to grub2 (neither will any other CD I tried but the parted magic one, which won't work because it is i386 and not UEFI).

Yep. I have read it. I didn't get me past my current dilemma, however... though I suppose I could try gummiboot, I suppose... but it is not in portage. I'd rather stick with the recommended gentoo way._________________To look without without looking within is like looking without without looking at all.

That is what I am saying d2, I cannot properly install grub2, because you must be booted using UEFI -- and I cannot get it to boot this way. Nothing works. none of the live linux CDs that support it will boot in this laptop. Trying to make a bootable flash drive doesn't work either. I can only boot via the legacy setting in the bios. So while I have grub2 emerged, I cannot install it._________________To look without without looking within is like looking without without looking at all.

There is a chicken-and-egg conundrum here: You can't use efibootmgr without first booting in EFI mode, and you can't boot in EFI mode without using efibootmgr to install your boot loader of choice.

There are at least three ways out of this conundrum:

Use an EFI-bootable Linux emergency disc to boot in EFI mode and use efibootmgr from that emergency boot to install your desired boot manager. System Rescue CD supposedly now supports EFI-mode booting, although I've not tried it myself. An Ubuntu install disc in its "live CD" mode should also work.

Install an EFI boot manager using Windows. You can use the Windows bcdedit command to add an EFI boot loader in this way, once you've copied the files. The rEFInd documentation includes explicit instructions on this approach.

Boot to an EFI shell (installed on a removable disk or accessible via some firmwares' user interfaces) and use the bcfg command to install your boot program of choice. This command is briefly described on this Intel page and on this Arch Linux wiki, among other places.

Another important point: If your computer shipped with Windows 8, it almost certainly has Secure Boot active. This will prevent booting Linux unless you either disable Secure Boot in the firmware setup utility or install a signed version of shim and follow-on software that can be used with it. At the moment, disabling Secure Boot is the easier course of action, although with any luck that will change in the not-too-distant future. It's more likely to change slowly for non-profit and niche distributions like Gentoo than for bigger commercial ones like Red Hat/Fedora, SUSE, and Ubuntu.

A final word of advice: Don't restrict yourself to EFI boot loader and boot manager software that's in the Gentoo portage tree. At the moment and AFAIK, GRUB 2 and ELILO are the only boot loaders/managers in portage that can work with EFI, and neither of them is really optimal, especially for a Linux/Windows dual-boot configuration. If you're happy with your computer's boot manager, you could use it in conjunction with the kernel's own EFI stub loader, but I have yet to find a computer with a built-in EFI boot manager that I'd consider acceptable. IMHO, gummiboot and my own rEFInd are the two best EFI boot managers available, and neither is yet in portage. Refusing to use these tools because they're not in portage is like cutting off your nose to spite your face.

As I mentioned before, booting to an UEFI capable boot disk such as ubuntu or system resuce do not work. I get the boot menu options, but no matter what I choose, I get a black screen afterward. If there any parameters or something I should try, I would very much like to hear them.

I will look over the windows way you mention in bullet two, this may be my only option :0/

Yes, I have disabled the secure boot in the bios.

Quote:

Refusing to use these tools because they're not in portage is like cutting off your nose to spite your face.

Well no, actually. I'm not refusing, just stating a preference. When you have a couple dozen machines to maintain, it is always in ones best interest to stick with the package manager of the distro just to keep updates simple. That's all I'm saying. If I *have to* break from that, I will. I just like to try the "official options" first.

You have given me some options to ponder. Thank you.

G_________________To look without without looking within is like looking without without looking at all.

As I mentioned before, booting to an UEFI capable boot disk such as ubuntu or system resuce do not work. I get the boot menu options, but no matter what I choose, I get a black screen afterward. If there any parameters or something I should try, I would very much like to hear them.

Hi, I had the black screen problem. I had to update my bios/uefi firmware for my motherboard. So, you should check if there any update concerning the bios/uefi for your hardware.

After that, I was able to boot without any problem with the latest SystemRescueCD in UEFI mode.

FWIW, here's my experience with a Lenovo Thinkpad X230 (64bit UEFI, 64bit OS):
1. I had to boot with sys rescue CD in UEFI mode (if that doesn't work for you - then I can't help much more than other people have with their suggestions).
2. Despite the fact that sys rescue CD comes with grub2, it doesn't come with the correct platform to install in 64bit UEFI, so I had to still chroot into my to-be system and install grub2 with the 64bit EFI platform (GRUB_PLATFORMS="efi-64 pc" in /etc/portage/make.conf). Have a read here: http://wiki.gentoo.org/wiki/GRUB2, pick what is relevant to you.
3. Once you have that, a grub2-install with /boot mounted should do the trick, assuming you want to use grub2 as your boot manager. Then you have to have fun with the configuration, menu entry, and all that. Should be easy.

If, however, you don't want to use grub2 as your boot manager you can copy your kernel to /EFI/BOOT/BOOTX64.EFI in your EFI partition, which will be recognized by your UEFI BIOS and boot from there or give it as a boot option, assuming it follows the standards properly. If you choose this method, you have to make sure that your kernel has the correct parameters in the configuration (CONFIG_CMDLINE_BOOL if I remember well will switch on the ability for you to enter this), at least you need root=/dev/to/root/partition.

Hi, I had the black screen problem. I had to update my bios/uefi firmware for my motherboard. So, you should check if there any update concerning the bios/uefi for your hardware.

This was a great idea... but unfortunately, I flashed the system with the latest bios, and it changed nothing... I cannot boot system rescue CD, or Ubuntu, or any other 64bit EFI disk I can get my hands on

I think I will have to try bullet #2 on SRS's post.

I know this is my fault for getting a "bleeding edge" system. I expected some resistance to installing linux -- but I never expected it to be this much of a pain!

I will keep at it.

Thank you all for your thoughtful ideas and suggestions...

G_________________To look without without looking within is like looking without without looking at all.

Look at the motherboard bios --> is there a option to boot into EFI Shell? If so, then put the Shelx64.efi under (EFI)/BOOT/ and use that to force a boot into your linux. Once in you can then use efibootmgr.

What MB and bios do you have? The latest ASUS/ASrock bios seem to have acceptable EFI Bios boot support.

Look at the motherboard bios --> is there a option to boot into EFI Shell? If so, then put the Shelx64.efi under (EFI)/BOOT/ and use that to force a boot into your linux. Once in you can then use efibootmgr.

What MB and bios do you have? The latest ASUS/ASrock bios seem to have acceptable EFI Bios boot support.

This is my system. Unfortunately, no, I don't see any such option..._________________To look without without looking within is like looking without without looking at all.

Okay, I did bullet #2 on srs5694's post, and it didn't work. (install rEFInd under Windows 8 )

I followed the instructions very closely, but rather than booting up to the rEFInd menu, it just starts up the bios. So now I cannot boot anything.

I don't get it, I followed the instructions to the letter, and double-checked for typos along the way, and it still isn't working.

The only thing that differed slightly was that Step 3 of the "Alternative Naming Options" (which proved necessary, because it booted to win8, completely ignoring refind), was that I had an /EFI/Boot and an /EFI/Microsoft/Boot directory (the directions mention it as a "this or that" situation, but does not mention a "both" scenario). So I renamed both as suggested (and copied the refind files to both directories), rebooted, and all I get now is the BIOS.

So... None of the efi boot disks work, and I cannot get into windows...

Now what can I do?

(and yes, secure boot is disabled in the bios)_________________To look without without looking within is like looking without without looking at all.

Either you're doing something very wrong or you've got a very broken EFI implementation. I do have a few suggestions, but only the last one is really likely to work (and it's radical and perhaps not acceptable):

Create a bootable CD-R or USB flash drive that contains a boot loader of your choice as EFI/BOOT/bootx64.efi. There's a ready-made rEFInd CD-R, and the rEFInd downloads page includes instructions on creating a bootable rEFInd USB flash drive. You could put just about any boot loader you like on a USB flash drive as EFI/BOOT/bootx64.efi, including even the Windows boot loader. (Creating a bootable USB flash drive is considerably easier than creating a bootable CD-R.)

Check your firmware to see if it includes any options to boot an EFI boot loader from a file, or to add a boot loader file to the list it maintains in NVRAM. This is a bit of a long-shot; although this function is present in the UEFI reference implementation, I haven't seen it on any production system.

Use bcfg (if you can get a version 2 shell launched) or efibootmgr (if you can get Linux launched in any way) to change the name of the rEFInd entry to "Windows Boot Manager". According to this blog post by Matthew Garret, at least one EFI implementation has a bug that prevents it from launching a boot loader unless it has this name (or "Red Hat Enterprise Linux"). Getting the system to launch to something that can use these tools may be a challenge, though....

Check your Secure Boot settings again. Yes, I know you say you've done so, but your problem is consistent with a computer that's booting with Secure Boot active. Maybe the settings are named strangely, or maybe you need to change two settings to disable Secure Boot, or maybe there's a bug that's preventing you from disabling Secure Boot.

Try adding a signed version of shim to the boot path. This will help if your firmware is buggy and prevents Secure Boot from being disabled. A relatively easy way to test this is to prepare a bootable USB flash drive with rEFInd, but pass the "--usedefault /dev/flashpart --shim /path/to/shim.efi" parameters to the install.sh script. (Change "/dev/flashpart" to the FAT partition on your USB flash drive and "/path/to/shim.efi" to the path to the shim.efi program file.) You can prepare this USB flash drive on any Linux computer. If this works, you'll first see the MokManager tool, which you'll have to use to add rEFInd's certificate to your NVRAM. You'll also need to sign your kernel and other boot loaders; see the rEFInd Secure Boot documentation for more information.

Using any tool available, restore the original EFI/Microsoft/Boot/bootmgfw.efi file to its original location. If that doesn't work, copy this file to EFI/BOOT/bootx64.efi, too. This should at least get Windows booting again.

Reconfigure your system to boot in BIOS mode. I've heard of this being done while saving a Windows installation, but I don't happen to have a link handy to a step-by-step procedure.

Return the computer to the retailer. Let them and the manufacturer know precisely why you're returning it. Get a computer from another manufacturer in its place.

If I had to put money on it, I'd wager that you've got a Secure Boot problem -- your ability to launch Windows but no other boot loader sounds like Secure Boot is active. Unfortunately, most Secure Boot implementations don't seem to bother returning any sort of error message when a boot loader fails Secure Boot checks; the system just moves on to the next available boot loader. If nothing works, you end up getting dumped into the firmware setup utility, with no explanation.

Oh... don't worry! I'm not blaming anyone, SRS. Like I said, I expected resistance with bleeding edge hardware. So I didn't mean anything personal there, I was just exasperated and wondering what my options are. I'm sure I can get the system back up and running someway or another.

I suppose that it is possible that I botched my bcdedit command, I was careful, but also exhausted by the time I tried it. I have downloaded your rEFInd cd, and while it won't boot as cd, it did boot on usb stick. It finds the boot images, though it will not boot any of them (MS wants me to insert the win8 disk, and of course, I do not have one. Maybe a winPE boot disk from win 7 will work...).

When I get some time, I will try to re-execute the directions from your webpage.

But, I did want to know about the /EFI/Boot and the /EFI/Microsoft thing... I have BOTH. Your instructions do not include this contingency. What should I do about that?

Thanks, and {Merry|Happy} {$holiday}!

G_________________To look without without looking within is like looking without without looking at all.

If you put the EFI stub kernel in /EFI/Boot/bootx64.efi in a FAT32 formatted partition of type EF00, then you don't need efibootmgr. Your UEFI will find it automatically.

CONFIG_CMDLINE is helpful there, especially in combination with root=PARTUUID=...
If you need initramfs, make sure it is an uncompressed CPIO archive with .cpio filename extension (genkernel by default creates gzip compressed CPIO archives), and add it to CONFIG_INITRAMFS_SOURCE.

Only if you want to create more boot entries, you need efibootmgr. You can run it after you first booted your bootx64.efi.

I suppose that it is possible that I botched my bcdedit command, I was careful, but also exhausted by the time I tried it. I have downloaded your rEFInd cd, and while it won't boot as cd, it did boot on usb stick. It finds the boot images, though it will not boot any of them (MS wants me to insert the win8 disk, and of course, I do not have one. Maybe a winPE boot disk from win 7 will work...).

What exactly happens when you try to boot one of the images in rEFInd's menu? Do you get an error message, and if so what does it say? Also, what are the files in the EFI/BOOT directory of the USB stick you created?

My initial hunch here is that you've got a USB flash drive that includes the Secure Boot files (shim.efi, with rEFInd stored as grubx64.efi) and rEFInd is failing to launch the boot loaders that it detects because they aren't signed. It could be that something else is going on, though.

Quote:

But, I did want to know about the /EFI/Boot and the /EFI/Microsoft thing... I have BOTH. Your instructions do not include this contingency. What should I do about that?

The "or" in the rEFInd documentation concerning these directories is non-exclusive. When both files are present, your firmware could be launching either one first, so to be 100% sure you launch a particular boot program, you'd need to replace both of them with the program you want to launch. You could do this in stages, too -- replace one, and if that doesn't work, replace the other.

chithanh wrote:

If you put the EFI stub kernel in /EFI/Boot/bootx64.efi in a FAT32 formatted partition of type EF00, then you don't need efibootmgr. Your UEFI will find it automatically.

This is true if the firmware doesn't have any NVRAM boot entries. If it's got such entries, they take precedence over the EFI/BOOT/bootx64.efi filename. At least, that's the way it's supposed to work. There are a lot of broken EFI implementations out there that tend to "forget" their NVRAM entries or that launch them only when certain additional conditions are met.

Even if other NVRAM boot entries exist, you can typically open the UEFI boot menu and select a boot entry that corresponds to your bootx64.efi. As a last resort, a reset to default settings will wipe the NVRAM boot entries too.

Even if other NVRAM boot entries exist, you can typically open the UEFI boot menu and select a boot entry that corresponds to your bootx64.efi. As a last resort, a reset to default settings will wipe the NVRAM boot entries too.

True, but neither of those options is ideal if you simply want to get a particular boot program launching as the default. For that, using efibootmgr from Linux (or bcfg from an EFI shell) is the way to go, with the caveat that there are still a lot of buggy/quirky EFI implementations out there that don't always react the way they should.

Well, I attempted to restore the system to factory defaults using the recovery disks that came with the system (well, I had to make the images using their software and burn them myself). It did not work. So I called MSI to inform them of this, and they said "sounds like a hardware issue, send it back." So, I wound up sending it back. Maybe it was... but I don't know... I'm not convinced. I personally think there was a flaw in their recovery disks... but I have no way of really knowing. They are sending a new one, and I will give this another try then.....

[To Be Continued....]_________________To look without without looking within is like looking without without looking at all.

Okay, new one came in last night. Before I do anything, however, I wanted to image the hard drive. The new clonezilla says it supports EFI... but I'm running into the same exact problems I did before: nothing will boot when this laptop is in EFI mode. I can get the clonezilla disk to come up to grub, but no matter what option I pick, the screen just goes black and the thing hangs.

I even used the rEFInd boot disk, and pointed it to the boot image on a USB stick with clonezilla on it, and the same thing happens: Grub starts, but no matter what I choose, the screen goes black.

I know MSI tech support said the last one had hardware issues... but I don't know if I believe it. I think their recovery disks just don't work -- so I want to make sure that this time I have a means of restoring to factory defaults before I proceed. But I'm stuck again, even before I begin...._________________To look without without looking within is like looking without without looking at all.