About androidboot.hardware

5,402 views
Skip to first unread message

Chih-Wei Huang

unread,
Oct 11, 2016, 1:21:43 AM10/11/16
to Android-x86
Hi all,
For those who don't understand what
the androidboot.hardware is, here is
an brief explanation:

androidboot.hardware=xxx is a kernel cmdline config
which is passed to android init process.
The init process parses this config and sets
the properties ro.boot.hardware and
ro.hardware to xxx.
The latter property is used to load the correct
rc files and HALs at the boot time.
Therefore an incorrect setting of
androidboot.hardware=xxx results in boot failure.

Practically xxx must be set to the target name
of the built image. This is AOSP's original design and
we just follow it since the day one of the project started.
Currently we only support two targets:
android_x86 for the 32-bit image and
android_x86_64 for the 64-bit image.
However, other derived projects may
use different target names.
For example Remix OS uses remix_x86 for
32-bit and remix_x86_64 for 64-bit images.

Android-x86 installer would set it correctly if
you choose to install grub (or grub-efi).
However, for those who choose to skip this step
and create the android-x86 boot entry themselves,
there is a chance that they set the value incorrectly.

I found it has become one of the most common
mistakes that the new comers made.
So I tried to solve it more systematically.
Fortunately the solution is not difficult.
I just set the default value of ro.hardware to
the target name so that when androidboot.hardware
is not set in kernel cmdline, the init process
would still get the correct value of ro.hardware.
This eliminates the necessity of androidboot.hardware.

https://osdn.net/projects/android-x86/scm/git/system-core/commits/a3eb6a57bc0f217de30bb04de072eb20aecfae21

In short, if you are using an image built with that patch
(i.e., after Sep 23th), you don't need to set
androidboot.hardware in cmdline anymore.
Of course you can still add it but it must be
set correctly.

Note cm-13.0-x86-rc1 is the first released image
containing this patch. The 6.0-r1 is released earlier
so you still need to set androidboot.hardware correctly.


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

Marshall Kiker

unread,
Oct 12, 2016, 2:22:29 PM10/12/16
to Android-x86
Short question, does the patch enable the OS to boot without Grub? If so that would solve an issue I'm having using a GPT table. I can't seem to get grub to install properly.

Chih-Wei Huang

unread,
Oct 12, 2016, 2:26:45 PM10/12/16
to Android-x86
2016-10-13 1:52 GMT+08:00 Marshall Kiker <mkike...@gmail.com>:
> Short question, does the patch enable the OS to boot without Grub? If so
> that would solve an issue I'm having using a GPT table. I can't seem to get
> grub to install properly.

It's unrelated to Grub.

Android-x86 doesn't depend on grub.
You can use any bootloader that
can boot a Linux kernel.

Grub-efi could boot android-x86 from a
GPT table device. But it's not necessary.

Marshall Kiker

unread,
Oct 13, 2016, 11:05:59 PM10/13/16
to Android-x86
I can't get anything to work with Android though. GPT depends on either EFI, which my computer doesn't have, or a 1meg partition to house either Grub or any linux based bootloader. The Android X86 installer however fails to use the 1meg partition that Linux uses to get itself onto Bios machines. I can use gparted to prepare the disc before the install but so far I have failed to find an answer other than reverting back to mbr/msdod partition table.

I'm not sure if GPT has enough features to be worth all the trouble but since I'm starting with a clean disk I wanted to format it to the newest protocols.

youling 257

unread,
Oct 14, 2016, 2:44:17 PM10/14/16
to Android-x86
x86 cm14,only  linux /kernel root=/dev/ram0 androidboot.selinux=permissive DATA= DEBUG=2

but,i am use it test cm14 and 7.0

menuentry "q (DEBUG mode)" {
set DIR=/q
search --set=root --file /32/1kernel
linuxefi /32/1kernel root=/dev/ram0 androidboot.hardware=android_x86 DIR=$DIR SRC=$DIR androidboot.selinux=permissive intel_idle.max_cstate=0 i915.enable_psr=0 DEBUG=2
initrdefi /initrd.img
}

i notice cm14 ,init.cm_android_x86.rc and fstab.cm_android_x86,so , i do this,cp fstab.cm_android_x86 fstab.android_x86,cp init.cm_android_x86.rc init.android_x86.rc,boot cm14 success.


Reply all
Reply to author
Forward
0 new messages