6

I replaced a modified build.prop which contains ro.kernel.qemu=0 to the system.img with yaffey, but it did not work. When the emulator restarted, ro.kernel.qemu=1 still exists in the output of adb shell getprop .

EDIT:

I also tried:

  1. add ro.kernel.qemu=0 in default.prop in ramdisk.img
  2. add setprop ro.kernel.qemu 0 in init.goldfish.rc in ramdisk.img

But all these did not work. When I start the emulator with modified ramdisk.img, ro.kernel.qemu is still 1 in the output of adb shell getprop.

I am now trying to rebuild the kernel to set it to 0, but I did not find where ro.kernel.qemu is set in the kernel source code.

Appreciated for any advices.

WKPlus
  • 6,955
  • 2
  • 35
  • 53
  • Is it OK if you can change the ro.kernel.qemu from /data/local.prop? Or you only wants it via default.prop or init.goldfish.rc ? – AADProgramming Jan 20 '15 at 13:16
  • @AADTechnical Changing the value in `/data/local.prop`, 'default.prop` or `init.goldfish.rc` did not work, I still got `ro.kernel.qemu=1` when executing `adb shell getprop` after that. – WKPlus Jan 20 '15 at 15:43
  • you could try https://github.com/jduck/rootadb , it allows setting ro property values, specifically you can just use the native part of the app setpropex to set the ro values from su shell, but needs to be set on each reboot – nandeesh Jan 21 '15 at 11:47
  • @nandeesh In an emulator, root privilege is already got. – WKPlus Jan 23 '15 at 04:37
  • yeah, so setpropex might work – nandeesh Jan 23 '15 at 07:17
  • @nandeesh Unfortunately, `setpropex` can not set `ro.kernel.qemu` either. – WKPlus Jan 27 '15 at 05:04

1 Answers1

2

You need to modify ramdisk.img which contains /init and the initial property files. system.img is mounted later, so any changes there will not affect the boot.

Also, init might need to be modified, because it might set the ro.kernel.xxxxx variables from the kernel command-line before parsing the boot property config file.

Digit
  • 2,073
  • 1
  • 13
  • 10
  • I did unzip the ramdisk.img and did not find where `ro.kernel.qemu` is set. – WKPlus Jan 15 '15 at 05:16
  • I mean `ro.kernel.qemu` is neither set in `init.rc` nor in `default.prop`. – WKPlus Jan 15 '15 at 05:29
  • 1
    ro.kernel.xxx variables are set by init from the kernel's parameters (i.e. /proc/cmdline, iirc). In this specific case, the emulator sets a parameter "qemu=1" on startup, and that's why ro.kernel.qemu is defined to 1 by init on startup. I.e. you will have to either modify the emulator, or the init program on your ramdisk.img to achieve what you want. Not setting ro.kernel.qemu might modify the way system libraries behave under emulation and may render your system un-bootable or un-usable. Have fun :-) – Digit Jan 21 '15 at 08:08
  • I am trying to modify the emulator or init program but don't know how. Could you please give some more detail information? – WKPlus Jan 22 '15 at 10:35