Custom boot.img - Click Android Development

Here you go, a boot.img with a custom default.prop & init.rc:
- ro.secure = 0, which means ADB running as root;
- /, /system, /data mounted as rw;
- /data/local/bin added to PATH, to ease usage of installed local commands.
Anyone wanting to use this should already now how to flash it by now
Update:
Version 2 of this boot image, that automatically loads tattoo-hack.ko, uploaded here http://forum.xda-developers.com/showpost.php?p=5792750&postcount=38.

thx,
Someone has tested? comment to be helping mainfram3

leon i go to test
mainfram3 thanks for you hard work

Thank you very much
adb push ./boot.mf3.img /sdcard
- Then, open a shell to your phone via 'adb shell', get root (type "su"), and do the following two commands to flash your new boot image:
# cat /dev/zero > /dev/mtd/mtd2
write: No space left on device [this is ok, you can ignore]
# flash_image boot /sdcard/boot.mf3.img
-Reboot
Is it right?

It´s work!!!! Thanks a lot mainfram3

chusen said:
It´s work!!!! Thanks a lot mainfram3
Click to expand...
Click to collapse
How have you installed it?

*.- adb shell
*.- su
*.- insmod /data/local/bin/tattoo-hack.ko
*.- mount -o rw,remount /dev/block/mtdblock5 /data
*.- mount -o rw,remount /dev/block/mtdblock3 /system
*.- chmod 755 /data/local/bin/flash_image
*.- /data/local/bin/flash_image boot /sdcard/boot.mf3.img
You need flash_image by mainfram3 in /data/local/bin

chusen said:
*.- adb shell
*.- su
*.- insmod /data/local/bin/tattoo-hack.ko
*.- mount -o rw,remount /dev/block/mtdblock5 /data
*.- mount -o rw,remount /dev/block/mtdblock3 /system
*.- chmod 755 /data/local/bin/flash_image
*.- /data/local/bin/flash_image boot /sdcard/boot.mf3.img
You need flash_image by mainfram3 in /data/local/bin
Click to expand...
Click to collapse
Thank you chusen

I got this:
Code:
# /data/local/bin/flash_image boot /sdcard/boot.mf3.img
/data/local/bin/flash_image boot /sdcard/boot.mf3.img
mtd: read error at 0x00000000 (Cannot allocate memory)
.............
mtd: read error at 0x00160000 (Cannot allocate memory)
flashing boot from /sdcard/boot.mf3.img
#
It is correct?

svprm said:
I got this:
Code:
# /data/local/bin/flash_image boot /sdcard/boot.mf3.img
/data/local/bin/flash_image boot /sdcard/boot.mf3.img
mtd: read error at 0x00000000 (Cannot allocate memory)
.............
mtd: read error at 0x00160000 (Cannot allocate memory)
flashing boot from /sdcard/boot.mf3.img
#
It is correct?
Click to expand...
Click to collapse
mmmm.. i think no but i dont help you sorry

Now when i go to "adb shell"
It directly go to "#"

works fine here too.
Is it safe now to delete from /data/local/bin m7, su, flash_image etc, or needed to be there?

svprm said:
Now when i go to "adb shell"
It directly go to "#"
Click to expand...
Click to collapse
mmmm.....then is correctly? any dev can help he?

mainfram3 said:
- ro.secure = 0, which means ADB running as root;
Click to expand...
Click to collapse
If you're getting a root shell, than the image is working as intended

Thanks mainfram3, works as stated

Hi
Good work Mainfram3. Congratulations.
Sorry for my English. I'm Spanish.
adb shell ----> # ---->"root"
But there is a problem. to change something in /system runs out of space.
Tested with "df" command.
before:
/system: 153600K total, 142156K used, 11444K available (block size 4096)
after:
/system: 153600K total, 153600K used, 0K available (block size 4096)
Editar/Borrar Mensaje
EDIT:
This also happened before with M7 hack.
bye

mainfram3:
Hi, how did you repack the boot.img? Repacking it as thisWiki discribed seems not working.

maverixx said:
Hi
Good work Mainfram3. Congratulations.
Sorry for my English. I'm Spanish.
adb shell ----> # ---->"root"
But there is a problem. to change something in /system runs out of space.
Tested with "df" command.
before:
/system: 153600K total, 142156K used, 11444K available (block size 4096)
after:
/system: 153600K total, 153600K used, 0K available (block size 4096)
Editar/Borrar Mensaje
EDIT:
This also happened before with M7 hack.
bye
Click to expand...
Click to collapse
I think you didn't use the tattoo-hack.ko kernel module - right? Take some time and read here: http://forum.xda-developers.com/showthread.php?t=635961 - first post under "Other developer stuff"...
-bm-

I know perfectly this post.
If system is RW is assumed that the tattoo-hack.ko module is loaded.
even by executing:
insmod /data/local/bin/tattoo-hack.ko
mount -o rw,remount /dev/block/mtdblock3 /system
it is the same.
Thanks

@mainfram3: yo can modify boot.mf3.img to load tattoo-hack.ko at star?thanks in advance

Related

[SOLVED]help creating persistent swap partition.

I am using CyanogenMod v3.6.8.1 and I decided I wanted a swap partition.
I partitioned my 2GB SD with a 32MB swap partition and formatted using gparted.
From the shell (using adb) I remounted /dev/block/mtdblock3 with rw and edited /system/etc/fstab and added a line for the swap. Here is what the entire file looks like now:
Code:
/dev/block/mtdblock3 /system yaffs2 rw
/dev/block/mtdblock4 /cache yaffs2 rw
/dev/block/mtdblock5 /data yaffs2 rw
/dev/block/mmcblk0p1 /sdcard vfat rw
/dev/block/mmcblk0p2 /system/sd auto rw
/dev/block/mmcblk0p3 none swap sw
/system/modules/modules.sqf /system/modules squashfs ro,loop
/system/xbin/xbin.sqf /system/xbin squashfs ro,loop
I can turn on the swap with 'swapon -a' which works and shows up in /proc/swaps and with the 'free' command, but upon boot, swap isn't activating.
I'm not really familiar with the android init scripts, so I'm not sure how I can enable the swap automatically upon boot. Any advice would be appreciated.
Okay I fixed it.
I downloaded one of Drizzy's roms that I know use swap, extracted, and searched for 'swap' in all the files. I found it in /system/bin/a2sd at the end. Here is what's there:
Code:
if [ -n /dev/block/mmcblk0p3 ];
then
mkswap /dev/block/mmcblk0p3;
fi;
if [ -e /dev/block/mmcblk0p3 ];
then
echo 30 > /proc/sys/vm/swappiness;
swapon /dev/block/mmcblk0p3;
fi;
The first if doesn't make sense to me as it's a string test which will always be true, so I got rid of it and just kept the test for the file existing, but I changed it to -b to be a little more specific (to see if it's a block device), and I commented out the swappiness change to leave it at default.
Im using same rom and i woild love to do this but is there any other way as im totally unfamiliar with adb
turboyo said:
Im using same rom and i woild love to do this but is there any other way as im totally unfamiliar with adb
Click to expand...
Click to collapse
I just used adb because I can use the copy/paste function of my gnome terminal and it's easier than using the shell on the phone itself.
Here is what is needed:
Get into a root shell, either on the phone or using adb.
Code:
mount -t yaffs2 -o rw,remount /dev/block/mtdblock3 /system
vi /system/bin/a2sd
press capital G which will take you to the bottom of the file
press lower case o which will open a line below your cursor for editing.
type in the following:
Code:
if [ -b /dev/block/mmcblk0p3 ];
then
echo 30 > /proc/sys/vm/swappiness;
swapon /dev/block/mmcblk0p3;
fi;
press escape to exit insert mode (I read that in the terminal emulator you have to hold the trackball and press 1 for esc)
type :wq and press enter.
exit terminal and reboot. To see if it's working, get back into a terminal and use the command 'free'
you can also do 'swapon -a' instead of specifying the swap partition itself. Note that the above example uses the third partition of the SD card as the swap.
This also assumes you have already created the swap partition and formatted it as swap.
You can omit the swappiness line to leave it at the linux default of 60.

[Q] Improved Refresh-Rate on 2.1?

Per the Nookie Froyo thread they have a suggestion to increase the refresh rate to 68000 to stop/reduce flicker.
I noticed a similar flicker on "stock" 2.1 and checked /sys/devices/omapdss/display0/timings only to find out it is also set at 48000. I increased it to 68000, but it is reset after each reboot.
What is the proper refresh rate? Anyone else notice a flicker on the stock ROM?
jleecong said:
Per the Nookie Froyo thread they have a suggestion to increase the refresh rate to 68000 to stop/reduce flicker.
I noticed a similar flicker on "stock" 2.1 and checked /sys/devices/omapdss/display0/timings only to find out it is also set at 48000. I increased it to 68000, but it is reset after each reboot.
What is the proper refresh rate? Anyone else notice a flicker on the stock ROM?
Click to expand...
Click to collapse
what process did you use to modify the file?
paleh0rse said:
what process did you use to modify the file?
Click to expand...
Click to collapse
I used the following from the thread I linked.
Code:
adb shell echo 68000,1024/70/200/40,600/10/11/10 > /sys/devices/omapdss/display0/timings
jleecong said:
I used the following from the thread I linked.
Code:
adb shell echo 68000,1024/70/200/40,600/10/11/10 > /sys/devices/omapdss/display0/timings
Click to expand...
Click to collapse
Did you su and mount as r/w first?
paleh0rse said:
Did you su and mount as r/w first?
Click to expand...
Click to collapse
You don't remount /sys
so does anyone know how to make this stick after boot?
dennisi01 said:
so does anyone know how to make this stick after boot?
Click to expand...
Click to collapse
See the thread I just made: http://forum.xda-developers.com/showthread.php?t=901791
jleecong said:
I used the following from the thread I linked.
Code:
adb shell echo 68000,1024/70/200/40,600/10/11/10 > /sys/devices/omapdss/display0/timings
Click to expand...
Click to collapse
Originally Posted by dennisi01
so does anyone know how to make this stick after boot?
See the thread I just made: http://forum.xda-developers.com/showthread.php?t=901791
Click to expand...
Click to collapse
Thank you both. Seems to work. Now I know how to run my own scripts afterboot.
Does that mean we add the
adb shell echo 68000,1024/70/200/40,600/10/11/10 > /sys/devices/omapdss/display0/timings
Click to expand...
Click to collapse
at the end of the clrbootcount.sh text to have it run that command to fix the refresh and make it stick?
I did this (as I posted in the nook flicker thread):
I did a CAT on immediately after, and it had defaulted instead to 66461 instead of 68000 (maximum rate for the chip?)
Of course it also cleared upon reboot. Should I have seen a flicker improvement right away?
After clearing up all the posted suggestions listed here is what worked for me
greenmky said:
I did this (as I posted in the nook flicker thread):
I did a CAT on immediately after, and it had defaulted instead to 66461 instead of 68000 (maximum rate for the chip?)
Of course it also cleared upon reboot. Should I have seen a flicker improvement right away?
Click to expand...
Click to collapse
I also get 66461
------------------------
increase the refresh rate to 68000/66461 to stop/reduce flicker.
---------------------------------------------------------------------------
adb pull /system/bin/clrbootcount.sh
gedit clrbootcount.sh (assume you stay in specific dir)
add this to end of file and save
---------------------------------------------------
#run other commands
setprop persist.service.mount.umsauto 0
---------------------------------------------------
NEXT
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
--------------
NEXT
adb shell - NOW AT THE su # PROMPT (HAD NO LUCK WITH THE ADB SHELL and then commands all in one line)
cat /sys/devices/omapdss/display0/timings
mount -o remount,rw /dev/block/mmcblk0p5 /system
chmod 0755 /sys/devices/omapdss/display0/timings
echo 68000,1024/70/200/40,600/10/11/10 > /sys/devices/omapdss/display0/timings
mount -o ro,remount -t ext2 /dev/block/mmcblk0p5 /system
reboot
-----------------------------------------------
NEXT
cat /sys/devices/omapdss/display0/timings
66461,1024/70/200/40,600/10/11/10
----------------------------------------------
Three reboots and I still have the changes...
Read all the posting listed if you want/need more details....
here.david said:
adb shell - NOW AT THE su # PROMPT (HAD NO LUCK WITH THE ADB SHELL and then commands all in one line)
cat /sys/devices/omapdss/display0/timings
mount -o remount,rw /dev/block/mmcblk0p5 /system
chmod 0755 /sys/devices/omapdss/display0/timings
echo 68000,1024/70/200/40,600/10/11/10 > /sys/devices/omapdss/display0/timings
mount -o ro,remount -t ext2 /dev/block/mmcblk0p5 /system
reboot
Click to expand...
Click to collapse
You do not need to remount /system to write to /sys, and if you have chmod at all (unlikely) it would not be 755, it would be 644.
here.david said:
I also get 66461
------------------------
increase the refresh rate to 68000/66461 to stop/reduce flicker.
---------------------------------------------------------------------------
adb pull /system/bin/clrbootcount.sh
gedit clrbootcount.sh (assume you stay in specific dir)
add this to end of file and save
---------------------------------------------------
#run other commands
setprop persist.service.mount.umsauto 0
---------------------------------------------------
NEXT
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
--------------
NEXT
adb shell - NOW AT THE su # PROMPT (HAD NO LUCK WITH THE ADB SHELL and then commands all in one line)
cat /sys/devices/omapdss/display0/timings
mount -o remount,rw /dev/block/mmcblk0p5 /system
chmod 0755 /sys/devices/omapdss/display0/timings
echo 68000,1024/70/200/40,600/10/11/10 > /sys/devices/omapdss/display0/timings
mount -o ro,remount -t ext2 /dev/block/mmcblk0p5 /system
reboot
-----------------------------------------------
NEXT
cat /sys/devices/omapdss/display0/timings
66461,1024/70/200/40,600/10/11/10
----------------------------------------------
Three reboots and I still have the changes...
Read all the posting listed if you want/need more details....
Click to expand...
Click to collapse
Tried all that and it did not stick. The final CAT showed a reversion to 48000. Still don't understand how the change to the clrbootcount.sh is supposed to make it stick but it isn't working.
DatterBoy said:
Tried all that and it did not stick. The final CAT showed a reversion to 48000. Still don't understand how the change to the clrbootcount.sh is supposed to make it stick but it isn't working.
Click to expand...
Click to collapse
It wouldn't. The change to the clrbootcount.sh only changes the automount, the change to the /sys var is completely temporary. I assume one could also put it in the clrbootcount.sh, assuming it isn't modified later by the system (negating the change made from the clrbootcount.sh script).
Yeah. not sure how anyone is getting this to work but i can't figure it out. As a warning, modifying the clrbootcount.sh and trying to incorporate the fefresh change script has force firmware into boot loop to needing a factory reset twice now. Wonder if anyone else had the same experience.
The flicker is annoying and the refresh change works, but just won't stick.
To get it to stick, follow the steps on my other thread http://forum.xda-developers.com/showthread.php?t=901791.
When you edit clrbootcount.sh, add the following to the end:
Code:
echo 68000,1024/70/200/40,600/10/11/10 > /sys/devices/omapdss/display0/timings
The final file (if you also want to disable automounting), will look like:
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
While I've never really looked at this, but isn't the "refresh" "rate" largely irrelevant with LCD based screens? I'd always just assumed that even assigning them a "refresh" "rate" was just a place holder to make things work and not break CRT compatibility in drivers/display engines.
Did all this from a super clean root. Did not hold.
cutterjohn said:
While I've never really looked at this, but isn't the "refresh" "rate" largely irrelevant with LCD based screens? I'd always just assumed that even assigning them a "refresh" "rate" was just a place holder to make things work and not break CRT compatibility in drivers/display engines.
Click to expand...
Click to collapse
Don't know if that is true, but I have seen flicker on other LCD panels that could be addressed with refresh changes. The echo command does work instantly on the NC but just won't hold for me.
I have been playing with this and while the changes in clrbootcount.sh do stick, I'm unable to get it to either set the refresh rate or run a script that sets the refresh that I KNOW works from the terminal. Seems idealy this should be set in the ROM. Back to the terminal...
I should add I'm running 1.0.1 (Auto-Nooter 2.12.25) and also tried it in Nookie Froyo.

EXT4/RFS problem

So I decided to try JVH because it looked cool. I got Tweaky's JVH rom and flashed that up. Converted to EXT4 and was everything worked. Somehow I flashed an update of his rom that had voodoo's kernel in there and it converted my internal memory to EXT4 on top of it being EXT4 already. I just flashed voodoo's kernel and it has said it disabled the lag fix, but EXT4 tools still can't access my sd card (everything is grayed out) so I can't confirm anything at all, and the phone acts erratically some times (apps are downloaded and installed but don't show up at all)
TLDR:
Something weird happened and now im on JVH without being able to confirm whether or not a lagfix is enabled (voodoo said it disabled a lagfix and CF Root can't read my internal memory)
Any help?
I think if you open up an adb shell and type 'mount' it should tell you what filesystem you're using.
i get some weird segmentation fault error
Code:
* daemon not running. starting it now *
* daemon started successfully *
$ mount
mount
Segmentation fault
$ help
help
help: not found
$ /?
/?
/d: permission denied
$ ?
?
d: not found
$ #
#
$ #mount
#mount
$ #mount
#mount
$ su
su
#su
#su
su
su
#su
#su
Permission denied
$ #su
$ su
# #su
# mount
mount
Segmentation fault
# umount
umount
Segmentation fault
# mount
mount
Segmentation fault
# echo /dev/block/mmcblk0 > /sys/devices/platform/s3c-usbgadget/gadget/lun1/file
echo /dev/block/mmcblk0 > /sys/devices/platform/s3c-usbgadget/gadget/lun1/file
cannot create /sys/devices/platform/s3c-usbgadget/gadget/lun1/file: directory no
nexistent
# dd if=/dev/zero of=/dev/mmcblk0p1
dd if=/dev/zero of=/dev/mmcblk0p1
ddd: writing '/dev/mmcblk0p1': No space left on device
336617+0 records in
336616+0 records out
172347392 bytes (164.4MB) copied, 4.479194 seconds, 36.7MB/s
# mount
dmount
dmount: not found
# mount
mount
Segmentation fault
# umount /dev/block/mmcblk0p1
umount /dev/block/mmcblk0p1
Segmentation fault
# mount /dev/block/mmcblk0p1
mount /dev/block/mmcblk0p1
Segmentation fault
# mount
mount
Segmentation fault
# ls
ls
Segmentation fault
# dd if=/dev/zero of=/dev/mmcblk0p1
dd if=/dev/zero of=/dev/mmcblk0p1
dd: writing '/dev/mmcblk0p1': No space left on device
336617+0 records in
336616+0 records out
172347392 bytes (164.4MB) copied, 2.161554 seconds, 76.0MB/s
# fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Segmentation fault
#
hey can u tell me how to convert the file system to ext4. Please i m desparate...
supershailz said:
hey can u tell me how to convert the file system to ext4. Please i m desparate...
Click to expand...
Click to collapse
I think it would be a really good help if you provided some details.
What kernal have you used?
I would go for clean ezbase flash, that will get you back and working, then just flash kernel, then rom and try again
Sent from gt i9000 insanity 8.5/fugumod

[BRAINSTORM] Booting directly into recovery

For reference, these are my thoughts on the matter.
We have 3 ways to do this:
1. Get hold of SBL, change it and flash it
Currently impossible afaik.
2. Get an init.d bash script to reboot into recovery if key is pressed
Most likely possible taking these 2 assumptions into account:
a) Bash allows to detect a pressed key, something like this:
Code:
_key()
{
local kp
ESC=$'\e'
_KEY=
read -d '' -sn1 _KEY
case $_KEY in
"$ESC")
while read -d '' -sn1 -t1 kp
do
_KEY=$_KEY$kp
case $kp in
[a-zA-NP-Z~]) break;;
esac
done
;;
esac
printf -v "${1:-_KEY}" "%s" "$_KEY"
}
_key x
case $x in
$'\e[15~') reboot recovery ;;
esac
Replacing this key code for one of OB's.
But for this, we need assumption number 2:
b) Key codes mapping is the same for recoveries.
Now, while this is the method of the greatest chance to work, it is also fairly useless. Developers will often break the boot before the init.d scripts are ran. So, this code should be ran before. Hence, the third method.
3. Start a custom service in init.rc (@ ramdisk) that will detect pressed key
This would be the perfect solution as it can't be broken from kernel (zImage) or system changes. However, init.rc has its own programming language (android init language) and there's no way to run this kind of listener.
However, it is possible to run an external script located for example in /system/bin/. These can be both an executable compiled from c (higher chances of working) or a bash scripting like the aforementioned one (lower chances of working since android probably doesn't start a console on boot).
Code for this would be something like:
Code:
service exampleservice /system/bin/exampleservice
user exampleservice
group exampleservice
oneshot
So uh, am I missing anything?
Anyone has other ideas?
a lot of times i heared about pressing "G" and "Power" would boot into some kind of save mode... if thats true i guess its easyer to reprogramm that keycombo to do something else... so does that keycombo anything? i couldnt figure out^^
Sent from my LG-P970 using XDA App
Are others devices has the key combination code in SBL?
I wish I have enough knowledge about android system so i can help...
i04055 said:
Are others devices has the key combination code in SBL?
I wish I have enough knowledge about android system so i can help...
Click to expand...
Click to collapse
Yes there are devices heaving the key-combo in SBL if that answers your question. The "Samsung Galaxy S GT-I9000" e.g. has them there afaik. With that device it was possible flashing the SBL to add a "booting directly into recovery" key-combo...
So I don´t know why there should not be a solution to do the same to the OB but Noejn surely has good reason for telling its impossible.
But hey what about booting into recovery on every system startup and only boot into the system through the recovery? It´s a "quick & dirty" solution even if its possible but better than developing the way we do isn´t it? I´m not sure if its easier to change the startup that way than to add or modify a key-combo but maybe someone here does?
I'm sure (or hope..) someone can, but perhaps we should move this Thread to another part of the Forum so someone with the knowledge how to do this will read it.
d0n22 said:
But hey what about booting into recovery on every system startup and only boot into the system through the recovery? It´s a "quick & dirty" solution even if its possible but better than developing the way we do isn´t it? I´m not sure if its easier to change the startup that way than to add or modify a key-combo but maybe someone here does?
Click to expand...
Click to collapse
Yeah, i prefer that way if poosibble rather than nothing.
But if put it that way, when the phone get bootloop is it still posibbe to boot into recovery?
Sent from my LG-P970 using XDA App
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
racht said:
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
Click to expand...
Click to collapse
yeah ,from this we can see what is running before logo screen and we can mod that file
so.. is that mean we can boot to recovery mode same as x8?
racht said:
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
Click to expand...
Click to collapse
soundes quite promising... have you tried it?
Can this be usefull?
http://forum.xda-developers.com/showthread.php?t=991276
Noejn have you abandoned us ? Or are u planning to take a look at this ? Would be nice if u get OB up and running
recovery
Hi,
has there been any success with booting into recovery mode?
BR,
J
logitec said:
Hi,
has there been any success with booting into recovery mode?
BR,
J
Click to expand...
Click to collapse
No,I try to boot directly into recovery through boot.img,but I get a big "error" form the LG Security Team!
Hijacking a daemon would work if Optimus Black had those binaries. I took a quick glance at a backup and I didn't see chargemon in /system/bin.
Besides, a xRecovery is limited as it's dependent on system files so a /format can't be done which isn't really that "comfy", especially when changing fs.
But yeah, better than nothing. Still, the method you described is only possible in Xperia phones, as far as I know.
I still say injecting a service on the init.rc is the way to go.
However, I can't test this now.
racht said:
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
Click to expand...
Click to collapse
Good news, I'm getting close.
ok, thank you for everithing
Noejn said:
Good news, I'm getting close.
Click to expand...
Click to collapse
good news indeed^^ im working on it as well but im not feeling like getting close :-\ pls let me know what you did and how you did it as soon as its done... again thank you very much for your efforts!
Sent from my LG-P970 using XDA App
d0n22 said:
good news indeed^^ im working on it as well but im not feeling like getting close :-\ pls let me know what you did and how you did it as soon as its done... again thank you very much for your efforts!
Sent from my LG-P970 using XDA App
Click to expand...
Click to collapse
Well, I've succeed injecting the script on boot.
However, I'm getting some problems on the event0 > keycheck; I don't think at this time of boot /dev entries are up.
But I've already thought of a workaround and I'll test it tomorrow.
I´m thinking, if i compile kernel of ubuntu and install it in recovery partition, not possible then run ubuntu in native mode from sdcard with dualboot?

[Q] CWR Error: Can't mount /cache

I get this error in CWR (3.2.0.1), I have a nook with a blue sticker:
Code:
E:Can't mount /cache/recovery/command
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/command
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/command
Nothing, and I mean Nothing I have found in this forum solved this error, including the repartition-boot-stock+factory rest.
Any help guys? I am desperate!
adb is working but shell is not
This is what I got, anyone has an idea how to recover from this?
Code:
C:\Users\Barak>adb shell
- exec '/system/bin/sh' failed: No such file or directory (2) -
reifba said:
This is what I got, anyone has an idea how to recover from this?
Code:
C:\Users\Barak>adb shell
- exec '/system/bin/sh' failed: No such file or directory (2) -
Click to expand...
Click to collapse
Nothing, and I mean Nothing I have found in this forum solved this error, including the repartition-boot-stock+factory rest.
Click to expand...
Click to collapse
If you repartitioned, that may be the reason the adb command is not working....
patruns said:
If you repartitioned, that may be the reason the adb command is not working....
Click to expand...
Click to collapse
So I have 2 two problems in which the solution to one causes the other...
In the mean time I manged to run both the Froyo and HoneyComb from the sd card, but not the CM7 (which is the one I am trying to install on the internal memory)
using ADB to restore
I tried to use the methods described in:
:http://forum.xda-developers.com/showthread.php?t=919353
However it is not clear where should the factory.zip go?
for some reason it also says that the /dev partition is only 244MB so I cannot flash the system.img, it is probably the partition in the SD card and not the memory, so not much advancement here either. I also think that because it gives me 11223344556677 as the S/N and not the real one.
The quest to restore the nook continues...
Is there a way to manually repartition through ADB?
or anything? cause nothing solves the first error posted in this thread
reifba said:
I tried to use the methods described in:
:http://forum.xda-developers.com/showthread.php?t=919353
However it is not clear where should the factory.zip go?
for some reason it also says that the /dev partition is only 244MB so I cannot flash the system.img, it is probably the partition in the SD card and not the memory, so not much advancement here either. I also think that because it gives me 11223344556677 as the S/N and not the real one.
The quest to restore the nook continues...
Click to expand...
Click to collapse
factory.zip and rombackup.zip should be located on /dev/block/mmcblk0p3
system should be written to /dev/block/mmcblk0p5
1123344556677 is normal for the device listing when adb'ing in when running CWM on the uSD
to write the img files you need to use:
dd if=(IMG FILE ON SD) of=(PARTITION ON /dev... i.e. /dev/block/mmcblk0p1)
to help you out...here's a list of what goes where:
mmcblk0p1-boot.img
mmcblk0p2-rom.img
mmcblk0p3-factory.img
mmcblk0p4-logical.img
mmcblk0p5-system.img
mmcblk0p6-data.img
mmcblk0p7-cache.img
mmcblk0p8-media.img
problem:
thanks for the reply, I am studying more about andriod and adb now than during all my bachelor's.
just
adb push factory.zip /dev/block/mmcblk0p3 ??
and
adb shell dd if=/sdcard/boot.img of=/dev/block/mmcblk0p1
(in some places I saw they didn't write "/block")
and where is rombackup.zip from?
the problem is that for some reason /dev/ is only 244MB so I can't dd system.img, only the boot.img.
I wish that somewhere in the world would exist something that solves it from CWR, just some zip I would install to fix boot+factory+system in one stroke...
reifba said:
thanks for the reply, I am studying more about andriod and adb now than during all my bachelor's.
just
adb push factory.zip /dev/block/mmcblk0p3 ??
and
adb shell dd if=/sdcard/boot.img of=/dev/block/mmcblk0p1
(in some places I saw they didn't write "/block")
and where is rombackup.zip from?
the problem is that for some reason /dev/ is only 244MB so I can't dd system.img, only the boot.img.
I wish that somewhere in the world would exist something that solves it from CWR, just some zip I would install to fix boot+factory+system in one stroke...
Click to expand...
Click to collapse
to get factory and rombackup zip files on mmcblk0p3...
adb shell mkdir /sdcard/tmp3
adb shell mount /dev/block/mmcblk0p3 /sdcard/tmp3
adb push factory.zip /sdcard/tmp3
adb push rombackup.zip /sdcard/tmp3
more problems (desperation is looming)
DizzyDen said:
adb shell mount /dev/block/mmcblk0p3 /sdcard/tmp3
Click to expand...
Click to collapse
when I type the above I get
Code:
[email protected]:/ # mount /dev/block/mmcblk0p3 /sdcard/tmp3
Usage: mount [-r] [-w] [-o options] [-t type] device directory
I had to do it in the shell in order to su.
reifba said:
when I type the above I get
Code:
[email protected]:/ # mount /dev/block/mmcblk0p3 /sdcard/tmp3
Usage: mount [-r] [-w] [-o options] [-t type] device directory
I had to do it in the shell in order to su.
Click to expand...
Click to collapse
then I would use
mount rw /dev/block/mmcblk0p3 /sdcard/tmp3
If that doesn't work:
mount rw -o remout /dev/bloc/mmcblk0p3 /sdcard/tmp3
but it would appear something else is amiss... since it even shows the command should have worked... since everything other than the command (mount) the device (/dev/block/mmcblk0p3) and directory (/sdcard/tmp3) are optional parameters

Categories

Resources