[Android General] exbarboss:
Hi people!

I faced a trouble and spent around 3 hours trying to setup Grub but no success(. I have a Dell E5430 laptop. If I install grub from LiveUSB Android works great and even find my windows partition. But if I install it separately it fails on boot and restart my laptop each time I select Android x86 from Grub menu.

Here is what I have:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 298,1G 0 disk
├─sda1 8:1 0 80G 0 part
└─sda2 8:2 0 218,1G 0 part
sdb 8:16 0 117,4G 0 disk
├─sdb1 8:17 0 20,1G 0 part
├─sdb2 8:18 0 7,8G 0 part
├─sdb3 8:19 0 19,7G 0 part
├─sdb4 8:20 0 1K 0 part
├─sdb5 8:21 0 52G 0 part /
├─sdb6 8:22 0 7,9G 0 part [SWAP]
└─sdb7 8:23 0 9,9G 0 part

and here is fdisk resut:

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x19525c8e

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 167774207 83886080 7 HPFS/NTFS/exFAT
/dev/sda2 167774208 625139711 228682752 7 HPFS/NTFS/exFAT

Disk /dev/sdb: 126.0 GB, 126035288064 bytes
255 heads, 63 sectors/track, 15322 cylinders, total 246162672 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e4a43

Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 42084351 21041152 83 Linux
/dev/sdb2 83333120 99717119 8192000 82 Linux swap / Solaris
/dev/sdb3 42084352 83333119 20624384 83 Linux
/dev/sdb4 99719166 246161407 73221121 5 Extended
/dev/sdb5 99719168 208857087 54568960 83 Linux
/dev/sdb6 229646336 246161407 8257536 82 Linux swap / Solaris
/dev/sdb7 208859136 229644287 10392576 83 Linux

Partition table entries are not in disk order

sdb1/2 - I have kali + swap

sdb3 - elementary OS

sdb4 it is extended partition that includes sdb5/6 - Linux Mint and finally sdb7 - Android x86

Here what I have in gedit /etc/grub.d/40_custom:

menuentry "Android-x86_4.4" {
set root='(hd1,7)'
search --no-floppy --fs-uuid --set=root ae4d708b-b9ec-41cb-aecc-650096c10cfb
linux android-4.4-r1/kernel root=UUID=ae4d708b-b9ec-41cb-aecc-650096c10cfb quiet androidboot.hardware=generic_x86 SRC=/android-4.4-r1 acpi_sleep=s3_bios,s3_mode
initrd android-4.4-r1/initrd.img
}

and here is grub entries from install Android x86 with grub:

default=0
timeout=6
splashimage=/grub/android-x86.xpm.gz
root (hd0,6)

title Android-x86 4.4-r1
kernel /android-4.4-r1/kernel quiet root=/dev/ram0 androidboot.hardware=android_x86 video=-16 SRC=/android-4.4-r1
initrd /android-4.4-r1/initrd.img

title Android-x86 4.4-r1 (Debug mode)
kernel /android-4.4-r1/kernel root=/dev/ram0 androidboot.hardware=android_x86 video=-16 DEBUG=2 SRC=/android-4.4-r1
initrd /android-4.4-r1/initrd.img

title Android-x86 4.4-r1 (Debug nomodeset)
kernel /android-4.4-r1/kernel nomodeset root=/dev/ram0 androidboot.hardware=android_x86 video=-16 DEBUG=2 SRC=/android-4.4-r1
initrd /android-4.4-r1/initrd.img

title Android-x86 4.4-r1 (Debug video=LVDS-1:d)
kernel /android-4.4-r1/kernel video=LVDS-1:d root=/dev/ram0 androidboot.hardware=android_x86 video=-16 DEBUG=2 SRC=/android-4.4-r1
initrd /android-4.4-r1/initrd.img

title Windows
rootnoverify (hd1,6)
chainloader +1

the difference is kernel vs linux actually.

And even more fun, if in grub I'm clicking 'e' - and then try to type set root='( the auto complete shows the following:

hd0,msdos1 hd0,msdos2 hd0,msdos3 hd0,msdos4 hd0,msdos6 hd0,msdos7
hd1,msdos1 hd1,msdos2

But by all rules it should be vice verse, like sda = hd0, sdb=hd1 or am I wrong?

Ha, I found a solution:

[SOLUTION]:

menuentry 'Android-4.4' --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set=root ae4d708b-b9ec-41cb-aecc-650096c10cfb
echo	'Loading android-4.4 ...'
linux /android-4.4-r1/kernel quiet root=ae4d708b-b9ec-41cb-aecc-650096c10cfb androidboot_hardware=generic_x86 acpi_sleep=s3_bios,s3_mode SRC=/android-4.4-r1 DATA= DPI=160
echo	'Loading initial ramdisk ...'
initrd /android-4.4-r1/initrd.img
}

Maybe will help somebody to save time)