grub and secure boot

446 views
Skip to first unread message

willi...@alltel.net

unread,
Apr 4, 2017, 9:35:42 PM4/4/17
to Android-x86
I'm trying to get Android-x86 6.0-r2 to boot on my Dell Inspiron 11" 3157, and I'm having issues. The thing that confuses me is that on my previous setup, on this same laptop, it worked just fine. Now, not so much.

Okay some details. On my previous setup, it was Ubuntu/Kubuntu/Lubuntu only, with a partition layout something like this:
/dev/sda1 -- efiboot
/dev/sda2 -- swap
/dev/sda3 -- /, ext4
/dev/sda4 -- android, ext4
/dev/sda5 -- /home, ext4

with all the Microsoft-inspired BIOS (yeah, yeah, I know, it's EUFI, but I have a hard time not calling it BIOS) stuff (Secure Boot & the like) turned off. If I put android-x86 in its own partition (sda5) or just in a folder at the root-level, it's boot as long as I had the grub menuentry correct.

This is what I put in /etc/grub.d/40_custom to boot grub:

    menuentry 'Android-x86' --class android-x86{
        set root='(hd0,3)'
        linux /kernel androidboot.hardware=android_86_64 androidboot.selinux=permissive
        initrd /intrd.img
    }

I'd change the set root line to "set root='(hd0,4)'" if I wasn't booting out of the android partition - I was working out as many possible ways to make it work as I could.

Now, my current setup is a bit different. It turns out I need to use Win10 from time to time, so my current partition table looks like this:

/dev/sda1        2048     206847     204800   100M EFI System
/dev/sda2      206848     239615      32768    16M Microsoft reserved
/dev/sda3      239616  307439615  307200000 146.5G Microsoft basic data
/dev/sda4  1949837312 1953523711    3686400   1.8G Windows recovery environment
/dev/sda5  1882724352 1949837311   67112960    32G Linux filesystem
/dev/sda6   307439616  311660543    4220928     2G Linux filesystem
/dev/sda7   311660544  395552767   83892224    40G Linux filesystem
/dev/sda8   395552768 1882724351 1487171584 709.1G Linux filesystem

I booted and installed Win10 first, then used Win10's partition tools to shrink sda3 to around 150 GB. Since I was installing Win10, I went into BIOS / EUFI & set Secure Boot & etc on before installation.

Then I used an Ubuntu boot drive to create a 32 partition (sda5) in the unused space, before installing openSUSE tumbleweed into the remaining unused space. Once I had openSUSE installed, I opened the android-x86-6.0-r2.iso and extracted initrd.img, kernel, ramdisk.img and system.sfs, which I copied to sda5. This is the method I've used before to install android-x86 and remixOS, and I expected it to work again.

However, after a couple weeks of effort, and I don't know how many reboots, the best I've got is an error message something like this:

"kernel has invalid signature
you have to load kernel first"

If I'm reading things right, this is caused by Secure Boot being on. When I turn Secure Boot off, and remove the "quiet' flag from grub, I get the wall o' text as it boots into android, but then the screen goes black. Furthermore, if I try booting into openSUSE with Secure Boot off, it also boots to a black screen. I'm open to suggestions.

Here's my current 40_custom:

menuentry "Android-x86" --class android-x86{
set root='(hd0,5)'
search --set=root --file /system.sfs
linuxefi /kernel root=/dev/ram0 androidboot.hardware=android_x86_64 androidboot.selinux=permissive
SDCARD=/dev/sdb
initrdefi /initrd.img
}

I have a 64 GB sd card I intend to use as external storage for android, and as an easy way to move files between Win10, openSUSE & linux.

Chih-Wei Huang

unread,
Apr 4, 2017, 10:49:12 PM4/4/17
to Android-x86
If you use search, no need to add 'set root ...'

> linuxefi /kernel root=/dev/ram0 androidboot.hardware=android_x86_64

linuxefi -> linux

> androidboot.selinux=permissive
> SDCARD=/dev/sdb
> initrdefi /initrd.img

initrdefi -> initrd

> }

Note you didn't use linuxefi and initrdefi before
as shown above.
(if you copy&paste correctly)


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

willi...@alltel.net

unread,
Apr 5, 2017, 9:27:56 PM4/5/17
to Android-x86


On Tuesday, April 4, 2017 at 9:49:12 PM UTC-5, Chih-Wei Huang wrote:
2017-04-05 9:10 GMT+08:00  <willi...@alltel.net>:

<snip>
 
> menuentry "Android-x86" --class android-x86{
> set root='(hd0,5)'
> search --set=root --file /system.sfs

If you use search, no need to add 'set root ...'

Okay, that's easier.

> linuxefi /kernel root=/dev/ram0 androidboot.hardware=android_x86_64

linuxefi -> linux

> androidboot.selinux=permissive
> SDCARD=/dev/sdb
> initrdefi /initrd.img

initrdefi -> initrd

> }

If I'm reading you correctly, I should have these two lines in 40_custom:
linuxefi kernel root=/dev/ram0 androidboot.hardware=android_x86_64
initrdefi initrd

(i.e. no "/" in front of either of them)

If I do that, I get "hd1,gpt5 hd1,gpt5error: invalid file name: 'kernel'"

Note you didn't use linuxefi and initrdefi before
as shown above.
(if you copy&paste correctly)

Correct. In my earlier installations, I used linux and initrd instead of linuxefi and initrdefi, and it worked fine. Again, though, I had Secure Boot off and Legacy Boot on, which may or may not have had something to do with it.

I also notice that the hard drive notation is different. Instead of using (hd0,5), it's (hd1,5).

Chih-Wei Huang

unread,
Apr 5, 2017, 9:30:48 PM4/5/17
to Android-x86
2017-04-06 1:46 GMT+08:00 <willi...@alltel.net>:
> On Tuesday, April 4, 2017 at 9:49:12 PM UTC-5, Chih-Wei Huang wrote:
>>
>> 2017-04-05 9:10 GMT+08:00 <willi...@alltel.net>:
>>
> <snip>
>
>>
>> > menuentry "Android-x86" --class android-x86{
>> > set root='(hd0,5)'
>> > search --set=root --file /system.sfs
>>
>> If you use search, no need to add 'set root ...'
>
>
> Okay, that's easier.
>>
>>
>> > linuxefi /kernel root=/dev/ram0 androidboot.hardware=android_x86_64
>>
>> linuxefi -> linux
>>
>> > androidboot.selinux=permissive
>> > SDCARD=/dev/sdb
>> > initrdefi /initrd.img
>>
>> initrdefi -> initrd
>>
>> > }
>>
> If I'm reading you correctly, I should have these two lines in 40_custom:
> linuxefi kernel root=/dev/ram0 androidboot.hardware=android_x86_64
> initrdefi initrd

NO! Of course not!

> (i.e. no "/" in front of either of them)
>
> If I do that, I get "hd1,gpt5 hd1,gpt5error: invalid file name: 'kernel'"
>
>> Note you didn't use linuxefi and initrdefi before
>> as shown above.
>> (if you copy&paste correctly)
>
> Correct. In my earlier installations, I used linux and initrd instead of
> linuxefi and initrdefi, and it worked fine. Again, though, I had Secure Boot
> off and Legacy Boot on, which may or may not have had something to do with
> it.

I meant your earlier setting is correct.
Why did you change that?

> I also notice that the hard drive notation is different. Instead of using
> (hd0,5), it's (hd1,5).

Use 'search'. Don't bother with that.
Reply all
Reply to author
Forward
0 new messages