[Brick] This Kindle will kill me - 7" Kindle Fire HD Q&A, Help & Troubleshooting

Hi guys,
first please be lenient with my english, I do my best to express myself.
My friend gave me a Kindle Fire HD7 2nd generation, which is bricked, cause he installed cyanogenmod on it and one day, he tried to reset the kindle by soft-resetting. But now the kindle stucks on the recovery TWRP's logo.
So I tried to unbrick it. I tried lots of fixes, always failed. First, I've installed the kindle adb drivers, and now the tablet is reconized as plugged and in recovery.
I can go in a shell, try an adb shell id and everything's okayas you can see, I'm root.
Code:
adb shell id
uid=0(root) gid=0(root)
But now, I can't access to the reocvery, I've tried the following commands and this is where I am.
Code:
adb shell
~ # idme bootmode 4002
/sbin/sh: idme: not found
~ # ls -a /sbin/
[
[[
adbd
adjtimex
arp
ash
awk
base64
basename
bbconfig
blkid
blockdev
brctl
bunzip2
busybox
bzcat
bzip2
cal
cat
catv
chattr
chcon
chgrp
chmod
chown
chroot
clear
cmp
comm
cp
cpio
crond
crontab
cut
date
dc
dd
depmod
devmem
df
diff
dirname
dmesg
dnsd
dos2unix
dosfsck
dosfslabel
du
dump_image
e2fsck
echo
ed
egrep
env
erase_image
exfat-fuse
expand
expr
false
fb2png
fbsplash
fdisk
fgrep
find
fix_permissions.sh
flash_image
flash_lock
flash_unlock
flashcp
flock
fold
free
freeramdisk
fsck.exfat
fstrim
fsync
ftpget
ftpput
fuser
getenforce
getopt
getprop
getsebool
grep
groups
gunzip
gzip
halt
head
hexdump
id
ifconfig
inetd
insmod
install
ionice
iostat
ip
kill
killall
killall5
less
libaosprecovery.so
libblkid.so
libbmlutils.so
libc.so
libcutils.so
libdl.so
libexfat.so
libext2_blkid.so
libext2_com_err.so
libext2_e2p.so
libext2_profile.so
libext2_uuid.so
libext2fs.so
libext4_utils.so
libflashutils.so
libjpeg.so
liblog.so
libm.so
libminadbd.so
libminuitwrp.so
libminzip.so
libmmcutils.so
libmtdutils.so
libopenaes.so
libselinux.so
libsparse.so
libstdc++.so
libstlport.so
libtar.so
libz.so
linker
ln
load_policy
losetup
ls
lsattr
lsmod
lsusb
lzcat
lzma
lzop
lzopcat
make_ext4fs
man
md5sum
mesg
minivold
mkdir
mkdosfs
mke2fs
mkexfatfs
mkfifo
mkfs.exfat
mkfs.ext2
mkfs.vfat
mknod
mkswap
mktemp
modinfo
modprobe
more
mount
mount.exfat
mountpoint
mpstat
mv
nanddump
nandwrite
nbd-client
nc
netstat
nice
nohup
nslookup
ntpd
od
openaes
patch
pgrep
pidof
pigz
ping
pipe_progress
pkill
pmap
postrecoveryboot.sh
poweroff
printenv
printf
ps
pstree
pwd
pwdx
rdev
readlink
realpath
recovery
renice
reset
resize
restorecon
rev
rm
rmdir
rmmod
route
run-parts
runcon
rx
sed
seq
setconsole
setenforce
setprop
setsebool
setserial
setsid
sh
sha1sum
sha256sum
sha3sum
sha512sum
sleep
sort
split
start
stat
stop
strings
stty
sum
swapoff
swapon
sync
sysctl
tac
tail
tar
taskset
teamwin
tee
telnet
telnetd
test
tftp
tftpd
time
timeout
toolbox
top
touch
tr
traceroute
true
ttysize
tune2fs
ueventd
umount
uname
uncompress
unexpand
uniq
unix2dos
unlzma
unlzop
unpigz
unxz
unzip
uptime
usleep
uudecode
uuencode
vi
watch
watchdogd
wc
wget
which
whoami
xargs
xz
xzcat
yes
zcat
So as you can see, idme is not here. Then I've tried to manually replace all folders and files in each directory of the kindle, but after a manual reboot the kindle resets. Also, I've tried to use the Kindle Fire Utility but it didn't work.
I can't do anything else, if you have questions I'm here to answer you for details, but I don't have any idea of what can I do, I tried all the solutions proposed in the differents threads in the forum.
Thanks

Jb-kun said:
Hi guys,
first please be lenient with my english, I do my best to express myself.
My friend gave me a Kindle Fire HD7 2nd generation, which is bricked, cause he installed cyanogenmod on it and one day, he tried to reset the kindle by soft-resetting. But now the kindle stucks on the recovery TWRP's logo.
So I tried to unbrick it. I tried lots of fixes, always failed. First, I've installed the kindle adb drivers, and now the tablet is reconized as plugged and in recovery.
I can go in a shell, try an adb shell id and everything's okayas you can see, I'm root.
But now, I can't access to the reocvery, I've tried the following commands and this is where I am.
So as you can see, idme is not here. Then I've tried to manually replace all folders and files in each directory of the kindle, but after a manual reboot the kindle resets. Also, I've tried to use the Kindle Fire Utility but it didn't work.
I can't do anything else, if you have questions I'm here to answer you for details, but I don't have any idea of what can I do, I tried all the solutions proposed in the differents threads in the forum.
Thanks
Click to expand...
Click to collapse
see 2nd generation forums
link in Fire Index: Which Amazon (Kindle) Fire Do I have?
Sent from my XT1254 using XDA Labs

sd_shadow said:
see 2nd generation forums
link in Fire Index: Which Amazon (Kindle) Fire Do I have?
Sent from my XT1254 using XDA Labs
Click to expand...
Click to collapse
Thanks a lot, I've never seen this thread, I'll check it !

Okay, now I've flashed boot.img and recovery.img, thanks to this thread. Now the tablet bootloop on the "kindle fire" orange logo, and the kindle is not reconized as connected for my pc anymore (and so not detected in adb or fastboot). Any idea?

Related

Is there a .bashrc equivalent for android?

See title. Mostly I just want to have some aliases set every time I open terminal emulator or adb shell. Does anyone know if this is possible?
Just dig /init.rc then you may find the way.
biAji said:
Just dig /init.rc then you may find the way.
Click to expand...
Click to collapse
I don't think that works, init.rc looks like it's executed on boot... I'm looking for a file that executes every time a shell is started.
Hi there,
I'm wondering the same thing.
I've tried to create a bashrc
(/.bashrc ; /system/etc/bash.bashrc ; /root/.bashrc ) But none is working.
I'm about to try a different way,
I've cp /system/bin/sh to /system/bin/sh1
then I'll try to replace /system/bin/sh by a shell script that will launch my aliases then sh1
Something like:
Code:
#!/system/bin/sh1
alias lsa='ls -Alh '
[...]
/system/bin/sh1
But i'm not pretty sure It could work properly. Firstly because I remember a gain-super-user manipulation that requires to copy and modify rights on sh. (but it could be ok if the script and the copy of sh have the same rights).
Secondly, because I'm not really OK with this; When I'll remove /system/bin/sh in order to replace it, I'll have no shell for a time (if it crashes, I'll not be able to use sh anymore, even with adb).
So if anybody have an other solution it could be damn cool
Thank you all
EDIT: I've just tried this. It's ok, I've not lost my shell, but the modifications (one alias, and a path export), are not applied.
There is no such file. In fact, the default shell is sh, not bash.
However, there is a solution. Read my post in this thread: http://forum.xda-developers.com/showthread.php?t=518959
lbcoder said:
There is no such file. In fact, the default shell is sh, not bash.
However, there is a solution. Read my post in this thread: http://forum.xda-developers.com/showthread.php?t=518959
Click to expand...
Click to collapse
That is interesting. I'll have to try it. I assume it won't work with ADB? Or am I wrong (please say yes)?
I would have thought that it would work with adb, but when I try this:
adb shell /path/to/bash --rcfile /path/to/bashrc
it seems that its a 1-way shell...
well you can always run bash after connecting....
adb shell
/path/to/bash --rcfile /path/to/bashrc
Alternatively, with a little bit of craftiness, you may be able to replace the sh binary with a script that runs bash.
Sweet, can't wait until I get home.
The best way, and what a lot of the ROM devs are doing now is putting a check/call to /system/init.rc and /data/init.rc so we can add our own customizations. This would include boot time chmod/chowns or aliases if need be. Hell we could put a call to /etc/.profile if we wanted and put all our aliases in there. But we can't do any of that till ROM devs put that call in boot.img->boot.ramdisk->init.rc
Android's default shell /system/bin/sh is a link to mksh in the same directory. It reads /system/etc/mkshrc & ~/.mkshrc
I think it also reads ~/.profile & /etc/profile but I'm not sure & I don't know what order.
See https://www.mirbsd.org/mksh.htm for the documentation.
Also worth noting is that most, if not all, shells read /etc/profile & ~/.profile so anything in there should be very general.
Yes there is
lbcoder said:
There is no such file. In fact, the default shell is sh, not bash.
However, there is a solution. Read my post in this thread: http://forum.xda-developers.com/showthread.php?t=518959
Click to expand...
Click to collapse
Edit /system/etc/mkshrc. You can add your aliases there after the defaults. Type 'alias' from the terminal to see the default aliases that are defined in this file. I believe this file is the master, and when a shell is envoked, the mksh command pipes a hidden copy of this file into the users home directory as .mkshrc for the terminal session.
Also, this is the file to edit to append to your $PATH.
alanthehat said:
Android's default shell /system/bin/sh is a link to mksh in the same directory. It reads /system/etc/mkshrc & ~/.mkshrc
I think it also reads ~/.profile & /etc/profile but I'm not sure & I don't know what order.
See https://www.mirbsd.org/mksh.htm for the documentation.
Also worth noting is that most, if not all, shells read /etc/profile & ~/.profile so anything in there should be very general.
Click to expand...
Click to collapse
/system/etc/mkshrc & ~/.mkshrc
You had the answer right here but you didn't know it
smasraum said:
That is interesting. I'll have to try it. I assume it won't work with ADB?
Click to expand...
Click to collapse
curiously enough my bash aliases work when in the adb shell. I'm running bash on my mac. I guess the alias get expanded by bash before there are sent to adb shell.
Code:
mac $ alias ll
alias ll='\ls -albhFG'
mac $
Code:
mac $ adb shell
[email protected]_a11chl:/ $ ll
drwxr-xr-x root root 2016-10-03 13:10 acct
lrwxrwxrwx root root 2016-10-03 13:24 busybox -> /data/data/com.jrummy.app.managerfree/files/busybox
drwxrwx--- system cache 2016-10-03 14:37 cache
drwxrwx--x system carrier 2016-09-02 15:24 carrier
dr-x------ root root 2016-10-03 13:10 config
Please note this does not work:
Code:
mac $ adb shell ll
/system/bin/sh: ll: not found
On my side, here is what I did :
Code:
adb root
Code:
adb remount
Code:
adb shell
Code:
vim /etc/mkshrc
I added the following line :
Code:
alias ls='ls --color=auto'
Results attached, now I may play with the PS1 to get colors in the prompt....
In nougat, there is a bashrc in
"/system/etc/bash/bashrc"
idk about other versions check and tell me
Code:
uname -a: Linux debian 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u5 (2018-09-30) x86_64 GNU/Linux
[email protected]:/# adb root #restart adb with root permissions
[email protected]:/# adb remount #remount partitions on device read-write
remount succeeded
[email protected]:/# adb shell #run remote, interactive shell
device:/ # test0 #execute command test0
/system/bin/sh: test0: not found
127|device:/ # alias test0='date'
device:/ # test0
Wed Oct 10 15:06:16 +00 2018 #SUCCESS
[email protected]:/# adb root
adbd is already running as root
[email protected]:/# adb remount
remount succeeded
[email protected]:/# adb shell
klteusc:/ # test1
/system/bin/sh: test1: not found
127|klteusc:/ # echo "alias test1='date'">>/system/etc/mkshrc
klteusc:/ # test1
/system/bin/sh: test1: not found
127|klteusc:/ # exit
[email protected]:/# adb shell
klteusc:/ # test1
Wed Oct 10 15:10:41 +00 2018
klteusc:/ # exit
[email protected]:/# adb root
adbd is already running as root
[email protected]:/# adb remount
remount succeeded
[email protected]:/# adb shell
klteusc:/ # test2
/system/bin/sh: test2: not found
127|klteusc:/ # echo "alias test2='date'">>/system/etc/bash/bashrc
klteusc:/ # test2
/system/bin/sh: test2: not found
127|klteusc:/ # exit
[email protected]:/# adb shell
klteusc:/ # test2
/system/bin/sh: test2: not found
dirtygardner said:
Code:
uname -a: Linux debian 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u5 (2018-09-30) x86_64 GNU/Linux
[email protected]:/# adb root #restart adb with root permissions
[email protected]:/# adb remount #remount partitions on device read-write
remount succeeded
[email protected]:/# adb shell #run remote, interactive shell
device:/ # test0 #execute command test0
/system/bin/sh: test0: not found
127|device:/ # alias test0='date'
device:/ # test0
Wed Oct 10 15:06:16 +00 2018 #SUCCESS
[email protected]:/# adb root
adbd is already running as root
[email protected]:/# adb remount
remount succeeded
[email protected]:/# adb shell
klteusc:/ # test1
/system/bin/sh: test1: not found
127|klteusc:/ # echo "alias test1='date'">>/system/etc/mkshrc
klteusc:/ # test1
/system/bin/sh: test1: not found
127|klteusc:/ # exit
[email protected]:/# adb shell
klteusc:/ # test1
Wed Oct 10 15:10:41 +00 2018
klteusc:/ # exit
[email protected]:/# adb root
adbd is already running as root
[email protected]:/# adb remount
remount succeeded
[email protected]:/# adb shell
klteusc:/ # test2
/system/bin/sh: test2: not found
127|klteusc:/ # echo "alias test2='date'">>/system/etc/bash/bashrc
klteusc:/ # test2
/system/bin/sh: test2: not found
127|klteusc:/ # exit
[email protected]:/# adb shell
klteusc:/ # test2
/system/bin/sh: test2: not found
Click to expand...
Click to collapse
You need to manually edit the mksh file and add your command in for it to persistently work.
Just running the command below will work but will be wiped on reboot.
Code:
alias test1='date'
If you need it to stay persistent over reboots manually edit /system/etc/mkshrc
Code:
## Adding the test0 alias via file editing:
taimen:/ # test0
Wed Aug 5 13:09:46 GMT 2020
## Adding test1 alias via command line:
taimen:/ # alias test1='date'
taimen:/ # test1
Wed Aug 5 13:10:06 GMT 2020
## Reboot Device
taimen:/ # reboot
## Check for persistant changes:
taimen:/ # test0
Wed Aug 5 13:04:24 GMT 2020
taimen:/ # test1
/system/bin/sh: test1: not found
Example file that I used:
Code:
# Copyright (c) 2010, 2012, 2013, 2014
# Thorsten Glaser <[email protected]>
# This file is provided under the same terms as mksh.
#-
# Minimal /system/etc/mkshrc for Android
#
# Support: https://launchpad.net/mksh
: ${HOSTNAME:=$(getprop ro.product.device)}
: ${HOSTNAME:=android}
: ${TMPDIR:=/data/local/tmp}
export HOSTNAME TMPDIR
alias test0="date"
if (( USER_ID )); then PS1='$'; else PS1='#'; fi
PS4='[$EPOCHREALTIME] '; PS1='${|
local e=$?
(( e )) && REPLY+="$e|"
return $e
}$HOSTNAME:${PWD:-?} '"$PS1 "
This will stay persistent on reboot.

[HOW-TO] Run commands and persist settings after reboot - Updated

Here is an easy way to run commands after each boot.
In the init.rc file, the file /system/bin/clrbootcount.sh always gets run after a successful boot. Since it isn't trivial to change the init.rc file, we will use clrbootcount.sh to run commands after a boot. Since people are having issues with modifying clrbootcount.sh, we will choose a safer method.
clrbootcount.sh will always attempt to call /data/boot_complete_hook.sh, which doesn't exit. We are going to create this file and use that to run commands.
Create a file named boot_complete_hook.sh with the following contents (On Windows, use Notepad++):
Code:
#!/system/bin/sh
##################################################################################
#
# File boot_complete_hook.sh
# Description Run any commands that you want to be run after boot
#
##
setprop persist.service.mount.umsauto 0
echo 68000,1024/70/200/40,600/10/11/10 > /sys/devices/omapdss/display0/timings
Save and close.
Now, execute the following commands to put the file on your nook:
Code:
adb push boot_complete_hook.sh /data/boot_complete_hook.sh
adb shell chmod 755 /data/boot_complete_hook.sh
Note:
Before you reboot verify that the file will run properly. Open up a shell via adb shell. Inside that run the following:
Code:
setprop persist.service.mount.umsauto 1
getprop persist.service.mount.umsauto
You should see 1 as the output. Now run:
Code:
sh /system/bin/clrbootcount.sh
You should see an output similar to:
Code:
4+0 records in
4+0 records out
4 bytes transferred in 0.010 secs (400 bytes/sec)
Now run:
Code:
getprop persist.service.mount.umsauto
If 0 is printed out, exit the shell.
If 0 is not printed out, something went wrong and the file will not be run properly on the next boot. If you do reboot in this state 8 times, the boot count won't be reset and you will hit the factory reset. While you are trying to get the script working, you could always manually reset the boot count by executing (from a shell):
Code:
dd if=/dev/zero of=/rom/devconf/BootCnt bs=1 count=4
Now reboot:
Code:
adb shell reboot
As you are rebooting, run:
Code:
adb shell getprop persist.service.mount.umsauto
It will return 1 since the init.rc file sets it to 1 explicitly. However, once you are fully booted it will return 0.
Didn't work for me.
JoshMiers said:
Here is an easy way to run commands after each boot.
In the init.rc file, the file /system/bin/clrbootcount.sh will always gets run after a successful boot. Since it isn't trivial to change the init.rc file, we will use clrbootcount.sh to run commands after a boot.
Do:
Code:
adb pull /system/bin/clrbootcount.sh .
Open the file (on Windows, don't use Notepad) and you should see:
Code:
#!/system/bin/sh
##################################################################################
#
# File clrbootcount.sh
# Description Clear the bootcount variable to 0 on successful boot
#
##
# Run potential hook first.
/data/boot_complete_hook.sh
# Zero the boot count
dd if=/dev/zero of=/rom/devconf/BootCnt bs=1 count=4
Add the following to the end of the file:
Code:
#run other commands
setprop persist.service.mount.umsauto 0
Save and close.
Now, execute the following commands to put the file back on your nook:
Code:
adb shell mount -o rw,remount -t ext2 /dev/block/mmcblk0p5 /system
adb push clrbootcount.sh /system/bin/clrbootcount.sh
adb shell chmod 755 /system/bin/clrbootcount.sh
adb shell mount -o ro,remount -t ext2 /dev/block/mmcblk0p5 /system
adb shell reboot
As you are rebooting, run:
Code:
adb shell getprop persist.service.mount.umsauto
It will return 1 since the init.rc file sets it to 1 explicitly. However, once you are fully booted it will return 0.
Click to expand...
Click to collapse
Wouldn't this screw up the 8X "back to stock firmware" sequence since that depends on having the boot counter increment up to 8?
docfreed said:
Wouldn't this screw up the 8X "back to stock firmware" sequence since that depends on having the boot counter increment up to 8?
Click to expand...
Click to collapse
The script file is already there and already being called after each successful boot. The 8x boot counter logic happens with 8 failed boots. Regardless, the instructions just show you how to append a custom command to be run after the stock commands run, no other booting logic is affected.
>DARKMAN< said:
Didn't work for me.
Click to expand...
Click to collapse
What didn't work? Run the following and paste your output:
Code:
adb shell cat /system/bin/clrbootcount.sh
Code:
adb shell ls -l /system/bin/clrbootcount.sh
Awesome, thanks for the tip! Been wondering how to put in my own stuff into the init, I'd love to modify the path but I suspect this won't be the way, but regardless it's good info.
BTW, I have found that disabling this USM property seems to disable the SD card automounting but the Nook itself might still automount... But that's for another thread I suppose
Worked perfectly
This is exactly what I was looking for.
Thanks
Sent from my LogicPD Zoom2
There seems to be a little confusion over at the refresh rate thread http://forum.xda-developers.com/showthread.php?t=901294.
To be explicit, if you want to disable auto-mounting as well as change the refresh rate, you would edit clrbootcount.sh to have the following contents:
Code:
#!/system/bin/sh
##################################################################################
#
# File clrbootcount.sh
# Description Clear the bootcount variable to 0 on successful boot
#
##
# Run potential hook first.
/data/boot_complete_hook.sh
# Zero the boot count
dd if=/dev/zero of=/rom/devconf/BootCnt bs=1 count=4
#run other commands
setprop persist.service.mount.umsauto 0
echo 68000,1024/70/200/40,600/10/11/10 > /sys/devices/omapdss/display0/timings
If you don't want to disable auto-mounting, just remove the line with
Code:
setprop persist.service.mount.umsauto 0
I ran what was posted and it still returns 1.
Sent from my HAXSUNG Moment
JoshMiers said:
What didn't work? Run the following and paste your output:
Code:
adb shell cat /system/bin/clrbootcount.sh
Code:
adb shell ls -l /system/bin/clrbootcount.sh
Click to expand...
Click to collapse
Screen shot attached (1.0.1 Auto-Nooter 2.12.25).
# cat /system/bin/clrbootcount.sh
cat /system/bin/clrbootcount.sh
#!/system/bin/sh
################################################################################
##
#
# File clrbootcount.sh
# Description Clear the bootcount variable to 0 on successful boot
#
##
# Run potential hook first.
/data/boot_complete_hook.sh
# Zero the boot count
dd if=/dev/zero of=/rom/devconf/BootCnt bs=1 count=4
#
# ls -l /system/bin/clrbootcount.sh
ls -l /system/bin/clrbootcount.sh
-rwxr-xr-x root root 338 2011-01-06 19:50 clrbootcount.sh
#
edit double post oops
I lost my backup of clrbootcount.sh
and now it won't reset the boot count.
any help would be greatly appreciated.
adb shell getprop persist.service.mount.umsauto
Click to expand...
Click to collapse
always returns 1 during and after complete reboot. The echo command for screen does not persist. Have followed your instructions super letter by letter multiple times and leading up to the reboot everything is exactly as you say.
Right now, I am most concerned that whatever I have done will not reset the boot count since it stays at 1 and does not go to 0. I've already lost my entire setup twice and had to start from scratch trying to make this work. At least I know how to reset to 0 with the line command script but how do I ensure i don't need to worry about it?
I think this process may be a bust.
I am on 1.0.0 and have been using this since I posted it and both the refresh rate and automount values are sticking between reboots.
>DARKMAN< said:
# cat /system/bin/clrbootcount.sh
cat /system/bin/clrbootcount.sh
#!/system/bin/sh
################################################################################
##
#
# File clrbootcount.sh
# Description Clear the bootcount variable to 0 on successful boot
#
##
# Run potential hook first.
/data/boot_complete_hook.sh
# Zero the boot count
dd if=/dev/zero of=/rom/devconf/BootCnt bs=1 count=4
#
# ls -l /system/bin/clrbootcount.sh
ls -l /system/bin/clrbootcount.sh
-rwxr-xr-x root root 338 2011-01-06 19:50 clrbootcount.sh
#
Click to expand...
Click to collapse
I am assuming you are using the new method, which would mean you need to post your /data/boot_complete_hook.sh
>DARKMAN< said:
I lost my backup of clrbootcount.sh
and now it won't reset the boot count.
any help would be greatly appreciated.
Click to expand...
Click to collapse
The clrbootcount.sh file that you posted is the default file. I will post it again:
Code:
#!/system/bin/sh
##################################################################################
#
# File clrbootcount.sh
# Description Clear the bootcount variable to 0 on successful boot
#
##
# Run potential hook first.
/data/boot_complete_hook.sh
# Zero the boot count
dd if=/dev/zero of=/rom/devconf/BootCnt bs=1 count=4
Also, the original post explains how to manually reset the boot count. Here it is:
If 0 is not printed out, something went wrong and the file will not be run properly on the next boot. If you do reboot in this state 8 times, the boot count won't be reset and you will hit the factory reset. While you are trying to get the script working, you could always manually reset the boot count by executing (from a shell):
Code:
dd if=/dev/zero of=/rom/devconf/BootCnt bs=1 count=4
jleecong said:
Screen shot attached (1.0.1 Auto-Nooter 2.12.25).
Click to expand...
Click to collapse
It appears you are running Windows, so I am hoping that you did not use Notepad to edit this file.
Since you are running 1.0.1, post your /init.rc file.
Thought I may have been doing something wrong since I used notepad but downloaded Notepad++ and created the new .sh file. Still no go. Screen still flickers and USB still automounts. Maybe 1.0.1 just is not commpatible with this process. Only difference I can see.
The getprop persist.service.mount.umsauto also indicates 1 after full boot and not 0. Pretty sure this will wipe everything out after 8 boots, going to wipe it all out now and proactively prevent it.

[MOD] v0.3.1 Working Full Ubuntu for 1.5.7 and 1.8.3 based on Sogarth's script

Sogarth's webtop2sd will be released soon, you really should wait and install that instead of this! Thanks -The Management
No longer breaks on 1.83, thanks to Romracer
Update: This script worked on my phone. Mind you I was installing it from a fresh SBF flash, but it should work on your phone too. Absolutely no guarantees as usual.
Update 11th April 2011, 06:59 PM: Won't be getting CWM package because it'd be huuuuuuuuuge.
Update 28th April 2011. 16:38 PM: Removing BETA tag since there have been no issues with the script for quite some time.
First off I would like to thank Sogarth for making this script in the first place as well as Romracer for fixing it for 1.83. Since he is busy doing more important work I decided to do this little hack for those of us that updated to 1.5.7 and dont feel like flashing back to earlier versions to get full Ubuntu working.
Again, this is only necessary if you're already running 1.5.7 or 1.8.3.
Secondly, I am still working on this script so it may not work for you. If you have a problem you may post in the thread or PM me showing exactly the error message, word for word, that you receive.
Updates will be included in the OP from time to time as I fix errors.
Instructions:
1) install.bat (from your computer)
2) adb shell (get a shell on your phone)
3) su (get root on your phone in that shell)
4) . /data/local/tmp/install.sh (run the install script *on your phone* don't forget the "." and the space after the dot, or you will have to chmod 755 the shell script manually)
5) ?????
6) profit\
Noob instructions, written by Viamonte (I take no credit or responsibility):
Thanks again for all your help. Now the noob instructions:
"1-Download "Terminal Emulator" from the market, on your phone (or any other terminal), and the file anexed in this thread to your computer.
2-Connect the Atrix to the computer via USB, configuring the connection mode to "None" and enabling USB Debugging mode (Settings>Applications>Development>USB debugging)
3-Unzip the file you downloaded on your pc, and run Install.bat. This will push the script to your phone.
4-Go back to your phone and open the emulator you downloaded. Then type "su" (without quotes) and press enter. Then type ". /data/local/tmp/install.sh" (without quotes) and press enter again.
The script should begin running now. It will stop in two moments where you'll be instructed to get a cup of coffee, and may take several minutes to continue form this point. When finished, the Atrix will reboot.
To check if this worked, use the Webtop either on your multimidia dock or your lapdock and verify if new itens appeared on your task bar and on the right upper side of the screen"
0.3.1 release
0.2 release
0.1 first release
Changelog
0.3.1 fix to gconf file's mdate so it does what its supposed to do =)
0.3 Small typo fixes and cpp package install fix by romracer, now works on 1.83 =)
0.2 Fixed some typos in uninstall.sh and make sure the %gconf file wound up in the right spot.
0.1 - first version. NOT CWM install but ready to be packaged for that more or less
Nice, I'll give this a shot later.
Ill give it a shot when I get home!
Sent from Motorola Atrix on TELUS.
My phone is working perfectly, so why not ruin it?
I'm giving this a try right now!
1.4.57 - Rooted and gingerblurred with HDMI Mirroring and Webtop hack.
I'll update as progress goes along:
Edit 1:
Initial try gave me this
Checking device state...
Obtaining temporary root access...pushing shell scripts
A filesystem file already exists. Reset it? [n] y
Mounting the filesystem...
07.sh
--------------------------------------------
EXECUTION FAILED
Unable to mount the filesystem file. ERR 07
--------------------------------------------
Press any key to continue . . .
Edit 2:
Ok, it doesnt work with resetting it. How about removing?
Checking device state...
Obtaining temporary root access...pushing shell scripts
A filesystem file already exists. Reset it? [n] n
A filesystem file already exists. Delete it? [n] y
Deleting the filesystem file...
--------------------------------------
EXECUTION FAILED
Unable to delete the filesystem file.
--------------------------------------
Press any key to continue . . .
Edit 3:
Ok, only one option left then.
Checking device state...
Obtaining temporary root access...pushing shell scripts
A filesystem file already exists. Reset it? [n] n
A filesystem file already exists. Delete it? [n] n
--------------------------------------------------------------------------
EXECUTION FAILED
The filesystem file already exists, but no operations have been selected.
--------------------------------------------------------------------------
Press any key to continue . . .
=====================================================================
Edit 4:
Since execution is failing I'm trying to find the problem. Using ADB Shell i tried to manually run the shell scripts and stumbled here:
(I tried chmod 777 @ 02.sh to see if that was the problem, no change is results)
# ls -l
...
...
-rwsr-sr-x shell shell 87 2011-04-06 12:13 03.sh
-rwxrwxrwx shell shell 82 2011-04-06 12:11 02.sh
-rwsr-sr-x shell shell 251 2011-04-06 12:04 01.sh
# pwd
pwd
/data/tmp/shell
# /data/tmp/shell/02.sh
/data/tmp/shell/02.sh
/data/tmp/shell/02.sh: not found
I had the same issue as flybob when I tried to run the script.
Sent from my MB860 using XDA Premium App
Good effort, but 1.57 changes how we have to run commands as root. On a normal linux box, I'm sure your methods would work fine, but we're not dealing with a normal su binary. You should look into doing this as CWM as opposed to .bat files. I had a hell of a time getting around the restrictions since the psneuter exploit was closed.
Ah, I did not think about that Ririal, thanks for the info. I am not familiar with CWM though.
Why is the /tmp directory in /data ? That would certainly cause every script to fail.
I'll look at this some more tonight.
Ririal said:
Good effort, but 1.57 changes how we have to run commands as root. On a normal linux box, I'm sure your methods would work fine, but we're not dealing with a normal su binary. You should look into doing this as CWM as opposed to .bat files. I had a hell of a time getting around the restrictions since the psneuter exploit was closed.
Click to expand...
Click to collapse
How about a shell script that we can run in terminal emulator ? and the output goes to screen and a log file for debug !
molotof said:
How about a shell script that we can run in terminal emulator ? and the output goes to screen and a log file for debug !
Click to expand...
Click to collapse
most of the script is now run by shell scripts, no reason you couldn't run them in the terminal emulator, just get the order right. There are also a few lines I didn't translate to shell so you'd have to enter them by hand.
In any case I'll keep working on this until Sogarth releases his version with union mounts =D
You might be interested to know this;
# cd /tmp
cd /tmp
# pwd
pwd
/data/tmp
# ls -l /tmp
lrwxrwxrwx root root 2011-04-09 14:47 tmp -> /data/tmp
I'll happily help with the script, i know tons of linux and got my Atrix ready to be bricked
flybob said:
You might be interested to know this;
# cd /tmp
cd /tmp
# pwd
pwd
/data/tmp
# ls -l /tmp
lrwxrwxrwx root root 2011-04-09 14:47 tmp -> /data/tmp
I'll happily help with the script, i know tons of linux and got my Atrix ready to be bricked
Click to expand...
Click to collapse
That's just a symlinked directory. I won't make a difference if you call either.
Yes, just replied to the previous question
Why is the /tmp directory in /data ? That would certainly cause every script to fail.
I'll look at this some more tonight.
Click to expand...
Click to collapse
However, why doesn't the scripts run as wanted...?
# cat /tmp/shell/02.sh
cat /tmp/shell/02.sh
#!/bin/sh
/system/bin/su
/bin/rm /data/ubuntu.disk > /dev/null 2>&1 && echo PASS#
# ls -l /tmp/shell/02.sh
ls -l /tmp/shell/02.sh
-rwxrwxrwx shell shell 82 2011-04-06 12:11 02.sh
# /tmp/shell/02.sh
/tmp/shell/02.sh
/tmp/shell/02.sh: not found
flybob said:
Yes, just replied to the previous question
However, why doesn't the scripts run as wanted...?
# cat /tmp/shell/02.sh
cat /tmp/shell/02.sh
#!/bin/sh
/system/bin/su
/bin/rm /data/ubuntu.disk > /dev/null 2>&1 && echo PASS#
# ls -l /tmp/shell/02.sh
ls -l /tmp/shell/02.sh
-rwxrwxrwx shell shell 82 2011-04-06 12:11 02.sh
# /tmp/shell/02.sh
/tmp/shell/02.sh
/tmp/shell/02.sh: not found
Click to expand...
Click to collapse
Ah ok my mistake, you didn't quote anything I didn't realize that's what you were responding too
Likely noexec flag causing that issue.
Also, you can't invoke su from inside a shell script. It just doesn't work with this su binary.
yeah, I guess not. I hadn't realized that it wasn't a real 'su' before making this... too bad.
If anyone figures out how to get around that we'll be in business Unfortunately that's way beyond my expertise.
Okay, after fiddling a little bit and talking to a friend I may have solved some of the problems, mainly with the scripts executing and su working.
I will have to rewrite a bunch of things but should report back tonight.
the2dcour said:
Okay, after fiddling a little bit and talking to a friend I may have solved some of the problems, mainly with the scripts executing and su working.
I will have to rewrite a bunch of things but should report back tonight.
Click to expand...
Click to collapse
su -c "command"
You'll have to allow superuser on the phone for every single command.
PM'd you my error. I tried manually editing the permissions, but that didn't work.
Running on GladAtrix2 v3
USB debugging on; USB set to none
Checking device state...
Obtaining temporary root access...pushing shell scripts
-------------------------
EXECUTION FAILED
Unable to chmod scripts.
-------------------------
Press any key to continue . . .
Changed /sdcard-ext to /sdcard in script. Got this error
Checking device state...
Obtaining temporary root access...pushing shell scripts
-------------------------
EXECUTION FAILED
Unable to chmod scripts.
-------------------------
* server not running *
Press any key to continue . . .
Running BETA_ubuntu-1.0.6.4.zip. File extracts to BETA_ubuntu-1.0.6.2 directory. Ran ubuntu-1.5.7.bat
Moved BETA_ubuntu-1.0.6.2 to C:\ Same error
The only easy workaround to that I can see at the moment is to
Code:
adb shell
su
chmod 777 /path-to-scripts/*
ls -l /path-to-scripts/*
make sure all the files are executable (should say rwxrwxrwx)
then remove the bit of code from 1.5.7.bat
Code:
set retval=
for /f "tokens=*" %%l in ('%~dps0adb.exe shell "/bin/chmod 6755 /mnt/sdcard-ext/shell/* > /dev/null 2>&1 && echo PASS"') do set retval=%%l
if "%retval%" neq "PASS" set message=Unable to chmod scripts. && goto abort
If anyone can help me fix this problem I should be able to automate the chmod process using ririal's suggestion of su -c. The problem is that there are too many nested quotation marks in this section of the batch file, and I can't for the life of me figure out how to escape quotes so they pass through to adb:
Code:
set retval=
for /f "tokens=*" %%l in ('%~dps0adb.exe shell "/system/bin/su -c [U]'/bin/chmod 6755 /mnt/sdcard-ext/shell/*'[/U] > /dev/null 2>&1 && echo PASS"') do set retval=%%l
if "%retval%" neq "PASS" set message=Unable to chmod scripts. && goto abort
The underlined bit is where I need to escape either single or double quotes.
the2dcour said:
The only easy workaround to that I can see at the moment is to
Code:
adb shell
su
chmod 777 /path-to-scripts/*
ls -l /path-to-scripts/*
make sure all the files are executable (should say rwxrwxrwx)
then remove the bit of code from 1.5.7.bat
Code:
set retval=
for /f "tokens=*" %%l in ('%~dps0adb.exe shell "/bin/chmod 6755 /mnt/sdcard-ext/shell/* > /dev/null 2>&1 && echo PASS"') do set retval=%%l
if "%retval%" neq "PASS" set message=Unable to chmod scripts. && goto abort
If anyone can help me fix this problem I should be able to automate the chmod process using ririal's suggestion of su -c. The problem is that there are too many nested quotation marks in this section of the batch file, and I can't for the life of me figure out how to escape quotes so they pass through to adb:
Code:
set retval=
for /f "tokens=*" %%l in ('%~dps0adb.exe shell "/system/bin/su -c [U]'/bin/chmod 6755 /mnt/sdcard-ext/shell/*'[/U] > /dev/null 2>&1 && echo PASS"') do set retval=%%l
if "%retval%" neq "PASS" set message=Unable to chmod scripts. && goto abort
The underlined bit is where I need to escape either single or double quotes.
Click to expand...
Click to collapse
^ escapes batch, \ escapes shell. Hope this helps. If you zip up and send me the whole process in a single .sh file I can wrap it up in CWM for you.

[Q] Help rooting

Hi Android Gurus,
I am new to android and rooting. I tried to follow the steps available in the xda forums to root my kindle fire HD 7". But instead of just executing the scripts, I chose to read the scripts and manually execute them comand by comand so I could learn. In the process I did what seems to be like a terrible mistake by setting the wrong permissions on /system/xbin/su like below instead of 06755
-rwxr-xr-x root root 380532 2013-01-03 00:24 su
Basically I cannot su anymore, hence I cannot mount the /system rw to modify su's permissions (sounds like a chicken-and-egg situation here).
I badly need help and appereciate if some of you can provide a way.
Thanks.
Root and Google Play for Amazon 7" Kindle Fire HD Software Version 7.2.3
xdajunior said:
Hi Android Gurus,
I am new to android and rooting. I tried to follow the steps available in the xda forums to root my kindle fire HD 7". But instead of just executing the scripts, I chose to read the scripts and manually execute them comand by comand so I could learn. In the process I did what seems to be like a terrible mistake by setting the wrong permissions on /system/xbin/su like below instead of 06755
-rwxr-xr-x root root 380532 2013-01-03 00:24 su
Basically I cannot su anymore, hence I cannot mount the /system rw to modify su's permissions (sounds like a chicken-and-egg situation here).
I badly need help and appereciate if some of you can provide a way.
Thanks.
Click to expand...
Click to collapse
So you can not perform:
adb shell chown 0.0 /system/xbin/su chmod 06755 /system/xbin/su
What happens when you attempt to run these commands? If not, your real option is to go to our thread
noted below and use Root MANY ANDROID! to fix it.
Help rooting
I get this. The problem is that I now have a read-only /system so I couldn't change owner/permissions.
[email protected]:/ $ chown 0.0 /system/xbin/su
Unable to chmod /system/xbin/su: Read-only file system
10|[email protected]:/ $
I also tried to copy su binary again to /data/local/tmp again to see if I can recreate su ownership/permission but I'm unable to do that as well
[email protected]:/data/local/tmp $ pwd
/data/local/tmp
[email protected]:/data/local/tmp $ ls -l
-rwxr-xr-x shell shell 1085140 2012-08-09 13:42 busybox
-rwxrwxrwx shell shell 91980 2008-02-28 22:33 su
[email protected]:/data/local/tmp $ chown 0.0 /data/local/tmp/su
Unable to chmod /data/local/tmp/su: Operation not permitted
Will redoing "Root MANY ANDROID!" solve this problem?
Root and Google Play for Amazon 7" Kindle Fire HD Software Version 7.2.3
xdajunior said:
I get this. The problem is that I now have a read-only /system so I couldn't change owner/permissions.
[email protected]:/ $ chown 0.0 /system/xbin/su
Unable to chmod /system/xbin/su: Read-only file system
10|[email protected]:/ $
I also tried to copy su binary again to /data/local/tmp again to see if I can recreate su ownership/permission but I'm unable to do that as well
[email protected]:/data/local/tmp $ pwd
/data/local/tmp
[email protected]:/data/local/tmp $ ls -l
-rwxr-xr-x shell shell 1085140 2012-08-09 13:42 busybox
-rwxrwxrwx shell shell 91980 2008-02-28 22:33 su
[email protected]:/data/local/tmp $ chown 0.0 /data/local/tmp/su
Unable to chmod /data/local/tmp/su: Operation not permitted
Will redoing "Root MANY ANDROID!" solve this problem?
Click to expand...
Click to collapse
xdajunior,
Yes, both Root MANY ANDROID! and Qemu will solve your issues. Then you can take a peek
inside the batch files to see how they get the job done. Since you are in a pickle, you
really need these utilities. Be sure you download these utilities from our site, there are
minor bugs in the original versions. If you have any questions, let me know, I love to
teach people and would be willing to offer you some free phone support. This time
would be spent teaching you some of the aspects of the Kindle and Android. I
will be around all day tomorrow, from 11am to 10pm PST GMT -8. Sorry for the
delayed repose I was on an emergency call most of the afternoon.

Xiaomi Mi A2, auto reboot on usb power on

Hello people,
I need a xiaomi phone to boot when usb power is turned on.
Stock boot image
Android 9 PKQ1.180904.001.V10.0.8.0.PDIMIXM
What I tried so far:
#1 Battery animation file
I found some solutions for samsung smartphones modifing charger animation files.
system/bin/lpd
system/bin/lpod
--> Did not find such file. My /System/bin/ contains:
Code:
acpi dd input mknod rmdir tc-wrapper-1.0
am debuggerd insmod mkswap rmmod tee
app_process dex2oat ionice mktemp run-as telecom
app_process32 dexdiag iorenice modinfo runcon time
app_process64 dexdump ip modprobe schedtest timeout
applypatch dexlist ip-wrapper-1.0 monkey screencap tinycap
appops df ip6tables more screenrecord tinymix
appwidget diff ip6tables-restore mount secdiscard tinypcminfo
atrace dirname ip6tables-save mountpoint secilc tinyplay
awk dmesg ip6tables-wrapper-1.0 move_time_data.sh sed toolbox
base64 dos2unix iptables mv sendevent top
basename dpm iptables-restore ndc sensors_test touch
bcc du iptables-save ndc-wrapper-1.0 sensorservice toybox
blockdev dumpsys iptables-wrapper-1.0 netstat seq tr
bmgr echo iw newfs_msdos service true
bu egrep keystore_cli_v2 nice setenforce truncate
bugreport env kill nl setprop tty
bugreportz expand killall nohup setsid tzdatacheck
bunzip2 expr ld.mc oatdump settings uiautomator
bzcat fallocate linker od sh ulimit
bzip2 false linker64 paste sha1sum umount
cal fgrep linker_asan patch sha224sum uname
cat file linker_asan64 patchoat sha256sum uniq
chcon find ln perfetto sha384sum unix2dos
chgrp flock load_policy pgrep sha512sum update_engine_client
chmod fmt locksettings pidof simg2img uptime
chown free log ping sleep usleep
chroot getenforce logcat ping6 sm uudecode
chrt getevent logname pkill sort uuencode
cksum getprop logwrapper pm split vmstat
clear grep losetup pmap start vr
cmd groups ls ppd stat wc
cmp gunzip lshal printenv stop which
comm gzip lsmod printf strings whoami
content head lsof ps stty wigig_logcollector
cp hid lspci pvclicense_sample svc wigig_remoteserver
cpio host_manager_11ad lsusb pwd swapoff wigig_wiburn
crash_dump32 hostname md5sum readlink swapon wm
crash_dump64 hw media realpath sync xargs
curl hwclock microcom reboot sysctl xxd
cut id mkdir renice tac yes
dalvikvm ifconfig mkfifo requestsync tail zcat
dalvikvm32 ime mkfs.ext2 resize2fs tar
dalvikvm64 incident mkfs.ext3 restorecon taskset
date inotifyd mkfs.ext4 rm tc
#2 Ram Disk modification
I pulled the /System/bin/reboot file using adb shell and extracted the boot.img using android kitchen 3.5 from the forum.
Verified that everything works by unpacking/repacking/flasing boot image.
https://forum.xda-developers.com/showthread.php?t=2073775
- replaced the /ramdisk/sbin/charger file with the reboot file
--> battery animation is still there but nothing happens
- modified the charger file according to this discussion: https://forum.xda-developers.com/ga...-os-auto-boot-charge-connected-t3626364/page2
--> battery animation gone but stuck at google logo
- modified /ramdisk/init.rc and added:
on charger
trigger late-init
--> battery animation gone but stuck at google logo
- deleted /sbin/charger and charger service in init.rc and flashed image to both boot slots
--> changes nothing, battery animation will still show up.
- searched for battery/animation files / images in the ramdisk, but there seems to be nothing.
What else could I try?
Why isnt it working as expected?
Would flashing LineageOS or getting root access change anything?
UPDATE
--> here you can find a solution
[Q] Power on when plugged in (boot when docked)?
Many Greetings & Thanks alot,
himi

Categories

Resources