Sunday, 15 August 2010

cannot do chroot with init shell script in android -



cannot do chroot with init shell script in android -

i want run glibc within android ics emulator, have bundled glibc separate folder in aosp root folder, android.mk in below contents:

local_path:= $(call my-dir) include $(clear_vars) $(shell mkdir -p $(target_out)/glibc/) $(shell cp -rf $(local_path)/* `pwd`/$(target_out)/glibc/)

it copies entire glibc folder out/target/product/generic/system/ folder. , create snod includes in system.img

there startglibc.sh , init.sh script withing glibc folder gets copied /system/glibc & /system/glibc/root/ folder respectively.

i have busybox compiled , copied /system/bin/ folder.

content of /system/glibc/startglibc.sh below:

busybox=/system/bin/busybox mnt=/system/glibc export path=/usr/bin:/usr/sbin:/bin:$path export root=/root ${busybox} chroot $mnt /root/init.sh

the startglibc.sh invoked init.goldfish.rc below:

service myscript /system/bin/busybox ash /system/glibc/startglibc.sh class main oneshot

i have given 777 , root:root file permission init.sh using system/core/include/private/android_filesystem_config.h below:

{ 00777, aid_root, aid_root, "system/glibc/root/init.sh" },

during boot time startglibc.sh script getting called while executing chroot gives permission denied error.

am missing doing chroot using init.sh? or copying glibc folder wrongly during android aosp build?

i able chroot. below did:

chroot requires not init script or /bin/sh execute permission, of file scheme folders bin. etc. var. etc. creating new root.

hence, gave below in system/core/include/private/android_filesystem_config.h

{ 00755, aid_root, aid_root, "system/glibc/" }, { 00755, aid_root, aid_root, "system/glibc/*" },

because when re-create entire folder during aosp build, default permission files , folders in copied folder 644 , hence necessary folders required chroot not have execute permission.

also, if of folder within copied needs additional permission, can specify same below above code.

i loved way android gives permissions filesystem. extremely configurable.

i hope helps else well.

android android-emulator chroot android-build prebuild

No comments:

Post a Comment