Auto Boot / Start on charge (different devices) - General Questions and Answers

Hello all,
i would like to buy a new (cheap) tablet which i can modify to auto boot / start on charge. I need this for an project. I plan to use this tablet as a mediaplayer in my new bathroom and the buttons of this tablet will not be reachable. Is it possible to modify every device to auto boot on charge or has someone experience with devices not working?
Thx and greetings
gigi

Sorry OP
i want to hijack this thread to to compile all successful method for different devices to autoboot when plug in /charging
any one to do this must root their device and use AIK to decompile/recompile boot.image, modify certain file depending on the device
---------- Post added at 05:35 PM ---------- Previous post was at 05:23 PM ----------
]REDMI 6A MTK Device
need to modify kopc_charger file
here
https://forum.xda-developers.com/showpost.php?p=81874791&postcount=158
https://forum.xda-developers.com/showpost.php?p=81880927&postcount=159
---------- Post added at 05:45 PM ---------- Previous post was at 05:35 PM ----------
On I9500 runing linage OS 16
modify the init.rc
on charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"
---------- Post added at 06:03 PM ---------- Previous post was at 05:45 PM ----------
Redmi 4x
modify init.rc
on charger
class_start charger
class_stop charger
on property:sys.boot_from_charger_mode=1
trigger late-init

Samsung S5 (klte)
Working Roms: lineage-15.1
stock 6
modify init.rc:
on charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"
tried the same with samsung s3 mini (kminilte) but not working

HI there, i have installed this Rom to my samsung s8, it is pretty cool, and i am trying to set auto boot on USB power pluggin, but until now, no luck.
Since Android 10, seems the init.rc is regenerated every time when it boots, so unpack/repack of the .img solution seems not working any more. what i am trying next is via magisk module, still in process but no progress.
Is there any other way to do this? any light would be appreciated.

tonyniu2008 said:
HI there, i have installed this Rom to my samsung s8, it is pretty cool, and i am trying to set auto boot on USB power pluggin, but until now, no luck.
Since Android 10, seems the init.rc is regenerated every time when it boots, so unpack/repack of the .img solution seems not working any more. what i am trying next is via magisk module, still in process but no progress.
Is there any other way to do this? any light would be appreciated.
Click to expand...
Click to collapse
The init.rc is unpacked from the boot partition, you see in / only a copy of init.rc
What other solutions did you try to make it boot instantly?

hisoka_simp said:
The init.rc is unpacked from the boot partition, you see in / only a copy of init.rc
What other solutions did you try to make it boot instantly?
Click to expand...
Click to collapse
I tried to unpack the boot image, and actually the init.rc is missing from the root path, i googled it, as i think it caused by the system version, starting from Android 10, init.rc will be only generated when booting, my system is LineageOS 17.1
when the system finishing booting, i can adb shell to the file, init.rc is there then, i tried to unpack the recovery image, the init.rc is there, i tried to change that and flash to boot, and recovery, no luck, after booting the init.rc still keep the same as before.
I am currently trying the magisk module, but not yet a solution.
As you said the init.rc is copyed from somewhere, do you know where?

tonyniu2008 said:
I tried to unpack the boot image, and actually the init.rc is missing from the root path, i googled it, as i think it caused by the system version, starting from Android 10, init.rc will be only generated when booting, my system is LineageOS 17.1
when the system finishing booting, i can adb shell to the file, init.rc is there then, i tried to unpack the recovery image, the init.rc is there, i tried to change that and flash to boot, and recovery, no luck, after booting the init.rc still keep the same as before.
I am currently trying the magisk module, but not yet a solution.
As you said the init.rc is copyed from somewhere, do you know where?
Click to expand...
Click to collapse
Can you send me a link (google drive would be nice) to an unmodified version of your boot.img? I'll modify it correctly and send back to you

hisoka_simp said:
Can you send me a link (google drive would be nice) to an unmodified version of your boot.img? I'll modify it correctly and send back to you
Click to expand...
Click to collapse
It is so kind of you, you can find my TWRP backup image here: https://drive.google.com/file/d/1dtdovnRIZY58SYqFBNEgT4TafktmAycd/view?usp=sharing
just have a clean backup there. but as i unpacked, there is no init.rc under root, hope you know a way for this.
Let me know if you found something, thx

hisoka_simp said:
Can you send me a link (google drive would be nice) to an unmodified version of your boot.img? I'll modify it correctly and send back to you
Click to expand...
Click to collapse
The content of ramdisk is extracted from the boot partition every time it starts, so modifying init.rc does not work.
I extracted my boot partition to boot.img, then unpacked it, modified the init.rc inside, repackaged it as boot.img, and finally flashed into the boot partition
After the system started, I saw that the init.rc was modified
But it’s not pungent and has no effect
on charger
class_start charger
setprop sys.powerctl reboot
My device is huawei MediaPad3,maybe your device can work。Try it

tonyniu2008 said:
I tried to unpack the boot image, and actually the init.rc is missing from the root path, i googled it, as i think it caused by the system version, starting from Android 10, init.rc will be only generated when booting, my system is LineageOS 17.1
when the system finishing booting, i can adb shell to the file, init.rc is there then, i tried to unpack the recovery image, the init.rc is there, i tried to change that and flash to boot, and recovery, no luck, after booting the init.rc still keep the same as before.
I am currently trying the magisk module, but not yet a solution.
As you said the init.rc is copyed from somewhere, do you know where?
Click to expand...
Click to collapse
The content of ramdisk is extracted from the boot partition every time it starts, so modifying init.rc does not work.
I extracted boot partition to boot.img, then unpacked it, modified the init.rc , repackaged it as boot.img, and finally flashed into the boot partition
After the system started, I saw that the init.rc was modified
But it’s no effect
on charger
class_start charger
setprop sys.powerctl reboot
My device is huawei MediaPad3,maybe your device can work。Try it

bearllm said:
The content of ramdisk is extracted from the boot partition every time it starts, so modifying init.rc does not work.
I extracted boot partition to boot.img, then unpacked it, modified the init.rc , repackaged it as boot.img, and finally flashed into the boot partition
After the system started, I saw that the init.rc was modified
But it’s no effect
on charger
class_start charger
setprop sys.powerctl reboot
My device is huawei MediaPad3,maybe your device can work。Try it
Click to expand...
Click to collapse
Hey I recommend you to also try this code which worked for another device I had, hope it works
on charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"

hisoka_simp said:
Hey I recommend you to also try this code which worked for another device I had, hope it works
on charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"
Click to expand...
Click to collapse
Thanks,I tried it last night,It does not work : (
I think Huawei’s program entry is not here
BTW,i use the APP "Tasker",my device can automatically shut down when the usb line is unplugged

hisoka_simp said:
Hey I recommend you to also try this code which worked for another device I had, hope it works
on charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"
Click to expand...
Click to collapse
I think i did it
in the "init.charger.rc"
on charger
chmod 0440 /sys/class/hw_power/battery/isc
chown system system /sys/class/hw_power/battery/isc
trigger cust_parse_action
class_start charger
wait /dev/block/bootdevice/by-name/oeminfo
start oeminfo_nvm
start teecd
change to
on charger
chmod 0440 /sys/class/hw_power/battery/isc
chown system system /sys/class/hw_power/battery/isc
trigger cust_parse_action
class_start charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"
wait /dev/block/bootdevice/by-name/oeminfo
start oeminfo_nvm
start teecd
the new problem is coming
when i flash the repacked into my device,i can't enter developer options
I tried not to make any changes, just package boot.img with the unpacked file, the same situation
but i flash the boot.img from my boot partition,everything is ok

You
bearllm said:
I think i did it
in the "init.charger.rc"
on charger
chmod 0440 /sys/class/hw_power/battery/isc
chown system system /sys/class/hw_power/battery/isc
trigger cust_parse_action
class_start charger
wait /dev/block/bootdevice/by-name/oeminfo
start oeminfo_nvm
start teecd
change to
on charger
chmod 0440 /sys/class/hw_power/battery/isc
chown system system /sys/class/hw_power/battery/isc
trigger cust_parse_action
class_start charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"
wait /dev/block/bootdevice/by-name/oeminfo
start oeminfo_nvm
start teecd
the new problem is coming
when i flash the repacked into my device,i can't enter developer options
I tried not to make any changes, just package boot.img with the unpacked file, the same situation
but i flash the boot.img from my boot partition,everything is ok
Click to expand...
Click to collapse
I removed the whole code in the on charger block and pasted just mine so in the block is ONLY those 2 commands.
This maybe results in an error bc charger class is started but not properly shutdown.
Another error could be the file, idk if there is a global init.rc in your boot.img if yes then search in there for on charger bc the global init.rc is called at first and only after that the others so maybe look if there is an on charger block in the unpacked boot img in the init.rc
But I don't know why you can't access the developer options anymore, it would help me to do if you explain a bit more detailed what's going on when you try to open them

hisoka_simp said:
You
I removed the whole code in the on charger block and pasted just mine so in the block is ONLY those 2 commands.
This maybe results in an error bc charger class is started but not properly shutdown.
Another error could be the file, idk if there is a global init.rc in your boot.img if yes then search in there for on charger bc the global init.rc is called at first and only after that the others so maybe look if there is an on charger block in the unpacked boot img in the init.rc
But I don't know why you can't access the developer options anymore, it would help me to do if you explain a bit more detailed what's going on when you try to open them
Click to expand...
Click to collapse
ok
this is my test
step1
I extracted boot.img from the boot partition.
step2
unpack boot.img to the folder “unpacked_img”
step3
repacked the folder “unpacked_img” to the RepackBoot.img (Did not change any files in the folder, just repacked)
step4
flah the RepackBoot.img to the boot partition
i can't access the developer options anymore
but i flash the boot.img(step1) to the boot partition
i can access the developer options again
think you so much

bearllm said:
ok
this is my test
step1
I extracted boot.img from the boot partition.
step2
unpack boot.img to the folder “unpacked_img”
step3
repacked the folder “unpacked_img” to the RepackBoot.img (Did not change any files in the folder, just repacked)
step4
flah the RepackBoot.img to the boot partition
i can't access the developer options anymore
but i flash the boot.img(step1) to the boot partition
i can access the developer options again
think you so much
Click to expand...
Click to collapse
bearllm said:
ok
this is my test
step1
I extracted boot.img from the boot partition.
step2
unpack boot.img to the folder “unpacked_img”
step3
repacked the folder “unpacked_img” to the RepackBoot.img (Did not change any files in the folder, just repacked)
step4
flah the RepackBoot.img to the boot partition
i can't access the developer options anymore
but i flash the boot.img(step1) to the boot partition
i can access the developer options again
think you so much
Click to expand...
Click to collapse
Did you try to unlock developer options again? (Tapping build number 10x)

hisoka_simp said:
Did you try to unlock developer options again? (Tapping build number 10x)
Click to expand...
Click to collapse
I have tried, failed~~~~~~~
and i reset pad to factory settings, do not open the developer options first,flash the RepackBoot.img
unlock developer options after reboot
the situation is still the samet,can't access the developer options
my heart is broken,hahaha

bearllm said:
I have tried, failed~~~~~~~
and i reset pad to factory settings, do not open the developer options first,flash the RepackBoot.img
unlock developer options after reboot
the situation is still the samet,can't access the developer options
my heart is broken,hahaha
Click to expand...
Click to collapse
What do you mean exactly you can't access? Is the toast not showing which says you unlocked developer options or do you try to open them and settings crash then?

hisoka_simp said:
What do you mean exactly you can't access? Is the toast not showing which says you unlocked developer options or do you try to open them and settings crash then?
Click to expand...
Click to collapse
i can unlocked developer options ,but when i click the "developer options ",the program crashes

hello.
one year ago, i can modify my xiaomi mix2s with xiaomi.eu rom. and the phone boots when the charger is connected. The modification i make power the phone, apears the chargin animation and after a second, the phone reboots and launch android.
The problem is, i must factory reset the phone and now, this not works, and i must do the trick again. but i dont remember what i did!!!!
somebody know how to modify the phone to boot when charger is connected??

Related

Modded recovery and boot images

Here is a zip file containing a modified recovery and boot image, as well as a few other things:
http://rapidshare.com/files/166164961/AndroidMod.zip
http://jf.nyquil.org/AndroidMod.zip
http://android-dls.com/forum/index.php?f=24&t=191&rb_v=viewtopic (see post for actual link to file)
NOTE: if you need a complete RC30 to v1.3 guide, see this page.
The recovery image (recovery_testkeys.img) uses the test keys that are distributed with the android platform source. This means that an OTA update or an update.zip update must be signed with the test key in order for it to install. In other words, it will no longer install OTA updates from t-mobile. You don't want them stealing back root access from you now do you? .
I've also included the test keys and the SignApk.jar tool, so you can sign your own update scripts (for use only with the modified recovery image). You can resign any image, even if it has been signed before. So for example, if you needed to install an "official" t-mobile update, you must re-sign it with the test keys first.
Another bonus in this recovery image is that ADB is enabled while in recovery mode. You can't adb into a shell (no sh binary), but you can at least use it to push and pull files from the device. For example, you could push an update.zip file to the sdcard.
The boot image (boot_nosecure.img) has been modified so that adb has root access by default. So when you do an adb shell, you automatically get a root shell. You can remount the system image using adb, and then push files directly to the system partition.
Finally, the "update - Restore Original RC29 Boot Image.zip" file is an update.zip file signed with the test keys, which will restore your boot partition back to the stock RC29 image. Useful if you accidentally hose your boot partition..
To install the recovery image onto your phone:
Code:
D:\Android\AndroidMod>adb push recovery_testkeys.img /data/local/recovery.img
912 KB/s (0 bytes in 1767424.001s)
D:\Android\AndroidMod>adb shell
$ su
su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# cd /system
cd /system
# cat /data/local/recovery.img > recovery.img
cat /data/local/recovery.img > recovery.img
# flash_image recovery recovery.img
flash_image recovery recovery.img
#
Note: You must place the recovery image at /system/recovery.img. the init.rc boot script automatically flashes the recovery partition with that file every time you boot up the phone.
At this point, it's probably a good idea to reboot the phone into recovery mode, and make sure it loads OK. If the recovery image is corrupt somehow, it will throw you back into SPL mode (the multi-color bootloader screen). If that happens, just boot the phone normally, and reflash recovery image.
Once it boots into recovery mode, press alt+L, and the next to top line of text should say something like "using test keys.". If it doesn't, then you're still using the original recovery image.
Note: If you are planning on installing the modified RC30 update, you can ignore the following - there is no need to install the boot image. The update already has a newer, modified boot image.
Now that you know you have the modified recovery image loaded, you can install the boot image:
Code:
D:\Android\AndroidMod>adb push boot_nosecure.img /data/local/boot.img
939 KB/s (0 bytes in 1533952.001s)
D:\Android\AndroidMod>adb shell
$ su
su
# flash_image boot /data/local/boot.img
flash_image boot /data/local/boot.img
# rm /data/local/boot.img
rm /data/local/boot.img
#
Now reboot the phone and let it boot normally. If the boot image was corrupted, it will boot into recovery mode instead. You can use the included update zip file to reload the original RC29 boot image.
Otherwise, if it boots up normally, open a command prompt however you like (telnet, adb, terminal emulator app, etc.) and type "getprop ro.secure". If it says 0, then you're running the modified boot image. Otherwise, if it says 1, you're still running the original boot image.
Attachement..
Hmm. It doesn't look like the attachment made it.. Does anyone have some space I could throw the file up at? It's around 5mb.
JesusFreke said:
Hmm. It doesn't look like the attachment made it.. Does anyone have some space I could throw the file up at? It's around 5mb.
Click to expand...
Click to collapse
I should have some space let me know
JesusFreke said:
Hmm. It doesn't look like the attachment made it.. Does anyone have some space I could throw the file up at? It's around 5mb.
Click to expand...
Click to collapse
Sent you an email with u/p if you need space.
test
anyway to test and make sure i did this correctly.. other than my phone booted and is not a paperweight
jriley60 said:
anyway to test and make sure i did this correctly.. other than my phone booted and is not a paperweight
Click to expand...
Click to collapse
To check the boot image, boot the phone normally, and then get a shell with adb. Type "id", and see if you are root
To check the recovery image, boot up the phone into recovery mode. Once you're in recovery mode, Press alt-l to show the text. The next to top line should say something like "using test keys"
JesusFreke said:
To check the boot image, boot the phone normally, and then get a shell with adb. Type "id", and see if you are root
To check the recovery image, boot up the phone into recovery mode. Once you're in recovery mode, Press alt-l to show the text. The next to top line should say something like "using test keys"
Click to expand...
Click to collapse
When will we see the files? Can you just upload to RS and we will mirror?
neoobs said:
When will we see the files? Can you just upload to RS and we will mirror?
Click to expand...
Click to collapse
Look at the original post. I added a link for the zip file..
boot.img is in correct. assuming typing id in telnet returning uid=0(root) gid=0(root) means i'm root then i'm good, thank you so much. looks like i really should install the emulator it might make things a little easier
JesusFreke said:
Look at the original post. I added a link for the zip file..
Click to expand...
Click to collapse
thank you. Sorry
jriley60 said:
boot.img is in correct. assuming typing id in telnet returning uid=0(root) gid=0(root) means i'm root then i'm good, thank you so much. looks like i really should install the emulator it might make things a little easier
Click to expand...
Click to collapse
Well, that does mean you have root, but that doesn't say anything about whether the boot.img was installed correctly. If you're telneting in, then you would have root access regardless of whether you are running a stock boot image or my modified one.
My boot image allows adb to connect to the phone as root. If you don't use adb, there's no reason to install my modified boot image.
Actually, there's an easier way to tell if you're running my boot image. Get to a command prompt (telnet, adb, terminal emulator app, whatever), and type
getprop ro.secure
If it says 0, then you correctly installed my boot image. Otherwise, if it says 1, you're still running the stock image.
Thanks! Was waiting for this.
Now to screw with my phone like crazy
Not that I don't trust you... but...
Ok... I don't trust you implicitly enough to reflash my phone with your stuff
Any chance you can post diffs against the android source tree so I can apply your changes and build it myself?
No offense - I just like to know what's going on...
RyeBrye said:
Ok... I don't trust you implicitly enough to reflash my phone with your stuff
Any chance you can post diffs against the android source tree so I can apply your changes and build it myself?
No offense - I just like to know what's going on...
Click to expand...
Click to collapse
Not at all
The recovery tool is just a stock build (almost) from the android source, using the test keys, which is the default if you don't specify keys of your own. The only change I made was to make it print out "using test keys" when it runs, just to make it easy to tell if it's running. I can give you a diff if you really want.. but it's a simple change though, and doesn't affect the actual functionality.
For the boot image, I replaced the initramfs image in the boot.img included in the official RC29 update, with the initramfs image from a default build of the android source, which has the ro.secure property set to 0.
I first tried the boot.img that was generated by the default android build, but I had issues with getting wifi to work, so I tried merging the initramfs image with the RC29 boot.img, and it seems to work fine.
I suspect you could accomplish the same thing by extracting the initramfs image from the RC29 boot.img, un-gzipping and un-cpioing it, and then modifying the default.prop file to set ro.secure to 0. Then you would have to package it back up and stick it back into the RC29 boot.img.
ro.secure is the property that the adb service looks at to determine if it should use root user, or drop to the shell user. When ro.secure is 0, adb will run as root.
It can be a bit of a pain to get the android source to build though. Make sure you get the dream specific product files (they aren't downloaded by default when you do a "repo sync"). You'll also encounter issues where it can't find libaudio.so or librpc.so. You'll have to copy these from the phone to a couple of output folders in order for the build to proceed.
If you get stuck, feel free to give me a holler and I'll try and help out.
Be warned.. the build takes quite a while.. on the order of an hour or two at least. But then again, I was doing it in a VM.. it may be faster if you do it on a native linux box.
i cant get it to work i know I'm doing something wrong can you(everyone)help me out(i have Vista 64) i get this error
this i what i type​# C:\Android\AndroidMod>adb push recovery_testkeys.img /data/local/recovery.img​
this is the error​C:AndroidAndroidMod: not found​
please and thank you
EDIT: could we do it off the sdcard?
EDIT2: i think i found my own mistake this cant be done in Windows i need to have shell with adb meaning time to whip out VM
JesusFreke said:
For the boot image, I replaced the initramfs image in the boot.img included in the official RC29 update, with the initramfs image from a default build of the android source, which has the ro.secure property set to 0.
I first tried the boot.img that was generated by the default android build, but I had issues with getting wifi to work, so I tried merging the initramfs image with the RC29 boot.img, and it seems to work fine.
Click to expand...
Click to collapse
Can you talk more about this step of the process? How did you do this "merging"? Did you use mkbootimg?
JesusFreke said:
I suspect you could accomplish the same thing by extracting the initramfs image from the RC29 boot.img, un-gzipping and un-cpioing it, and then modifying the default.prop file to set ro.secure to 0. Then you would have to package it back up and stick it back into the RC29 boot.img.
Click to expand...
Click to collapse
And this could be done without going through the whole process of doing an Android build, right? I'm just thinking about how one might build a simple utility to allow editing of the ramdisk.
alansj said:
Can you talk more about this step of the process? How did you do this "merging"? Did you use mkbootimg?
Click to expand...
Click to collapse
I just used the good ol hex-editor. The gzip file starts with a few specific bytes (don't remember them offhand..), so you can search through the image. There are 2 gzip files, the initramfs is the last one. In mine, it starts at offset 0x00154000.
Once you find it, just cut it out and dump the new one in (there is some 00 padding after the gzip file ends.. not sure if you need to keep the padding or not). You also have to update the size of the initramfs, which is at offset 0x00000010.
alansj said:
And this could be done without going through the whole process of doing an Android build, right? I'm just thinking about how one might build a simple utility to allow editing of the ramdisk.
Click to expand...
Click to collapse
Yes.
Anyway to make this using the update.zip sd card method?
JesusFreke, per some requests in #android on freenode I have setup a wiki (not a device wiki like xda's but more like an "information about android/g1 and how to tweak it" wiki) and would like to put this on there. Let me know if you care (unless you would like to add it in your own words), the wiki is http://android-dls.com/wiki and its still very new, but im trying to to get it built up (RyeBrye is doing most of the work).
humble said:
i cant get it to work i know I'm doing something wrong can you(everyone)help me out(i have Vista 64) i get this error
this i what i type​# C:\Android\AndroidMod>adb push recovery_testkeys.img /data/local/recovery.img​
this is the error​C:AndroidAndroidMod: not found​
please and thank you
EDIT: could we do it off the sdcard?
Click to expand...
Click to collapse
First of, you do know that when we refer to "C:\..." we refer to windows via a command prompt (or "cmd") and when you see "# ..." we refer to a shell connection to the Android phone.
Second, you do have the Android SDK right? If not download it HERE. Now extract that to a folder, preferably close to the C: root. (ex. C:\AndroidSDK)
1)Either extract/copy the files from the "AndroidMod.zip" to the Android Tools folder from the SDK (ex. C:\AndroidSDK\Tools) OR copy "adb.exe" and "AdbWinApi.dll" from the Android Tools folder from the SDK (ex. C:\AndroidSDK\Tools)to the folder where you have extracted the "AndroidMod.zip" to.
2)Open up a command prompt. Start -> Run (or Windows key + R) and type "cmd"
3)CD to the directory where the files are.
EXAMPLE:
C:\Users\[your_user_name_here]> cd \
C:> cd androidsdk\tools
C:\AndroidSDK\Tools>
4) Now follow the Instructions.

[HOWTO] Enable init.d on stock *rooted* Desire roms

If you are like me and you like your stock Desire rom, you rooted it using unrEVOked or some other methods, you made some custom adjustment to it and you really don't want to load a fully fledged 3rd party rom but still, you'd like to tweak it a little bit more, you'll quickly realize that you are going to need a working init.d system in order to start custom scripts on boot.
This thread will try to explain how to add init.d support to your rom, without needing to flash a new rom and wipe everything, we're just going to flash a new boot.img.
Requirements
Rooted HTC Desire
New modified boot.img, supported firmware versions: 2.10.405.2, 2.29.405.2/5, check your firmware version here: (Settings -> About Phone -> Software information -> Software number)
Download this one: View attachment boot_2.10.405.2.zip if your "Software number" is: 2.10.405.2
Download this one: View attachment boot_2.29.405.2_5.zip if your "Software number" is: 2.29.405.2 or 2.29.405.5
Make sure you download the one matching your "Software number", the wrong one will cause boot loops and weird behaviors.
ADB shell access
flash_image binary, usually provided by unrEVOked under /data/local/flash_image but if you don't have grab it here: View attachment flash_image.zip
busybox correctly installed under /system/xbin
HOW-TO
NOTE: if your Desire is not S-OFF (meaning you can't write to the /system directory), you'll need to do the whole procedure in recovery mode.
Do a nandroid backup, this in order to save your current boot.img, and also because it's never a bad idea
Make sure the nandroid backup went ok
Check your exact firmware version (Settings -> About Phone -> Software information -> Software number) and download the corresponding modified boot.img
Copy and unzip the downloaded boot.img to your sdcard or wherever you like it
Obtain adb shell access, become root (su) and wipe the existing boot image with:
Code:
cat /dev/zero > /dev/mtd/mtd2
ignore the "write: No space left on device", it's normal.
Flash the new boot image:
Code:
flash_image boot /sdcard/boot.img
where "/sdcard/boot.img" is the path where you copied the downloaded boot.img
Remount the /system partition read-write if you're not in recovery mode:
Code:
mount -o remount,rw /system
or mount it if you are in recovery mode:
Code:
mount /system
Create the init.d directory where all the custom boot scripts will be executed:
Code:
mkdir /system/etc/init.d
and set permissions:
Code:
chmod 755 /system/etc/init.d
Important: unzip and copy the View attachment 99complete.zip script to the newly created /system/etc/init.d/99complete, set permissions:
Code:
chmod 755 /system/etc/init.d/99complete
and ownership:
Code:
chown root.shell /system/etc/init.d/99complete
Failure to do so will cause a boot loops.
Cross your fingers and reboot! If anything goes wrong you can always boot into recovery and fix errors or you can restore the nandroid backup (you can just restore the boot.img if you don't want to do a full restore).
From now on, every script you put inside /system/etc/init.d will be executed at boot before almost any other initializations. Make sure you set the correct permissions to your scripts (i.e. 755).
Thanks to: teppic74 for providing stock roms with init.d support (thread) where I extracted the boot images.
Technical explanation
The provided boot.img are the original HTC provided boot.img with the init.rc script modified to stop the init process until the cm.filesystem.ready property is set to 1:
Code:
start sysinit
on property:cm.filesystem.ready=1
class_start default
where the sysinit service is the service in charge of starting all the scripts inside /etc/init.d:
Code:
# Execute files in /etc/init.d before booting
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
and the last of this script, 99completed, only sets that property to 1 so the normal system boot can continue:
Code:
#!/system/bin/sh
sync;
setprop cm.filesystem.ready 1;
of course changing init.rc is only possible by flashing a new boot.img with init.rc modified inside the ramdisk because that file, even if you can see it under / will be overwritten at every boot.
Another small modification of the new boot.img is the default.prop, in which rc.secure is set to 0 allowing to gain direct access through "adb shell"
Sounds great
Thx for your work!
So if I get that right, it's the same as if we'd flash teppic74 ROM, and nandrestoring everything except system & boot?
Just our stock ROM with init.d support?
Does that also mean we could flash the optional mods from teppic74 thread like a2sd?
Ty again!
Puenos said:
Sounds great
Does that also mean we could flash the optional mods from teppic74 thread like a2sd?
Ty again!
Click to expand...
Click to collapse
Well you could but effectively all you need is an apps2sd+ script and you can adb push it to the correct location. /system/etc/init.d
Really? I would have tried flashing either a2sd provided in teppic74's thread or even a2sd script by DT? last I would have compared to firerat's script. But if all you need to do is pushing via adb.. Is there a script out for a2sd especially for stock/sense? (like kali advised using firerat with CM?)
Thank you
Not sure to be honest, I haven't used sense for a long time. But assume if the one teppic uses on his, works - it should work for you too.
I'm just using Sense because of it's Mail-widget, haha
But I guess I'll just give it a try then, will report back, when I've managed so set everything up without having my phone exploding, hehe
But thank you very much
exactly this boot.img will just enable init.d support, no need to flash a new system.img but you just need to create the init.d directory and put the 99complete script, after that you can install any mod you like, also the ones provided in teppic74's thread.
You can also try data2whatever by melethron (that's what I'm using), just make sure you have busybox correctly installed.
hope you enjoy it and happy new year!
well I hv software number 2.11.832.3 so what I hv to do...?
r3vb07inf said:
well I hv software number 2.11.832.3 so what I hv to do...?
Click to expand...
Click to collapse
unfortunately I don't have a boot.img for that software number, you'll need to manually extract your boot.img, modify a file (init.rc) and reflash it, if you don't know how to do it I can try to do it for you but I'll need a download link for your original firmware version
You could make a universal (froyo) update zip using Koush's AnyKernel installer, then you're able to update the ramdisk only and add the init.d folder/script. Thats how i did it for CM7.
worstenbrood said:
You could make a universal (froyo) update zip using Koush's AnyKernel installer, then you're able to update the ramdisk only and add the init.d folder/script. Thats how i did it for CM7.
Click to expand...
Click to collapse
interesting, an update script that can extract the boot.img, unpack, change files, repack it and reflash it...is it safe? I may think about building an update.zip this way but I'm pretty scared by how safe it can be to automatically mess with a boot.img..
EDIT: one problem of this is that the init.rc needs to be extracted and modified, but it may be different from one firmware and another
moebius83 said:
interesting, an update script that can extract the boot.img, unpack, change files, repack it and reflash it...is it safe? I may think about building an update.zip this way but I'm pretty scared by how safe it can be to automatically mess with a boot.img..
EDIT: one problem of this is that the init.rc needs to be extracted and modified, but it may be different from one firmware and another
Click to expand...
Click to collapse
Should be the same between all froyo rom's. Check this update zip, it's for gingerbread tho, you have to replace the ramdisk-new.gz with a froyo one (with edited init.rc offcourse). It also contains /system/etc/init.d/99complete.
Edit: Don't be scared, everyone who releases custom kernels uses this method. The other way around then, keep the original ramdisk and merge it with the new kernel.
Hello there
Really appreciate all your efforts
Kindaa feeling real dumb in comparison! lol
Anyways
My Desire specs :
2.2
2.32.415.3
Baseband 32.49.00.32U_5.11.05.27
Now this has built in arabic enabled support and that is the main reason I would like to keep it
Am yet to run into a custom ROM that would provide that without having to downgrade my version
Also, had a lotta fun trying to root, just couldn't root, up untill a few days back when unrevoked came out with thier new 3.3 version
I noticed you had only two software versions from which to start...
So what about my case? could you please help this newbie along?!!
docnasef said:
Hello there
Really appreciate all your efforts
Kindaa feeling real dumb in comparison! lol
Anyways
My Desire specs :
2.2
2.32.415.3
Baseband 32.49.00.32U_5.11.05.27
Now this has built in arabic enabled support and that is the main reason I would like to keep it
Am yet to run into a custom ROM that would provide that without having to downgrade my version
Also, had a lotta fun trying to root, just couldn't root, up untill a few days back when unrevoked came out with thier new 3.3 version
I noticed you had only two software versions from which to start...
So what about my case? could you please help this newbie along?!!
Click to expand...
Click to collapse
Same thing happens to me. My spec:
2.2
2.13.707.1
32.44.00.32U
Can you help as well? Or where or how (from RUU) can I find the ramdisk-new.gz as worstenbrood's mention.
mumu_li said:
Same thing happens to me. My spec:
2.2
2.13.707.1
32.44.00.32U
Can you help as well? Or where or how (from RUU) can I find the ramdisk-new.gz as worstenbrood's mention.
Click to expand...
Click to collapse
Thanks "worstenbrood" then I can extract boot.img from stock rom. Based on the guide, I made a new boot.img. But with this new boot.img, the phone hangs at the first screen(waiting at least for 15 mins). I don't know why. I also did as worstenbrood suggest and the system boot loopless.
Can somebody help?
I attached my boot.img (original and modified) for your information.
mumu_li said:
Thanks "worstenbrood" then I can extract boot.img from stock rom. Based on the guide, I made a new boot.img. But with this new boot.img, the phone hangs at the first screen(waiting at least for 15 mins). I don't know why. I also did as worstenbrood suggest and the system boot loopless.
Can somebody help?
I attached my boot.img (original and modified) for your information.
Click to expand...
Click to collapse
did you create the /system/etc/init.d directory and the 99complete file with the correct permissions? as noted on the OP this is needed because that file will tell the boot process to continue, otherwise you'll be stuck at the boot screen
EDIT: also, do you have busybox installed under /system/xbin?
docnasef said:
Hello there
Really appreciate all your efforts
Kindaa feeling real dumb in comparison! lol
Anyways
My Desire specs :
2.2
2.32.415.3
Baseband 32.49.00.32U_5.11.05.27
Now this has built in arabic enabled support and that is the main reason I would like to keep it
Am yet to run into a custom ROM that would provide that without having to downgrade my version
Also, had a lotta fun trying to root, just couldn't root, up untill a few days back when unrevoked came out with thier new 3.3 version
I noticed you had only two software versions from which to start...
So what about my case? could you please help this newbie along?!!
Click to expand...
Click to collapse
@ moebius83
If you could help, I would really appreciate it...
Please take into consideration That I am more or less android dumb!
I attached the url for my original RUU if that helps?
http://www.mediafire.com/?ih3lbbm7yfag7d2
Would REALLY appreciate your help.
Thanks m8!
mumu_li said:
Thanks "worstenbrood" then I can extract boot.img from stock rom. Based on the guide, I made a new boot.img. But with this new boot.img, the phone hangs at the first screen(waiting at least for 15 mins). I don't know why. I also did as worstenbrood suggest and the system boot loopless.
Can somebody help?
I attached my boot.img (original and modified) for your information.
Click to expand...
Click to collapse
i created a update.zip which replaces the ramdisk only and add /system/etc/init.d/99complete. It should work for every froyo release.
worstenbrood said:
i created a update.zip which replaces the ramdisk only and add /system/etc/init.d/99complete. It should work for every froyo release.
Click to expand...
Click to collapse
great job, I was just going to make the same update.zip, you were faster, I'll link it on the OP, thanks again!

[Q] Building a recovery.img from scratch

Here is the theory I want.
Given a mobile phone that has a lock on it wether pin code, pattern or password, If the mobile's bootloader was unlocked I can install a custom recovery and then boot to that recovery in which I can run the adb and have access to the data in the phone. If my hypothesis is correct then how I can build a recovery.img ??
I have been reading for the recover.img for 2 weeks and almost understood how it works and most of the files in it. However, I couldn't find a tutorial of how can I build my own recovery.img
What I decided to do it to modify on the CWM recovery.img.
So I downloaded the CWM and then I unpack it to see the kernel and the initrd. After decompressing the initrd, I found many files. I made a simple test which is to run a script from the init.rc. Inside the init.rc I added two lines. The first one to mount the /data partition and then I just echoed "test" to a file called text.txt then I rebooted my device to normal boot connected to adb and checked the /data partition, but unfortunately I didn't find anything.
I would like to know what I am missing and if my theory is correct or not and how can I build my OWN recovery and have something like adb running from the start.
Thank you

Need help to get Tom Tom working on Intel device

Hi Guys,
As we all know Tom Tom does not work on the intel units.
For the MTCB devices there is a way to get it working: https://forum.xda-developers.com/an...lution-tomtom-connection-to-internet-t3368026 To get that working you need xposed installed. Since we can not install xposed we can not use that methode.
If we look at this post: https://forum.xda-developers.com/showpost.php?p=69772506&postcount=109 someone already tried to put a serial into the default.prop file but that does not work.
I found this page: http://stackoverflow.com/questions/19368712/where-is-ro-boot-serialno-and-ro-serialno-stored that does not work neither.
http://forum.odroid.com/viewtopic.php?f=94&t=12243
This page says we need to extract the boot.file and use the CarlivImageKitchen tool to extract it so we can modified the file.
I could find the boot.img in the latest update from joying: https://www.carjoying.com/Joying-blog/59.html location: 5009_20.zip.
I tried to extract the boot.img and unpack it with the Kitchen tool and found the init.rc file. Also found the on boot section and added the following lines:
Code:
# Set serial number.
setprop ro.serialno 1234567812345678
setprop ro.boot.serialno 1234567812345678
setprop ril.serialnumber 1234567812345678
Also added those lines to the default.prop file.
Repacked the file and put everything together.
We know that if we put a usb stick with the latest firmware in the usb input from the device it will automatic update and so also the new serial numbers.
The point is, i only wrote a android program a few times and i do not know much about boot files etc.
My question to your developers (because you are 100x times better then i am) would this work? What could probably go wrong if we add 3 lines in the ini.rc file?
Hoping to get some help from you guys!
According to the steps you need to do to get root i found the command to copy the boot.img to the device:
Code:
adb shell dd if=/mnt/usb_storage/USB_DISK0/udisk0/boot.img of=/dev/block/mmcblk0p9
I used the boot.img from the root steps. Added the command in the init.rc file and default.prop. Copied it back to the device and booted.
No luck with the ro.serialno and ro.boot.serialno. serialno was changed to what i have set.
The values of ro.serialno are overwritten somewhere else
Hi,
Have you been able to change the serial no. yet? I'm also waiting for a solution to install Tomtom GO on to this intel headunit
Nope still no success.
I don't have any idea what i can do to fix it.
Put here photo whit error tomtom go please and model headunit and android .

[GUIDE] How to fix the touchscreen in TWRP (Moto G 5G)

In this guide a describe how you can easily fix the touchscreen issue in TWRP for Moto G 5G.
Before providing the necessary steps, I would like to express my gratitude to the guys here, especially Andrew Hexen for providing the sources and instructions to build the TWRP for this great device.
Building the TWRP from source might result in a recovery without the touchscreen support. To fix that, you can follow these simple steps.
First, we need to extract the touchscreen drivers from the phone. To do this, you need to boot to TWRP. Connect your phone to your PC, open up the terminal and type:
Bash:
# reboot to bootloader
adb reboot bootloader
# boot to recovery
fastboot boot twrp.img
Wait for the phone to boot to recovery. If your phone uses password/PIN or other forms of protection you might have to decrypt the filesystem before proceeding. You can use OTG mouse to do that.
On your PC, in terminal type:
Bash:
adb pull "/vendor/lib/modules/" <path to where you want the modules folder to be pulled>
This will pull from the phone all the necessary drivers, among those are the drivers for the touchscreen. (Probably you could pull just the touchscreen driver, but to be sure I pulled everything.)
On you PC, use Android Kitchen to unpack the recovey image. I usually use the terminal to go to the Android Kitchen folder and I run:
Bash:
./unpacking.sh <path to your twrp.img>
Then go to ramdisk folder that was created by Android Kitchen
Bash:
cd ramdisk
and manually create the following folder:
Bash:
sudo mkdir -p vendor/lib/modules
Then copy the drivers you previously pulled from your phone to this folder:
Bash:
sudo cp <path to modules folder with drivers>/* vendor/lib/modules/
In the ramdisk folder open the init.rc file. We need to open it as su user. You can use:
Bash:
sudo gedit
and then open the file from the editor.
Find the following lines:
Code:
# Load properties, Android 6.0+, vendor init lives here
on load_persist_props_action
load_persist_props
and add a line after load_persist_props so that you get:
Code:
# Load properties, Android 6.0+, vendor init lives here
on load_persist_props_action
load_persist_props
start load_modules # this is the line you must add
Use Android Kitchen to repack the image:
Bash:
cd .. # to move back to the folder where Android Kitchen is
./repacking.sh
You'll get a file called image-new.img. That's your new recovery with a working touchscreen!
I'm sure there's a better way to do this so feedback is welcome.
I tired your method and completed with a newimage file, and flastboot booted off it. Still had touch problems, files attached. Vendor.zip was placed in ramdisk\vendor\lib\modules. Any ideas?
Thankyou
PS (edit): would anything needed to be added to ramdisk/vendor/manifest.xml?
Lostwon said:
I tired your method and completed with a newimage file, and flastboot booted off it. Still had touch problems, files attached. Vendor.zip was placed in ramdisk\vendor\lib\modules. Any ideas?
Thankyou
Click to expand...
Click to collapse
Lostwon said:
I tired your method and completed with a newimage file, and flastboot booted off it. Still had touch problems, files attached. Vendor.zip was placed in ramdisk\vendor\lib\modules. Any ideas?
Thankyou
PS (edit): would anything needed to be added to ramdisk/vendor/manifest.xml?
Click to expand...
Click to collapse
PPS I am trying this on the Moto G stylus xt2043-4. I just noticed thats not the phone you wrote this for, Im going to pull and umpack my stock recovery and compre that to the Twrp3.4 image and see whats missing .

Categories

Resources