0

I have a PC with Win7, and Ubuntu.

I recently installed Android, but because Win7 is on the second partition, there were already 3(+1 extended) partitions, so I could only install Android within the extended partition, and only on a logical partition, and now Android isn't showing up in GRUB.

I tried to use Android's GRUB, but that doesn't show Ubuntu. I tried a custom script in the /etc/grub.d/40_custom file, but it doesn't do anything; I mean the /boot/grub/grub.cfg normally automatically adds the custom scripts to itself but that isn't happening for me.

custom script (contents of the 40_custom file):

#!/bin/sh  
exec tail -n +3 $0  
#This file provides an easy way to add custom menu entries.  Simply type the  
# menu entries you want to add after this comment.  Be careful not to change  
# the 'exec tail' line above.  
set root='(hd0,6)'  
linux /android-4.4-r1/kernel quiet root=/dev/ram0 androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode SRC=/android-4.4-r1
initrd /android-4.4-r1/initrd.img

My Android version is Android 4.4 r1 (not rc1)

3 Answers 3

1
\#!/bin/sh

I don't know where those backslashes come from, but if they are actually in your 40_custom then they don't belong there and you should remove them.

The component in Grub that automatically includes other distributions boot settings is called os-prober, but Android x86 appears to be not included in the set of known distributions.

Note that 4.4-r4 and Android M have been announced on android-x86.org

6
  • the slashes because somebody edited the answer and gave it a new format and forgot to delete \-s
    – Yakusho
    Jul 30, 2016 at 10:20
  • corrected the backslash thing
    – Yakusho
    Jul 30, 2016 at 10:21
  • 2
    @ZoltánPataki my apologies. I left the backslashes because the way you formatted it I couldn't tell whether they were part of the file or part of your formatting, and I didn't want to throw away information
    – Zanna
    Jul 30, 2016 at 10:30
  • no problem :D i am not know a lot of things about format, so something i can make very misleading things :D
    – Yakusho
    Jul 30, 2016 at 10:33
  • like i didnt know that if you have space before the # it wont be a giant text so i used \ (\ is disable the next character format code, like # is make the text gigantic) but when you made the space before the \, \ is also was disabled :D so its my fault
    – Yakusho
    Jul 30, 2016 at 10:36
0

OK, please check this image:

My Android Grub entry in Grub Customizer

Try to extract the files within the ISO (initrd.img, ramdisk.img, system.sfs (open this file with gnome-disk-image-mounter in a terminal and you will find a readable and writeable system.img) and kernel) to a folder in one of your Ubuntu partitions, and add a "data" directory inside that folder (as you can see in the image, I have my Android inside my /dev/sda6 home partition, and it runs pretty well). Modify the entry according to the new situation of the Android files, and post your result.

Also note that my only boot option is androidboot.hardware=android_x86, and as I have noticed, you wrote in the 40_custom file more options (quiet root=/dev/ram0 acpi_sleep=s3_bios,s3_mode SRC=/android-4.4-r1). If the Android works with just the androidboot.hardware=android_x86 boot option, try to add the other options (be careful with the root=* and SRC=* options!!)

I hope this issue to be solved.

0

Try deleting the contents of the 40_custom file (only what you have added) and using Grub Customizer to add the Android entry. When I have to dual boot Android with Ubuntu, I always use Grub Customizer, and it always works with no problems.

If you want to install it (and you haven't installed it yet), run the following from a terminal (Ctrl+Alt+T):

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

I hope this info to be useful to you.

1
  • thats good and fancy, but when i select other in grub-customizer, it just give me a empty code without any clue what to do, and when i select linux, and get all spaces filled, when i try to load android from grub, its give me an error
    – Yakusho
    Jul 30, 2016 at 9:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .