I have carefully researched HTCdev bootloader unlock process and found next:
1. Completely erases (filling 0x00) mmcblk0p23 (data).
2. All files deleted from /cache/ partition (but partition itself NOT fills with 0x00).
3. On partition mmcblk0p16 erases (overwriting with 0x00) 10 bytes at offset 0xA0 (mine was "3.08.401.1").
4. In paritions mmcblk0p16 and mmcblk0p31 written 0x01 at offset 0xC40 (was 0x00). I don't know what is it, but maybe it's related to "unlocked" bootloader problems.
5. In partition mmcblk0p3 at offset 0x424 written 4 bytes, replacing existing values: 0x74B50109 (was 0x4ED7B921) - it's not text string.
6. In partition mmcblk0p3 at offset 0x8404 written 4 bytes: HTCU.
On relocking bootloader using fastboot oem lock i seen following changes:
1. In partition mmcblk0p3 at offset 0x424 written 4 bytes, replacing existing values: 0xE6D84D2B - it's not text string.
2. In partition mmcblk0p3 at offset 0x8404 written 4 bytes: HTCL.
BUT!
to really unlock bootloader (checked if it's only text in BOOT changed or really unlocked by command fastboot boot boot.img, on locked I got FAILED (remote: not allowed)) You need do only last steps, writting into parttion mmcblk0p3 at offset 0x8404 HTCU for unlocked, HTCL for relocked or 0x00000000 for locked.
read partition image using terminal commands
su (and gain root access to terminal)
dd if=/dev/block/mmcblk0p3 of=/sdcard/mmcblk0p3.img
then mount SDCARD to PC over USB and edit mmcblk0p3 using WinHEX or another HEX editor, jump to offset 0x8404 and write HTCU for unlocked, HTCL for relocked or 0x00000000 for locked.
Then umount SDCARD from PC and write modified partition image back to phone memory using command
dd if=/sdcard/mmcblk0p3.img of=/dev/block/mmcblk0p3
That's all. Please post Your zipped mmcblk0p3.img files with HBOOT/firmware/radio/baseband version descriptions to find if 5 bytes at offset 0x424 same for all phones, or individual.
Thank You!
P.S. I have HBOOT 1.49.0018. mmcblk0p3 is 31.6Mib, but zips to ~32Kb
It sounds interesting, but could you please simplify the whole process and write a detailed instruction how to do it?
Interested in this method aswell.
Could it work on hboot 1.53 also?
Sent from my shooteru using xda premium
phikal said:
Interested in this method aswell.
Could it work on hboot 1.53 also?
Sent from my shooteru using xda premium
Click to expand...
Click to collapse
I don't know. If somebody with unlocked or relocked bootloader and 1.53 HBOOT can provide image of this partition - we can just look for this strings and find this string. offset may differs, but I think it's same for all hboots.
Thank God for $amsung !
Sent from the man in Your attic.....
At 0x424 -- 74 b5 01 09 01
HTCU at 0x8404
Unlocked soff 1.49.007
Latest radio 11.25.3504.06_M
Blk16 at 0xa0 just zeros
Odesláno z mého PG8600 pomocí Tapatalk 2
New motherboard
Hi
I just recover my phone from HTC with a new motherboard and hboot 1.53.
How can I help ? I am under linux but dd isn't my favorite command. is there a way to have a .sh or smth ?
I am just desperate for this.
Thanks in advance.
I recieved some images of this partition fom mine russian friends and compared them. Here is results:
4 bytes at offest 0x824 are unique for every phone. There is "simlock" string near this bytes. I think it's used to generate sim lock code.
4 bytes at offset 0x424 are unique for every unlocked or relocked phone. I recieved only one image from locked phone, but this bytes was same for mine and that image. It's too little to be sure, but it's looks like it's same for every locked phone. it's 0x4ED7B921
16 bytes at offset 0x9400 - unique for every phone
another 16 bytes at offset 0x9410 repeats 265 times (until 0xA49F) and unique for every phone. - 4040 bytes at all.
previous 16 bytes again at offset 0xA800 repeats 32 times (until 0xA9FF) and unique for every phone. 512 bytes at all.
Grea09 said:
Hi
I just recover my phone from HTC with a new motherboard and hboot 1.53.
How can I help ? I am under linux but dd isn't my favorite command. is there a way to have a .sh or smth ?
I am just desperate for this.
Thanks in advance.
Click to expand...
Click to collapse
Are You have wire-trick s-off? Phones with new motherboard are much more interesting than stock.
I have one image of mmcblk0p3 partition from such phone. There is some more differences in it, comparing to stock phone:
4 bytes at offset 0xC24 (near "simunlock"string - at all other images those bytes was same.
256 bytes at offset 0xAD00 - all other images had 0x00 at this offset. It's NOT Unlock_code.bin.
previous 256 bytes again at offset 0xB100 - again same 256 bytes. All other images had 0x00 at this offset. It's still NOT Unlock_code.bin.
Here is Bash script. Correct ADB= string to which adb output for Your system or full path to adb binary, then save it as adbflasher, then chmod +x adbflasher
Connect Your S-OFF Evo 3D to PC and run ./adbflasher read security_record security_record.img - this will be mmcblk0p3 partition image.
Code:
#!/bin/bash
set -x
E_WRONGCOMMAND=65
E_WRONGPARTITION=66
E_ERASE=67
ADB="/opt/android-sdk-update-manager/platform-tools/adb"
fs_write() {
echo fs_write $*
local param_fs=$1
local param_file=$2
local param_device=$3
exportfs none
exportfs $param_fs
device_detect $param_device
sudo pv $param_file|dd of=$device bs=65536
sync
exportfs none
}
fs_read() {
echo fs_read $*
local param_fs=$1
local param_file=$2
local param_device=$3
exportfs none
echo calling exportfs $param_fs
exportfs $param_fs
echo calling device_detect
device_detect $param_device
sudo pv $device |dd of=$param_file bs=65536 &
exportfs none
}
fs_erase() {
echo fs_erase $*
local param_fs=$1
local param_device=$2
case $param_fs in
security_record) echo Erasing partition $param_fs not allowed: it may brick Your phone!; exit $E_ERASE;;
hboot) echo Erasing partition $param_fs not allowed: it will brick Your phone!; exit $E_ERASE;;
emmc) echo Erasing partition $param_fs not allowed: it will brick Your phone!; exit $E_ERASE;;
none) echo Unable to erase partition $param_fs!; exit $E_ERASE;;
*) fs_write $param_fs /dev/zero $param_device ;;
esac
}
exportfs() {
echo exportfs $*
case $1 in
security_record) partition=/dev/block/mmcblk0p3;;
hboot) partition=/dev/block/mmcblk0p12;;
radio) partition=/dev/block/mmcblk0p17;;
adsp) partition=/dev/block/mmcblk0p19;;
boot) partition=/dev/block/mmcblk0p20;;
recovery) partition=/dev/block/mmcblk0p21;;
system) partition=/dev/block/mmcblk0p22;;
data) partition=/dev/block/mmcblk0p23;;
cache) partition=/dev/block/mmcblk0p24;;
devlog) partition=/dev/block/mmcblk0p27;;
emmc) partition=/dev/block/mmcblk0;;
sdcard) partition=/dev/block/mmcblk1;;
none) partition="none";;
*) echo Wrong partition: $1; exit $E_WRONGPARTITION;;
esac
legacy="/sys/devices/platform/usb_mass_storage/lun0/file"
recent="/sys/devices/platform/msm_otg/msm_hsusb/gadget/lun0/file"
until $ADB shell "echo $partition > $legacy" ; do sleep 1;done
until $ADB shell "echo $partition > $recent" ; do sleep 1;done
until $ADB shell "echo $partition |su -c \"tee $legacy\"" ; do sleep 1;done
until $ADB shell "echo $partition |su -c \"tee $recent\"" ; do sleep 1;done
echo exportfs $* done
}
device_detect() {
echo "device_detect $*"
device=`find /dev/disk/by-id/|grep -i Android|sort|head -n 1` ## TODO: write better detect function!
if [[ "z$1" != "z" ]] ;then device=$1; fi
}
usage() {
echo "Usage: adbflasher flash hdsp boot.img [device_to_flash]
adbflasher flash recovery recovery.img [device_to_flash]
adbflasher flash radio radio.img [device_to_flash]
adbflasher flash hboot hboot.img [device_to_flash] ## Dangerous!
adbflasher flash adsp adsp.img [device_to_flash]
adbflasher flash emmc emmc.img [device_to_flash] ## Extremly dangerous! DO NOT FLASH ANY FILE EXCEPT YOUR HAVE READ FROM YOUR PHONE EARLIER!
adbflasher exportfs {hboot|radio|adsp|boot|recovery|system|data|cache|devlog|emmc|sdcard|none}
## Might br dangerous! ALWAYS do exportfs none before exportfs another partition!
adbflasher read {security_record|hboot|radio|adsp|boot|recovery|system|data|cache|devlog|emmc|sdcard|none} filename.img [device_to_read]
adbflasher erase {radio|adsp|boot|recovery|system|data|cache|devlog|sdcard} [device_to_erase]"
}
if [[ $# -eq 0 ]] ;then usage; exit $E_WRONGCOMMAND; fi
case $1 in
exportfs) exportfs $2 ;;
erase) fs_erase $2 $3 |exit $? ;;
read) fs_read $2 $3 $4 |exit $? ;;
flash) fs_write $2 $3 $4 |exit $? ;;
*) echo "Wrong command: $1"; usage; exit $E_WRONGCOMMAND ;;
esac
#until /opt/android-sdk-update-manager/platform-tools/adb reboot ; do sleep 1;done
S-trace said:
I recieved some images of this partition fom mine russian friends and compared them. Here is results:
4 bytes at offest 0x824 are unique for every phone. There is "simlock" string near this bytes. I think it's used to generate sim lock code.
4 bytes at offset 0x424 are unique for every unlocked or relocked phone. I recieved only one image from locked phone, but this bytes was same for mine and that image. It's too little to be sure, but it's looks like it's same for every locked phone. it's 0x4ED7B921
16 bytes at offset 0x9400 - unique for every phone
another 16 bytes at offset 0x9410 repeats 265 times (until 0xA49F) and unique for every phone. - 4040 bytes at all.
previous 16 bytes again at offset 0xA800 repeats 32 times (until 0xA9FF) and unique for every phone. 512 bytes at all.
Are You have wire-trick s-off? Phones with new motherboard are much more interesting than stock.
I have one image of mmcblk0p3 partition from such phone. There is some more differences in it, comparing to stock phone:
4 bytes at offset 0xC24 (near "simunlock"string - at all other images those bytes was same.
256 bytes at offset 0xAD00 - all other images had 0x00 at this offset. It's NOT Unlock_code.bin.
previous 256 bytes again at offset 0xB100 - again same 256 bytes. All other images had 0x00 at this offset. It's still NOT Unlock_code.bin.
Here is Bash script. Correct ADB= string to which adb output for Your system or full path to adb binary, then save it as adbflasher, then chmod +x adbflasher
Connect Your S-OFF Evo 3D to PC and run ./adbflasher read security_record security_record.img - this will be mmcblk0p3 partition image.
Code:
#!/bin/bash
set -x
E_WRONGCOMMAND=65
E_WRONGPARTITION=66
E_ERASE=67
ADB="/opt/android-sdk-update-manager/platform-tools/adb"
fs_write() {
echo fs_write $*
local param_fs=$1
local param_file=$2
local param_device=$3
exportfs none
exportfs $param_fs
device_detect $param_device
sudo pv $param_file|dd of=$device bs=65536
sync
exportfs none
}
fs_read() {
echo fs_read $*
local param_fs=$1
local param_file=$2
local param_device=$3
exportfs none
echo calling exportfs $param_fs
exportfs $param_fs
echo calling device_detect
device_detect $param_device
sudo pv $device |dd of=$param_file bs=65536 &
exportfs none
}
fs_erase() {
echo fs_erase $*
local param_fs=$1
local param_device=$2
case $param_fs in
security_record) echo Erasing partition $param_fs not allowed: it may brick Your phone!; exit $E_ERASE;;
hboot) echo Erasing partition $param_fs not allowed: it will brick Your phone!; exit $E_ERASE;;
emmc) echo Erasing partition $param_fs not allowed: it will brick Your phone!; exit $E_ERASE;;
none) echo Unable to erase partition $param_fs!; exit $E_ERASE;;
*) fs_write $param_fs /dev/zero $param_device ;;
esac
}
exportfs() {
echo exportfs $*
case $1 in
security_record) partition=/dev/block/mmcblk0p3;;
hboot) partition=/dev/block/mmcblk0p12;;
radio) partition=/dev/block/mmcblk0p17;;
adsp) partition=/dev/block/mmcblk0p19;;
boot) partition=/dev/block/mmcblk0p20;;
recovery) partition=/dev/block/mmcblk0p21;;
system) partition=/dev/block/mmcblk0p22;;
data) partition=/dev/block/mmcblk0p23;;
cache) partition=/dev/block/mmcblk0p24;;
devlog) partition=/dev/block/mmcblk0p27;;
emmc) partition=/dev/block/mmcblk0;;
sdcard) partition=/dev/block/mmcblk1;;
none) partition="none";;
*) echo Wrong partition: $1; exit $E_WRONGPARTITION;;
esac
legacy="/sys/devices/platform/usb_mass_storage/lun0/file"
recent="/sys/devices/platform/msm_otg/msm_hsusb/gadget/lun0/file"
until $ADB shell "echo $partition > $legacy" ; do sleep 1;done
until $ADB shell "echo $partition > $recent" ; do sleep 1;done
until $ADB shell "echo $partition |su -c \"tee $legacy\"" ; do sleep 1;done
until $ADB shell "echo $partition |su -c \"tee $recent\"" ; do sleep 1;done
echo exportfs $* done
}
device_detect() {
echo "device_detect $*"
device=`find /dev/disk/by-id/|grep -i Android|sort|head -n 1` ## TODO: write better detect function!
if [[ "z$1" != "z" ]] ;then device=$1; fi
}
usage() {
echo "Usage: adbflasher flash hdsp boot.img [device_to_flash]
adbflasher flash recovery recovery.img [device_to_flash]
adbflasher flash radio radio.img [device_to_flash]
adbflasher flash hboot hboot.img [device_to_flash] ## Dangerous!
adbflasher flash adsp adsp.img [device_to_flash]
adbflasher flash emmc emmc.img [device_to_flash] ## Extremly dangerous! DO NOT FLASH ANY FILE EXCEPT YOUR HAVE READ FROM YOUR PHONE EARLIER!
adbflasher exportfs {hboot|radio|adsp|boot|recovery|system|data|cache|devlog|emmc|sdcard|none}
## Might br dangerous! ALWAYS do exportfs none before exportfs another partition!
adbflasher read {security_record|hboot|radio|adsp|boot|recovery|system|data|cache|devlog|emmc|sdcard|none} filename.img [device_to_read]
adbflasher erase {radio|adsp|boot|recovery|system|data|cache|devlog|sdcard} [device_to_erase]"
}
if [[ $# -eq 0 ]] ;then usage; exit $E_WRONGCOMMAND; fi
case $1 in
exportfs) exportfs $2 ;;
erase) fs_erase $2 $3 |exit $? ;;
read) fs_read $2 $3 $4 |exit $? ;;
flash) fs_write $2 $3 $4 |exit $? ;;
*) echo "Wrong command: $1"; usage; exit $E_WRONGCOMMAND ;;
esac
#until /opt/android-sdk-update-manager/platform-tools/adb reboot ; do sleep 1;done
Click to expand...
Click to collapse
Thanks a lot for your great work.
What is security_record ? Is this script only saving the partition or is there a serious risk of bricking ?
I realy can't afford now any serious riscky operation beceause I am realy unlucky with this phone and I'm planning to sell it now.
I can help if you want (for other to know what to do) but I am not ready for this anymore.
Grea09 said:
Thanks a lot for your great work.
What is security_record ? Is this script only saving the partition or is there a serious risk of bricking ?
I realy can't afford now any serious riscky operation beceause I am realy unlucky with this phone and I'm planning to sell it now.
I can help if you want (for other to know what to do) but I am not ready for this anymore.
Click to expand...
Click to collapse
What is security_record? - It's mmcblk0p3 partition of eMMC card (internal memory of Evo 3D). What is it's data are? I don't know, and I'm trying to reserach it. It's looks like some diigtal keys stored in this place, some of them are same for every phone, and some are individual for every phone.
No, it's no risk if You will just read partition using read command (and don't using write or erase commands).
This script is only open selected partition (or full eMMC in "* emmc" operations) to access from PC and then read it using dd command.
But I will need images of another partitions or all eMMC card, and it would be fine if You can provide it later for future research of Evo 3D memory. You can even erase CACHE, DATA, SYSTEM, ADSP and RADIO partitions using ./adbflasher erase {system/data/cache/adsp/radio/boot/recovery/logo} before sending zipped emmc.img to me using ./adbflasher read emmc emmc.img command.
This is recommended sequence of commands:
./adbflasher read emmc emmc_original.img ## Reading original eMMC image to restore it later.
./adbflasher erase cache ## Erasing CACHE partition. I'm not interested for it.
./adbflasher erase data ## Erasing DATA partition. It's Your private data, I'm not interested for it.
./adbflasher erase system ## Erasing SYSTEM partition. It's Android OS. I'm not interested for it.
./adbflasher erase radio ## Erasing RADIO partition. I'm not interested for it.
./adbflasher erase adsp ## Erasing ADSP partition. I'm not interested for it.
./adbflasher erase boot ## Erasing BOOT partition. I'm not interested for it.
./adbflasher erase recovery ## Erasing RECOVERY partition. I'm not interested for it.
./adbflasher erase logo ## Erasing LOGO partition. I'm not interested for it.
## It's no brick risk now, even while all those partitions have erased. You can boot to HBOOT and flash PG86IMG.zip with firmware, restoring LOGO, ADSP, RADIO partitions, then flash Your favorite recovery using fastboot or PG86IMG.zip, then wipe CACHE and restore NANDROID backup of SYSTEM and DATA.
./adbflasher read emmc emmc.img ## Reading cleaned eMMC image for sending it to me
gzip emmc.img ## Packing 2.25Gb to ~16Mb, because it's almost all space in file is now filled with 0x00
./adbflasher write emmc emmc_original.img ## Writing original eMMC image back to phone. It's some bricking risk now, if power loss will occur during early stage of writing process. It's no risk if You using UPS or notebook with fully charged battery.
rm emmc_original.img ## Erasing 2.25Gb original eMMC image. You can keep it, if needed.
Now, You can send emmc.img.gz to me. You will need at least 5.5Gb of free disk space on Your PC before doing this.
Thank You.
Hi's.
S-trace said:
What is security_record? - It's mmcblk0p3 partition of eMMC card (internal memory of Evo 3D). What is it's data are? I don't know, and I'm trying to reserach it. It's looks like some diigtal keys stored in this place, some of them are same for every phone, and some are individual for every phone.
No, it's no risk if You will just read partition using read command (and don't using write or erase commands).
This script is only open selected partition (or full eMMC in "* emmc" operations) to access from PC and then read it using dd command.
But I will need images of another partitions or all eMMC card, and it would be fine if You can provide it later for future research of Evo 3D memory. You can even erase CACHE, DATA, SYSTEM, ADSP and RADIO partitions using ./adbflasher erase {system/data/cache/adsp/radio/boot/recovery/logo} before sending zipped emmc.img to me using ./adbflasher read emmc emmc.img command.
This is recommended sequence of commands:
./adbflasher read emmc emmc_original.img ## Reading original eMMC image to restore it later.
./adbflasher erase cache ## Erasing CACHE partition. I'm not interested for it.
./adbflasher erase data ## Erasing DATA partition. It's Your private data, I'm not interested for it.
./adbflasher erase system ## Erasing SYSTEM partition. It's Android OS. I'm not interested for it.
./adbflasher erase radio ## Erasing RADIO partition. I'm not interested for it.
./adbflasher erase adsp ## Erasing ADSP partition. I'm not interested for it.
./adbflasher erase boot ## Erasing BOOT partition. I'm not interested for it.
./adbflasher erase recovery ## Erasing RECOVERY partition. I'm not interested for it.
./adbflasher erase logo ## Erasing LOGO partition. I'm not interested for it.
## It's no brick risk now, even while all those partitions have erased. You can boot to HBOOT and flash PG86IMG.zip with firmware, restoring LOGO, ADSP, RADIO partitions, then flash Your favorite recovery using fastboot or PG86IMG.zip, then wipe CACHE and restore NANDROID backup of SYSTEM and DATA.
./adbflasher read emmc emmc.img ## Reading cleaned eMMC image for sending it to me
gzip emmc.img ## Packing 2.25Gb to ~16Mb, because it's almost all space in file is now filled with 0x00
./adbflasher write emmc emmc_original.img ## Writing original eMMC image back to phone. It's some bricking risk now, if power loss will occur during early stage of writing process. It's no risk if You using UPS or notebook with fully charged battery.
rm emmc_original.img ## Erasing 2.25Gb original eMMC image. You can keep it, if needed.
Now, You can send emmc.img.gz to me. You will need at least 5.5Gb of free disk space on Your PC before doing this.
Thank You.
Click to expand...
Click to collapse
I have also tried to unlock HTC evo3d over the internet site HTCdev.com but I could not. Could you please explain your solution in a clear and simple way?
Thank you very much.
Hakancoskun35 said:
I have also tried to unlock HTC evo3d over the internet site HTCdev.com but I could not. Could you please explain your solution in a clear and simple way?
Thank you very much.
Click to expand...
Click to collapse
Are You S-OFF?
This method works only for S-OFF and rooted devices.
If you are already rooted. Why would you need it,
Sorry Bro I don't want to abuse you. But I have same problem
My Handsets motherboard was replaced I here I am stuck with unlock-able EVO 3d. I tried many things but can't get through.
Your works is exactly what I was had in mind, Can we make a universal .IMG or .PG86IMG.zip for unlock boot loader.
Just a thought.
Ohh mine is HBOOT 1.53.007 Unlock-able HTC EVO 3D
P.S. if you can direct me I can try to S-OFF & Root my device as per your instructions
Thanks
abhi_nagpure said:
If you are already rooted. Why would you need it,
Sorry Bro I don't want to abuse you. But I have same problem
My Handsets motherboard was replaced I here I am stuck with unlock-able EVO 3d. I tried many things but can't get through.
Your works is exactly what I was had in mind, Can we make a universal .IMG or .PG86IMG.zip for unlock boot loader.
Just a thought.
Ohh mine is HBOOT 1.53.007 Unlock-able HTC EVO 3D
P.S. if you can direct me I can try to S-OFF & Root my device as per your instructions
Thanks
Click to expand...
Click to collapse
My brother has the same problem, motherboard replaced so devunlock doesnt work. Would be great if this methode works for him.
Sent from my shooteru using xda premium
I can build update.zip for Recovery. But You still will need S-OFF to have write access to mmcblk0p3.
Yes thats what I am talking about.
You see there are many people here who have same problem. May be you are at solving it.
I am already fighting with HTC Service for unlocking or replacing my handset. But I don't think they'll give it.
So we have to do some thing our selves.
Sent from my HTC EVO 3D X515m using Tapatalk 2
Flashable package to unlock/lock/relock bootloader
I have built this package for You.
Just rename it to what You want to do:
query_bootloader.zip - query current state of bootloader (do it before anything else!)
unlock_bootloader.zip - unlock
relock_bootloader.zip - relock
lock_bootloader.zip - lock
and then flash it using Recovery. That's all.
Package is untested on device, sorry, I have bricked mine Evo during another experiments T_T
I don't have root or s-off but still I'll try whatever possible to test your zip,
Thanks
Sent from my HTC EVO 3D X515m using Tapatalk 2
Сome on!
It's 14 downloads at now, but 0 replies!
I am very interested to result! I have tested sctipt on test images and it's worked perfectly, but how about real devices? Especially S-ON?
Hey,
I have an Evo 3D with the following:
- unlocked bootloader via HTCDev
- HBOOT downgrade from 1.49.0018 to 1.49.0007 via Revolutionary
- S-OFF
- Custom Firmware
The problem is that the touchscreen is not working properly anymore (i suspect the digitizer), so there's a hardware issue.
My questions:
- how can i bring my phone to factory defaults so i can send it to warranty? Ok, i know that i should flash an PG86IMG.zip via bootloader to bring the original ROM and Bootloader back. Are there any other steps that i should follow?
- how can i lock my bootloader? I say lock, not relock.
The phone was bought SIM FREE and it was not branded.
Cheers.
Related
I'm trying to make an auto install script within the initramfs. I've got everything working, including automatic fdisk, but I cannot get mkfs.ext4 to work on the Android kernel, and there is no version of Busybox with the ext4 applet. Does anyone have a mkfs.ext4 that runs successfully on Android? When I run it from a terminal the output is
Code:
mkfs.ext4: 1: Syntax error: word unexpected (expecting ")")
Here's my code if you want to see what I'm doing.
Code:
mount /dev/mmcblk1p1 /tmp/mnt
if [ -f /tmp/mnt/mysticfw.tar.gz ]; then
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
mount /dev/mmcblk1p2 /tmp/tmproot
mkdir /tmp/tmproot/itworks
tar -xzvf /tmp/mnt/mysticfw.tar.gz -C /tmp/tmproot/
sync
#rm /tmp/mnt/mysticfw.tar.gz
umount /tmp/tmproot
fi
sync
umount /tmp/mnt
It automatically partitions the stock Android block and installs a tar.gz from the internal storage to simplify my unsquashed 2.1.4 filesystem install, and the only part I can't get working is mkfs.ext4.
Found one! It's 3 MBs though, so if anyone has a smaller one, it would be very nice.
msticninja said:
I'm trying to make an auto install script within the initramfs. I've got everything working, including automatic fdisk, but I cannot get mkfs.ext4 to work on the Android kernel, and there is no version of Busybox with the ext4 applet. Does anyone have a mkfs.ext4 that runs successfully on Android? When I run it from a terminal the output is
Code:
mkfs.ext4: 1: Syntax error: word unexpected (expecting ")")
Click to expand...
Click to collapse
Why do you don't use the mke2fs from Uruk for example (the easiest way) asking $auron if it's ok for him. His size is only 49KB.
Find it like the following on Uruk installation:
Code:
[COLOR="DarkRed"]
# mkfs.ext4 -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
# find / -name mke2fs | xargs ls -l
-rwxr-xr-x 1 root root 30584 Dec 15 03:46 /system/bin/mke2fs
[B]-rwxr-xr-x 5 root root 49248 4 Jan 15 13:14 /usr/local/sbin/mke2fs[/B]
#/usr/local/sbin/mke2fs -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
[/COLOR]
Here's my code if you want to see what I'm doing.
Code:
mount /dev/mmcblk1p1 /tmp/mnt
if [ -f /tmp/mnt/mysticfw.tar.gz ]; then
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
mount /dev/mmcblk1p2 /tmp/tmproot
mkdir /tmp/tmproot/itworks
tar -xzvf /tmp/mnt/mysticfw.tar.gz -C /tmp/tmproot/
sync
#rm /tmp/mnt/mysticfw.tar.gz
umount /tmp/tmproot
fi
sync
umount /tmp/mnt
It automatically partitions the stock Android block and installs a tar.gz from the internal storage to simplify my unsquashed 2.1.4 filesystem install, and the only part I can't get working is mkfs.ext4.
Click to expand...
Click to collapse
and don't forget to add "-l" on FDISK command and change the device mmcblk0 with mmcblk1 on the lines:
Code:
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
Cheers,
shklifo said:
Why do you don't use the mke2fs from Uruk for example (the easiest way) asking $auron if it's ok for him. His size is only 49KB.
Find it like the following on Uruk installation:
Code:
[COLOR="DarkRed"]
# mkfs.ext4 -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
# find / -name mke2fs | xargs ls -l
-rwxr-xr-x 1 root root 30584 Dec 15 03:46 /system/bin/mke2fs
[B]-rwxr-xr-x 5 root root 49248 4 Jan 15 13:14 /usr/local/sbin/mke2fs[/B]
#/usr/local/sbin/mke2fs -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
[/COLOR]
and don't forget to add "-l" on FDISK command and change the device mmcblk0 with mmcblk1 on the lines:
Code:
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
Cheers,
Click to expand...
Click to collapse
Why didn't I think of that? Thanks.
But regarding mmcblk0/1, I'm replacing the stock Android, so the fdisk.input file contains the commands to delete mmcblk0p2 and p3, and make a new partition in the unused space. I hate using space on my Internal Storage, so I'm using Archos' space.
msticninja said:
Why didn't I think of that? Thanks.
But regarding mmcblk0/1, I'm replacing the stock Android, so the fdisk.input file contains the commands to delete mmcblk0p2 and p3, and make a new partition in the unused space. I hate using space on my Internal Storage, so I'm using Archos' space.
Click to expand...
Click to collapse
If you are using the mmcblk0p2 as rootfs as you say (and you are expanded tar archive on mmcblk1p2), than you have to change the line:
mount /dev/mmcblk1p2 /tmp/tmproot
Click to expand...
Click to collapse
with
mount /dev/mmcblk0p2 /tmp/tmproot
Click to expand...
Click to collapse
shklifo said:
If you are using the mmcblk0p2 as rootfs as you say (and you are expanded tar archive on mmcblk1p2), than you have to change the line:
with
Click to expand...
Click to collapse
I know, that's my current data partition, I'll change it once I'm done testing. The tar file just has a test file in it, so when I boot back into block1, I can see if the IF statement was executed by seeing if it was extracted to block1. I'll also have to change etc/mountpoints once testing is actually finished.
One more question since you're so quick. I think I have everything working, except it needs a reboot in between the fdisk and mke2fs commands to reload the partition table. I'm trying to use partprobe instead of rebooting, but it hasn't been cross compiled to work on Android, AFAIK. Have you seen a way to reload the MBR without rebooting?
msticninja said:
I know, that's my current data partition, I'll change it once I'm done testing. The tar file just has a test file in it, so when I boot back into block1, I can see if the IF statement was executed by seeing if it was extracted to block1. I'll also have to change etc/mountpoints once testing is actually finished.
One more question since you're so quick. I think I have everything working, except it needs a reboot in between the fdisk and mke2fs commands to reload the partition table. I'm trying to use partprobe instead of rebooting, but it hasn't been cross compiled to work on Android, AFAIK. Have you seen a way to reload the MBR without rebooting?
Click to expand...
Click to collapse
I'v been looking at the recovery_lib.sh in the recovery boot image and can't find anything special to re-read the partition table. And yes they also use fdisk to repartition. So I suspect the driver for the block device does not cache the MBR and you can just mke2fs after the partition table is created.
I can't remember from what firmware that recovery boot image was but I think it's from the 2.1.04 and they do some repartitioning there for the swap space.
I'll check it again and get back to you.
wdl1908 said:
I'v been looking at the recovery_lib.sh in the recovery boot image and can't find anything special to re-read the partition table. And yes they also use fdisk to repartition. So I suspect the driver for the block device does not cache the MBR and you can just mke2fs after the partition table is created.
I can't remember from what firmware that recovery boot image was but I think it's from the 2.1.04 and they do some repartitioning there for the swap space.
I'll check it again and get back to you.
Click to expand...
Click to collapse
I just checked the recovery image from 2.1.04 and after the fdisk commands there is nothing to re-read the MBR the next commands executed are mount commands to check if the fs is present I suggest you look at the /etc/scripts/recovery_lib.sh yourself it could give some clues on how to do things.
wdl1908 said:
I just checked the recovery image from 2.1.04 and after the fdisk commands there is nothing to re-read the MBR the next commands executed are mount commands to check if the fs is present I suggest you look at the /etc/scripts/recovery_lib.sh yourself it could give some clues on how to do things.
Click to expand...
Click to collapse
For me too, it have nothing to do with a reboot to load partitions table and access partition to format them with the choised filesystem.
You can delete any partition on linux (except rootfs one ), recreate them and directly format them as you like, reboot isn't necesary.
Thanks for all the replies, very helpful, but I'm stuck. Fdisk seems to use ioctl to reload the partition table, so you don't need a reboot if everything on the device is unmounted before writing the partition table, but I'm having very strange issues with mke2fs now. I've had the whole thing work twice now, but when I flash back to stock, then retry the script, it usually does everything except the formatting. Here's the code:
Code:
mount /dev/mmcblk1p1 /tmp/mnt
if [ -f /tmp/mnt/mysticfw.tar.gz ]; then
umount /dev/mmcblk0p1
umount /dev/mmcblk0p2
umount /dev/mmcblk0p3
umount /dev/mmcblk0p4
fdisk /dev/mmcblk0 < /home/fdisk.input
mv /tmp/mnt/mysticfw.tar.gz /tmp/mnt/mysticf.tar.gz
sync
umount /tmp/mnt
log_and_reboot
fi
if [ -f /tmp/mnt/mysticf.tar.gz ]; then
rm /etc/mtab
touch /etc/mtab
mke2fs -T ext4 -O ^huge_file /dev/mmcblk0p2
mount /dev/mmcblk0p2 /tmp/tmproot
tar -xzf /tmp/mnt/mysticf.tar.gz -C /tmp/tmproot/
sync
mv /tmp/mnt/mysticf.tar.gz /tmp/mnt/mysticdone.tar.gz
umount /tmp/tmproot
rm /etc/mtab
ln -s /proc/mounts /etc/mtab
fi
sync
umount /tmp/mnt
I have it reboot after the fdisk just in case, and the fdisk works perfectly, so the second IF/THEN is the issue. I had to retouch the mtab just to make sure it's empty, as mke2fs fails if mtab doesn't exist(at least in terminal), then I relink it to /proc/mounts as they do in the stock firmware. Here's my mke2fs.conf:
Code:
[defaults]
base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr
blocksize = 4096
inode_size = 256
inode_ratio = 16384
[fs_types]
ext3 = {
features = has_journal
}
ext4 = {
features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
inode_size = 256
}
ext4dev = {
features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
inode_size = 256
options = test_fs=1
}
small = {
blocksize = 1024
inode_size = 128
inode_ratio = 4096
}
floppy = {
blocksize = 1024
inode_size = 128
inode_ratio = 8192
}
news = {
inode_ratio = 4096
}
largefile = {
inode_ratio = 1048576
blocksize = -1
}
largefile4 = {
inode_ratio = 4194304
blocksize = -1
}
hurd = {
blocksize = 4096
inode_size = 128
}
Is there a way to echo the output from my script to a file like dontpanic so I can see what the error is?
msticninja said:
Is there a way to echo the output from my script to a file like dontpanic so I can see what the error is?
Click to expand...
Click to collapse
Simple append (">>") and "echo" doesn't work to a redirected logfile?
I've only learned what I've needed to learn over the years, usually with endless google searches and reading through man pages, so I've never tried to log outputs, because I could always see the output in a terminal or onscreen during boot. Android is the first time I haven't been able to actually see the boot process.
Once again, thanks for your help. I probably could've googled this, but I kind of asked as an afterthought. I didn't even think about redirecting. So if the mke2fs line is the one I want to log, I just add "2&>> /tmp/mnt/logfile" to the end of it, right?
Also, thanks for your original thread about booting from Internal Storage, I never got around to developing on Android until you posted that, and I realized just how similar Android is to L/unix(e.g. exactly the same).
msticninja said:
I didn't even think about redirecting. So if the mke2fs line is the one I want to log, I just add "2&>> /tmp/mnt/logfile" to the end of it, right?
Click to expand...
Click to collapse
ehm, no.
In your case must be like the following:
Code:
"your command" >> /tmp/mnt/logfile 2>&1
That means redirect all messages from STDERR (2 - standard error) to STDOUT (1 - standard output) and all messaged collected on STDOUT to the redirected log file /tmp/mnt/logfile, or more comprensible redirect all mesage including error ones to the log file.
I'm working in Unix environments and use them often
And a good practice in developing is to use "echo" to the same log file, so you know the exact place the script is running, like:
Code:
echo "I'm just before the formatting step of the ..." >> /tmp/mnt/logfile
shklifo said:
ehm, no.
In your case must be like the following:
Code:
"your command" >> /tmp/mnt/logfile 2>&1
That means redirect all messages from STDERR (2 - standard error) to STDOUT (1 - standard output) and all messaged collected on STDOUT to the redirected log file /tmp/mnt/logfile, or more comprensible redirect all mesage including error ones to the log file.
I'm working in Unix environments and use them often
And a good practice in developing is to use "echo" to the same log file, so you know the exact place the script is running, like:
Code:
echo "I'm just before the formatting step of the ..." >> /tmp/mnt/logfile
Click to expand...
Click to collapse
Strange. The google searching lead me to believe the "2>&1" was before the location, and replaced ">>". Once again, thanks for the help.
any chance of you getting this uploaded? iterested in this since I'm not that good with linux
TjaXanK said:
any chance of you getting this uploaded? iterested in this since I'm not that good with linux
Click to expand...
Click to collapse
I could probably finish it, but I'm waiting for a new version of Uruk first, as his install script already gets rid of the linux steps, it just doesn't give you the choice to install to the internal memory yet. Once he does that, I'll add my changes to make it install to the Archos partition. The latest Uruk is also a bit too big for the archos partition. I had to cut my data partition down to ~150 megs.
msticninja said:
I could probably finish it, but I'm waiting for a new version of Uruk first, as his install script already gets rid of the linux steps, it just doesn't give you the choice to install to the internal memory yet. Once he does that, I'll add my changes to make it install to the Archos partition. The latest Uruk is also a bit too big for the archos partition. I had to cut my data partition down to ~150 megs.
Click to expand...
Click to collapse
ok, I'm currently running urk with the new install system and it's brillant but it would be perfect if we could run it without cutting down on our storage space
This procedure is really dangerous so I have to warn that you can brick your phone. It directly modifies partition tables so if something goes wrong you may have a bricked phone. Do it at your own risk and I'm not responsible for any damage it may cause.
By following the procedure, you acknowledge and accept that the author is not liable for any loss, material or otherwise howsoever caused.
OK, you've been warned Now to the fun part.
This procedure does work but, please, follow it only if you are an advanced user or a developer.
It also has some unnecessary steps but I include them since they can help you to learn something.
Later, I might write an "update.zip" for cwm which automatically does all the work
This works only on top of the existing N4 8G conversion.
So if you're stock etc then you'll need to do N4 8G conversion first, that is to flash the tot listed in N4 conversion topic in LGNPST.
This is a link to the N4 conversion thread: http://forum.xda-developers.com/showthread.php?t=2099784
You also need cwm recovery installed. I did it in sk8's cwm touch recovery. So I suggest using it: http://forum.xda-developers.com/showthread.php?t=2010984
Also, you need an external sd card with at least 100MB(after doing all rom backups) of free space and I recommend to do a filesystem check of the sd card in windows/*nix/osx.
And another requirement is to have working adb and fastboot drivers for Nexus 4.
Before starting the procedure look through all the steps and please stop if you don't understand something. No rocket science here but it's just a dangerous thing to do.
- Download the following 3 files and copy them to your _external_ sd card root directory
Links:
Modified busybox dd : http://d-h.st/cFA
16G Primary GPT(includes MBR): http://d-h.st/yUQ
16G Secondary GPT: http://d-h.st/0dH
- if you care about the content of your internal sd card then back it up somewhere. After doing this conversion all your data and /sdcard will be purged.
- boot into cwm recovery.
- if you care about your current ROM/data do a backup to _external_ sd.
- connect the phone via USB to your pc and on your pc run 'adb shell'. Once in shell:
Code:
# cp /external_sd/dd /
# chmod 755 /dd
- Backup your existing partition tables. Make sure you put / in front of dd to use my modified dd
Code:
# /dd if=/dev/block/mmcblk0 of=/external_sd/pgpt8G.img bs=512 count=34
# /dd if=/dev/block/mmcblk0 of=/external_sd/sgpt8G.img bs=512 skip=30777311
- By default cwm mounts userdata and cache partitions. You need to unmount them
Code:
# umount /data
# umount /cache
- Make sure no partition from /dev/block/mmcblk0 is mounted. df should return only this with no extra rows:
Code:
# df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 911.7M 48.0K 911.6M 0% /dev
/dev/block/mmcblk1p1 59.4G 4.8G 54.6G 8% /external_sd
- Move content of DDR and grow partitions to their new locations. I doubt this step is required, but did it for safety. Seeking to the end of the mmc may take couple of minutes, don't freak out:
Code:
# /dd if=/dev/block/mmcblk0 of=/external_sd/DDR bs=512 skip=15267840 count=2015
# /dd if=/external_sd/DDR of=/dev/block/mmcblk0 bs=512 seek=30775296 conv=notrunc
- Install new partition tables. Seeking to the end of the mmc may take couple of minutes:
Code:
# /dd if=/external_sd/sgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
# /dd if=/external_sd/pgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
- At this point you have new partition tables installed. Verify this by running parted. You should see this:
Code:
# parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
p
Model: MMC 016G92 (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.2MB 524kB sbl1
3 68.2MB 68.7MB 524kB sbl2
4 68.7MB 70.8MB 2097kB sbl3
5 70.8MB 71.3MB 524kB tz
6 71.3MB 94.4MB 23.1MB boot
7 94.4MB 117MB 23.1MB recovery
8 117MB 118MB 799kB m9kefs1
9 118MB 119MB 799kB m9kefs2
10 119MB 120MB 799kB m9kefs3
11 120MB 121MB 524kB rpm
12 121MB 121MB 524kB aboot
13 121MB 122MB 524kB sbl2b
14 122MB 124MB 2097kB sbl3b
15 124MB 124MB 524kB abootb
16 124MB 125MB 524kB rpmb
17 125MB 125MB 524kB tzb
18 125MB 126MB 524kB metadata
19 126MB 143MB 16.8MB misc
20 143MB 159MB 16.8MB ext4 persist
21 159MB 1040MB 881MB ext4 system
22 1040MB 1627MB 587MB ext4 cache
23 1627MB 15.8GB 14.1GB ext4 userdata
24 15.8GB 15.8GB 524kB DDR
25 15.8GB 15.8GB 507kB grow
(parted) quit
quit
Notice that userdata partition is 14.1GB in size
In case parted reports an error I suggest to return back to the old 8G partition tables, see below.
- Reboot the phone into bootloader: run reboot command and hold 'Up' button to enter bootloader menu
Code:
# reboot
- on your pc command line run:
Code:
fastboot erase userdata
fastboot -w
- In phone bootloader enter 'Recovery Mode' to load cwm
- In cwm restore your previous N4 rom from external sd or flash a new N4 rom
PS
In case parted reported an error, put the old 8G partition tables back. This should not happen but never say never:
Code:
# /dd if=/external_sd/sgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
# /dd if=/external_sd/pgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
reserved
Awww Look at the "community" sharing!!!
really easy process thank you!
This is the final straw for me, I'm gonna try the conversion tonight. Thanks a ton!
Damn, so was this the final problem with the conversion? Does this mean all the bugs have been worked out? If so, this is awfully tempting... haha
blenkows said:
Damn, so was this the final problem with the conversion? Does this mean all the bugs have been worked out? If so, this is awfully tempting... haha
Click to expand...
Click to collapse
For the most part, I think a few people still have issues with NFC, but I think that's just about ironed out too. Goodbye Quickmemo and Q-slide, I'll actually miss you!
Awesome work but I'll wait tell you make a update zip since I don't trust my computer have USB problems
Sent from my LG-E970 using xda premium
Right now I have the little voices in my head. The good guy is saying "NO DUDE! WAIT FOR AOSP! ITS JUST AROUND THE CORNER!". The other dude is saying "OMG JUST DO IT YOU WUSS!"
Mannnnnnn. Now I'm confused as to what I wanna do. Stock JB or convert? Great job. Looks good!
Sent from my LG Optimus G
Neroga said:
Mannnnnnn. Now I'm confused as to what I wanna do. Stock JB or convert? Great job. Looks good!
Sent from my LG Optimus G
Click to expand...
Click to collapse
More like Nexus 4 with SD card and LTE 4.2.2 or LGOG with 4.1.2?
xxgmon3yxx said:
More like Nexus 4 with SD card and LTE 4.2.2 or LGOG with 4.1.2?
Click to expand...
Click to collapse
You know, plus the millions of other possibilities that come along with a nexus.
C2fifield said:
You know, plus the millions of other possibilities that come along with a nexus.
Click to expand...
Click to collapse
No doubt... this phone will be supported for years to come! I'm never getting rid of it.
C2fifield said:
For the most part, I think a few people still have issues with NFC, but I think that's just about ironed out too. Goodbye Quickmemo and Q-slide, I'll actually miss you!
Click to expand...
Click to collapse
If NFC does not work for you, try to flash zip from the 'Notes' section of http://forum.xda-developers.com/showthread.php?p=37518694
Now can people accept the conversion lol so we can move on with our phones?
Sent from my LG-E970 using xda premium
blenkows said:
Right now I have the little voices in my head. The good guy is saying "NO DUDE! WAIT FOR AOSP! ITS JUST AROUND THE CORNER!". The other dude is saying "OMG JUST DO IT YOU WUSS!"
Click to expand...
Click to collapse
Haha, I feel you! I don't even trust myself with the conversion, though :/
But if a flash zip comes out, all hell might break loose!
Sent from my LG-E970 using xda app-developers app
TangoXray said:
Haha, I feel you! I don't even trust myself with the conversion, though :/
But if a flash zip comes out, all hell might break loose!
Sent from my LG-E970 using xda app-developers app
Click to expand...
Click to collapse
Just did it, it's all running smoothly, thanks again!
Seems to have worked here as well. Just restored my nandroid and its booting as we speak. And....... success. 12+ gigs of usable storage. Thanks a ton!!!!
thanks i just did it and works perfect
As I restore my backup, I have to wonder, why do we erase userdata and fastboot -w when a restore from backup works without a problem? Does the backup not look at the partition tables where booting straight up would and freeze up something?
Or is everything wiped from modifying the table and the fastboot part is just to make sure the partitions are empty?
DISCLAIMER: THIS IS VERY DANGEROUS COMPARED TO A NORMAL ROM FLASH. DO NOT DO THIS IF YOU DON'T KNOW WHAT YOU'RE DOING OTHER THAN FLASHING ROMS.
IF SOMETHING GOES WRONG, YOU HAVE ONLY YOURSELF TO BLAME. YOU HAVE BEEN WARNED.[/B]
To convert to Nexus 4
First off, there are a few issues.
-SDCard doesn't work.
-Capacitive buttons aren't working. No known way to fix it.
First off, lets flash the N4 Rom.
1) Install LGNPST - Use tSilenzio's AutoLGNPST - http://www.oudhitsquad.com/android/LGE/Firmware/Tools/AutoLGNPST-tSilenzio.zip
2) Download the Nexus 4 Image - https://www.androidfilehost.com/?fid=9390248398092765463
3) Rename the extracted .tot file to a .bin file
4) Put the phone in Download mode. Volume Up + Volume Down While inserting USB cable.
5) Open LGNPST and select the phone - Should be Com[Number]
6) In the DLL section, select LGNPST_LS970.dll
7) In the file selection, select the previously renamed Nexus 4 bin file.
8) Start the flashing process and hold your breath.
9) When it hits 67%, your phone should start booting. DO NOT UNPLUG YET.
10) At 85%, an error will occur saying that the phone was unplugged. Ignore it and close LGNPST. The image is fully flashed.
11) Hold Volume Up + Power to put the phone into FASTBOOT mode.
12) Download the recovery from here and place it into your fastboot directory. - http://forum.xda-developers.com/showthread.php?t=2010984
13) Download the following 3 files and place them on the MicroSD card. - http://d-h.st/cFA - http://d-h.st/yUQ - http://d-h.st/0dH
14) While still in fastboot, type "fastboot boot recovery.img" - This will put the phone on the custom recovery. Make sure the SD card is in.
---Here, we're going to fix the partition tables for 16GB of space and replace the backup GPT so that we can't hardbrick from the backup GPT.
15) Run adb shell to get into a root shell in recovery.
16) Copy the modified DD onto the phone
Code:
# cp /external_sd/dd /
# chmod 755 /dd
17) Backup the partition tables incase something goes wrong.
Code:
# /dd if=/dev/block/mmcblk0 of=/external_sd/pgpt8G.img bs=512 count=34
# /dd if=/dev/block/mmcblk0 of=/external_sd/sgpt8G.img bs=512 skip=30777311
18) Unmount the filesystems so that you can overwrite the partition table.
Code:
# umount /data
# umount /cache
19) Make sure nothing is mounted. It should return this (Other than partition size):
Code:
# df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 911.7M 48.0K 911.6M 0% /dev
/dev/block/mmcblk1p1 59.4G 4.8G 54.6G 8% /external_sd
20) Move the partitions to their new locations. This may take a couple minutes.
Code:
# /dd if=/dev/block/mmcblk0 of=/external_sd/DDR bs=512 skip=15267840 count=2015
# /dd if=/external_sd/DDR of=/dev/block/mmcblk0 bs=512 seek=30775296 conv=notrunc
21) Install the new partition tables.
Code:
# /dd if=/external_sd/sgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
# /dd if=/external_sd/pgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
22) Make sure no errors occurred. Run 'parted /dev/block/mmcblk0' and check that it returns the same as the below.
Code:
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
p
Model: MMC 016G92 (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.2MB 524kB sbl1
3 68.2MB 68.7MB 524kB sbl2
4 68.7MB 70.8MB 2097kB sbl3
5 70.8MB 71.3MB 524kB tz
6 71.3MB 94.4MB 23.1MB boot
7 94.4MB 117MB 23.1MB recovery
8 117MB 118MB 799kB m9kefs1
9 118MB 119MB 799kB m9kefs2
10 119MB 120MB 799kB m9kefs3
11 120MB 121MB 524kB rpm
12 121MB 121MB 524kB aboot
13 121MB 122MB 524kB sbl2b
14 122MB 124MB 2097kB sbl3b
15 124MB 124MB 524kB abootb
16 124MB 125MB 524kB rpmb
17 125MB 125MB 524kB tzb
18 125MB 126MB 524kB metadata
19 126MB 143MB 16.8MB misc
20 143MB 159MB 16.8MB ext4 persist
21 159MB 1040MB 881MB ext4 system
22 1040MB 1627MB 587MB ext4 cache
23 1627MB 15.8GB 14.1GB ext4 userdata
24 15.8GB 15.8GB 524kB DDR
25 15.8GB 15.8GB 507kB grow
23) If something different was returned, run the below code to restore the previous partition tables.
Code:
# /dd if=/external_sd/sgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc
# /dd if=/external_sd/pgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
24) Exit the shell and type 'adb reboot bootloader' or reboot the phone while holding Volume Up.
25) Check that you're in fastboot mode and exit the following commands - This will fix the filesystem to take up the entire partition.
Code:
fastboot erase userdata
fastboot format userdata
fastboot -w
26) Boot the phone and update as needed. Then, put this on the phone and flash in recovery.
27) You are now working other than the SD card and Capacitive buttons.
Credits:
http://forum.xda-developers.com/showthread.php?t=2117576
http://forum.xda-developers.com/showthread.php?t=2099784
http://forum.xda-developers.com/showthread.php?t=2160124
http://forum.xda-developers.com/showthread.php?t=2146816
To convert from Nexus 4
This assumes that you have read the Convert to section.
1) Wipe the phone. Go into fastboot mode [Vol Up + Power] and execute the following commands. This is to prevent corrupted data partitions.
Code:
fastboot -w
fastboot format system
fastboot format userdata
fastboot format cache
fastboot format data
fastboot erase system
fastboot erase userdata
fastboot erase cache
fastboot erase data
2) LGNPST back to stock. You will do this twice to fix some issues.
To get into download mode, turn the phone off and hold Vol Up + Vol Down while inserting the USB cable.
3) Download these 2 images. Mar. 8, 2013 and Sept. 29, 2012
4) Flash the Mar. 8, 2013 firmware in LGNPST (See above for how to flash firmware in LGNPST. As before, the phone will start booting at 67% and LGNPST will show an error at 85%. Ignore the error and close LGNPST.
5) Restart the phone in download mode and now flash the Sept. 29, 2012 firmware. If you don't, your /SDCARD may be corrupted and you cant root.
6) Root the phone and unlock the bootloader. See here
7) If that doesn't work, try Teenybin.
8) Some partitions are broken. Go into CWM recovery and open an 'adb shell'.
9) Execute the following code. This will backup the broken partitions and wipe them.
Code:
dd if=/dev/block/mmcblk0p15 of=/sdcard/mmcblk0p15.bak
dd if=/dev/block/mmcblk0p16 of=/sdcard/mmcblk0p16.bak
dd if=/dev/block/mmcblk0p19 of=/sdcard/mmcblk0p19.bak
mke2fs -T ext4 /dev/block/mmcblk0p15
mke2fs -T ext4 /dev/block/mmcblk0p16
mke2fs -T ext4 /dev/block/mmcblk0p19
---You should now be back to stock--- LGNPST again if you want 'True Stock'
Let me know if you see anything wrong and please leave nasty comments at the door.
Ok, granted. This is more about recovering from flashing to Nexus 4 than about flashing to it. Basically, DON'T DO IT, as it doesn't seem to be worth it. We have AOSP and Cyanogen, etc.
I just posted this because I bought a phone that was flashed and went through hours of work fixing it.
Please read this before you think about flashing. http://forum.xda-developers.com/showpost.php?p=36735476&postcount=149
Its not worth it so much now but it was great when first released and it doesn't take that long to revert your phone. I went back and fourth like 5 times and my phone is fine. I think there is a low chance of your phone bricking as long as you follow instructions. The conversion is still a good option to have.
Sent from my LG Optimus G using XDA Premium 4 mobile app
Dr0!dFreek said:
Its not worth it so much now but it was great when first released and it doesn't take that long to revert your phone. I went back and fourth like 5 times and my phone is fine. I think there is a low chance of your phone bricking as long as you follow instructions. The conversion is still a good option to have.
Sent from my LG Optimus G using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Yeah, it seems nice to have the ability to do so, which is why I wrote the guide (and to give a single comprehensive guide that works).
It's nice to have a perfectly working KitKat rom the day its released, which is why I converted (When KK was released), but now, it doesn't seem worth it (We have AOSP). If you want MultiRom and franco kernel (Like I did), then its nice to have, but otherwise, most people don't need it.
alastair53 said:
13) Download the following 3 files and place them on the MicroSD card. - http://d-h.st/cFA - http://d-h.st/yUQ - http://d-h.st/0dH
Click to expand...
Click to collapse
Is this part SPYWARE? the 3 files downloads a exe and is detetected as virus or something.
So anyways i was dissecting dlx 3.06.405.4 ad i happened to stumble across this file in the same directory in the rom.zip. i know this might not be a surprise to some. at first i thought that maybe it was just a regular old fastboot.exe. but in fact when i executed the file i was surprised to find different commands and options. ive searched all over for the commands that are underlined but had no luck. if anybody has anything to contribute to this topic feel free.
C:\Users\Homer\Desktop>htc_fastboot.exe
usage: fastboot [ <option> ] <command>
commands:
flash <partition> [ <filename> ] write a file to a flash partition
dump emmc <filename> <start sector> <sector number> dump the emmc content to the specified file
dump ram <filename> <start address> <size> dump the memory content to the specified file
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
getfb <filename> get frame buffer
boot <kernel> [ <ramdisk> ] download and boot kernel
devices list all connected devices
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message
version show Version num
options:
-d disable the auto resend function for Hboot pre-update
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address
-n <page size> specify the nand page size. default: 2048
-m <memory usage> specify the max. memory usage(1~100MB) for zip flash. default: 10
C:\Users\Homer\Desktop>
Found the same thing
I found the htc_fastboot.exe as well.
New options.
Have you had any luck experimenting with it?
Hello,
my phone is an E2303. The only problem for me with this phone is the limited memory.
I have rooted the phone the way explained in http://forum.xda-developers.com/m4-a.../root-t3421932
With Root Explorer, i removed a lot of stuff in /system. Now 1,66 GB are used and 810 MB are free.
usderdata and system partitions ( sgdisk --print /dev/block/mmcblk0 )
Nr Name Start Stop Size type
29 userdata 1449984 10043391 4.1 GIB 8300
30 system 10043392 15269375 2.5 GIB 8300
My idea:
- use TWRP to backup userdata and system partions
- delete both partitions
- create userdata with 4.6 GIB
- create system with 2 GIB
- format both partitions with make_extfs4
- restore both partitions with TWRP
I know that as a consequence, i'm not able to flash updates.
Do you think, that this would work ?
===[ Update 5.12.2016 ]===
Yes !
I've attatched my scripts to this initial post. Howto follows ...
i can tell you that something similar worked on lg g2 mini (d610/d618)
that phone have a cache partition with 1gb of unused storage, so a developer resized to reduce this to 100mb, you can find this on L90 or g2 mini forum
did you try it yet?
try and give info
resize partitions Script
Hello,
i've startet coding a shell script:
------------------------------------------------------------
#!/bin/bash
MMC=/dev/block/mmcblk0
NEW_FREE_SEC=65536 # 32 mbyte in sectors
if [ $(id -u) -ne 0 ]; then
echo "Only root is allowed"
exit
fi
mount | grep "$MMC" > /dev/null
RC=$?
if [ $RC -eq 1 ]; then
echo "system not mounted. mounting now"
mount /system
RC=$?
echo $RC
fi
FREE_MB=$(df -P -m /system/ | grep 'mmcblk0p30' | awk '{print $4}')
FREE_KB=$(df -Pk /system/ | grep 'mmcblk0p30' | awk '{print $4}')
FREE_SEC=$(df -P -B 512 /system/ | grep 'mmcblk0p30' | awk '{print $4}')
echo "Your system partion has $FREE_MB mbyte free ( kbyte = $FREE_KB ; sectors = $FREE_SEC)"
DATA_FS=$(sgdisk --print $MMC | awk ' $1 == "29" { print $2}')
DATA_LS=$(sgdisk --print $MMC | awk ' $1 == "29" { print $3}')
SYS_FS=$(sgdisk --print $MMC | awk ' $1 == "30" { print $2}')
SYS_LS=$(sgdisk --print $MMC | awk ' $1 == "30" { print $3}')
echo "Data partition first sector: $DATA_FS"
echo "Data partition last sector: $DATA_LS"
echo "System partition first sector: $SYS_FS"
echo "System partition last sector: $SYS_LS"
let NEW_DATA_LS=$DATA_LS+$FREE_SEC-$NEW_FREE_SEC
let NEW_SYS_FS=$NEW_DATA_LS+1
echo "Data partion NEW last sector: $NEW_DATA_LS"
echo "System partion NEW first sector: $NEW_SYS_FS"
-------------------------------
Output:
/external_sd # . resize_partions
Your system partion has 839 mbyte free ( kbyte = 859392 ; sectors = 1718784)
Data partition first sector: 1449984
Data partition last sector: 10043391
System partition first sector: 10043392
System partition last sector: 15269375
Data partion NEW last sector: 11696639
System partion NEW first sector: 11696640
-------------------------------
Next things to code would be:
- Backup both partitions to SD-card using "tar" ( tar cpf ...)
- unmount partitions
- delete partitions ( sdisk $MMC --delete 30 )
- create partitions with new sector boundaries ( sgdisk $MMC --new 30:11696640:15269375 )
- change partition type ( sgdisk $MMC -t 30:8300)
- change name ( sgdisk $MMC --change-name 30:"system")
- create ext4 partion ( make_ext4fs -L system /dev/block/mmcblk0p30)
- mount
- restore partions ( tar xpf ..)
Do i need special options for make_ext4fs ?
But the question is: would this work ??? What, if i bootloop my device ?
klarseher said:
Hello,
i've startet coding a shell script:
------------------------------------------------------------
#!/bin/bash
MMC=/dev/block/mmcblk0
NEW_FREE_SEC=65536 # 32 mbyte in sectors
if [ $(id -u) -ne 0 ]; then
echo "Only root is allowed"
exit
fi
mount | grep "$MMC" > /dev/null
RC=$?
if [ $RC -eq 1 ]; then
echo "system not mounted. mounting now"
mount /system
RC=$?
echo $RC
fi
FREE_MB=$(df -P -m /system/ | grep 'mmcblk0p30' | awk '{print $4}')
FREE_KB=$(df -Pk /system/ | grep 'mmcblk0p30' | awk '{print $4}')
FREE_SEC=$(df -P -B 512 /system/ | grep 'mmcblk0p30' | awk '{print $4}')
echo "Your system partion has $FREE_MB mbyte free ( kbyte = $FREE_KB ; sectors = $FREE_SEC)"
DATA_FS=$(sgdisk --print $MMC | awk ' $1 == "29" { print $2}')
DATA_LS=$(sgdisk --print $MMC | awk ' $1 == "29" { print $3}')
SYS_FS=$(sgdisk --print $MMC | awk ' $1 == "30" { print $2}')
SYS_LS=$(sgdisk --print $MMC | awk ' $1 == "30" { print $3}')
echo "Data partition first sector: $DATA_FS"
echo "Data partition last sector: $DATA_LS"
echo "System partition first sector: $SYS_FS"
echo "System partition last sector: $SYS_LS"
let NEW_DATA_LS=$DATA_LS+$FREE_SEC-$NEW_FREE_SEC
let NEW_SYS_FS=$NEW_DATA_LS+1
echo "Data partion NEW last sector: $NEW_DATA_LS"
echo "System partion NEW first sector: $NEW_SYS_FS"
-------------------------------
Output:
/external_sd # . resize_partions
Your system partion has 839 mbyte free ( kbyte = 859392 ; sectors = 1718784)
Data partition first sector: 1449984
Data partition last sector: 10043391
System partition first sector: 10043392
System partition last sector: 15269375
Data partion NEW last sector: 11696639
System partion NEW first sector: 11696640
-------------------------------
Next things to code would be:
- Backup both partitions to SD-card using "tar" ( tar cpf ...)
- unmount partitions
- delete partitions ( sdisk $MMC --delete 30 )
- create partitions with new sector boundaries ( sgdisk $MMC --new 30:11696640:15269375 )
- change partition type ( sgdisk $MMC -t 30:8300)
- change name ( sgdisk $MMC --change-name 30:"system")
- create ext4 partion ( make_ext4fs -L system /dev/block/mmcblk0p30)
- mount
- restore partions ( tar xpf ..)
Do i need special options for make_ext4fs ?
But the question is: would this work ??? What, if i bootloop my device ?
Click to expand...
Click to collapse
try and give info
Flashing stock with Flashtool should restore official partition table.
bootloop now ...
ch3mn3y said:
Flashing stock with Flashtool should restore official partition table.
Click to expand...
Click to collapse
As a first step, I have only risized the system partition. The files were backuped with "tar cpf" and restored with "tar xpf" in the recreated partition.
I could see the files in the partion, but the phone does not startup "normal".
I had to use the hidden off button near the SD-slot to power off the phone. Flashing didn't resolved the problem. There is an error while writing system.sin - probably because the partition is to small.
Maybe i have to downgrade flashtool, as mentioned in http://forum.xda-developers.com/showpost.php?p=62751375&postcount=3 ???
Next step would be to "unbrick" my phone. With original system partition, i will only backup and restore the content, to see, if "tar" is able to do the job. Second try with TWRP Backup.
Hello,
I could be wrong, but I think your bootloop problem would probably comes from some sort of SONY extra protection layer.
This additional security system is called RIC and prevents you from freely modifying the system partition at runtime by blocking r/w mount of the system partition.
There is also a default Android security that checks the system partition against a hardcoded hash on boot, to prevent system partition modification (maybe partition size is part of the check operation...).
So you may try to disable the first protection (look at Z5 tutorial) and/or look for a way to bypass the boot check (not sure if possible).
Regards.
system parttion successfull shrinked
Okay, i finally shrinked my system partition and the phone will boot up normal.
The process is a little bit complicated.
You have to create a TWRP backup of your debloated system partition.
Check, if this backup is working ! So rm -rf everything in system and restore from backup.
Next, delete partition with sgdisk and create smaler one ( my script from 1st post will do the calculation for 1st sector )
Change name of partion to "system".
Create ext4 fileystem on parttion ( TWRP will also format - don't know if realy needed )
Reboot into TWRP an try to restore - maybe reboot some times into TWRP and check parttions
To recover with flashtool in case you didn't manage to get it to work - delete system partition and flash "partition.sin" and "system.sin"
In the next step, i will increase data partition
Code:
/system # df -h .
Filesystem Size Used Available Use% Mounted on
/dev/block/mmcblk0p30
1.6G 1.6G 4.9M 100% /system
/system # sgdisk --print /dev/block/mmcblk0 | tail -10
21 393216 475135 40.0 MiB FFFF FOTAKernel
22 475136 475151 8.0 KiB FFFF ssd
23 475152 475215 32.0 KiB FFFF DDR
24 475216 476239 512.0 KiB FFFF config
25 476240 509007 16.0 MiB 8300 LTALabel
26 516096 532479 8.0 MiB 8300 apps_log
27 532480 1040383 248.0 MiB 8300 oem
28 1040384 1449983 200.0 MiB 8300 cache
29 1449984 10043391 4.1 GiB 8300 userdata
30 11702880 15269375 1.7 GiB 8300 system
/system #
klarseher said:
Okay, i finally shrinked my system partition and the phone will boot up normal.
The process is a little bit complicated.
You have to create a TWRP backup of your debloated system partition.
Check, if this backup is working ! So rm -rf everything in system and restore from backup.
Next, delete partition with sgdisk and create smaler one ( my script from 1st post will do the calculation for 1st sector )
Change name of partion to "system".
Create ext4 fileystem on parttion ( TWRP will also format - don't know if realy needed )
Reboot into TWRP an try to restore - maybe reboot some times into TWRP and check parttions
To recover with flashtool in case you didn't manage to get it to work - delete system partition and flash "partition.sin" and "system.sin"
In the next step, i will increase data partition
Code:
/system # df -h .
Filesystem Size Used Available Use% Mounted on
/dev/block/mmcblk0p30
1.6G 1.6G 4.9M 100% /system
/system # sgdisk --print /dev/block/mmcblk0 | tail -10
21 393216 475135 40.0 MiB FFFF FOTAKernel
22 475136 475151 8.0 KiB FFFF ssd
23 475152 475215 32.0 KiB FFFF DDR
24 475216 476239 512.0 KiB FFFF config
25 476240 509007 16.0 MiB 8300 LTALabel
26 516096 532479 8.0 MiB 8300 apps_log
27 532480 1040383 248.0 MiB 8300 oem
28 1040384 1449983 200.0 MiB 8300 cache
29 1449984 10043391 4.1 GiB 8300 userdata
30 11702880 15269375 1.7 GiB 8300 system
/system #
Click to expand...
Click to collapse
give flashable zip
Increasing userdata worked the same way. Backup userdata with TWRP, delete partition 29, create partition 29 with new last sector. Restore with TWRP.
( I've lost adoptive storage in this step - but this is okay, because adoptive storage is to slow for me )
Now userdata on my phone has 4.9 GIB.
To do the same, you have to read and understand.
There is no flashable zip - you will resize your partitions after removing unused stuff from system partition. You have to deal with sgdisk on the TWRP cmdline ( adb shell)
klarseher said:
Hello,
my phone is an E2303. The only problem for me with this phone is the limited memory.
I have rooted the phone the way explained in http://forum.xda-developers.com/m4-a.../root-t3421932
With Root Explorer, i removed a lot of stuff in /system. Now 1,66 GB are used and 810 MB are free.
usderdata and system partitions ( sgdisk --print /dev/block/mmcblk0 )
Nr Name Start Stop Size type
29 userdata 1449984 10043391 4.1 GIB 8300
30 system 10043392 15269375 2.5 GIB 8300
My idea:
- use TWRP to backup userdata and system partions
- delete both partitions
- create userdata with 4.6 GIB
- create system with 2 GIB
- format both partitions with make_extfs4
- restore both partitions with TWRP
I know that as a consequence, i'm not able to flash updates.
Do you think, that this would work ?
Click to expand...
Click to collapse
When you remove or delete any system app the folder & ink may get deleted but odex file of original stock rom remains in odex folder as squashed this way you can free up at least 200 to 300 mb.
I have tested it on LP.
& As per my assumption the squashed odexes got nothing to do with selinux as it only load images from squashed folder.
rebuild odex.system.sqsh
Hello,
I rebuild odex.system.sqsh - the size has been reduced from 275MByte to 151MByte.
but, my current linux distribution does not support selinux
So, i have to repeat with another linux distribution and replace odex.system.sqsh in /system folder.
maybe next weekend ...
howto
klarseher said:
Hello,
I rebuild odex.system.sqsh - the size has been reduced from 275MByte to 151MByte.
but, my current linux distribution does not support selinux
So, i have to repeat with another linux distribution and replace odex.system.sqsh in /system folder.
maybe next weekend ...
Click to expand...
Click to collapse
The solution:
- install CentOS 7 in VirtualBox
Get odex.system.sqsh from phone ( Phone in TWRP Mode):
adb pull /system/odex.system.sqsh .
Copy odex.system.sqsh to CentOS ( via shared folder)
As root:
- yum install squashfs-tools
- unsquashfs odex.system.sqsh # you got a lot of warnings, because unsquashfs is not allowed to access selinux attributes
- rm -rf squashfs-root # remove for next try
- grep unsquashfs /var/log/audit/audit.log | audit2allow -M mypol
- semodule -i mypol.pp
- unsquashfs odex.system.sqsh
Now, remove unused stuff inside squashfs-root folder
mksquashfs squashfs-root/ odex.system-new.sqsh -comp xz -noI -noF -noX -no-fragments -no-duplicates
---
In TWRP -adb shell:
cd /system
touch dummy
chcon --reference=system.odex.sqsh dummy
rm system.odex.sqsh
# Copy from pc with
adb put odex.system-new.sqh /system/
Back in adb shell:
mv odex.system-new.sqh odex.system.sqh
chcon --reference=dummy system.odex.sqsh
---
The cleanaup in squashfs-root depends on you debloating. I have build my delete script on file lists from /system before and after removing unwanted apps. ( diff before/after | grep '\.odex$')
As a final step, i shrinked my system partion to 1.5 GB ( from original 2.5) and increased /data to 5.1 GB.
Very cool and great job! Maybe try making a step by step tutorial during your free time? Could benefit us all
partitions in DiskInfo
See layout of /data and /system partitions on my phone
klarseher said:
See layout of /data and /system partitions on my phone
Click to expand...
Click to collapse
Very cool and great job!
Please making a step by step tutorial for all !!! Thanks !
manhquyet90 said:
Very cool and great job!
Please making a step by step tutorial for all !!! Thanks !
Click to expand...
Click to collapse
Thanks !
Boot phone into TWRP
1. create a backup of your system partition with TWRP
2. "adb shell" to your phone (still booted in TWRP) and create a filelist from system partion on your SD card ( "mount /system ; find /system -type f > /external_sd/system_filelist.lst" - unsure about path to your SD-card )
( we need filelist later for odex "cleanup" )
3. "debloat" your system partition - there are some threads in this forum about removing stuff from /system - i could not help you with this task !
Boot phone into TWRP
4. "adb shell" to your phone. Come back with the output of "mount /system ; df -k /system" and "sgdisk --print /dev/block/mmcblk0"
( I will calculate the new first sector for the system partition depending on your free space )
Then, we do the next step together !
Kind regards
klarseher said:
Thanks !
Boot phone into TWRP
1. create a backup of your system partition with TWRP
2. "adb shell" to your phone (still booted in TWRP) and create a filelist from system partion on your SD card ( "mount /system ; find /system -type f > /external_sd/system_filelist.lst" - unsure about path to your SD-card )
( we need filelist later for odex "cleanup" )
3. "debloat" your system partition - there are some threads in this forum about removing stuff from /system - i could not help you with this task !
Boot phone into TWRP
4. "adb shell" to your phone. Come back with the output of "mount /system ; df -k /system" and "sgdisk --print /dev/block/mmcblk0"
( I will calculate the new first sector for the system partition depending on your free space )
Then, we do the next step together !
Kind regards
Click to expand...
Click to collapse
Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\MQ>adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
YT911B19A1 recovery
C:\Users\MQ>adb shell
~ # â†[6nmount /system
~ # â†[6nfind /system -type f > /external_sd/system_filelist.lst
~ # â†[6nmount /system
mount: mounting /dev/block/mmcblk0p30 on /system failed: Device or resource busy
~ # â†[6ndf -k /system
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/block/mmcblk0p30
2531076 2448068 66624 97% /system
~ # â†[6nsgdisk --print /dev/block/mmcblk0
CANNOT LINK EXECUTABLE: cannot locate symbol "__register_atfork" referenced by "
sgdisk"...
page record for 0x7f91ab0010 was not found (block_size=64)
~ # â†[6n