[Q] [DEV] Disable device in init.rc? - Nexus S Q&A, Help & Troubleshooting

Hi!
I would like to know if I can disable a device-driver within init.rc or something.
The reason is, that I would like to totally switch off the touchkey-buttons (the function and the backlight). They are not active in bootloader-mode, but switch on when the device is booting the kernel, so I guess they could be switched off by deleting or at least disabling the driver.
Any ideas on how to do that without having to recompile the whole kernel?
Thanks
McDV

Related

[Q] Question: replacing a running kernel

Hi,
From what I've gathered (and please correct me if I'm wrong), Motorola has locked down their devices by requiring you to sign any replacement kernel with a secret key. This process is enforced by their bootloading code.
We can't replace the bootloader or the kernel without this key, but we do have root access to the Defy. Would it not be possible to write a kernel module, and load it using insmod on a rooted phone? Is insmod available on Android?
This kernel module would then run in kernel mode, and should thus have access to any and all features of the processor and the entire memory space, right? Can't this be used to load a different kernel into memory, reconfigure the MMU to put it at the appropriate memory address, and then have the phone boot the new kernel?
The limited modding that has been done on the Defy and the uncertainty about upgrades down the road are the only thing that keep me from buying it..
Never mind, apparently this is what http://freemymoto.com/tiki-index.php does, so not only is it possible, it's already been done.

[Q]Need Android Gurus - Issues

Hi to everybody, I come from the BADA subforum, and there is a new project trying to port Android to samsung Wave phone.
Devs have some issues, we are in the last steps and here is a summary
will want to note that the kernel has been confirmed as able to boot into android homescreen when flashed though JTAG
we're modifying the init scripts to boot it from sdcard
the device is accessible from adb how ever the Android system services such as zygote are restart looping
i *think* i managed to execute standard boot on init.rc with adb interface, zygote and android services appear to be stuck in a restart loop:
http://code.google.com/p/badadroid/source/detail?r=192
EDIT: would like to note that while "VIBETONZ" is appearing on the log, the phone is not vibrating, nothing is appearing on the display either. If possible i'd like a check on my kernel sources Oleg. EDIT AGAIN: the phone does actually vibrate, my bad
line 3150ish you can see the zygote service and various others getting killed and restarting.
EDIT2: another debug log extracted using "adb bugreport" (very large, will want to download in order to view)
http://code.google.com/p/badadroid/source/detail?r=193
http://badadroid.googlecode.com/svn/trunk/adb logs/bugreportnb190511.log
EDIT3: it's possible that the restart loop is caused by lack of memory, this could be caused by the memory mapping of the current bootloader we're using, will have to ask rebellos and srg about that.
added a log to googlecode for procedure to boot kernel using init.rc with adb interface working ( i'm not exactly sure why this works) i may upload the zImage i'm using for this, but it'll only work if you partition your memory card in the correct layout and format.
http://code.google.com/p/badadroid/source/detail?r=194
http://code.google.com/p/badadroid/d...511v2&can=2&q=
Click to expand...
Click to collapse
We need some ideas, or whatever you can provide with your knowledge to help us in this project.
more info: http://forum.xda-developers.com/showthread.php?t=1012856&page=100
Thanks to everybody.
hi to everybody
need help, please!
anybody?
I will take a look later on this evening and see if I can tell anything.
Your kernel seems to work, most of your issues in the log that was posted in my thread come from the ramdisk and system build. Until you work at those for a bit, I don't think you're going to know where to place the blame for issues until you're clean.
For the VM crash loop:
Take all of the non critical apps and gapps out of /system/apps (stuff like vending, maps, touchwiz and so on.)
And see what you get. If you can't solve it that way, then try to do:
adb pull /dbdata/databases/com.android.providers.settings/settings.db settings.db
And see what you get. If its there, it's corrupt. If it isn't, check to make sure the directory is getting created. You can also get someone to pull settings.db from a similar device (i9000?) and try to push it to yours.
But that's only the first of your problems. You have some bad lines in init.rc (your rild daemon isn't configured correctly amongst other things), and a few things missing in /system/bin and /system/lib (calls to missing things). If you aren't using an extract of system.img from the sdk, you probably should. Then you can load in libs one at a time in a clean and controlled environment.
BTW: What Android system are you using? What device did it come from? If you built it from source, seriously, try using an emulator image first.
spacemoose1 said:
Your kernel seems to work, most of your issues in the log that was posted in my thread come from the ramdisk and system build. Until you work at those for a bit, I don't think you're going to know where to place the blame for issues until you're clean.
For the VM crash loop:
Take all of the non critical apps and gapps out of /system/apps (stuff like vending, maps, touchwiz and so on.)
And see what you get. If you can't solve it that way, then try to do:
adb pull /dbdata/databases/com.android.providers.settings/settings.db settings.db
And see what you get. If its there, it's corrupt. If it isn't, check to make sure the directory is getting created. You can also get someone to pull settings.db from a similar device (i9000?) and try to push it to yours.
But that's only the first of your problems. You have some bad lines in init.rc (your rild daemon isn't configured correctly amongst other things), and a few things missing in /system/bin and /system/lib (calls to missing things). If you aren't using an extract of system.img from the sdk, you probably should. Then you can load in libs one at a time in a clean and controlled environment.
BTW: What Android system are you using? What device did it come from? If you built it from source, seriously, try using an emulator image first.
Click to expand...
Click to collapse
It is possible it was not made clear, its a 2.2 stock ROM being ported from the Samsung Galaxy S to the Samsung Wave (formerly a BadaOS device). It is also being booted off of SD as apposed to OneNand. It uses a patched version of the SBL from the galaxy S but when Android is flashed to Nand it can boot fine (although problems are had initializing the Modem).
sabianadmin said:
It is possible it was not made clear, its a 2.2 stock ROM being ported from the Samsung Galaxy S to the Samsung Wave (formerly a BadaOS device). It is also being booted off of SD as apposed to OneNand. It uses a patched version of the SBL from the galaxy S but when Android is flashed to Nand it can boot fine (although problems are had initializing the Modem).
Click to expand...
Click to collapse
You need to compare logs from system booted from nand and from sd. Whatever errors are the same don't matter. Its the different ones that will tell you more.
But you're crashing right now because some line of code somewhere in your build is looking for a database and can't find it. If it doesn't do that when installed to nand, then your problem is that directories that the system creates to host configs and module parts aren't getting created at boot.
The modem issue, (if the error in logcat is the same whether the system booted or not, haven't seen both) looks to be a radio interface layer problem, your rild daemon isn't loading (check /system/bin/ for "rild") and make sure the line in init rc that starts it is correct.
spacemoose1 said:
some line of code somewhere in your build is looking for a database and can't find it.
Click to expand...
Click to collapse
It's a strange problem, as using the extracted system.img from the Android emulator as filesystem the above error disappears - with the same kernel/initramfs/init.rc (obviously other errors appear but the services seems to be stable).
I think we can forget the ril related errors now (I commented out the service in my build together with the DR daemon) as we have no modem driver yet ...

[ASK][MSM8625] Compiled kernel from CAF doesn't boot

Ok, I'm trying to do something fun with my phone... (Hisense EG909 MSM8625)
Since hisense is keeping the source code, so I'm trying to build the source from codeaurora.org ics branch M8625SSNSKMLYA1015 (to keep the same version with my current stock ROM)
I've successfully compiled the kernel with the ndk but I'm stuck on getting it to boot.
It just show the carrier logo (bootloader). I can't get the bootanimation to load.
I'm not expecting things like wifi / bluetooth or even the radio works... but I'm just trying to at least get it to boot the launcher
I have experience in c/c++ but I know nothing about android and just started to learn it...
Can anyone point me on how to debug or see what's wrong with the kernel?
Is there any way to show something on the screen? I mean turning on the frame buffer
I've search and tried many method like altering the command line "console=tty0", adding "CONFIG_MSM_FRAMEBUFFER", etc..
but seems like nothing works, it just stuck there...
the way I build is:
1. downloading code from caf
2. pulled config.gz from my working phone... but it require some hisense stuff. so I'm using the configs that come with the code
3. tried both msm7627a_defconfig and msm7627a-perf_defconfig,
4. extract current working boot.img
5. substitute the kernel with my compiled zImage, and repack the boot.img
Am I missing something here?
million thanks for your help...
Looks like you are missing some hardware drivers. Why not find the lines in defconfig mentioning "hisense stuff" and search at Google or "searchcode.org" to see if drivers are available. And then patch your source as necessary.
sharonsym said:
Ok, I'm trying to do something fun with my phone... (Hisense EG909 MSM8625)
Since hisense is keeping the source code, so I'm trying to build the source from codeaurora.org ics branch M8625SSNSKMLYA1015 (to keep the same version with my current stock ROM)
I've successfully compiled the kernel with the ndk but I'm stuck on getting it to boot.
It just show the carrier logo (bootloader). I can't get the bootanimation to load.
I'm not expecting things like wifi / bluetooth or even the radio works... but I'm just trying to at least get it to boot the launcher
I have experience in c/c++ but I know nothing about android and just started to learn it...
Can anyone point me on how to debug or see what's wrong with the kernel?
Is there any way to show something on the screen? I mean turning on the frame buffer
I've search and tried many method like altering the command line "console=tty0", adding "CONFIG_MSM_FRAMEBUFFER", etc..
but seems like nothing works, it just stuck there...
the way I build is:
1. downloading code from caf
2. pulled config.gz from my working phone... but it require some hisense stuff. so I'm using the configs that come with the code
3. tried both msm7627a_defconfig and msm7627a-perf_defconfig,
4. extract current working boot.img
5. substitute the kernel with my compiled zImage, and repack the boot.img
Am I missing something here?
million thanks for your help...
Click to expand...
Click to collapse
if you can't extract original defconfig (config.gz) from device, it would be hard to have bootable kernel.
Sent from my Oppo N1 using Tapatalk

@all Kernel devs: Removing the knox leftovers on ramdisk

Hey guys I already posted this in a few kernel devs threads but I wanted to create this thread so I can share my info more easily with all the people out there.
What I found is some leftovers of knox on the ramdisk of nearly all the kernels out there - and possibilities to get rid of some more clutter.
There is this init.container.rc file which gets called from the init.rc who's job is to set up the mount points and some symlinks etc. for knox (just take a look at it). It also contains a service called "containersetup" and which's binary is located in /system/bin/containersetup.
I dont 100% know what this containersetup thingy does - but I just renamed the binary to stop it from running with no negative side-effects at all.
Disabling/removing the init.container.rc would also get rid of those reappearing data_1, data_2, data_3 etc. folders which get created by it.
---
This one is not particulary interesting for kernel devs I think, but I also found some other binaries that are or at least appear to be rather useless:
- there is "tima_dump_log" which creates some dumps related to tima on the data partition (possibly for the knox watchdog crap) - disabled that without side effects so far.
- there is "auditd" which is the audit daemon, which logs security related stuff (wether selinux allowed or disallowed stuff etc) - also disabled without side effects.
could possibly find some more.. (bootchecker, drsservice etc.. but not 100% sure on those)
P.S: Why don't you all include init.d support into the kernel? Just wondering, no attack (hard to tell in the internet hehe). Isn't that standard on linux kernel or is it a special feature which normally gets handled by the operating system / rom? (I know how to activate init.d support myself... well its not that hard.. but still wondering lol, because when switching kernels I always have to try and test if the kernel includes init.d support so scripts dont get run twice... some do some don't ...)
Just cooked my "own" custom version of faux123 v004 with the android image kitchen. (http://forum.xda-developers.com/showthread.php?t=2073775)
Removed the init.container.rc
Removed the call to init.container.rc inside init.rc
Edited the fstab.qcom to change system partitions mount flags to "ro,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic"
(you could also add init.d support to init.rc, but I already got that in my install-recovery.sh..)
--
Repacked everything together and flashed it onto my phone. This got rid of the container folders and data_1,data_2,data_3,mnt_1, etc. plus the mount "tweaks".
Unfortunately I cannot redistribute the kernel image with the modified ramdisk (its not my work, i just edited it a tiny bit...), but with the android image kitchen you can just do it yourself - until the kernel devs include this into their kernels as well. (might not be important to you guys, but I like my phone clutter free hehe)
---
ADD: By the way - this android image kitchen is awesome! I was trying to do this stuff with other versions of kernel repack tools - which are mostly made for linux. But the resulting kernels were not working. (the addresses used are not standard, and one would have had to edit the mkbootimg.c and recompile it himself to do it... but with this thing its just idiot-safe drag n drop. Just make sure you dont do any bullcrap on the ramdisk partition..
ADD2: Does anyone know how I could completely disable selinux (not just permissive, but completely turning it off)? I know it might missbehave, but I want to give it a try. The mount script already has the option to mount the firmware partition context free for the case that se-linux is disabled - so it must be possible somehow right? (what benefit does selinux give you anyway in permissive mode other than a possible nsa backdoor or smth?)
Awesome
Enviado do meu SM-N9005 através de Tapatalk
with selinux=permissive you can also deactivate the samsung drs service (this thing handles context labeling as it appears).
It consists of an app called "drsservice" and the binary /system/bin/drs. Can/could been disabled on selinux=enforcing too, but then you needed to do restorecon yourself on some occurences.
--
so on my device I disabled the following services/binaries (please lets try to find more together ...):
/system/bin/containersetup
/system/bin/auditd
/system/bin/tima_dump_log
/system/bin/kiesexe
/system/bin/drs
---
What I would like to manage (if possible) to disable the watchdog daemon and all that bullcrap that checks if the device was tempered (the watchdog daemon is related to knox right?)
zroice said:
Just cooked my "own" custom version of faux123 v004 with the android image kitchen. (http://forum.xda-developers.com/showthread.php?t=2073775)
Removed the init.container.rc
Removed the call to init.container.rc inside init.rc
Edited the fstab.qcom to change system partitions mount flags to "ro,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic"
(you could also add init.d support to init.rc, but I already got that in my install-recovery.sh..)
--
Repacked everything together and flashed it onto my phone. This got rid of the container folders and data_1,data_2,data_3,mnt_1, etc. plus the mount "tweaks".
Unfortunately I cannot redistribute the kernel image with the modified ramdisk (its not my work, i just edited it a tiny bit...), but with the android image kitchen you can just do it yourself - until the kernel devs include this into their kernels as well. (might not be important to you guys, but I like my phone clutter free hehe)
---
ADD: By the way - this android image kitchen is awesome! I was trying to do this stuff with other versions of kernel repack tools - which are mostly made for linux. But the resulting kernels were not working. (the addresses used are not standard, and one would have had to edit the mkbootimg.c and recompile it himself to do it... but with this thing its just idiot-safe drag n drop. Just make sure you dont do any bullcrap on the ramdisk partition..
ADD2: Does anyone know how I could completely disable selinux (not just permissive, but completely turning it off)? I know it might missbehave, but I want to give it a try. The mount script already has the option to mount the firmware partition context free for the case that se-linux is disabled - so it must be possible somehow right? (what benefit does selinux give you anyway in permissive mode other than a possible nsa backdoor or smth?)
Click to expand...
Click to collapse
I followed the link to the Android Image Kitchen and successfully followed your instructions from post #2 but I was wondering if you could please let me know of a good place to find some kernel tutorials for absolute beginners? Thank you for your information as well.
@zroice: Maybe you're already thinking about doing a free rom of Knox
Silverbolt said:
I followed the link to the Android Image Kitchen and successfully followed your instructions from post #2 but I was wondering if you could please let me know of a good place to find some kernel tutorials for absolute beginners? Thank you for your information as well.
Click to expand...
Click to collapse
not sure really, this was just basic scripting and editing the boot scripts, and I just found this out by playing around with the things.
I'm sure you will find a tutorial or smth on xda or google. I have yet to compile anything for android.. so I dont have a clue.
Just sharing my findings and hoping for some interesting replies what other people find out.
what about those data_x folders in a stock image?
Hi!
I've encountered these data_1 data_2 & data_3 on my stock note 3. Is there a way to remove them?
Ibe been looking for a way to remove these processes. I dont have any knox or container agents on my phone nor doea the kt747 kernel have selinux enforcing but I do see these leftovers running around. I found this thread by searching how to disable the tima log. There doeant seem to be much info about this available anywhere. I do se something else running that I suspect is a waste is called edmaudit. I suspect is enterprise device management. Not sure tho. I changed the permissions on the files you mentioned. I know its been a year but if you happen to have any new insight on thos I'd appreciate it.

Framebuffer Access?

I'm trying to make use of my D6603's framebuffer. As I understand it, I should be able (as root) to run "cat /dev/urandom > /dev/graphics/fb0" to pump random binary into the framebuffer, which should result in random pixel color changes occurring on my screen. Doing so appears to work just fine, but I get no output. I am not at all an expert--the best I can assume is that the stock kernel (I'm running rooted stock 23.0.1.A.5.77) somehow fails to provide framebuffer access, and that all attempts are therefore destined to fail. This seems odd though, since if it's using the framebuffer, how could there be no way to input into it given root access?
Question 1: Is this correct, or is there some way to use the framebuffer on the stock ROM?
Question 2: If not, is there a modified stock kernel that will work? As I understand it any modified kernel will prevent my DRM from working, and so maybe there's no point in asking this, and I ought to be asking whether any kernel with any rom will work?

Categories

Resources