Thanks that worked for Samsung S3 GT-I9300Found solution that works on Samsung Galaxy Tab A6
For me the reboot scheme didn't work but what did work was putting into /system/bin/lpm this:
Code:#!/system/bin/sh echo b > /proc/sysrq-trigger
Thanks that worked for Samsung S3 GT-I9300Found solution that works on Samsung Galaxy Tab A6
For me the reboot scheme didn't work but what did work was putting into /system/bin/lpm this:
Code:#!/system/bin/sh echo b > /proc/sysrq-trigger
Hi guys, as a followup after trying again tonight it is working!
I came across a different link where someone posted his "one-liner" for doing this:
As mentioned previously, with me using Magisk users have reported "/system" mount not existing.
What it looks like it boils down to at least for me, is that every time I was trying this, I was doing a move/rename of the original /system/bin/lpm, then creating a new /system/bin/lpm (as root/root) and then doing a chmod 0755 and a chown to root/shell. Apparently this method did not work for me even though I was seemingly left with the same file with same permissions, but looks like since this person's one-liner does a copy to backup original /system/bin/lpm and then just overwrites the existing file contents with the simple shell shell script to auto-boot, this works!
I'm not sure if my situation is related to Magisk or what, I'm just not very familiar with Android mounts/partitions/etc. but if anyone is having a problem similar to mine, replacing contents of existing file worked for me.
touch -r <original_file> <new_file>
su
mount -o rw,remount /
echo "#!/system/bin/sh\nsleep 20\n/system/bin/reboot" > /system/bin/lpm
restorecon is most useless twrp option ever seen. only way to set proper secontext is with chconI also fixed the SeLinux context using twrp, but this did not help.
Thanks!! This worked for me for Galaxy S6 Edge Sprint on stock ROM (7.0) unlocked and rooted.Found solution that works on Samsung Galaxy Tab A6
For me the reboot scheme didn't work but what did work was putting into /system/bin/lpm this:
Code:#!/system/bin/sh echo b > /proc/sysrq-trigger
Hope it helps someone![]()
su
mount -o rw,remount /
echo "#!/system/bin/sh" > /system/bin/lpm
echo "echo b > /proc/sysrq-trigger" >> /system/bin/lpm
exit
#!/system/bin/sh
su
/system/bin/reboot
how did you do it please tell methankssss!!!
Only this solution works with my Lenovo tablet...do you think is also possible to check battery percentage before to reboot the tablet?
With samsung smartphone I already made it working with lpm file, but with Lenovo it seems to be different
the file does not repackanother successful auto reboot for Redmi 4x running stock android 7.1.2 mui11
need to change in init.rc the
on charger
class_start charger
with:
on charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"
i dont have custom recovery can i do it sitll please tell me the steps i am confused nowreporting again here on successfull on making auto boot redmi note 7 global on android 10 miui 12
after sucessfull install orangefox recovery and install magisk using orangefox.
boot into system and use total commander to search for init.rc
modify the on charger line from
on charger
class_start charger
to
on charger
exec u:r:magisk:s0 -- /system/bin/reboot
save the init.rc and boot into recovery, mount all partition. go to where you keep the init.rc and set permission to 644
the copy/paste ( using orangefox file manager) init.rc to \system_root folder.
then turn off the device and plug-in charger. the device will boot twice and boot into system..
walla
you have to change to custom recovery as stock recovery wont allow you to do any modificationi dont have custom recovery can i do it sitll please tell me the steps i am confused now
Ok can you please tell me all the steps as I have no knowledge of doing this and have done some small things to make my phone a dash camerayou have to change to custom recovery as stock recovery wont allow you to do any modification
sorry,Ok can you please tell me all the steps as I have no knowledge of doing this and have done some small things to make my phone a dash camera
Hello,Hi guys, as a followup after trying again tonight it is working!
I came across a different link where someone posted his "one-liner" for doing this:
As mentioned previously, with me using Magisk users have reported "/system" mount not existing.
What it looks like it boils down to at least for me, is that every time I was trying this, I was doing a move/rename of the original /system/bin/lpm, then creating a new /system/bin/lpm (as root/root) and then doing a chmod 0755 and a chown to root/shell. Apparently this method did not work for me even though I was seemingly left with the same file with same permissions, but looks like since this person's one-liner does a copy to backup original /system/bin/lpm and then just overwrites the existing file contents with the simple shell shell script to auto-boot, this works!
I'm not sure if my situation is related to Magisk or what, I'm just not very familiar with Android mounts/partitions/etc. but if anyone is having a problem similar to mine, replacing contents of existing file worked for me.
Where exactly you write this commandCan anyone explain why replacing the /system/bin/lpm file with a new one will stop it from being executed?
I was trying this on a samsung S9 which needs auto-boot.
- made a backup copy and replaced the original lpm with one I edited on my computer
- changed permissions, owner and even creating time
but the charging logo is stuck which shows me that the script is not being executed.Code:touch -r <original_file> <new_file>
I also fixed the SeLinux context using twrp, but this did not help.
At the moment I am downloading the stock firmware to reset everything and try again without removing/replacing the lpm file.
However it would be very interesting to know what is happening here!
UPDATE:
I can now confirm that that the autoboot also works on a samsung S9.
The following adb shell now works without problems:
Code:su mount -o rw,remount / echo "#!/system/bin/sh\nsleep 20\n/system/bin/reboot" > /system/bin/lpm
Is that for samsung?Thanx any way, I have manage to solve it by
1. enter FASTBOOT mode
2. Connect phone to computer via USB
3. Go to adb folder and then press SHIFT+RIGHT CLICK
4. Select command prompt
5. Enter "fastboot oem off-mode-charge 0"
#!/system/bin/sh
/system/bin/reboot
I think I'm in the same boat as @fritz.barnes. I've tried every combination of suggestion here but there's something weird going on.
I have a Samsung Galaxy Tab A 10.1 (2019) with unlocked bootloader, TWRP, and root (Magisk).
It appears as if anytime i replace /system/bin/lpm and put in the suggested shell scripts to trigger a reboot, it appears this isn't running at all or incurring some kind of exception.
I was initially really confused because there were other people saying that the script appeared to be working but that it was booting them into recovery/TWRP, and that appeared to be what was happening to me. But after going through so many scenarios, I think there was a reason for that.
1. When I first made the change to /system/bin/lpm after being in USB debugging and from ADB shell, when I turned the tablet off with cord unplugged, then plugged in cord, I got stuck at the initial lightning charge screen that doesn't have the real battery %, etc.
2. When this just got stuck forever and didn't reboot (regularly or into TWRP), I held POWER + VOL DOWN to reboot, then POWER + VOL UP to get back into TWRP. After getting into TWRP, mounting system, and making the similar changes to /system/bin/lpm, it "appeared" to be working in that after powering off with cord unplugged, it would start up when cord plugged in but go immediately into TWRP.
3. I realized later after trying multiple different versions of this file that all kept going into TWRP, if I rebooted regularly into system first with TWRP, then powered off with cord unplugged, then plugged cord in, I was still stuck at the initial lightning charge screen that doesn't have the real battery %, etc.
After all that, I'm assuming the initial lightning charge screen has nothing to do with /system/bin/lpm, and that this shows regardless of what /system/bin/lpm is. But compared to the original /system/bin/lpm behavior of in a few seconds showing correct battery %, my attempts at the shell script /system/bin/lpm probably just appear to be doing nothing (not rebooting) and just keeping me at the initial lightning charge screen.
As I said, I tried multiple different versions of the script throughout this thread and nothing has seemed to work. I have created the file or copied the file in different ways and also verified EOL characters, etc.
Does anyone have any idea what's going on with my situation (and possibly with @fritz.barnes having the same or similar issue that I do) or how to debug this? Is there something that has been altered with reboots by TWRP that requires any sort of Android property to be set or anything? I'm not an Android developer, but I see this in the TWRP source in terms of doing a system reboot, but I'm not fully sure what's going on here.
Code:case rb_system: Update_Intent_File("s"); sync(); check_and_run_script("/sbin/rebootsystem.sh", "reboot system"); #ifdef ANDROID_RB_PROPERTY return property_set(ANDROID_RB_PROPERTY, "reboot,"); #elif defined(ANDROID_RB_RESTART) return android_reboot(ANDROID_RB_RESTART, 0, 0); #else return reboot(RB_AUTOBOOT); #endif
Thanks!
---------- Post added at 09:48 PM ---------- Previous post was at 09:21 PM ----------
Not sure if I'm normally supposed to reply to my own post here, but I have some more information that seems interesting.
If I take the original /system/bin/lpm, make a copy and then use the copy as /system/bin/lpm (and move the original to a different file, i.e. /system/bin/lpm.bak), the copied version of the original binary also seems to not work and keep me at the initial lightning charge screen. I am making sure to chmod 0755 and chown root.shell any copied files as you can see below. The original file has timestamp of 2008-12-31, and this specific file appears to be the only one that will work (and go to the normal charge indicator screen).
![]()
Not sure if this will further help diagnosis anything, but what's going on here? Why with a copy of the original lpm binary does this also result in me being stuck at the initial lightning charge screen? Any ideas?
I'd be willing to send a $50 bounty via Venmo to whoever can help me get this working.
from my own experience, if something get stuck, it means the comand in tge lpm file is wrong, you have to try different command.
i have successfully auto boot 4 different phone, S4, Mate 7, zenphone6, redmi 6a, they all need to use different command, eventhough i only changing the same file. in my case in init.rc and some by just changing kpoc file.
Sent from my Redmi Note 7 using Tapatalk
mount -o remount,rw /dev/block/platform/dw_mmc.0/by-name/SYSTEM /system && cp /system/bin/lpm /system/bin/lpm_orig && echo "#!/system/bin/sh\n/system/bin/reboot" > /system/bin/lpm