12

I need to use this for a Samsung Tablet.

Usually if the device is switched-off and the USB cable is being connected the display will wake up for some seconds showing an animated battery. Instead I want to let it boot.

I suspect this is close to the metal. Where do I have to make a modification? In the kernel, in the Android platform, or is this hidden in some proprietary code of the manufacturer?

user506290
  • 121
  • 1
  • 1
  • 3
  • 1
    This is about as low level of a feature as you'll get. I'm not sure how the bios of an android card works but it will probably be there. If not, since it does turn the display on when plugged in, you MAY be able to get somewhere by looking at the boot loader. – Falmarri Nov 12 '10 at 22:10

6 Answers6

7

A member on XDA has posted a solution for this which seems to work on some Samsung devices.

The idea is to replace the script for the battery icon (which will appear of course as soon as the device is plugged in) with a custom script that will boot the phone. To make this work locate /system/bin/playlpm. Rename the old playlpm to playlpm.bak and replace it with the following script:

#!/system/bin/sh
/system/bin/reboot

For more information read the thread on XDA

Panos Rontogiannis
  • 4,154
  • 1
  • 24
  • 29
kingarold
  • 109
  • 1
  • 3
  • Hi, I have a Cyanogenmod device , do you know how can I do this on cyanogenmod ? Thanks – m0j1 Apr 20 '16 at 02:33
5

I have a rooted Samsung S4 mini. The following steps worked for me:

  1. mount -o remount,rw /system
  2. mv /system/bin/lpm /system/bin/lpm.orig
  3. create /system/bin/lpm as follows:

    #!/system/bin/sh
    /system/bin/lpm.orig &
    while [ true ]; do
      sleep 1
      ps | grep lpm.orig && sleep 3 && /system/bin/reboot
    done
    
  4. chown root.shell /system/bin/lpm

Thorsten
  • 51
  • 1
  • 2
  • Hi, I have a Cyanogenmod device , do you know how can I do this on cyanogenmod ? Thanks – m0j1 Apr 20 '16 at 02:33
3

That's going to be a function of firmware at a very low level which, if the device is shut down, runs without any part of Android present.

Blrfl
  • 6,817
  • 1
  • 25
  • 25
1

On my S4 mini GT-i9291 the procedure listed above by Thorsten worked only with one modification: add the "su".

#!/system/bin/sh
su
mount -o remount,rw /system
/system/bin/lpm.orig &
while [ true ]; do
sleep 1
ps | grep lpm.orig && sleep 3 && /system/bin/reboot
chown root.shell /system/bin/lpm
done  

Tks!!!!!

Tomi Pasin
  • 11
  • 1
1

The change you'll need to make is in the bootloader.

That's the first thing that's started up, which comes long before the C environment gets initialized, or the kernel gets loaded, or even anything from the user space or from Android...

Bootloaders can vary significantly depending on the hardware they were written for, but there is little that's secret about them and you should be able to find the information you're looking for -- now that you know which keywords to use.

Stephan Branczyk
  • 9,363
  • 2
  • 33
  • 49
0

These answers led me to my solution. I'm using this on a Samsung Galaxy Tab S. For other tablets, the path to the system mount will be different. To find it, use this command in an adb shell.

cat /proc/mounts | grep system

One problem I came across was the tablet booting into recovery mode after I changed the lpm file, but that's because I mv'd the old one and created a new lpm file and didn't set the correct permissions and ownership. Using cp instead fixed this. My one-liner to set this up on a tablet is:

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
elliptic1
  • 1,654
  • 1
  • 19
  • 22