0

I installed the android-x86-8.1-r2.x86_64.rpm package on Ubuntu 18.04 using the following commands as suggested by Release Note 8.1-r2 but it didn't add boot entries to the grub2 menu.

  • sudo apt install alien
  • sudo alien -ci android-x86-8.1-r2.x86_64.rpm

Question: What are the definitions of the boot entries I need to add to the 40_custom grub file in order to add android-x86-8.1-r2 to my grub2 boot menu?


Based on the answer below I tried adding the following menu entry to the 40_custom grub file. I also tried changing system.img to system.sfs.


menuentry "Android-x86 8.1-r2" --class android-x86 {
insmod part_gpt
search --file --no-floppy --set=root /android-8.1-r2/system.img
linux /android-8.1-r2/kernel root=/dev/ram0 androidboot.hardware=remix_x86_64 androidboot.selinux=permissive CMDLINE
initrd /android-8.1-r2/initrd.img
}


Based on How to Install Android in Dual Boot with Linux I also tried adding the following menu entry to the 40_custom grub file.


menuentry "Android-x86 8.1-r2" {
search --set=root --file /android-8.1-r2/kernel
linux /android-8.1-r2/kernel quiet root=/dev/ram0 androidboot.selinux=permissive
initrd /android-8.1-r2/initrd.img
}


Neither of the two menu entries above work. When I update grub it produces the following output which seems to indicate grub isn't recognizing the menu entry, and my computer continues to boot directly into Ubuntu 18.04.


Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.18.0-25-generic
Found initrd image: /boot/initrd.img-4.18.0-25-generic
Found linux image: /boot/vmlinuz-4.18.0-15-generic
Found initrd image: /boot/initrd.img-4.18.0-15-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done


My computer hard drive has a single Linux ext4 partition, and the contents of /android-8.1-r2 are as follows:


drwxr-xr-x 2 root root 4096 Jul 21 09:40 data
-rw-r--r-- 1 root root 1358699 Jun 13 02:11 initrd.img
-rw-r--r-- 1 root root 7437056 Jun 13 02:11 kernel
-rw-r--r-- 1 root root 1424814 Jun 13 02:11 ramdisk.img
-rw-r--r-- 1 root root 877621248 Jun 13 02:11 system.sfs

2 Answers 2

1

I determined that grub was actually configured with an option to boot Android, but I wasn't seeing this option because grub was configured to automatically boot Ubuntu. I added the # to the beginning of the following lines in /etc/default/grub, ran "sudo update-grub", and now my computer gives me the option to boot Android.

#GRUB_TIMEOUT_STYLE=hidden
#GRUB_TIMEOUT=0

I also determined the menu entry I added to 40_custom wasn't necessary as it resulted in a redundant option to boot Android in the grub boot menu, so I deleted this menu entry (which I had manually added as described in my question above) from my 40_custom file.

0

In your case you must edit 40_custom and write this into the file:

menuentry 'android' --class android-x86 {
        insmod part_gpt
        search --file --no-floppy --set=root /android-8.1-r2./system.sfs
        linux /android-8.1-r2./kernel root=/dev/ram0 androidboot.hardware=remix_x86_64 androidboot.selinux=permissive CMDLINE
        initrd /android-8.1-r2./initrd.img
}

and then update your grub. Maybe you must change paths.

7
  • My folder name is android-8.1-r2. There is no system.img file in this folder, but there is a system.sfs file along with kernel, initrd.img and ramdisk.img files and a data folder. Commented Jul 29, 2019 at 15:15
  • ok then change it from system.img to system.sfs
    – lucki1000
    Commented Jul 29, 2019 at 20:59
  • I tried that and it didn't work as I indicated in my updated question above. Commented Jul 29, 2019 at 21:07
  • Did you get any error if you start Android?
    – lucki1000
    Commented Jul 29, 2019 at 21:15
  • My problem is I can't start Android. I don't get an option to boot it when I start my computer since update-grub doesn't seem to be recognizing it when I add it to the 40_custom file. Commented Jul 29, 2019 at 22:37

You must log in to answer this question.

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