Android x86 boots from first partition always (GRUB2)

153 views
Skip to first unread message

aleksandr ivanovich

unread,
Jun 13, 2020, 3:51:50 AM6/13/20
to Android-x86
Hello,

I have a dual boot (Windows 10/Linux Mint) laptop.
Recently I needed to use two Android X86 distributions and I've installed them also, so it became four-boot system :)
Anyways, when I boot the first Android (A-1 entry), it boots ok. When I boot the second (A-2 entry), it still boots the first one. Bootloader prints that: "Detecting Android-x86... found at /dev/nvme0n1p6". As you see, I've configured the second to boot from a different partition [1].
I've also tried to install at partition /dev/nvme0n1p10. Then it boots from it. It seems that it always tries to boot from the partition with the smallest number alphabetically.

Any help to boot the second android would be appreciated.

[1]
menuentry "A-1" {
set root='(hd0,6)'
linux /android-8.1-r2/kernel root=/dev/ram0 quiet androidboot.selinux=permissive acpi_sleep=s3_bios,s3_mode SRC=/android-8.1-r2
initrd /android-8.1-r2/initrd.img
}
menuentry "A-2" {
set root='(hd0,7)'
linux /android-8.1-r2/kernel root=/dev/ram0 quiet androidboot.selinux=permissive acpi_sleep=s3_bios,s3_mode SRC=/android-8.1-r2
initrd /android-8.1-r2/initrd.img
}

Chih-Wei Huang

unread,
Jun 14, 2020, 10:12:03 AM6/14/20
to Android-x86
aleksandr ivanovich <alvliv...@gmail.com> 於 2020年6月13日 週六 下午3:51寫道:
>
> I have a dual boot (Windows 10/Linux Mint) laptop.
> Recently I needed to use two Android X86 distributions and I've installed them also, so it became four-boot system :)
> Anyways, when I boot the first Android (A-1 entry), it boots ok. When I boot the second (A-2 entry), it still boots the first one. Bootloader prints that: "Detecting Android-x86... found at /dev/nvme0n1p6". As you see, I've configured the second to boot from a different partition [1].
> I've also tried to install at partition /dev/nvme0n1p10. Then it boots from it. It seems that it always tries to boot from the partition with the smallest number alphabetically.

Actually it searches the partition containing the dir
specified by SRC. So yes, your grub.cfg makes it always
find the first Android partition.
Note the root partition (specified by set root=...) only affects
where grub finds the partition containing kernel & initrd.img.
It doesn't affect how Android partition is found.

You have two ways (at least) to achieve your goal:
* Add ROOT= to kernel cmdline, e.g.,
ROOT=/dev/nvme0n1p10 (suppose it's the second Android partition)
* Rename the second Android dir, say, SRC=/android-8.1-r2_2
In fact in this way you don't need two Android partitions.
You can just put two installations to two different dirs in the same
partition.

> [1]
> menuentry "A-1" {
> set root='(hd0,6)'
> linux /android-8.1-r2/kernel root=/dev/ram0 quiet androidboot.selinux=permissive acpi_sleep=s3_bios,s3_mode SRC=/android-8.1-r2
> initrd /android-8.1-r2/initrd.img
> }
> menuentry "A-2" {
> set root='(hd0,7)'
> linux /android-8.1-r2/kernel root=/dev/ram0 quiet androidboot.selinux=permissive acpi_sleep=s3_bios,s3_mode SRC=/android-8.1-r2
> initrd /android-8.1-r2/initrd.img
> }


--
Chih-Wei
Android-x86 project
http://www.android-x86.org
Reply all
Reply to author
Forward
0 new messages