Custom init.<device>.rc is not invoked

1,867 views
Skip to first unread message

ffxx68

unread,
Dec 7, 2012, 5:41:46 AM12/7/12
to android...@googlegroups.com
Hi,

I'm struggling to find a solution to this problem.

I have a device with the following definitions:

emev.mk:PRODUCT_NAME := renesas_emev
emev.mk:PRODUCT_DEVICE := emev
emev.mk:PRODUCT_BOARD := emev

PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init.rc:root/init.rc \
$(LOCAL_PATH)/ueventd.emev.rc:root/ueventd.emxx.rc \
$(LOCAL_PATH)/init.emev.rc:root/init.emxx.rc \
$(LOCAL_PATH)/init.emev.sh:system/etc/init.emev.sh \

(details here: https://github.com/Renesas-EMEV2/Renesas-device_emev)

Now, in "init.emev.sh" there's the call to the insmod for the SGX graphics modules.
When I boot the device, SGX modules aren't initialized, until I manually invoke the init.emev.sh, e.g. from host:

 adb shell /system/etc/init.emev.sh

which allows to finally startup the SGX and complete device boot up.

What's wrong in my build env?
Is it PRODUCT_DEVICE, or PRODUCT_BOARD, that should be set to "emxx"?

 thanks
 Fabio


 

ffxx68

unread,
Dec 7, 2012, 5:43:43 AM12/7/12
to android...@googlegroups.com
Sorry, forgot to mention that the content of init.emxx.rc is a call to init.emev.sh:

---------
on boot
setprop net.dns1 192.168.0.1
setprop ro.radio.use-ppp no
setprop ro.radio.noril yes
setprop ro.showcursor 1
chown system system /sys/class/leds/led1/brightness
chown system system /sys/class/leds/led2/brightness

service emev-setup /system/etc/init.emev.sh
oneshot
---------

ffxx68

unread,
Dec 7, 2012, 5:51:48 AM12/7/12
to android...@googlegroups.com
... and the complete set of product names (in my emev.mk) is:

PRODUCT_NAME := renesas_emev
PRODUCT_DEVICE := emev
PRODUCT_BOARD := emev
PRODUCT_BRAND := emxx
PRODUCT_MANUFACTURER := renesas

Vishveshwar

unread,
Dec 7, 2012, 6:31:05 AM12/7/12
to android...@googlegroups.com

What is the machine name set in your kernel board file? This is what android init expects your filename to contain.
. e.g for Nexus 7 (grouper) it is set to "grouper" like this in arch/arm/mach-tegra/board-grouper.c
 MACHINE_START(GROUPER, "grouper")

Check the kernel boot log, you may see an error about init.xxx.rc not found.

-Vishveshwar

 thanks
 Fabio


 

ffxx68

unread,
Dec 7, 2012, 10:29:34 AM12/7/12
to android...@googlegroups.com
the machine name from kernel is

cd  arch/arm/mach-emxx
grep MACHINE_START *.c

emev_board.c:MACHINE_START(EMXX, "EMXX")

So, looks like I need an "init.EMXX.rc" file... Does lower/upper case count?

I'm puzzled, because I had exactly the same files in my GB version and it worked seamlessly. In JB something must have changed...

ffxx68

unread,
Dec 7, 2012, 10:31:56 AM12/7/12
to android...@googlegroups.com
btw - thanks Vishveshwar!

ffxx68

unread,
Dec 7, 2012, 11:13:17 AM12/7/12
to android...@googlegroups.com
I find no message about init.xxxx.rc as you said in kernel or logcat boot.
I've also tried with these init.xxxx.rc names:

init.EMXX.rc
init.emev.rc

but still the script isn't called.... I'm getting crazy with it!
What's irritating is that calling it manually everything goes fine.
What else to check?



On Friday, 7 December 2012 12:31:05 UTC+1, Vishveshwar wrote:

Shree Kumar

unread,
Dec 7, 2012, 12:26:36 PM12/7/12
to ffu...@googlemail.com, android...@googlegroups.com
Here's one method I can think of : Lookup the file that sources the vendor specific file; I believe this is /init.rc. This would have a line like

import /init.${ro.hardware}.rc (looking at aosp).

Now, get a shell on the device and execute "getprop ro.hardware". This should give you the right filename to use. Plus you need to make sure this gets packaged properly in the initrd...

HTH
-- Shree


ffxx68

unread,
Dec 7, 2012, 5:51:07 PM12/7/12
to android...@googlegroups.com
Thanks Shree. I will check that, but could you please elaborate about the initrd? How could I verify that?

ffxx68

unread,
Dec 11, 2012, 7:14:26 AM12/11/12
to android...@googlegroups.com
I think I solved. Thanks all for the useful suggestions.
I had a custom init.rc which entirely missed the "import /init.${ro.hardware}.rc" line !
Also, the script had to be started with proper "class" service, to make it go, i.e.

service emev-setup /system/etc/init.emev.sh
    class core
    user root
    group root
    oneshot

And, I had to fix file privileges to make it finally go:

 chown system:system init.rc
 chown system:system init.emxx.rc
 chmod 644 init.rc
 chmod 644 init.emxx.rc


On Friday, 7 December 2012 11:41:46 UTC+1, ffxx68 wrote:

Shree Kumar

unread,
Dec 11, 2012, 7:45:12 AM12/11/12
to Fabio Fumi, android...@googlegroups.com
Glad to know you solved the problem.

To debug service related issues, consider running them using the "logwrapper" program (see system/core/logwrapper/logwrapper.c ) - this will redirect messages to android's logging system - thus letting you figure out what's going wrong using "logcat"

HTH
-- Shree


--
Reply all
Reply to author
Forward
0 new messages