Introduction
Hi folks,
While trying to get CM on a LG G3 (D855), I found people recommending Newest Root Method for LG devices (by digital-bug). Unfortunately this tool is Windows only and does not really describe what happens under the hood. For this reason I started reverse engineering the Download Mode protocol and created a Python tool that can replace the Send_Command.exe binary.
This project is aimed at users who would like to dump or restore partitions and developers who need some power in download mode.
Source code: https://github.com/Lekensteyn/lglaf
(Protocol documentation: https://github.com/Lekensteyn/lglaf/blob/master/protocol.md)
Features
Should work on any LG device.
Dump and restore partitions.
Dump individual files.
Run any shell command as root in Download Mode.
Works on Linux.
Works on Windows.
Opensource code and protocol documentation.
Installation instructions
See the README for details. Basically:
Install Python (www.python.org)
Install PyUSB (Linux) or LG drivers (Windows)
Ensure phone is connected and started in Download Mode (poweroff, hold Volume Up and insert USB cable in a PC).
Run the tool of your choice (lglaf.py, partitions.py, etc.)
Examples
Some examples are listed in the README, here are additional ones:
List partitions, dump the userdata partition (/data) to a local "data.bin" file (may take a while):
Code:
python partitions.py --list
python partitions.py --dump data.bin userdata
Dump all partitions (except ones larger than 64 MiB: cache, userdata, system, cust):
Code:
python extract-partitions.py
Backup the contents of the data partition (assuming it to be small enough to fit in /) and retrieve it:
Code:
python lglaf.py -c "busybox tar czf data.tar.gz data"
python dump-file.py /data.tar.gz data.tar.gz
Get more usage information on these tools:
Code:
python lglaf.py --help
python partitions.py --help
python extract-partitions.py --help
python dump-file.py --help
Q&A
Q: What devices are supported?
A: In principle all LG devices as they all use the same download mode. Tested with G2, G3, G4 (see README).
Q: How can I root a device with this?
A: This depends on your currently installed ROM. Feel free to post a guide.
Q: How can I install a custom ROM using this?
A: With older bootloader versions, you should be able to write a "bumped" recovery image:
Code:
python partitions.py --wipe recovery
python partitions.py --restore cm-12.1-20151117-SNAPSHOT-YOG7DAO1K8-d855-recovery.img recovery
Newer versions (such as my G3 (D855 with 20T)) do not support the "bump" method and will refuse to boot ("ERROR: Boot certification verify").
In that case, wipe the recovery partition and you will end up in the fastboot mode where you can boot your custom images:
Code:
# recovery
fastboot boot cm-12.1-20151117-SNAPSHOT-YOG7DAO1K8-d855-recovery.img
# after installing zip in recovery, reboot, then boot with:
unzip cm-12.1-20151117-SNAPSHOT-YOG7DAO1K8-d855.zip boot.img
fastboot boot boot.img
XDA:DevDB Information
LG Download Mode utility (LGLAF.py), Tool/Utility for all devices (see above for details)
Contributors
Lekensteyn
Source Code: https://github.com/Lekensteyn/lglaf
Version Information
Status: Beta
Created 2016-01-04
Last Updated 2016-01-04
(Reserved post)
(Also, was planning to post this in G3 general, but this is possibly of interest to other LG hackers.)
Hi! I got this to work with lglaf.py but I get the following error with partitions.py
$ python partitions.py --list
Traceback (most recent call last):
File "partitions.py", line 276, in <module>
main()
File "partitions.py", line 253, in main
list_partitions(comm, args.partition)
File "partitions.py", line 124, in list_partitions
partitions = get_partitions(comm)
File "partitions.py", line 41, in get_partitions
assert arrow == '->', "Expected arrow in ls output"
AssertionError: Expected arrow in ls output
Not sure what might be wrong.
Lekensteyn said:
(Also, was planning to post this in G3 general, but this is possibly of interest to other LG hackers.)
Click to expand...
Click to collapse
First of all, this is an awesome tool. I am very intrigued as I have bricked my lgk7 (lgk330). I am running into some trouble with it however.
lets get the preliminaries out of the way:
background:
bootloader is unlocked. neither adb nor fastboot see the device.
I did a full wipe from TWRP, even the system partition, (forgot to restore my backup ) and rebooted . In it's current form, doing this button combination to get back into TWRP on my K7 only runs TWRP "open recovery script" which reboots to the bootloader and no further.
I am using Ubuntu 16.04. Per your readme.md, I have installed Python 2.7.11 as well as 3.5.1+, PyUSB v1.0.0 (from source), and libusb-1.0-0
I added 42-usb-lglaf.rules to my udev rules.d
I have next to no skill with python.
verbose lsusb while in download mode, you'll notice that idProduct is "633e" just like the G3.
Code:
Bus 001 Device 011: ID 1004:633e LG Electronics, Inc. G2 Android Phone [MTP mode]
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x1004 LG Electronics, Inc.
idProduct 0x633e G2 Android Phone [MTP mode]
bcdDevice 3.10
iManufacturer 1 LG Electronics Inc.
iProduct 2 LGE Android Phone
iSerial 3 LGK330b3b3462
bNumConfigurations 2
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 6 Imaging
bInterfaceSubClass 1 Still Image Capture
bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470)
iInterface 5 MTP
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x001c 1x 28 bytes
bInterval 6
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 128
bNumInterfaces 4
bConfigurationValue 2
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 6 Imaging
bInterfaceSubClass 1 Still Image Capture
bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470)
iInterface 6 MTP
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x001c 1x 28 bytes
bInterval 6
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 1
bInterfaceCount 2
bFunctionClass 2 Communications
bFunctionSubClass 2 Abstract (modem)
bFunctionProtocol 1 AT-commands (v.25ter)
iFunction 9 CDC Serial
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 1 AT-commands (v.25ter)
iInterface 7 CDC Abstract Control Model (ACM)
CDC Header:
bcdCDC 1.10
CDC Call Management:
bmCapabilities 0x00
bDataInterface 2
CDC ACM:
bmCapabilities 0x02
line coding and serial state
CDC Union:
bMasterInterface 1
bSlaveInterface 2
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 9
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 8 CDC ACM Data
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x85 EP 5 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 2
Device Status: 0x0000
(Bus Powered)
lglfa does communicate with the phone. For example if I run
Code:
/opt/lglaf$ ./lglaf.py
LGLAF.py by Peter Wu (https://lekensteyn.nl/lglaf)
Type a shell command to execute or "exit" to leave.
# !INFO
LGLAF.py: WARNING: Command failed with error code 0x80000001
#ls
LGLAF.py: WARNING: Command failed with error code 0x8000010a
#!EXEC ls\0
LGLAF.py: WARNING: Header field requires a DWORD, got str 'ls\x00'
# dd if=/dev/zero of=/dev/null bs=5129 count=1
LGLAF.py: WARNING: Command failed with error code 0x8000010a
!INFO chances the status box on the phone to
Code:
USER S0.0 AS0.0 S
S U LG-K330 05.1.1 Hrev_10
K33010f
However, if i run something like extract-partitions.py
Code:
/opt/lglaf$ ./extract-partitions.py
Traceback (most recent call last):
File "./extract-partitions.py", line 63, in <module>
main()
File "./extract-partitions.py", line 58, in main
with partitions.laf_open_disk(comm) as disk_fd:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/opt/lglaf/partitions.py", line 73, in laf_open_disk
open_header = comm.call(open_cmd)[0]
File "/opt/lglaf/lglaf.py", line 176, in call
raise RuntimeError('Command failed with error code %#x' % errCode)
RuntimeError: Command failed with error code 0x8000010a
as a last note, here is my !INFO GPRO if it helps
Code:
download cable = 'USER'
battery level = 100
download type = ' '
download speed = 0
usb version = 'UHS'
hardware revision = 'rev_10'
download sw version = ' '
device sw version = 'K33010f'
secure device = 'S'
laf sw version = '1.2'
device factory version = 'LGK330AT-01-V10f-310-260-JAN-06-2016-ARB00+0'
device factory out version = 'LGK330AT-00-V10f-TMO-US-JAN-06-2016-ARB00+0'
pid = 'CY17S160129000815'
imei = 'xxxxxxxxxxxxxxxx'
model name = 'LG-K330'
device build type = 'U'
chipset platform = 'msm8909'
target_operator = 'TMO'
target_country = 'US'
ap_factory_reset_status = 6
cp_factory_reset_status = 0
isDownloadNotFinish = 0
qem = 0
cupss swfv = 'FFFFFFFFFFF-FFFFFFFFFFF-FFFFFFFFFFF-FFFFFFFFFFF-F'
is one binary dual plan = 0
memory size = 15269888
memory_id = 'H8G1e\x05\n'
bootloader_ver = 'MiniOS 3.0'
Any input at all would be greatly appreciated.
I am experiencing the same error with LG G3 EU D855: 0x8000010a. Connection seems to be working (lglaf.py -c '!INFO GPRO \x08\x0b\0\0' > props.bin returns correctly the information), but for any other command I get the error above.
I am trying to retrieve the userdata partition from a device in bootloop, therefore I would be very interested in a solution of this issue.
I don't know if someone is working on this problem, or has any suggestion, that would be very appreciated.
Thank you.
Hi, does anyone know how to push files to the device? I ended up in a bootloop after a botched install of Xposed.
EDIT: By pushing files, maybe something using "<, >, or |" via Command Prompt. I have cat and dd and the like for Windows, if that can be of any use.
rk2612 said:
Hi! I got this to work with lglaf.py but I get the following error with partitions.py ....
Click to expand...
Click to collapse
I couldn't get partitions.py to work and my guess is that this occurs because partitions of my LG-G3-D858HK are perhaps different from D855 for which this is written.
Nonetheless, I was able to use the following to try and install TWRP:
1. Copied TWRP to internal SD Card
2. Once connected in download mode:
$ python lglaf.py
LGLAF.py by Peter Wu (https://lekensteyn.nl/lglaf)
Type a shell command to execute or "exit" to leave.
# dd if=/data/media/0/[name_of_your_recovery].img of=/dev/block/platform/msm_sdcc.1/by-name/recovery
27540+1 records in
27540+1 records out
14100496 bytes transferred in 1.152 secs (12240013 bytes/sec)
# exitThat's it. TWRP installed without a fuss.
Sounds too good to be true but I am wondering if this can be used on all LG / Qualcomm devices. Anyone willing to try?
PS: Make sure that you've got Python 2.7 or 3 and pyusb installed (https://github.com/walac/pyusb) installed. I tried it on Ubuntu 16.04.
rk2612 said:
I couldn't get partitions.py to work and my guess is that this occurs because partitions of my LG-G3-D858HK are perhaps different from D855 for which this is written.
Nonetheless, I was able to use the following to try and install TWRP:
1. Copied TWRP to internal SD Card
2. Once connected in download mode:
$ python lglaf.py
LGLAF.py by Peter Wu (https://lekensteyn.nl/lglaf)
Type a shell command to execute or "exit" to leave.
# dd if=/data/media/0/[name_of_your_recovery].img of=/dev/block/platform/msm_sdcc.1/by-name/recovery
27540+1 records in
27540+1 records out
14100496 bytes transferred in 1.152 secs (12240013 bytes/sec)
# exit
That's it. TWRP installed without a fuss.
Sounds too good to be true but I am wondering if this can be used on all LG / Qualcomm devices. Anyone willing to try?
PS: Make sure that you've got Python 2.7 or 3 and pyusb installed (https://github.com/walac/pyusb) installed. I tried it on Ubuntu 16.04.
Click to expand...
Click to collapse
Yes it works fine for the LG G4 and is my preferred choice because I have linux boxes only. it is integrated in the next version of FWUL as well .
Sent from my LG-H815 using XDA Labs
steadfasterX said:
Yes it works fine for the LG G4 and is my preferred choice because I have linux boxes only. it is integrated in the next version of FWUL as well .
Sent from my LG-H815 using XDA Labs
Click to expand...
Click to collapse
Great! FWUL sounds good like what a lot of people on this forum could use.
Any idea if LG has patched lglaf now like they did patch the bump on LG G3 in subsequent upgrades? Wondering if it works only on LG lglaf partitions that most of us may have if we've manually upgraded system and boot partitions from the KDZ. E.g. when I upgraded from LP to MM, I extracted the system and boot images and then flashed them from TWRP (...hope that your FWUL has KDZ tools and boot / ramdisk pack & unpack tools integrated in it).
rk2612 said:
Great! FWUL sounds good like what a lot of people on this forum could use.
Any idea if LG has patched lglaf now like they did patch the bump on LG G3 in subsequent upgrades? Wondering if it works only on LG lglaf partitions that most of us may have if we've manually upgraded system and boot partitions from the KDZ. E.g. when I upgraded from LP to MM, I extracted the system and boot images and then flashed them from TWRP (...hope that your FWUL has KDZ tools and boot / ramdisk pack & unpack tools integrated in it).
Click to expand...
Click to collapse
Well I don't think so. Keep in mind that those both are total different things and the lglaf communication is needed by their own flashing tools as well.
Bump instead was ..afaik.. a method to unlock/trick the bootloader.
Added your suggestions to the roadmap Thx for the idea!
Sent from my LG-H815 using XDA Labs
steadfasterX said:
...
Added your suggestions to the roadmap Thx for the idea!
Click to expand...
Click to collapse
And since your FWUL is based on Arch, will the ISO be bootable from a grub menu entry? If so, what will that be?
rk2612 said:
And since your FWUL is based on Arch, will the ISO be bootable from a grub menu entry? If so, what will that be?
Click to expand...
Click to collapse
I dont get u sorry. FWUL is an ISO booted from an USB stick or CD/DVD and the idea is to give windows users the option to have a just-working environment for Android end-user tasks.
but we better discuss that in the FWUL thread I think
.
How to reboot to fastboot or recovery? I cant reboot to this
Excellent idea! Unfortunately I get a timeout on both my windows and linux box
Windows:
Code:
IOError: [Errno 2] No such file or directory: u'COM41'
(Correct drivers installed, I can us LGFlashTool to downgrade fine, and device is on COM41)
Linux:
List partitions fails:
Code:
usb.core.USBError: [Errno 110] Operation timed out
lglaf shell:
Code:
# !INFO
LGLAF.py: WARNING: Command failed with error code 0x80000001
It is definitely making communication in linux - if the device isn't plugged in, it gives me that error. Also, certain commands will cause the screen on the phone to change, but not fully as expected. Rats. Any ideas? (I installed the rules.d) Also, I am on BBQ Linux (which is Arch based)
Fix for reading/writing partitions!!
If you know your block mapping (you have a rooted device and can dump the partition table outside of download mode (with real root you would do ls -l /dev/block/platform/msm_sdcc.1/by-name) you can use something like my patch here to get things working:
https://github.com/blastagator/lglaf/commit/6397f3ad88cc9729ff671351991499523e37dfe6
THIS IS ONLY FOR G3 VS985!!! YOUR BLOCK MAPPING MIGHT BE DIFFERENT, DONT JUST COPY MINE!!!
Once you do this, commands like
Code:
python partitions.py --dump boot.img boot
will work fine.
blastagator said:
Excellent idea! Unfortunately I get a timeout on both my windows and linux box
Windows:
(Correct drivers installed, I can us LGFlashTool to downgrade fine, and device is on COM41)
Linux:
List partitions fails:
lglaf shell:
It is definitely making communication in linux - if the device isn't plugged in, it gives me that error. Also, certain commands will cause the screen on the phone to change, but not fully as expected. Rats. Any ideas? (I installed the rules.d) Also, I am on BBQ Linux (which is Arch based)
Fix for reading/writing partitions!!
If you know your block mapping (you have a rooted device and can dump the partition table outside of download mode (with real root you would do ls -l /dev/block/platform/msm_sdcc.1/by-name) you can use something like my patch here to get things working:
https://github.com/blastagator/lglaf/commit/6397f3ad88cc9729ff671351991499523e37dfe6
THIS IS ONLY FOR G3 VS985!!! YOUR BLOCK MAPPING MIGHT BE DIFFERENT, DONT JUST COPY MINE!!!
Once you do this, commands like
will work fine.
Click to expand...
Click to collapse
Have you tried the argument unlock? The name for this argument is totally misleading a better name would be auth because it does not unlock your device but uses a challenge and response method to communicate. Atm it is available with the shell only
Sent from my LG-H815 using XDA Labs
steadfasterX said:
Have you tried the argument unlock? The name for this argument is totally misleading a better name would be auth because it does not unlock your device but uses a challenge and response method to communicate. Atm it is available with the shell only
Sent from my LG-H815 using XDA Labs
Click to expand...
Click to collapse
Ya, it didn't work for me (I also tried the key that was in the comments as something to try if the first didn't work). I'm not too worried about this personally, my main goal was read/write partitions, which is still easily done with my workaround. Certainly things may change down the line though, if they make the unlock nonsense needed for read/write commands. Not sure they would do that though, considering things like the VZW PC update app would need to be able to unlock, and the key could probably be fished out of that communication. *shrug*
Hope my workaround helps someone
K10 has a different structure.
K430TV
partitions.py getting assert error.
this is my mount output
rootfs / rootfs rw,seclabel 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,seclabel,relatime 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/protect1 /protect_f ext4 rw,seclabel,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/protect2 /protect_s ext4 rw,seclabel,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/nvdata /nvdata ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/cust /cust ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/mpt /mpt ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/persist /persist ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/persist_lg /persist-lg ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/OP /OP ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
Any chance to make this work to extract userdata?
Dont know if it helps but if I do a ls with a mount address I get the device. see
# ls -l /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/nvdata
lrwxrwxrwx root root 2010-01-03 08:58 nvdata -> /dev/block/mmcblk0p35
# ls -l /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/OP
lrwxrwxrwx root root 2010-01-03 08:58 OP -> /dev/block/mmcblk0p38
If I ls -l to /dev/block/
# ls -l /dev/block/
lstat '/dev/block//mmcblk0p11' failed: Permission denied
lstat '/dev/block//mmcblk0p12' failed: Permission denied
lstat '/dev/block//mmcblk0p14' failed: Permission denied
lstat '/dev/block//mmcblk0p16' failed: Permission denied
lstat '/dev/block//mmcblk0p17' failed: Permission denied
lstat '/dev/block//mmcblk0p18' failed: Permission denied
lstat '/dev/block//mmcblk0p19' failed: Permission denied
lstat '/dev/block//mmcblk0p20' failed: Permission denied
lstat '/dev/block//mmcblk0p21' failed: Permission denied
lstat '/dev/block//mmcblk0p22' failed: Permission denied
lstat '/dev/block//mmcblk0p26' failed: Permission denied
lstat '/dev/block//mmcblk0p27' failed: Permission denied
lstat '/dev/block//mmcblk0p29' failed: Permission denied
lstat '/dev/block//mmcblk0p32' failed: Permission denied
lstat '/dev/block//mmcblk0p34' failed: Permission denied
lstat '/dev/block//mmcblk0p35' failed: Permission denied
lstat '/dev/block//mmcblk0p36' failed: Permission denied
lstat '/dev/block//mmcblk0p38' failed: Permission denied
brw------- root root 7, 0 2010-01-03 08:58 loop0
brw------- root root 7, 1 2010-01-03 08:58 loop1
brw------- root root 7, 2 2010-01-03 08:58 loop2
brw------- root root 7, 3 2010-01-03 08:58 loop3
brw------- root root 7, 4 2010-01-03 08:58 loop4
brw------- root root 7, 5 2010-01-03 08:58 loop5
brw------- root root 7, 6 2010-01-03 08:58 loop6
brw------- root root 7, 7 2010-01-03 08:58 loop7
brw-rw---- root system 179, 0 2010-01-03 08:58 mmcblk0
brw-rw---- root system 179, 32 2010-01-03 08:58 mmcblk0boot0
brw-rw---- root system 179, 64 2010-01-03 08:58 mmcblk0boot1
brw-rw---- root system 179, 1 2010-01-03 08:58 mmcblk0p1
brw-rw---- root system 179, 10 2010-01-03 08:58 mmcblk0p10
brw------- root root 179, 13 2010-01-03 08:58 mmcblk0p13
brw------- root root 179, 15 2010-01-03 08:58 mmcblk0p15
brw-rw---- root system 179, 2 2010-01-03 08:58 mmcblk0p2
brw------- root root 179, 23 2010-01-03 08:58 mmcblk0p23
brw------- root root 179, 24 2010-01-03 08:58 mmcblk0p24
brw------- root root 179, 25 2010-01-03 08:58 mmcblk0p25
brw------- root root 179, 28 2010-01-03 08:58 mmcblk0p28
brw------- root root 179, 3 2010-01-03 08:58 mmcblk0p3
brw------- root root 179, 30 2010-01-03 08:58 mmcblk0p30
brw------- root root 179, 31 2010-01-03 08:58 mmcblk0p31
brw-r--r-- root system 259, 1 2010-01-03 08:58 mmcblk0p33
brw------- root root 259, 5 2010-01-03 08:58 mmcblk0p37
brw------- root root 259, 7 2010-01-03 08:58 mmcblk0p39
brw-rw---- root system 179, 4 2010-01-03 08:58 mmcblk0p4
brw------- root root 259, 8 2010-01-03 08:58 mmcblk0p40
brw------- root root 179, 5 2010-01-03 08:58 mmcblk0p5
brw------- root root 179, 6 2010-01-03 08:58 mmcblk0p6
brw------- root root 179, 7 2010-01-03 08:58 mmcblk0p7
brw------- root root 179, 8 2010-01-03 08:58 mmcblk0p8
brw------- root root 179, 9 2010-01-03 08:58 mmcblk0p9
brw------- root root 179, 96 2010-01-03 08:58 mmcblk0rpmb
drwxr-xr-x root root 2010-01-03 08:58 platform
brw------- root root 254, 0 2010-01-03 08:58 zram0
#
Hope this helps
---------- Post added at 02:16 AM ---------- Previous post was at 01:54 AM ----------
Can I use DD to dump to an sd card or OTG?
---------- Post added at 02:35 AM ---------- Previous post was at 02:16 AM ----------
Changed the path in partition.py to /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/
Dumping now..
OK dumped data.bin 11gb file, how can I mount that?
rk2612 said:
AssertionError: Expected arrow in ls output
Not sure what might be wrong.
Click to expand...
Click to collapse
I'm getting this error, too. I was able to fix it by doing two small changes to partitions.py, function "get_partitions":
1. Change the line starting with "name_cmd" into:
Code:
name_cmd = 'ls -l /dev/block/platform/msm_sdcc.1/by-name'
2. Insert the following line after "for line in output.strip()...":
Code:
if line[0]=="l":
Make sure, the indentation is correct (more the the preceding "for" line, less than the following line with "label,arrow,path").
Probably someone by whom the original implementation works can check, whether this is a more generic solution?
I need help. I am trying to install either firmware OR custom recovery onto an LS660. This is my last hope. Please understand I know nothing of python and this is a one time fix. So plese be descriptive in lamen's terms for what file needs to be where and exactly what I must type.
Related
I think this thread is obsolete now, please go to
[DEV][REF] El Grande Partition Table Reference
instead, which contains more facts
Hi,
I want to create a list of Android partitions, to collect information for different purposes.
My current cause of investigation is about repartitioning emmc bricked Samsung phones, but the guide could collect all kinds of information (in short form, eventually with links to deeper investigations).
I want to format this as a living post, with new information added where appropriate (I assume the wiki would fit better, but I don't see a section to put this, also I don't know if fitting to Samsung only or Android in general until enough information is collected).
So let's start:
So let's visit partitions one by one:
GANG
* has zero size in PIT, seems to be hidden in the following unused area
* no real partition, but included in PITs
BOOT
* has zero size in PIT, seems to be hidden in the following unused area
EFS
* mounted on /efs
* contains many personalized information
* IMEI
* bluetooth MAC etc.
* restoration only possible with JTAG
* should be backuped!!!
SBL1, SBL2
* BL = boot loader
* S = Secondary?
* why do we have SBL1 *and* SBL2?
PARAM
* currently I don't know anything about this
KERNEL
* contains kernel (obviously)
* also contains recovery on some/many Samsung Galaxy phones (e.g. N7000)
* read only
RECOVERY
* seems to be unused on Samsung Galaxy N7000, KERNEL comes with recovery integrated
* read only
CACHE
* mounted on /cache
* temporary data
* can be cleared without loosing any important data
MODEM
* modem software for cell phone
* can be flashed from stock file
* read only?
FACTORYFS, system
* mounted on /system
* main OS code
* system apps
* read only
DATAFS, data
* mounted on /data
* user apps
* read/write
UMS, userdata
* mounted on /sdcard, sometimes /emmc
* sometimes called internal sd
HIDDEN, PRELOAD
* mounted on /preload
* purpose?
FOTA
* F = Factory?
* OTA = Over The Air
* may be used for Updates by stock ROM
Here are also some general thoughts about repartitioning these partitions to be mixed into the list later if it fits (just as a reminder):
* if you have a brick in a partition you cannot create a backup to restore afterwards
* partitions which have stock contents (not personalized) will be easy
* EFS cannot be restored without having a backup,
it contains nearly all really personalized information, with the most important data being the IMEI, which is unique to your phone. You find it printed on a sticker on your phone, but currently no one seems to be able to patch it into a generic copy of the EFS.
* some partitions will be needed to boot into recovery and/or download mode
I would assume BOOT, SBL1 and/or SBL2 are involved.
Some may be needed to boot into both recovery *and* download mode.
Some may be needed only for one of them.
If a PIT would move these, you cannot enter download and/or recovery again, thus your phone is nearly dead and only recoverable by JTAG.
* what about PARAM?
First of all, great initiative!
I have a SE Xperia Arc and the file structure differs a lot from your Samsung device.
Here is a list of the partitions, their current mount point(s) and filetype. I have put some useful references to the list. This will probably provide more accurate descriptions, rather than giving a brief explanation on each file system.
rootfs / rootfs [1]
tmpfs /dev tmpfs [2]
tmpfs /mnt/asec tmpfs
tmpfs /mnt/obb tmpfs
tmpfs /mnt/sdcard/.android_secure tmpfs
devpts /dev/pts devpts [3]
proc /proc proc [4]
sysfs /sys sysfs [5]
/dev/block/mtdblock0 /system yaffs2 [6][8]
/dev/block/mtdblock1 /cache yaffs2
/dev/block/mtdblock2 /system/vendor yaffs2
/dev/block/mtdblock3 /data yaffs2
/dev/block/vold/179:1 /mnt/sdcard vfat [7][9]
/dev/block/vold/179:1 /mnt/secure/asec vfat
References:
[1] rootfs
[2] tmpfs
[3] devpts
[4] proc
[5] sysfs
[6] yaffs2
[7] vfat Virtual FAT
[8] mtd
[9] vold
I also found two more links that could be useful in this thread.
Atrix HD Partition Research, How to use QUALCOMM eMMC MBR/EBR Partitioning plugin
hg42 said:
FOTA
* F = Factory?
* OTA = Over The Air
* may be used for Updates by stock ROM
Click to expand...
Click to collapse
F = firmware, http://en.wikipedia.org/wiki/FOTA_%28technology%29
Thanks, nice contribution.
Can you provide a dump of 'parted print' for your device?
Unfortunately, the parted partition command is not included among the Xperia Arc's stock binaries, nor in BusyBox 1.20.2 (but hopefully in the future).
Do you have a pre-compiled binary to share?
Here is what I can contribute to your collection for now:
Code:
[email protected]:/ # busybox fdisk -l
Linux localhost 2.6.32.9-perf #1 PREEMPT Wed Jul 4 12:32:24 2012 armv7l GNU/Linux
[email protected]:/ # busybox fdisk -l
Note: sector size is 4096 (not 512)
Disk [URL="http://shmilyxbq-compcache.googlecode.com/hg/README"]/dev/zram0[/URL]: 62 MB, 62914560 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 4096 = 65802240 bytes
Disk /dev/zram0 doesn't contain a valid partition table
k02a said:
Unfortunately, the parted partition command is not included among the Xperia Arc's stock binaries, nor in BusyBox 1.20.2 (but hopefully in the future).
Do you have a pre-compiled binary to share?
Click to expand...
Click to collapse
you can try the attachment to this post
but I'm not sure if an exynos processor (Samsung Galaxy Note N7000) has the same executable format than your phone, at least both have armv7l.
hg42 said:
but I'm not sure if an exynos processor (Samsung Galaxy Note N7000) has the same executable format than your phone, at least both have armv7l.
Click to expand...
Click to collapse
The parted binary worked fine, but the file system on the LT15i needs to be explored some day.
Code:
[email protected]:/ # parted
parted
GNU Parted 1.8.8.1.179-aef3
Using /dev/zram0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
print
Error: /dev/zram0: unrecognised disk label
(parted)
k02a said:
The parted binary worked fine, but the file system on the LT15i needs to be explored some day.
Error: /dev/zram0: unrecognised disk label
Click to expand...
Click to collapse
can you post the output of " adb shell ls /dev/block/ "?
Sure.
Code:
[email protected]:/ $ ls -la /dev/block
ls -la /dev/block
brw------- root root 254, 0 1980-01-06 02:02 dm-0
brw------- root root 254, 8 1980-01-06 02:02 dm-8
brw------- root root 7, 0 1980-01-06 02:01 loop0
brw------- root root 7, 1 1980-01-06 02:01 loop1
brw-rw---- root root 7, 10 1980-01-06 02:02 loop10
brw-rw---- root root 7, 11 1980-01-06 02:02 loop11
brw-rw---- root root 7, 12 1980-01-06 02:02 loop12
brw------- root root 7, 2 1980-01-06 02:01 loop2
brw------- root root 7, 3 1980-01-06 02:01 loop3
brw------- root root 7, 4 1980-01-06 02:01 loop4
brw------- root root 7, 5 1980-01-06 02:01 loop5
brw------- root root 7, 6 1980-01-06 02:01 loop6
brw------- root root 7, 7 1980-01-06 02:01 loop7
brw-rw---- root root 7, 8 1980-01-06 02:02 loop8
brw-rw---- root root 7, 9 1980-01-06 02:02 loop9
brw------- root root 179, 0 1980-01-06 02:01 mmcblk0
brw------- root root 179, 1 1980-01-06 02:01 mmcblk0p1
brw------- root root 31, 0 1980-01-06 02:01 mtdblock0
brw------- root root 31, 1 1980-01-06 02:01 mtdblock1
brw------- root root 31, 2 1980-01-06 02:01 mtdblock2
brw------- root root 31, 3 1980-01-06 02:01 mtdblock3
drwxr-xr-x root root 1980-01-06 02:01 platform
brw------- root root 1, 0 1980-01-06 02:01 ram0
brw------- root root 1, 1 1980-01-06 02:01 ram1
brw------- root root 1, 2 1980-01-06 02:01 ram2
brw------- root root 1, 3 1980-01-06 02:01 ram3
brw------- root root 1, 4 1980-01-06 02:01 ram4
brw------- root root 1, 5 1980-01-06 02:01 ram5
brw------- root root 1, 6 1980-01-06 02:01 ram6
brw------- root root 1, 7 1980-01-06 02:01 ram7
drwxr-xr-x root root 1980-01-06 02:01 vold
brw------- root root 253, 0 1980-01-06 02:01 zram0
The listing you were asking for is not as interesting as the following:
Code:
[email protected]:/ # ls -la /sys/devices/virtual/block/zram0
ls -la /sys/devices/virtual/block/zram0
-r--r--r-- root root 4096 2012-09-06 00:18 alignment_offset
lrwxrwxrwx root root 2012-09-06 00:18 bdi -> ../../bdi/253:0
-r--r--r-- root root 4096 2012-09-06 00:18 capability
-r--r--r-- root root 4096 2012-09-06 00:18 compr_data_size
-r--r--r-- root root 4096 2012-09-06 00:18 dev
-rw-r--r-- root root 4096 1980-01-06 02:01 disksize
-r--r--r-- root root 4096 2012-09-06 00:18 ext_range
drwxr-xr-x root root 2012-09-06 00:18 holders
-r--r--r-- root root 4096 2012-09-06 00:18 inflight
-r--r--r-- root root 4096 2012-09-06 00:18 initstate
-r--r--r-- root root 4096 2012-09-06 00:18 invalid_io
-r--r--r-- root root 4096 2012-09-06 00:18 mem_used_total
-r--r--r-- root root 4096 2012-09-06 00:18 notify_free
-r--r--r-- root root 4096 2012-09-06 00:18 num_reads
-r--r--r-- root root 4096 2012-09-06 00:18 num_writes
-r--r--r-- root root 4096 2012-09-06 00:18 orig_data_size
drwxr-xr-x root root 2012-09-06 00:18 power
drwxr-xr-x root root 2012-09-06 00:18 queue
-r--r--r-- root root 4096 2012-09-06 00:18 range
-r--r--r-- root root 4096 2012-09-06 00:18 removable
--w------- root root 4096 2012-09-06 00:18 reset
-r--r--r-- root root 4096 2012-09-06 00:18 ro
-r--r--r-- root root 4096 2012-09-06 00:18 size
drwxr-xr-x root root 2012-09-06 00:18 slaves
-r--r--r-- root root 4096 2012-09-06 00:18 stat
lrwxrwxrwx root root 2012-09-06 00:18 subsystem -> ../../../../
class/block
-rw-r--r-- root root 4096 2012-09-06 00:18 uevent
-r--r--r-- root root 4096 2012-09-06 00:18 zero_pages
Time to get some sleep.
k02a said:
Sure.
Code:
[email protected]:/ $ ls -la /dev/block
ls -la /dev/block
...
brw------- root root 179, 0 1980-01-06 02:01 mmcblk0
brw------- root root 179, 1 1980-01-06 02:01 mmcblk0p1
brw------- root root 31, 0 1980-01-06 02:01 mtdblock0
brw------- root root 31, 1 1980-01-06 02:01 mtdblock1
brw------- root root 31, 2 1980-01-06 02:01 mtdblock2
brw------- root root 31, 3 1980-01-06 02:01 mtdblock3
...
The listing you were asking for is not as interesting as the following:
Code:
[email protected]:/ # ls -la /sys/devices/virtual/block/zram0
ls -la /sys/devices/virtual/block/zram0
...
[/QUOTE]
why? Do you mean mtdblock0-3 are really located on zram0?
Or what else?
mtdblock0-3 don't seem to be partitions of a block device, like mmcblk0p1 is a partition on mmcblk0
Click to expand...
Click to collapse
hg42 said:
why? Do you mean mtdblock0-3 are really located on zram0?
Or what else?
mtdblock0-3 don't seem to be partitions of a block device, like mmcblk0p1 is a partition on mmcblk0
Click to expand...
Click to collapse
Sorry for my ambiguousness...
After having a bad nights' sleep, I made some re-thinking.
I dd'ed the /dev/zram0 (62 914 560 bytes). This value also corresponds to the content found in /sys/block/zram0/disksize and I find it unlikely that the OS keeps the entire amount of mtdblocks within this memory constraint, even if they are compressed. I have not tried to mount the zram-image on a Linux system, so I cannot tell anything about its content. My belief is that this image carries some RAM contents and perhaps some cache information.
Did you find anything similar in your Samsung device?
The mmcblk:s seem to represent the MicroSD-card device and I assume the mmcblk0p1 is the (only) partition.
k02a said:
Sorry for my ambiguousness...
After having a bad nights' sleep, I made some re-thinking.
I dd'ed the /dev/zram0 (62 914 560 bytes). This value also corresponds to the content found in /sys/block/zram0/disksize and I find it unlikely that the OS keeps the entire amount of mtdblocks within this memory constraint, even if they are compressed. I have not tried to mount the zram-image on a Linux system, so I cannot tell anything about its content. My belief is that this image carries some RAM contents and perhaps some cache information.
Did you find anything similar in your Samsung device?
The mmcblk:s seem to represent the MicroSD-card device and I assume the mmcblk0p1 is the (only) partition.
Click to expand...
Click to collapse
we have these block devices:
Code:
[email protected]:/ $ ls -lF /dev/block/
brw------- 1 root root 7, 0 Sep 6 08:28 loop0
brw------- 1 root root 7, 1 Sep 6 08:28 loop1
brw------- 1 root root 7, 2 Sep 6 08:28 loop2
brw------- 1 root root 7, 3 Sep 6 08:28 loop3
brw------- 1 root root 7, 4 Sep 6 08:28 loop4
brw------- 1 root root 7, 5 Sep 6 08:28 loop5
brw------- 1 root root 7, 6 Sep 6 08:28 loop6
brw------- 1 root root 7, 7 Sep 6 08:28 loop7
brw------- 1 root root 179, 0 Sep 6 08:28 mmcblk0
brw------- 1 root root 179, 1 Sep 6 08:28 mmcblk0p1
brw------- 1 root root 259, 2 Sep 6 08:28 mmcblk0p10
brw------- 1 root root 259, 3 Sep 6 08:28 mmcblk0p11
brw------- 1 root root 259, 4 Sep 6 08:28 mmcblk0p12
brw------- 1 root root 179, 2 Sep 6 08:28 mmcblk0p2
brw------- 1 root root 179, 3 Sep 6 08:28 mmcblk0p3
brw------- 1 root root 179, 4 Sep 6 08:28 mmcblk0p4
brw------- 1 root root 179, 5 Sep 6 08:28 mmcblk0p5
brw------- 1 root root 179, 6 Sep 6 08:28 mmcblk0p6
brw------- 1 root root 179, 7 Sep 6 08:28 mmcblk0p7
brw-rw---- 1 system radio 259, 0 Sep 6 08:28 mmcblk0p8
brw------- 1 root root 259, 1 Sep 6 08:28 mmcblk0p9
brw------- 1 root root 179, 8 Sep 6 08:28 mmcblk1
brw------- 1 root root 179, 9 Sep 6 08:28 mmcblk1p1
drwxr-xr-x 4 root root 0 Sep 6 08:28 platform/
brw------- 1 root root 1, 0 Sep 6 08:28 ram0
brw------- 1 root root 1, 1 Sep 6 08:28 ram1
brw------- 1 root root 1, 10 Sep 6 08:28 ram10
brw------- 1 root root 1, 11 Sep 6 08:28 ram11
brw------- 1 root root 1, 12 Sep 6 08:28 ram12
brw------- 1 root root 1, 13 Sep 6 08:28 ram13
brw------- 1 root root 1, 14 Sep 6 08:28 ram14
brw------- 1 root root 1, 15 Sep 6 08:28 ram15
brw------- 1 root root 1, 2 Sep 6 08:28 ram2
brw------- 1 root root 1, 3 Sep 6 08:28 ram3
brw------- 1 root root 1, 4 Sep 6 08:28 ram4
brw------- 1 root root 1, 5 Sep 6 08:28 ram5
brw------- 1 root root 1, 6 Sep 6 08:28 ram6
brw------- 1 root root 1, 7 Sep 6 08:28 ram7
brw------- 1 root root 1, 8 Sep 6 08:28 ram8
brw------- 1 root root 1, 9 Sep 6 08:28 ram9
drwxr-xr-x 2 root root 0 Sep 6 08:28 vold/
The ram* may be what is zram in your device.
The 'z' may indeed mean compression.
There are several tmpfs in our device (e.g. /tmp and /dev, perhaps they use these ram disks).
Also the root file system where everything is mounted runs in ram.
The zram0 seems to act like some kind of swap RAM and was obviously added to the latest SE 2011 firmware version [1].
My guess is that Sony Ericsson decided to pick the compressed alternative, due to the smaller flash memory in their Xperia 2011 devices. This solution probably costs some clock cycles, but I assume it gains in overall internal storage capacity.
I found an interesting thread where sirkay showed how to initiate/alter the zram size.
[1] questions/problems with 4.1.B.0.587 firmware
You guys are confusing.
The Xperia NAND disk device is translated to an MTD block device in the Linux world. The partition boundaries are hardcoded in the bootloader passed to the kernel via the ATAGs parameters. You can see those partitions via /proc/mtd
Code:
# cat /proc/mtd
dev: size erasesize name
mtd0: 19000000 00040000 "system"
mtd1: 00600000 00040000 "appslog"
mtd2: 06580000 00040000 "cache"
mtd3: 1a400000 00040000 "userdata"
Still those are only the partitions the bootlooader chooses to expose to the kernel. In reality, there are more, unknown to the kernel.
kuisma said:
You guys are confusing.
The Xperia NAND disk device is translated to an MTD block device in the Linux world. The partition boundaries are hardcoded in the bootloader passed to the kernel via the ATAGs parameters. You can see those partitions via /proc/mtd
Code:
# cat /proc/mtd
dev: size erasesize name
mtd0: 19000000 00040000 "system"
mtd1: 00600000 00040000 "appslog"
mtd2: 06580000 00040000 "cache"
mtd3: 1a400000 00040000 "userdata"
Still those are only the partitions the bootlooader chooses to expose to the kernel. In reality, there are more, unknown to the kernel.
Click to expand...
Click to collapse
Thanks for clearing up, this fits my conclusions.
Never saw such fixed devices before.
hg42 said:
Thanks for clearing up, this fits my conclusions.
Never saw such fixed devices before.
Click to expand...
Click to collapse
I'd say this is the way it's most commonly done in Android devices, using a raw NAND device with the MTD translation layer. It's far more uncommon using block devices, such as MMC devices as the primary internal memory.
kuisma said:
You guys are confusing.
The Xperia NAND disk device is translated to an MTD block device in the Linux world. The partition boundaries are hardcoded in the bootloader passed to the kernel via the ATAGs parameters. You can see those partitions via /proc/mtd
Code:
# cat /proc/mtd
dev: size erasesize name
mtd0: 19000000 00040000 "system"
mtd1: 00600000 00040000 "appslog"
mtd2: 06580000 00040000 "cache"
mtd3: 1a400000 00040000 "userdata"
Still those are only the partitions the bootlooader chooses to expose to the kernel. In reality, there are more, unknown to the kernel.
Click to expand...
Click to collapse
Thanks for this. :good:
I am still curious about the possibility to gain boot or root partition access in Xperia?
Many other devices come with this feature, e.g. HTC Incredible S, HTC Vision, Acer Liquid Metal and on the widely spread article HOWTO: Unpack, Edit, and Re-Pack Boot Images).
Oh, by the way...
I found a collection with recovery images on OnlineNandroid.
k02a said:
Thanks for this. :good:
I am still curious about the possibility to gain boot or root partition access in Xperia?
Many other devices come with this feature, e.g. HTC Incredible S, HTC Vision, Acer Liquid Metal and on the widely spread article HOWTO: Unpack, Edit, and Re-Pack Boot Images).
Click to expand...
Click to collapse
In Xperia, the boot partition is not visible to the Linux kernel, so you can't simply dd it to an image file. The easiest way is running Sony Update Service reflashing your phone with the current firmware, and then copy the temporary files it downloaded, recreating the FTF file using Flashtool. Unzip the FTF and you've got the boot.img. Now split it, do whatever you want to change and flash it using fastboot. There's a YouTube video showing this in detail. Search for it. Or download the firmware FTF directly from a trusted source.
I looked in fota0.sin and found a few more partition names on the Xperia (Active):
Code:
amss
amss_fs
fota0
fota1
dsp1
boot
system
userdata
cache
image_backup
amss_log
vendor
ramdump
Thanks a lot for this, a really valuable post!
I know I wont find the help I need to do what I want here, but ill provide the stuff from my Galaxy Note tomorrow (partition layout/vold)...
My Galaxy Note is nice, but 2GB is a joke for apps, and damnit I want my sdcard to actually be mounted as /sdcard! (PITA for apps that utilize /sdcard for game data and backups, not to mention having a 32GB or 64GB makes the joke 10GB internal... a JOKE!)
hg42 said:
we have these block devices:
Code:
[email protected]:/ $ ls -lF /dev/block/
brw------- 1 root root 7, 0 Sep 6 08:28 loop0
brw------- 1 root root 7, 1 Sep 6 08:28 loop1
brw------- 1 root root 7, 2 Sep 6 08:28 loop2
brw------- 1 root root 7, 3 Sep 6 08:28 loop3
brw------- 1 root root 7, 4 Sep 6 08:28 loop4
brw------- 1 root root 7, 5 Sep 6 08:28 loop5
brw------- 1 root root 7, 6 Sep 6 08:28 loop6
brw------- 1 root root 7, 7 Sep 6 08:28 loop7
brw------- 1 root root 179, 0 Sep 6 08:28 mmcblk0
brw------- 1 root root 179, 1 Sep 6 08:28 mmcblk0p1
brw------- 1 root root 259, 2 Sep 6 08:28 mmcblk0p10
brw------- 1 root root 259, 3 Sep 6 08:28 mmcblk0p11
brw------- 1 root root 259, 4 Sep 6 08:28 mmcblk0p12
brw------- 1 root root 179, 2 Sep 6 08:28 mmcblk0p2
brw------- 1 root root 179, 3 Sep 6 08:28 mmcblk0p3
brw------- 1 root root 179, 4 Sep 6 08:28 mmcblk0p4
brw------- 1 root root 179, 5 Sep 6 08:28 mmcblk0p5
brw------- 1 root root 179, 6 Sep 6 08:28 mmcblk0p6
brw------- 1 root root 179, 7 Sep 6 08:28 mmcblk0p7
brw-rw---- 1 system radio 259, 0 Sep 6 08:28 mmcblk0p8
brw------- 1 root root 259, 1 Sep 6 08:28 mmcblk0p9
brw------- 1 root root 179, 8 Sep 6 08:28 mmcblk1
brw------- 1 root root 179, 9 Sep 6 08:28 mmcblk1p1
drwxr-xr-x 4 root root 0 Sep 6 08:28 platform/
brw------- 1 root root 1, 0 Sep 6 08:28 ram0
brw------- 1 root root 1, 1 Sep 6 08:28 ram1
brw------- 1 root root 1, 10 Sep 6 08:28 ram10
brw------- 1 root root 1, 11 Sep 6 08:28 ram11
brw------- 1 root root 1, 12 Sep 6 08:28 ram12
brw------- 1 root root 1, 13 Sep 6 08:28 ram13
brw------- 1 root root 1, 14 Sep 6 08:28 ram14
brw------- 1 root root 1, 15 Sep 6 08:28 ram15
brw------- 1 root root 1, 2 Sep 6 08:28 ram2
brw------- 1 root root 1, 3 Sep 6 08:28 ram3
brw------- 1 root root 1, 4 Sep 6 08:28 ram4
brw------- 1 root root 1, 5 Sep 6 08:28 ram5
brw------- 1 root root 1, 6 Sep 6 08:28 ram6
brw------- 1 root root 1, 7 Sep 6 08:28 ram7
brw------- 1 root root 1, 8 Sep 6 08:28 ram8
brw------- 1 root root 1, 9 Sep 6 08:28 ram9
drwxr-xr-x 2 root root 0 Sep 6 08:28 vold/
Click to expand...
Click to collapse
From the above list is it possible to know the boot paritions.
on S2_lte_I9210 /proc/partitions list the system partition as /dev/block/mmcblk0p24 /system but not the boot partition.
I'm eagerly waiting to do boot.img backup using via dd command
---------- Post added at 04:20 PM ---------- Previous post was at 04:16 PM ----------
# cat /proc/partitions
major minor #blocks name
179 0 15387648 mmcblk0
179 1 102400 mmcblk0p1
179 2 500 mmcblk0p2
179 3 1500 mmcblk0p3
179 4 1 mmcblk0p4
179 5 500 mmcblk0p5
179 6 2048 mmcblk0p6
179 7 2500 mmcblk0p7
179 8 10240 mmcblk0p8
179 9 500 mmcblk0p9
179 10 500 mmcblk0p10
179 11 500 mmcblk0p11
179 12 10240 mmcblk0p12
179 13 100352 mmcblk0p13
179 14 3072 mmcblk0p14
179 15 3072 mmcblk0p15
179 16 3072 mmcblk0p16
179 17 100352 mmcblk0p17
179 18 3072 mmcblk0p18
179 19 3072 mmcblk0p19
179 20 3072 mmcblk0p20
179 21 10240 mmcblk0p21
179 22 10240 mmcblk0p22
179 23 10240 mmcblk0p23
179 24 677888 mmcblk0p24
179 25 2099200 mmcblk0p25
179 26 309248 mmcblk0p26
179 27 132096 mmcblk0p27
179 28 11738112 mmcblk0p28
179 32 15558144 mmcblk1
179 33 15557120 mmcblk1p1
Click to expand...
Click to collapse
partition list on samsung galaxy S2_lte I9210
Hi. I saw and interesting blog post where someone was able to run arch linux on a nook color and run X server directly.
thomaspolasek.blogspot.ca/2012/04/arch-linux-lxde-w-xorg-mouse-keyboard_16.html
So I tried to do this with the Atrix 2, and managed to get Arch working fine through chroot but when I try startx there is a problem accessing the virtual terminal and I get this error.
Code:
Fatal server error:
xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory)
So I checked /dev and found tty, tty00 tty01. Assuming that they were simply named differently by the kernel I symblinked tty0 > tty, but unfortunately I get this error
Code:
Fatal server error:
xf86OpenConsole: Cannot find a free VT: Invalid argument
So I'm wondering if there is there any workaround that will allow X to use the VT? Or is some sort of kernel patch/module required? (wich I don't think would be possible due to the locked bootloader)
Also might it be possible to point X to the VT used by webtop?
bump
usus transformer infinity t700t
Alias.TDP said:
bump
Click to expand...
Click to collapse
When I read the article it seemed like a custom kernel was installed. Stock kernels may not be compiled with VT support, anyhow
my t700t is as follows
ls -l /dev/tty*
[email protected]:/dev# ls tty*
tty tty0 tty1 tty2 ttyFIQ0 ttyHS1 ttyHS2 ttyHS3 ttyHS4 ttyS0 ttyS1 ttyS2 ttyS3
[email protected]:/dev# ls -l tty*
crw-rw-rw- 1 root root 5, 0 May 11 17:58 tty
lrwxrwxrwx 1 root root 3 May 12 14:45 tty0 -> tty
lrwxrwxrwx 1 root root 5 May 12 14:44 tty1 -> ttyS1
lrwxrwxrwx 1 root root 5 May 12 14:44 tty2 -> ttyS2
crw------- 1 root root 254, 0 May 11 17:58 ttyFIQ0
crw-rw-r-- 1 root system 244, 1 May 12 14:26 ttyHS1
crw-rw---- 1 bluetooth bluetooth 244, 2 May 11 17:58 ttyHS2
crw------- 1 root root 244, 3 May 11 17:58 ttyHS3
crw------- 1 root root 244, 4 May 11 17:58 ttyHS4
crw------- 1 root root 4, 64 May 11 17:58 ttyS0
crw------- 1 root root 4, 65 May 11 17:58 ttyS1
crw------- 1 root root 4, 66 May 11 17:58 ttyS2
crw------- 1 root root 4, 67 May 11 17:58 ttyS3
[email protected]:/dev#
I added the -> links myself...
when I run x (using Xorg to start it) it tells me:
Current Operating System: Linux android-fe30b4a8071b23ff 3.1.10-00001-gdc9b6cf #1 SMP PREEMPT Fri Dec 28 19:02:52 CST 2012 armv7l
Kernel command line: tegra_wdt.heartbeat=30 tegraid=30.1.3.0.0 [email protected] commchip_id=0 androidboot.serialno=015d2a508b080209 androidboot.commchip_id=0 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,0 usbcore.old_scheme_first=1 [email protected] [email protected] core_edp_mv=0 audio_codec=wm8903 board_info=245:0:44:de:28 tegraboot=sdmmc gpt gpt_sector=124174335 android.kerneltype=normal androidboot.productid=0x04 androidboot.carrier=wifi-only
Build Date: 11 April 2013 01:10:43PM
so the console is using ttys0 at 155baud
so I'm going to have a look at VT support, though I probably need a custom kernel to get it up and running.
---------- Post added at 04:21 PM ---------- Previous post was at 04:02 PM ----------
here's a list of devices on my t770t as reported by sysfs
[email protected]:/sys# ls -l dev/char/ | grep tty
lrwxrwxrwx 1 root root 0 May 12 15:12 244:1 -> ../../devices/platform/tegra_uart.1/tty/ttyHS1
lrwxrwxrwx 1 root root 0 May 12 15:12 244:2 -> ../../devices/platform/tegra_uart.2/tty/ttyHS2
lrwxrwxrwx 1 root root 0 May 12 15:12 244:3 -> ../../devices/platform/tegra_uart.3/tty/ttyHS3
lrwxrwxrwx 1 root root 0 May 12 15:12 244:4 -> ../../devices/platform/tegra_uart.4/tty/ttyHS4
lrwxrwxrwx 1 root root 0 May 12 15:12 254:0 -> ../../devices/virtual/tty/ttyFIQ0
lrwxrwxrwx 1 root root 0 May 12 15:12 4:64 -> ../../devices/platform/serial8250/tty/ttyS0
lrwxrwxrwx 1 root root 0 May 12 15:12 4:65 -> ../../devices/platform/serial8250/tty/ttyS1
lrwxrwxrwx 1 root root 0 May 12 15:12 4:66 -> ../../devices/platform/serial8250/tty/ttyS2
lrwxrwxrwx 1 root root 0 May 12 15:12 4:67 -> ../../devices/platform/serial8250/tty/ttyS3
lrwxrwxrwx 1 root root 0 May 12 15:12 5:0 -> ../../devices/virtual/tty/tty
lrwxrwxrwx 1 root root 0 May 12 15:12 5:1 -> ../../devices/virtual/tty/console
lrwxrwxrwx 1 root root 0 May 12 15:12 5:2 -> ../../devices/virtual/tty/ptmx
[email protected]
You can start xorg as follows
Xorg vt##
replacing ## with the number of the vt e.g.
Xorg vt0
This gives me a mix of three sperate errors, a file not found if the vt# isn't in /dev/vtt#, and io error if i symlink to a ttys and ad error saying the device doesn't exist if i symink tty0 to tty
Hi all,
I am in the process of porting the dual boot ramfs from the Galaxy S3 Siyah kernel to our Note II smartphones.
I have finished editing the ramfs, and changing the init files ect.
But the is still two files I have left to edit, and I am a bit stuck on them.
In the files /sbin/init and /sbin/ueventd the is quite a few references to theses partitions:
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12
Click to expand...
Click to collapse
the problem is this, on the Galaxy S3 (which is what that ramfs was designed for) those partitions dont exist as far as I can see.
But on the note 2, those partitions are the /DATA and /SYSTEM partitions.
So I need to change thoses partitions to something else, but I dont know what.
I have copied the contents of the two files which thoses partitions are referenced in, and a table showing the Note 2 partitions and the coresponing S3 partitions, below
Could someone please help me find out what I should do here, as I cant do any more on the dual boot kernel till I get that sorted.
Here is the question I asked gokhan moral:
“I have edited all the files in the ramfs, apart from two files.
In the files /sbin/init and /sbin/ueventd the is 2 partitions referenced thru out them, they are:
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12v
On the Galaxy S3, thoses partition names are un-used (as far as i know)
But on the Galaxy Note 2, thoses partitions are the /DATA and /SYSTEM partitions.
can i just change the partition names in thoses 2 files to soemthing like:
mknod /dev/block/mmcblk0p17 b 179 9
mknod /dev/block/mmcblk0p18 b 179 12v
or do i need to do something else to rename thoses two partitions?.”
Click to expand...
Click to collapse
And here is Gokhan Morals Response:
“block devices are created using the major and minor id's specific to your device (those do not change normally but you need to check anyway). so if they are mounted and needed you create them. if they are not needed in the script you don't have to create them. you have to try to keep the same functionality in the script. if you mount /system then you will need the block device that corresponds to /system with the correct major and minor numbers.”
Click to expand...
Click to collapse
but I still dont understand what I am supposed to do (I am not really a developer, I am more of a web designer ect)
Could someone please explain in simpler steps what I should do to rename thoses two partitions.
Here are the file contents (both files have the same contents, so i have only copied one here)
INIT:
#!/sbin/busybox sh
cd /
busybox mount -t proc proc /proc
busybox mount -t sysfs sysfs /sys
if busybox grep -q 1 /sys/class/power_supply/battery/batt_lp_charging ; then
# low power mode
echo 0 > /proc/sys/kernel/rom_feature_set
cp -a /res/misc/init.41/* /
chmod 755 /innt
chmod 644 /*.rc
chmod 644 /*.prop
exec /sbin/init2
fi
SECONDROM=1
NOBOOTLOGO=0
mkdir -p /dev/block
mkdir /dev/input
mkdir /dev/graphics
mknod /dev/graphics/fb0 c 29 0
mknod /dev/input/event1 c 13 65
mknod /dev/input/event2 c 13 66
mknod /dev/input/event8 c 13 72
mknod /dev/input/event9 c 13 73
mknod /dev/ashmem c 10 60
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12
mknod /dev/block/loop0 b 7 0
mkdir /mnt
chmod 755 /mnt
mkdir /.secondrom
mount -t ext4 /dev/block/mmcblk0p16 /.secondrom
NEXTBOOT=`cat /.secondrom/media/.nextboot`
rm -f /.secondrom/media/.nextboot
DEFAULTROM=`cat /.secondrom/media/.defaultrom`
if grep -q bootmode=2 /proc/cmdline ; then
NEXTBOOT=0
fi
if [ "$NEXTBOOT" == "0" ]; then
mv -f /res/etc /
umount /.secondrom
echo 0 > /proc/sys/kernel/rom_feature_set
mv -f /res/misc/init.41/* /
mv -f /res/misc/recovery/* /
chmod 755 /innt
chmod 644 /*.smdk4x12
chmod 644 /*.rc
chmod 644 /*.prop
chmod -R 755 /lib
exec /sbin/init2
fi
SECONDROM=1
NOBOOTLOGO=0
[ -f /.secondrom/media/.secondrom/system.img ] || SECONDROM=0
[ -f /.secondrom/media/.nobootlogo ] && NOBOOTLOGO=1
if [ "$SECONDROM" == "0" ];then
if [ "$NOBOOTLOGO" == "0" ];then
/sbin/choose_rom $SECONDROM
fi
else
if [ "$NEXTBOOT" == "1" ];then
SECONDROM=0;
elif [ "$NEXTBOOT" == "2" ];then
SECONDROM=1;
else
if [ "$NOBOOTLOGO" == "1" ];then
SECONDROM=$DEFAULTROM
elif [ "$DEFAULTROM" == "1" ];then
/sbin/choose_rom $SECONDROM
if [ "$?" == "1" ]; then
SECONDROM=0
else
SECONDROM=1
fi
else
/sbin/choose_rom $SECONDROM
if [ "$?" == "1" ]; then
SECONDROM=1
else
SECONDROM=0
fi
fi
fi
fi
if [ "$SECONDROM" == "1" ]; then
mount -t ext4 /.secondrom/media/.secondrom/system.img /system
else
mount -t ext4 /dev/block/mmcblk0p13 /system
fi
AOSP=0
MIUI=0
CM10=0
JB=0
[ -f /system/framework/framework2.jar ] || AOSP=1
[ -f /system/framework/miui-framework.jar ] && MIUI=1
[ -f /system/lib/ssl/engines/libkeystore.so ] && JB=1
[ -f /system/framework/seccamera.jar ] || CM10=1
if [ "$JB" == 1 ];
then
if [ "$CM10" == 1 ];
then
echo 3 > /proc/sys/kernel/rom_feature_set
mv -f /lib/modules/dhd_cm.ko /lib/modules/dhd.ko
mv -f /res/misc/init.cm10/* /
else
echo 2 > /proc/sys/kernel/rom_feature_set
mv -f /res/misc/init.41/* /
fi
fi
if [ "$SECONDROM" == "1" ];then
mv /init.smdk4x12.rc.2 /init.smdk4x12.rc
mv /init.rc.2 /init.rc
mv /fstab.smdk4x12.2 /fstab.smdk4x12
else
rm -f /init.rc.2 /init.smdk4x12.rc.2 /fstab.smdk4x12.2
fi
umount -f /system
umount -f /.secondrom
rm -rf /res/misc/init*
chmod 755 /innt
chmod 644 /*.smdk4x12
chmod 644 /*.rc
chmod 644 /*.prop
chmod -R 755 /lib
# misc mods for i9300
insmod /lib/modules/m0_mods.ko
# cpu undervolting interfaces
insmod /lib/modules/cpu_undervolting.ko
# mali (gpu) interfaces
insmod /lib/modules/mali_control.ko
# additional CPU governors
insmod /lib/modules/cpufreq_hotplug.ko
insmod /lib/modules/cpufreq_lulzactiveq.ko
# additional I/O schedulers
insmod /lib/modules/sio-iosched.ko
insmod /lib/modules/vr-iosched.ko
# audio enhancements
insmod /lib/modules/kscoobydoo.ko devicename=scoobydoo_sound
exec /sbin/init2
Click to expand...
Click to collapse
And here is the partition layouts:
PARTITION: ` Galaxy S3 Galaxy Note 2
/BOOT mmcblk0p5 mmcblk0p8
/BOTA0 mmcblk0p1 mmcblk0p1
/BOTA1 mmcblk0p2 mmcblk0p2
/CACHE mmcblk0p8 mmcblk0p12
/EFS mmcblk0p3 mmcblk0p3
/HIDDEN mmcblk0p10 mmcblk0p14
/OTA mmcblk0p11 mmcblk0p15
/PARAM mmcblk0p4 mmcblk0p7
/RADIO mmcblk0p7 mmcblk0p10
/RECOVERY mmcblk0p6 mmcblk0p9
/SYSTEM mmcblk0p9 mmcblk0p13
/TOMBSTONES unknown mmcblk0p11
/USERDATA mmcblk0p12 mmcblk0p16
Click to expand...
Click to collapse
I think i copied thoses partitions right from my pc, but i may have got one mixed up or something
Please can someone help, as i have been searching for days, and asking lots of different people on xda, but no response
Thanks in advance
Cheers
Corey
First, if "herbew" is a friend of yours, please ask him to never send me a PM asking me to help someone ELSE. That's just spam.
On the i9300 (and Note2) devices, I'm surprised to see any calls at all to mknod. Most of the device files are created automatically these days. However, I'm NOT familiar with Gokhan's dual boot thing (I've never used it and I don't have an i9300 anymore to tinker with it.) I'm assuming that you'd like to reverse engineer what Gokhan has done and it's often more fun to work backwards than to just nag him until he helps. So, I can't answer how to make it work, but I might be able to help you to reverse engineer or understand what is going on.
To find out more about your device nodes for mmcblk devices, you can run the following command (rooted, of course):
Code:
ls -l /dev/block/mmc*
The output will contain several lines similar to:
Code:
brw-rw---- 1 system root 179, 7 Dec 18 22:28 mmcblk0p7
In this case, the device major id is 179 and the minor id is 7. To see what those major ID's are, run "cat /proc/devices". (This doesn't show ALL device ID's used by the system, but covers most of them.) Another way to see all the partitions within the system is "cat /proc/partitions".
Doing the above on a i9300 both with and without the dual boot stuff might give some hints as to what changes the dualboot thing is making. You might also consider taking a look at whatever is used to install that dualboot stuff. Is it ONLY a kernel, or something more? Is it re-partitioning the device?
From what I could see of that init file, p16 is a partition used to store the secondary boot related flags and a system image. p13 appears to be the "primary" /system image partition.
Some questions to ask yourself:
What is the /system partition on a normal (non-dualboot) i9300? Is it p13 or something else? Does p16 exist in /proc/partitions on a non-dualboot system? In that non-dual boot setup, is there ANY device with a major of 179 and minor of 12? (My first thought would be it would be named mmcblk0p12)
Disclaimer: I'm going to try to avoid solving this for you. I'd prefer if I can guide you to solving it yourself and then sharing the results.
garyd9 said:
First, if "herbew" is a friend of yours, please ask him to never send me a PM asking me to help someone ELSE. That's just spam.
On the i9300 (and Note2) devices, I'm surprised to see any calls at all to mknod. Most of the device files are created automatically these days. However, I'm NOT familiar with Gokhan's dual boot thing (I've never used it and I don't have an i9300 anymore to tinker with it.) I'm assuming that you'd like to reverse engineer what Gokhan has done and it's often more fun to work backwards than to just nag him until he helps. So, I can't answer how to make it work, but I might be able to help you to reverse engineer or understand what is going on.
To find out more about your device nodes for mmcblk devices, you can run the following command (rooted, of course):
Code:
ls -l /dev/block/mmc*
The output will contain several lines similar to:
Code:
brw-rw---- 1 system root 179, 7 Dec 18 22:28 mmcblk0p7
In this case, the device major id is 179 and the minor id is 7. To see what those major ID's are, run "cat /proc/devices". (This doesn't show ALL device ID's used by the system, but covers most of them.) Another way to see all the partitions within the system is "cat /proc/partitions".
Doing the above on a i9300 both with and without the dual boot stuff might give some hints as to what changes the dualboot thing is making. You might also consider taking a look at whatever is used to install that dualboot stuff. Is it ONLY a kernel, or something more? Is it re-partitioning the device?
From what I could see of that init file, p16 is a partition used to store the secondary boot related flags and a system image. p13 appears to be the "primary" /system image partition.
Some questions to ask yourself:
What is the /system partition on a normal (non-dualboot) i9300? Is it p13 or something else? Does p16 exist in /proc/partitions on a non-dualboot system? In that non-dual boot setup, is there ANY device with a major of 179 and minor of 12? (My first thought would be it would be named mmcblk0p12)
Disclaimer: I'm going to try to avoid solving this for you. I'd prefer if I can guide you to solving it yourself and then sharing the results.
Click to expand...
Click to collapse
Hi,
Yes Herbew is a friend of mine, but i didn't tell him to start private messaging people like that lol, I think he just gets a bit carried away, I will tell him to stop .
I will try running thoses commands on my note 2 to get the device id ect tomorrow thanks.
And on a normal S3, the is no partitions past p12 (I think the /system partition is either p7 or p9, i will check tomorrow) hence why I am stuck
I don't have a galaxy S3, so i can't run thoses commands u said, is the any other way I can work it out?, without spending $500 on a s3?. Thanks.
Thanks for your help.
Sent from my GT-N7100
fishingfon said:
I don't have a galaxy S3, so i can't run thoses commands u said, is the any other way I can work it out?, without spending $500 on a s3?. Thanks.
Click to expand...
Click to collapse
If I wanted that info, I'd probably post a message in the i9300/General section titled "Need a rooted user to help" and containing a message body similar to:
Can someone who is rooted, comfortable with a shell prompt, and NOT running any kind of dualboot, please run the following commands and send me (or reply with) the results? "ls -l /dev/block/mmc*", "cat /proc/devices", and "cat /proc/partitions"
Thank you,
YourNameHere
Click to expand...
Click to collapse
You might also ask that a person who IS running dualboot do the same thing so you can compare them. Just be sure that they tell you if they are/aren't doing dualboot so you don't get mixed up which is which. Another thing that might be helpful is to compare the init scripts of a non-dualboot kernel's initramfs with the ones you already have. Understanding what is different might be the key to understanding what you'll have to change on the note2.
Gary
garyd9 said:
If I wanted that info, I'd probably post a message in the i9300/General section titled "Need a rooted user to help" and containing a message body similar to:
You might also ask that a person who IS running dualboot do the same thing so you can compare them. Just be sure that they tell you if they are/aren't doing dualboot so you don't get mixed up which is which. Another thing that might be helpful is to compare the init scripts of a non-dualboot kernel's initramfs with the ones you already have. Understanding what is different might be the key to understanding what you'll have to change on the note2.
Gary
Click to expand...
Click to collapse
Ok thanks, I will make a thread in the s3 section tomorrow.
I have already replaced all the init files in /res/misc/init.41 with the stock ones from the root of the ramfs from a stock boot img (when the phone starts, if it detects a jb stock rom, it will move all the init files from init.41 to the root of the ramfs). So they are already stock.
I will have another look thru the stock Sammy ramfs tomorrow, and see if I can find a init file in /sbin (where the one i am having trouble with came from).
I can't get on my pc right now, as the is about 200 ants that have decided to move in to the laptop, so i need to figure out how to remove them before I can look
Thanks again for your help.
Corey
Sent from my GT-N7100
Still no luck
http://forum.xda-developers.com/showthread.php?t=2058538
Cheers
Corey
Sent from my GT-N7100
garyd9 said:
If I wanted that info, I'd probably post a message in the i9300/General section titled "Need a rooted user to help" and containing a message body similar to:
You might also ask that a person who IS running dualboot do the same thing so you can compare them. Just be sure that they tell you if they are/aren't doing dualboot so you don't get mixed up which is which. Another thing that might be helpful is to compare the init scripts of a non-dualboot kernel's initramfs with the ones you already have. Understanding what is different might be the key to understanding what you'll have to change on the note2.
Gary
Click to expand...
Click to collapse
Hi,
I have got the results from typing 2 of the things in the terminal on the s3, and I will compare them when I get home, but i havent got the results from typing "ls -l /dev/block/mmc*" tho, do i really need the results from that command, or are the ones from the other 2 commands enough?.
Thanks
Cheers
Corey
EDIT: i have found someone to get me the results from "
ls -l /dev/block/mmc" so ignore the message above
Sent from my GT-N7100
Hi,
I have got the results from thoses 3 commands u said to run in the terminal, and u can see the is 3 extra devices when the dual boot kernel is installed on the S3. theses are the devices:
brw------- root root 179, 16 2012-12-22 12:53 mmcblk0boot0
brw------- root root 179, 32 2012-12-22 12:53 mmcblk0boot1
7 1 1572864 loop1
Here are the full results from the terminal:
Code:
"Siyah Dual boot 1.8.4,booted in to 2nd Rom ParanoidAndroid 2.54"
[email protected]:/ $ su
[email protected]:/ # ls -l /dev/block/mmc*
brw------- root root 179, 0 2012-12-22 12:53 mmcblk0
brw------- root root 179, 16 2012-12-22 12:53 mmcblk0boot0
brw------- root root 179, 32 2012-12-22 12:53 mmcblk0boot1
brw------- root root 179, 1 2012-12-22 12:53 mmcblk0p1
brw------- root root 179, 10 2012-12-22 12:53 mmcblk0p10
brw------- root root 179, 11 2012-12-22 12:53 mmcblk0p11
brw------- root root 179, 12 2012-12-22 12:53 mmcblk0p12
brw------- root root 179, 2 2012-12-22 12:53 mmcblk0p2
brw------- root root 179, 3 2012-12-22 12:53 mmcblk0p3
brw-rw---- system system 179, 4 2012-12-22 12:53 mmcblk0p4
brw------- root root 179, 5 2012-12-22 12:53 mmcblk0p5
brw------- root root 179, 6 2012-12-22 12:53 mmcblk0p6
brw-rw---- system radio 179, 7 2012-12-22 12:53 mmcblk0p7
brw------- root root 179, 8 2012-12-22 12:53 mmcblk0p8
brw------- root root 179, 9 2012-12-22 12:53 mmcblk0p9
brw------- root root 179, 48 2012-12-22 12:53 mmcblk1
brw------- root root 179, 49 2012-12-22 12:53 mmcblk1p1
[email protected]:/ # cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
21 sg
29 fb
81 video4linux
89 i2c
108 ppp
116 alsa
128 ptm
136 pts
153 spi
180 usb
188 ttyUSB
189 usb_device
204 ttySAC
216 rfcomm
243 ump
244 mali
248 ttyGS
249 roccat
250 BaseRemoteCtl
251 media
252 usbmon
253 tzic
254 rtc
Block devices:
1 ramdisk
259 blkext
7 loop
8 sd
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
179 mmc
254 device-mapper
[email protected]:/ # cat /proc/partitions
major minor #blocks name
7 0 1572864 loop0
7 1 1572864 loop1
179 0 15388672 mmcblk0
179 1 4096 mmcblk0p1
179 2 4096 mmcblk0p2
179 3 20480 mmcblk0p3
179 4 8192 mmcblk0p4
179 5 8192 mmcblk0p5
179 6 8192 mmcblk0p6
179 7 32768 mmcblk0p7
179 8 1048576 mmcblk0p8
179 9 1572864 mmcblk0p9
179 10 573440 mmcblk0p10
179 11 8192 mmcblk0p11
179 12 12091392 mmcblk0p12
179 32 2048 mmcblk0boot1
179 16 2048 mmcblk0boot0
179 48 30657536 mmcblk1
179 49 30653440 mmcblk1p1
[email protected]:/ #
Code:
"Siyah DualBoot 1.8.4,booted in to 1st rom XXELKC Samsung Rom"
[email protected]:/ $ su
[email protected]:/ # ls -l /dev/block/mmc*
brw------- root root 179, 0 2012-12-22 12:10 mmcblk0
brw------- root root 179, 16 2012-12-22 12:10 mmcblk0boot0
brw------- root root 179, 32 2012-12-22 12:10 mmcblk0boot1
brw------- root root 179, 1 2012-12-22 12:10 mmcblk0p1
brw------- root root 179, 10 2012-12-22 12:10 mmcblk0p10
brw------- root root 179, 11 2012-12-22 12:10 mmcblk0p11
brw------- root root 179, 12 2012-12-22 12:10 mmcblk0p12
brw------- root root 179, 2 2012-12-22 12:10 mmcblk0p2
brw------- root root 179, 3 2012-12-22 12:10 mmcblk0p3
brw-rw---- system system 179, 4 2012-12-22 12:11 mmcblk0p4
brw------- root root 179, 5 2012-12-22 12:10 mmcblk0p5
brw------- root root 179, 6 2012-12-22 12:10 mmcblk0p6
brw-rw---- system radio 179, 7 2012-12-22 12:10 mmcblk0p7
brw------- root root 179, 8 2012-12-22 12:10 mmcblk0p8
brw------- root root 179, 9 2012-12-22 12:10 mmcblk0p9
brw------- root root 179, 48 2012-12-22 12:10 mmcblk1
brw------- root root 179, 49 2012-12-22 12:10 mmcblk1p1
[email protected]:/ # cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
21 sg
29 fb
81 video4linux
89 i2c
108 ppp
116 alsa
128 ptm
136 pts
153 spi
180 usb
188 ttyUSB
189 usb_device
204 ttySAC
216 rfcomm
243 ump
244 mali
248 ttyGS
249 roccat
250 BaseRemoteCtl
251 media
252 usbmon
253 tzic
254 rtc
Block devices:
1 ramdisk
259 blkext
7 loop
8 sd
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
179 mmc
254 device-mapper
[email protected]:/ # cat /proc/partitions
major minor #blocks name
7 0 2111 loop0
179 0 15388672 mmcblk0
179 1 4096 mmcblk0p1
179 2 4096 mmcblk0p2
179 3 20480 mmcblk0p3
179 4 8192 mmcblk0p4
179 5 8192 mmcblk0p5
179 6 8192 mmcblk0p6
179 7 32768 mmcblk0p7
179 8 1048576 mmcblk0p8
179 9 1572864 mmcblk0p9
179 10 573440 mmcblk0p10
179 11 8192 mmcblk0p11
179 12 12091392 mmcblk0p12
179 32 2048 mmcblk0boot1
179 16 2048 mmcblk0boot0
179 48 30657536 mmcblk1
179 49 30653440 mmcblk1p1
254 0 2110 dm-0
[email protected]:/ #
Code:
"Stock Kernel (ELK4) + XXELKC Samsung Rom"
[email protected]:/ $ su
[email protected]:/ # ls -l /dev/block/mmc*
brw------- root root 179, 0 2012-12-22 12:57 mmcblk0
brw------- root root 179, 1 2012-12-22 12:57 mmcblk0p1
brw------- root root 179, 10 2012-12-22 12:57 mmcblk0p10
brw------- root root 179, 11 2012-12-22 12:57 mmcblk0p11
brw------- root root 179, 12 2012-12-22 12:57 mmcblk0p12
brw------- root root 179, 2 2012-12-22 12:57 mmcblk0p2
brw------- root root 179, 3 2012-12-22 12:57 mmcblk0p3
brw-rw---- system system 179, 4 2012-12-22 12:58 mmcblk0p4
brw------- root root 179, 5 2012-12-22 12:57 mmcblk0p5
brw------- root root 179, 6 2012-12-22 12:57 mmcblk0p6
brw-rw---- system radio 179, 7 2012-12-22 12:57 mmcblk0p7
brw------- root root 179, 8 2012-12-22 12:57 mmcblk0p8
brw------- root root 179, 9 2012-12-22 12:57 mmcblk0p9
brw------- root root 179, 16 2012-12-22 12:57 mmcblk1
brw------- root root 179, 17 2012-12-22 12:57 mmcblk1p1
[email protected]:/ # cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
21 sg
29 fb
81 video4linux
89 i2c
108 ppp
116 alsa
128 ptm
136 pts
153 spi
180 usb
188 ttyUSB
189 usb_device
204 ttySAC
216 rfcomm
243 ump
244 mali
248 roccat
249 BaseRemoteCtl
250 media
251 ttyGS
252 usbmon
253 tzic
254 rtc
Block devices:
1 ramdisk
259 blkext
7 loop
8 sd
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
179 mmc
254 device-mapper
[email protected]:/ # cat /proc/partitions
major minor #blocks name
7 0 2111 loop0
179 0 15388672 mmcblk0
179 1 4096 mmcblk0p1
179 2 4096 mmcblk0p2
179 3 20480 mmcblk0p3
179 4 8192 mmcblk0p4
179 5 8192 mmcblk0p5
179 6 8192 mmcblk0p6
179 7 32768 mmcblk0p7
179 8 1048576 mmcblk0p8
179 9 1572864 mmcblk0p9
179 10 573440 mmcblk0p10
179 11 8192 mmcblk0p11
179 12 12091392 mmcblk0p12
179 16 30657536 mmcblk1
179 17 30653440 mmcblk1p1
254 0 2110 dm-0
[email protected]:/ #
And here is the results I got from typing the commands in my Note
II
Code:
[email protected]:/ $ export PATH=/data/local/bin:$PATH
[email protected]:/ $ su
[email protected]:/ # ls -l /dev/block/mmc*
brw------- root root 179, 0 2012-12-22 08:35 mmcblk0
brw------- root root 179, 1 2012-12-22 08:35 mmcblk0p1
brw-rw---- system radio 179, 10 2012-12-22 08:35 mmcblk0p10
brw-rw---- system radio 179, 11 2012-12-22 08:35 mmcblk0p11
brw------- root root 179, 12 2012-12-22 08:35 mmcblk0p12
brw------- root root 179, 13 2012-12-22 08:35 mmcblk0p13
brw------- root root 179, 14 2012-12-22 08:35 mmcblk0p14
brw------- root root 179, 15 2012-12-22 08:35 mmcblk0p15
brw------- root root 259, 0 2012-12-22 08:35 mmcblk0p16
brw------- root root 179, 2 2012-12-22 08:35 mmcblk0p2
brw------- root root 179, 3 2012-12-22 08:35 mmcblk0p3
brw-rw---- system radio 179, 4 2012-12-22 08:35 mmcblk0p4
brw-rw---- system radio 179, 5 2012-12-22 08:35 mmcblk0p5
brw-rw---- system radio 179, 6 2012-12-22 08:35 mmcblk0p6
brw-rw---- system root 179, 7 2012-12-22 08:35 mmcblk0p7
brw------- root root 179, 8 2012-12-22 08:35 mmcblk0p8
brw------- root root 179, 9 2012-12-22 08:35 mmcblk0p9
brw------- root root 179, 16 2012-12-22 08:35 mmcblk1
brw------- root root 179, 17 2012-12-22 08:35 mmcblk1p1
[email protected]:/ # cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
21 sg
29 fb
81 video4linux
89 i2c
108 ppp
116 alsa
128 ptm
136 pts
153 spi
180 usb
188 ttyUSB
189 usb_device
204 ttySAC
216 rfcomm
243 ump
244 mali
248 roccat
249 BaseRemoteCtl
250 media
251 ttyGS
252 usbmon
253 tzic
254 rtc
Block devices:
1 ramdisk
259 blkext
7 loop
8 sd
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
179 mmc
254 device-mapper
[email protected]:/ # cat /proc/partitions
major minor #blocks name
7 0 47849 loop0
7 1 12506 loop1
7 2 14585 loop2
7 3 2111 loop3
7 4 3150 loop4
7 5 35375 loop5
7 6 34335 loop6
7 7 2111 loop7
179 0 15388672 mmcblk0
179 1 4096 mmcblk0p1
179 2 4096 mmcblk0p2
179 3 20480 mmcblk0p3
179 4 4096 mmcblk0p4
179 5 4096 mmcblk0p5
179 6 4096 mmcblk0p6
179 7 8192 mmcblk0p7
179 8 8192 mmcblk0p8
179 9 8192 mmcblk0p9
179 10 90112 mmcblk0p10
179 11 4096 mmcblk0p11
179 12 1400832 mmcblk0p12
179 13 2097152 mmcblk0p13
179 14 573440 mmcblk0p14
179 15 8192 mmcblk0p15
259 0 11141120 mmcblk0p16
179 16 62367744 mmcblk1
179 17 62351360 mmcblk1p1
254 0 47848 dm-0
254 1 12505 dm-1
254 2 14584 dm-2
254 3 2110 dm-3
254 4 3150 dm-4
254 5 35374 dm-5
254 6 34335 dm-6
254 7 2110 dm-7
7 8 13545 loop8
254 8 13545 dm-8
7 9 16664 loop9
254 9 16663 dm-9
7 10 2111 loop10
254 10 2110 dm-10
7 11 43691 loop11
254 11 43690 dm-11
7 12 8348 loop12
254 12 8347 dm-12
7 13 9387 loop13
254 13 9387 dm-13
7 14 21861 loop14
254 14 21861 dm-14
[email protected]:/ #
Do u know how I would get thoses two extra partitions on the note 2?. are thoses the same partitions that I mentioned in the first post (p13 and p16)??.
Thanks again for your help.
Corey
Ps,
The /system and /data partitions on a stick non-dual boot s3 are p9 and p12, and they have the minor of 9 and 12, just like the partitions p13 and p16 I mentioned in the first post. But the partitions on the first post have different names. Do u have any idea why that could be?.
Cheers
Corey
Sent from my GT-N7100
What I'm NOT seeing is the mmcblk0p13 and mmcblk0p16 devices that are supposedly made by the init script on the dual boot s3. Any idea why not?
garyd9 said:
What I'm NOT seeing is the mmcblk0p13 and mmcblk0p16 devices that are supposedly made by the init script on the dual boot s3. Any idea why not?
Click to expand...
Click to collapse
Hi,
No I have no idea
Also I can't find anything in the script about the 3 devices that are made, so i have absolutely no idea.
I asked Gokhan moral about them, and here is my message and then his:
" Hi,
I have spent the last day or two trying to figure out how to change the names of theses partitions that are referenced in /sbin/init
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12
But well I was doing that (I still haven't worked it out ). I noticed that when the dual boot is installed on a galaxy S3, the is 3 extra devices in dev/block
they are:
brw------- root root 179, 16 2012-12-22 12:53 mmcblk0boot0
brw------- root root 179 32 2012-12-22 12:53 mmcblk0boot1
7 1 1572864 loop1
I have already been thru the scripts lots of times, and I never noticed any partitions named this. I was just wondering if you could explain what files theses partitions are referenced in?. as I cant find them anywhere."
And here is his response:
" They are not referenced in any of my modifications because they are not needed for any of my customizations. I only create devices that I want to mount and mount them to some directories and try to understand the rom type. Once I get the rom type I initialize the corresponding init sequence by moving init files to the original location, move innt to init and exec it. That is all and there is no more in those scripts. Now try to read them once again and try to map my descriptions to that script. When I say init script I mean the symbolic link from /init to /sbin/init. "
Do u have any idea what I should do?, as i am a bit stuck
Thanks
Cheers
Corey
Sent from my GT-N7100
Okay...
First, the mmc*boot? device nodes are for the boot loaders - please ignore those device nodes. Act like they don't exist. Don't mess with them. Ever. If there's one way to brick a samsung phone, it's by messing up the bootloaders. (Thanks to people like Adam Outler, you might still be able to recover, but only via hardware tinkering.)
So, let's back up and not be concerned about what the device nodes are named, but more concerned about what the device nodes are USED FOR (in relation to dual booting.) If I'm correct, you really aren't concerned about those device node names, but are more concerned about getting the dual boot working.
Is that init script in the OP unmolested? The reason I'm asking is that parts of it aren't making sense to me. For example, it's mounting the /system directory either via an image file OR from mmcblk0p13. However, you've stated that the SGS3 has the SYSTEM partition on mmcblk0p9. It almost appears as if you (or someone else) might have started editing the init script to make it work with a device that has the system partition on p13 (such as the note2.) That would also match with the fact that p16 on the Note2 is the data (userdata) partition...
Actually, that might be exactly what's going on here. The mknod parameters are creating device nodes to the existing p9/p12 partitions, but giving them different names that just happen to match the names used on the Note2...
You could, in theory, do something similar to what you suggested in your OP, but you'd need to do it a bit differently.... Instead of making device nodes with unused names and minors of 9/12, you'd want to use unused names and minors of 13 and 16. Let me explain...
Here is the code you said was in the sgs3 init script (along with comments followed by "//")
Code:
mknod /dev/block/mmcblk0p13 b 179 9 // creates a device node called p13 but is identical to p9
mknod /dev/block/mmcblk0p16 b 179 12 // creates a device node called p16 but is identical to p12
So, in your init script, /dev/block/mmcblk0p13 is referencing the EXACT SAME DEVICE as /dev/block/mmcblk0p9 (and the same for the created p16 device and the already existing p12 device.)
Wow, I really hope that not only am I making sense, but also that you are following me. I'm going to start rambling even more.
You kind of have to understand how device nodes work, etc. The NAME of the device node doesn't matter. What matters is if it's a block or character device, the MAJOR number and the MINOR number. For block types of MAJOR 179, it's referring to a MMC device. For block/MMC (b 179). the minor number specifies the partition of the device. (I'm simplifying here - it's actually a masked value that includes a partition and device - and gets more interesting with > 16 partitions that require different majors)
So, you could (in theory) go into that script that works fine on the sgs3 and rename every occurrence of "mmcblk0p16" with "i_like_sex" and it'll still work on the sgs3 (even if you didn't like sex.)
Okay... so back to the script. Keep in mind that I'm basing EVERYTHING on that one script and haven't seen anything else related to this multi-boot thing. It'd probably help if someone gave me a link (I'm too lazy to search) to something that installs this multi-boot stuff.
Anyway, that script. I'm going to do something here for clarity. Instead of referencing the misleading "mmcblk0p13" and "mmcblk0p16" device node nodes, I'm just going to call them "extra13" and "extra16" (because they are NOT referencing partitions 13/16.)
So, in that script, extra13 is actually pointing to partition9 which (based on your information) is the SYSTEM partition (mmcblk0p9) and extra16 is actually pointing to partition12 which (again based on your info) is the USERDATA partition.
In other words, extra13 is pointing to what is normally mounted as "/system" and extra16 is pointing to what is normally mounted as "/data". However, at least for getting the dual boot stuff kick started, it's mounting extra16 in "/.secondrom" instead of "/data".
THAT should be enough information to get you going towards solving your issue.
Personally, I think that whoever decided to use mmcblk0p13 and mmcblk0p16 as fictional device node names on the sgs3 should be thumped in the head for either intentionally or unintentionally creating confusion. It might be due to one of the other dependencies of the dual booting system (what is "/sbin/choose_rom"?) that they were unwilling (or unable) to fix. It might also just be a way to try and make the stuff a pain to port. I don't know their intentions/motives.
I will offer this: If my explanation didn't make sense, you might want to take a few steps back and learn what all of it means before you keep going with the porting effort. Some of the concepts here are important to know, and some basic understanding of device nodes is important when mounting file systems.
Take care
Gary
garyd9 said:
Okay...
First, the mmc*boot? device nodes are for the boot loaders - please ignore those device nodes. Act like they don't exist. Don't mess with them. Ever. If there's one way to brick a samsung phone, it's by messing up the bootloaders. (Thanks to people like Adam Outler, you might still be able to recover, but only via hardware tinkering.)
So, let's back up and not be concerned about what the device nodes are named, but more concerned about what the device nodes are USED FOR (in relation to dual booting.) If I'm correct, you really aren't concerned about those device node names, but are more concerned about getting the dual boot working.
Is that init script in the OP unmolested? The reason I'm asking is that parts of it aren't making sense to me. For example, it's mounting the /system directory either via an image file OR from mmcblk0p13. However, you've stated that the SGS3 has the SYSTEM partition on mmcblk0p9. It almost appears as if you (or someone else) might have started editing the init script to make it work with a device that has the system partition on p13 (such as the note2.) That would also match with the fact that p16 on the Note2 is the data (userdata) partition...
Actually, that might be exactly what's going on here. The mknod parameters are creating device nodes to the existing p9/p12 partitions, but giving them different names that just happen to match the names used on the Note2...
You could, in theory, do something similar to what you suggested in your OP, but you'd need to do it a bit differently.... Instead of making device nodes with unused names and minors of 9/12, you'd want to use unused names and minors of 13 and 16. Let me explain...
Here is the code you said was in the sgs3 init script (along with comments followed by "//")
Code:
mknod /dev/block/mmcblk0p13 b 179 9 // creates a device node called p13 but is identical to p9
mknod /dev/block/mmcblk0p16 b 179 12 // creates a device node called p16 but is identical to p12
So, in your init script, /dev/block/mmcblk0p13 is referencing the EXACT SAME DEVICE as /dev/block/mmcblk0p9 (and the same for the created p16 device and the already existing p12 device.)
Wow, I really hope that not only am I making sense, but also that you are following me. I'm going to start rambling even more.
You kind of have to understand how device nodes work, etc. The NAME of the device node doesn't matter. What matters is if it's a block or character device, the MAJOR number and the MINOR number. For block types of MAJOR 179, it's referring to a MMC device. For block/MMC (b 179). the minor number specifies the partition of the device. (I'm simplifying here - it's actually a masked value that includes a partition and device - and gets more interesting with > 16 partitions that require different majors)
So, you could (in theory) go into that script that works fine on the sgs3 and rename every occurrence of "mmcblk0p16" with "i_like_sex" and it'll still work on the sgs3 (even if you didn't like sex.)
Okay... so back to the script. Keep in mind that I'm basing EVERYTHING on that one script and haven't seen anything else related to this multi-boot thing. It'd probably help if someone gave me a link (I'm too lazy to search) to something that installs this multi-boot stuff.
Anyway, that script. I'm going to do something here for clarity. Instead of referencing the misleading "mmcblk0p13" and "mmcblk0p16" device node nodes, I'm just going to call them "extra13" and "extra16" (because they are NOT referencing partitions 13/16.)
So, in that script, extra13 is actually pointing to partition9 which (based on your information) is the SYSTEM partition (mmcblk0p9) and extra16 is actually pointing to partition12 which (again based on your info) is the USERDATA partition.
In other words, extra13 is pointing to what is normally mounted as "/system" and extra16 is pointing to what is normally mounted as "/data". However, at least for getting the dual boot stuff kick started, it's mounting extra16 in "/.secondrom" instead of "/data".
THAT should be enough information to get you going towards solving your issue.
Personally, I think that whoever decided to use mmcblk0p13 and mmcblk0p16 as fictional device node names on the sgs3 should be thumped in the head for either intentionally or unintentionally creating confusion. It might be due to one of the other dependencies of the dual booting system (what is "/sbin/choose_rom"?) that they were unwilling (or unable) to fix. It might also just be a way to try and make the stuff a pain to port. I don't know their intentions/motives.
I will offer this: If my explanation didn't make sense, you might want to take a few steps back and learn what all of it means before you keep going with the porting effort. Some of the concepts here are important to know, and some basic understanding of device nodes is important when mounting file systems.
Take care
Gary
Click to expand...
Click to collapse
Hi,
Thanks for your reply, i think i uderstand what i need to do.
Just to be sure tho (i would rather not brick my phone if i dont have to ), is this what u think i should do?:
Change these lines:
Code:
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12
To:
Code:
mknod /dev/block/extra13 b 179 13
mknod /dev/block/extra16 b 259 0
Cos if u look at the Minor and majors for the data partition (p16) u see that they have thoses ids:
Code:
[email protected]:/ # ls -l /dev/block/mmc*
brw------- root root 179, 0 2012-12-22 08:35 mmcblk0
brw------- root root 179, 1 2012-12-22 08:35 mmcblk0p1
brw-rw---- system radio 179, 10 2012-12-22 08:35 mmcblk0p10
brw-rw---- system radio 179, 11 2012-12-22 08:35 mmcblk0p11
brw------- root root 179, 12 2012-12-22 08:35 mmcblk0p12
[COLOR="Red"] brw------- root root 179, 13 2012-12-22 08:35 mmcblk0p13[/COLOR]
brw------- root root 179, 14 2012-12-22 08:35 mmcblk0p14
brw------- root root 179, 15 2012-12-22 08:35 mmcblk0p15
[COLOR="Red"] brw------- root root 259, 0 2012-12-22 08:35 mmcblk0p16[/COLOR]
brw------- root root 179, 2 2012-12-22 08:35 mmcblk0p2
brw------- root root 179, 3 2012-12-22 08:35 mmcblk0p3
brw-rw---- system radio 179, 4 2012-12-22 08:35 mmcblk0p4
brw-rw---- system radio 179, 5 2012-12-22 08:35 mmcblk0p5
brw-rw---- system radio 179, 6 2012-12-22 08:35 mmcblk0p6
brw-rw---- system root 179, 7 2012-12-22 08:35 mmcblk0p7
brw------- root root 179, 8 2012-12-22 08:35 mmcblk0p8
brw------- root root 179, 9 2012-12-22 08:35 mmcblk0p9
brw------- root root 179, 16 2012-12-22 08:35 mmcblk1
brw------- root root 179, 17 2012-12-22 08:35 mmcblk1p1
Does that look right to you?.
Here are the links to the dual boot kernel:
Here is the link to the ramfs i used to edit:
https://github.com/gokhanmoral/ramfs-sgs3
Here is the full kernel source code:
https://github.com/gokhanmoral/siyahkernel-sgs3
Here is the Completed kernel for the S3:
http://www.gokhanmoral.com/
the init scipt i sent was completely un-molested. it came from the source code provided by gokhanmoral, and it hadnt been edited or anything.
Thanks again for your help.
Cheers
Corey
It looks okay... obviously you'll have to change the script and perhaps some other stuff. I can't download the linked stuff right now (I'm on my phone) but will look more later.
Sent from my SAMSUNG-SGH-I317 using Tapatalk 2
garyd9 said:
It looks okay... obviously you'll have to change the script and perhaps some other stuff. I can't download the linked stuff right now (I'm on my phone) but will look more later.
Sent from my SAMSUNG-SGH-I317 using Tapatalk 2
Click to expand...
Click to collapse
Ok thanks. So do u mean I need to change the partition layout on all the scripts, and change any reference of thoses partitions mentioned earlier?. Or do u mean something else?.
Gokhan moral said I just needed to change the partition layout, and try it and see if it boots, and if it doesn't I can play around with the init file to try
And get it booting (he also said he would give me a copy of his modded recovery which has all the dual boot options if I get the dual boot booting via adb )
Thanks again
Cheers
Corey
Sent from my GT-N7100
If I helped you, please hit Thanks..
fishingfon said:
Ok thanks. So do u mean I need to change the partition layout on all the scripts, and change any reference of thoses partitions mentioned earlier?. Or do u mean something else?.
Click to expand...
Click to collapse
You'd have to change the references to the device nodes in the scripts (and anything else that might use device nodes that reference sgs3 partitions.)
take care
Gary
garyd9 said:
You'd have to change the references to the device nodes in the scripts (and anything else that might use device nodes that reference sgs3 partitions.)
take care
Gary
Click to expand...
Click to collapse
Hi,
Yes I have already done that, although I will go thru all the scripts again to check I haven't missed one before I repack the ramdisk.
Thanks
Cheers
Corey
Sent from my GT-N7100
If I helped you, please hit Thanks..
Great news, I just flashed the kernel, and it didn't brick my phone .
The first rom booted fine, with the only bug being that the external sd doesn't work (but i know what i did wrong with that).
I have cloned the data to the second rom system img, but i am still figuring out how to boot in to the second rom, as the one boot user promt doesn't work without the custom dual boot recovery (i think)
Corey
Sent from my GT-N7100
If I helped you, please hit Thanks..
fishingfon said:
If I helped you, please hit Thanks..
Click to expand...
Click to collapse
What would be more helpful is for you to post not only that you've had successes, but also to post the details of those successes to share with the community. What did you have to change with the scripts, what does the end result look like, etc.
It's annoying to see "I got it working" posts without details of HOW a person got it working. As well, the details will help the next person who tries to port it to another platform.
Take care
Gary
garyd9 said:
What would be more helpful is for you to post not only that you've had successes, but also to post the details of those successes to share with the community. What did you have to change with the scripts, what does the end result look like, etc.
It's annoying to see "I got it working" posts without details of HOW a person got it working. As well, the details will help the next person who tries to port it to another platform.
Take care
Gary
Click to expand...
Click to collapse
Hi,
I haven't finished getting it working yet, as only the first Rom is booting, i am still setting up the ext4 images ect for the second rom. i didn't really see much point in writing what u said till I had got the actual dual boot working. But when I have got the dual boot working I will write what u said.
Cheers
Corey
Sent from my GT-N7100
If I helped you, please hit Thanks..
Hi guys, I hope one guru here can help me to unbrick my TF300T.
Yesterday I unlock the tablet with the ASUS utility and flashed lastest TWRP. After that the tablet always boot into TWRP but it can't mount any partition. I was able to go to fastboot with adb reboot-bootloader and boot Android from the Android icon. Then I tried to flash ASUS stock image to system (fastboot -i 0x0b05 flash system blob) and now I can't get it to boot.
fastboot send the image but doesn't write it, I get no error, but the process is to fast and the tablet freeze after it:
Code:
./fastboot devices
015d262e0b20101a fastboot
sudo ./fastboot -i 0x0B05 flash recovery recovery.img
sending 'recovery' (5644 KB)...
OKAY [ 2.471s]
writing 'recovery'...
OKAY [ 3.162s]
finished. total time: 5.633s
./fastboot devices
???????????? fastboot
./fastboot reboot
rebooting... <------ freeze!
I'm able to go to adb shell, then I push the recovery image and tried to flash it with but with no luck:
Code:
./adb devices
List of devices attached
0123456789ABCDEF recovery
./adb push recovery.img /root
1327 KB/s (5779560 bytes in 4.250s)
./adb shell
~ # cd root
/root # ls -alh
drwx------ 2 root root 0 Apr 16 07:21 .
drwxr-xr-x 19 root root 0 Apr 16 07:21 ..
-rw-rw-rw- 1 root root 5.5M Apr 15 20:25 recovery.img
/root # flash_image recovery recovery.img
failed with error: -1
/root #
Please tell me that I doesn't send 420€ to trash...
PS: I used Ubuntu for all this stuff.
I have read some threads with similar problems and tried some of the solutions with no luck:
http://forum.xda-developers.com/showthread.php?p=32792384
http://forum.xda-developers.com/showthread.php?t=1916952
http://forum.xda-developers.com/showthread.php?t=2228447
jmsosso said:
I have read some threads with similar problems and tried some of the solutions with no luck:
http://forum.xda-developers.com/showthread.php?p=32792384
http://forum.xda-developers.com/showthread.php?t=1916952
http://forum.xda-developers.com/showthread.php?t=2228447
Click to expand...
Click to collapse
I think, we must spam mail asus to release new nvflash
jmsosso said:
Hi guys, I hope one guru here can help me to unbrick my TF300T.
Yesterday I unlock the tablet with the ASUS utility and flashed lastest TWRP. After that the tablet always boot into TWRP but it can't mount any partition. I was able to go to fastboot with adb reboot-bootloader and boot Android from the Android icon. Then I tried to flash ASUS stock image to system (fastboot -i 0x0b05 flash system blob) and now I can't get it to boot.
fastboot send the image but doesn't write it, I get no error, but the process is to fast and the tablet freeze after it:
Code:
./fastboot devices
015d262e0b20101afastboot
sudo ./fastboot -i 0x0B05 flash recovery recovery.img
sending 'recovery' (5644 KB)...
OKAY [ 2.471s]
writing 'recovery'...
OKAY [ 3.162s]
finished. total time: 5.633s
./fastboot devices
????????????fastboot
./fastboot reboot
rebooting... <------ freeze!
I'm able to go to adb shell, then I push the recovery image and tried to flash it with but with no luck:
Code:
./adb devices
List of devices attached
0123456789ABCDEFrecovery
./adb push recovery.img /root
1327 KB/s (5779560 bytes in 4.250s)
./adb shell
~ # cd root
/root # ls -alh
drwx------ 2 root root 0 Apr 16 07:21 .
drwxr-xr-x 19 root root 0 Apr 16 07:21 ..
-rw-rw-rw- 1 root root 5.5M Apr 15 20:25 recovery.img
/root # flash_image recovery recovery.img
failed with error: -1
/root #
Please tell me that I doesn't send 420€ to trash...
PS: I used Ubuntu for all this stuff.
Click to expand...
Click to collapse
OK, first of all, it sounds like you've updated to the 4.2.1 firmware and flashed a recovery for the 4.1.1 firmware. So, make sure that the new recovery you're flashing is the patched TWRP with -42 at the end of the name. It's not the newest TWRP. If you're trying to flash the same version of TWRP as before, you won't fix anything, if you can even get it to flash.
Second, when you're in ADB shell, what happens when, instead of using flash_image, you use
Code:
su
dd if=/root/recovery.img of=/dev/block/mmcblk0p4
?
The worst that can happen is that you get the same error. That's if flash_image uses dd to flash the recovery. Otherwise, there's a chance it could work. I say it's worth a try.
Putting the ILLA in KILLA since 1985
---------- Post added at 04:18 AM ---------- Previous post was at 04:14 AM ----------
If that doesn't work, try this guide: http://forum.xda-developers.com/showthread.php?p=40343188
Putting the ILLA in KILLA since 1985
EndlessDissent said:
OK, first of all, it sounds like you've updated to the 4.2.1 firmware and flashed a recovery for the 4.1.1 firmware. So, make sure that the new recovery you're flashing is the patched TWRP with -42 at the end of the name. It's not the newest TWRP. If you're trying to flash the same version of TWRP as before, you won't fix anything, if you can even get it to flash.
Second, when you're in ADB shell, what happens when, instead of using flash_image, you use
Code:
su
dd if=/root/recovery.img of=/dev/block/mmcblk0p4
?
The worst that can happen is that you get the same error. That's if flash_image uses dd to flash the recovery. Otherwise, there's a chance it could work. I say it's worth a try.
Click to expand...
Click to collapse
I downloaded openrecovery-twrp-2.4.4.0-tf300t-4.2.blob and renamed it to twrp.blob then:
Code:
./adb push twrp.blob /root
1328 KB/s (7680104 bytes in 5.644s)
./adb shell
~ # cd root
/root # ls
twrp.blob
/root # su
/sbin/sh: su: not found
/root # dd if=twrp.blob of=/dev/block/mmcblk0p4
15000+1 records in
15000+1 records out
7680104 bytes (7.3MB) copied, 0.091978 seconds, 79.6MB/s
/root # exit
./adb reboot
Then the tablet boot directly into TWRP 2.5.0.0, the version that I installed at the beginning
Latter I'll try the other suggestion. Thanks a lot!
There aren't any partition mounted at boot and I can't mount any manually. I think the problem is in /dev/block:
Code:
~ # df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 486.8M 48.0K 486.8M 0% /dev
~ # cat /etc/fstab
/system ext4 rw
/cache ext4 rw
/external_sdcard vfat rw
/sd-ext ext4 rw
~ # mount -a
mount: mounting /system on ext4 failed: No such file or directory
mount: mounting /cache on ext4 failed: No such file or directory
mount: mounting /external_sdcard on vfat failed: No such file or directory
mount: mounting /sd-ext on ext4 failed: No such file or directory
~ # cd root
/root # mkdir test
/root # mount /dev/block/mmcblk0p4 test
mount: mounting /dev/block/mmcblk0p4 on test failed: No such file or directory
~ # ls -alh /dev/block/
drwxr-xr-x 2 root root 200 Apr 16 13:52 .
drwxr-xr-x 10 root root 2.1K Apr 16 13:53 ..
brw------- 1 root root 7, 0 Apr 16 13:52 loop0
brw------- 1 root root 7, 1 Apr 16 13:52 loop1
brw------- 1 root root 7, 2 Apr 16 13:52 loop2
brw------- 1 root root 7, 3 Apr 16 13:52 loop3
brw------- 1 root root 7, 4 Apr 16 13:52 loop4
brw------- 1 root root 7, 5 Apr 16 13:52 loop5
brw------- 1 root root 7, 6 Apr 16 13:52 loop6
brw------- 1 root root 7, 7 Apr 16 13:52 loop7
i just noticed of /proc/partitions is empty. Can anybody publish here a valid one? I don't know if just editing the file with the right values will solve my situation.
jmsosso said:
There aren't any partition mounted at boot and I can't mount any manually. I think the problem is in /dev/block:
Code:
~ # df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 486.8M 48.0K 486.8M 0% /dev
~ # cat /etc/fstab
/system ext4 rw
/cache ext4 rw
/external_sdcard vfat rw
/sd-ext ext4 rw
~ # mount -a
mount: mounting /system on ext4 failed: No such file or directory
mount: mounting /cache on ext4 failed: No such file or directory
mount: mounting /external_sdcard on vfat failed: No such file or directory
mount: mounting /sd-ext on ext4 failed: No such file or directory
~ # cd root
/root # mkdir test
/root # mount /dev/block/mmcblk0p4 test
mount: mounting /dev/block/mmcblk0p4 on test failed: No such file or directory
~ # ls -alh /dev/block/
drwxr-xr-x 2 root root 200 Apr 16 13:52 .
drwxr-xr-x 10 root root 2.1K Apr 16 13:53 ..
brw------- 1 root root 7, 0 Apr 16 13:52 loop0
brw------- 1 root root 7, 1 Apr 16 13:52 loop1
brw------- 1 root root 7, 2 Apr 16 13:52 loop2
brw------- 1 root root 7, 3 Apr 16 13:52 loop3
brw------- 1 root root 7, 4 Apr 16 13:52 loop4
brw------- 1 root root 7, 5 Apr 16 13:52 loop5
brw------- 1 root root 7, 6 Apr 16 13:52 loop6
brw------- 1 root root 7, 7 Apr 16 13:52 loop7
i just noticed of /proc/partitions is empty. Can anybody publish here a valid one? I don't know if just editing the file with the right values will solve my situation.
Click to expand...
Click to collapse
Hmmm... I think it's interesting that dd seemed to successfully write the recovery and exited with no errors, but didn't actually write anything. Not sure what that means or how it could help, but that wasn't at all what I expected. I thought it would either error out or successfully flash your recovery. It obviously did neither.
As for your request, I hope this helps, though I'm not sure if editing the file will help much. I guess it's better than nothing.
Code:
[email protected]:/ $ cat /proc/partitions
major minor #blocks name
7 0 6269 loop0
7 1 5229 loop1
7 2 41612 loop2
7 3 22901 loop3
7 4 9387 loop4
179 0 31039488 mmcblk0
179 1 786432 mmcblk0p1
179 2 438272 mmcblk0p2
179 3 2048 mmcblk0p3
179 4 835584 mmcblk0p4
179 5 5120 mmcblk0p5
179 6 512 mmcblk0p6
179 7 5120 mmcblk0p7
179 8 28924416 mmcblk0p8
179 32 2048 mmcblk0boot1
179 16 2048 mmcblk0boot0
254 0 6268 dm-0
254 1 5229 dm-1
254 2 41611 dm-2
254 3 22900 dm-3
254 4 9387 dm-4
[email protected]:/ $ ls -al /dev/block/
brw------- root root 254, 0 2013-04-14 03:40 dm-0
brw------- root root 254, 1 2013-04-14 03:40 dm-1
brw------- root root 254, 2 2013-04-14 03:40 dm-2
brw------- root root 254, 3 2013-04-14 03:40 dm-3
brw------- root root 254, 4 2013-04-14 03:40 dm-4
brw------- root root 7, 0 2013-04-14 03:36 loop0
brw------- root root 7, 1 2013-04-14 03:36 loop1
brw------- root root 7, 2 2013-04-14 03:36 loop2
brw------- root root 7, 3 2013-04-14 03:36 loop3
brw------- root root 7, 4 2013-04-14 03:36 loop4
brw------- root root 7, 5 2013-04-14 03:36 loop5
brw------- root root 7, 6 2013-04-14 03:36 loop6
brw------- root root 7, 7 2013-04-14 03:36 loop7
brw------- root root 179, 0 2013-04-14 03:36 mmcblk0
brw------- root root 179, 16 2013-04-14 03:36 mmcblk0boot0
brw------- root root 179, 32 2013-04-14 03:36 mmcblk0boot1
brw------- root root 179, 1 2013-04-14 03:36 mmcblk0p1
brw------- root root 179, 2 2013-04-14 03:36 mmcblk0p2
brw-rw---- root system 179, 3 2013-04-14 03:36 mmcblk0p3
brw-rw---- root system 179, 4 2013-04-14 03:36 mmcblk0p4
brw------- root root 179, 5 2013-04-14 03:36 mmcblk0p5
brw------- drm drm 179, 6 2013-04-14 03:36 mmcblk0p6
brw------- root root 179, 7 2013-04-14 03:36 mmcblk0p7
brw------- root root 179, 8 2013-04-14 03:36 mmcblk0p8
drwxr-xr-x root root 2013-04-14 03:36 platform
drwx------ root root 2013-04-14 03:36 vold
Good luck.
Putting the ILLA in KILLA since 1985
Edit: I almost forgot to mention that the guide I posted earlier uses fastboot, but theoretically you can do it with dd in ADB shell like you tried with the recovery. You'll need to know which partition is the bootloader, though, and substitute that in place of mmcblk0p4 in the dd command.
I was unable to modify the partitions file. I think that the problem is related to the new 4.2 encrypted file system:
http://forum.xda-developers.com/showthread.php?t=2180376
It is, and you're done.
In TWRP, there are no mmcblk devices, and so nothing to mount or mount to. Nothing to 'dd' to either.
In RCK, fastboot will lock the tablet trying to flash anything.
Nvflash won't help because you needed to use it BEFORE it was bricked.
There are likely lots of newly bricked TF300T's because of this.
Folks will say it's because you didn't read, but the directions on the Teamwin website will still result in a brick if they are followed after taking the 4.2.1 OTA update. In my case, I bricked mine in between the time TWRP 2.4.4.0 came out (I used the -JB release), and the time 2.4.4.0-4.2 was released - following those directions exactly. I'd imagine there is even more of this happening now that 2.5.0.0 was released (without a 4.2 compatible version), no change in the instructions on their website, and even more folks that have taken the 4.2.1 OTA update.
splashg said:
It is, and you're done.
In TWRP, there are no mmcblk devices, and so nothing to mount or mount to. Nothing to 'dd' to either.
In RCK, fastboot will lock the tablet trying to flash anything.
Nvflash won't help because you needed to use it BEFORE it was bricked.
There are likely lots of newly bricked TF300T's because of this.
Folks will say it's because you didn't read, but the directions on the Teamwin website will still result in a brick if they are followed after taking the 4.2.1 OTA update. In my case, I bricked mine in between the time TWRP 2.4.4.0 came out (I used the -JB release), and the time 2.4.4.0-4.2 was released - following those directions exactly. I'd imagine there is even more of this happening now that 2.5.0.0 was released (without a 4.2 compatible version), no change in the instructions on their website, and even more folks that have taken the 4.2.1 OTA update.
Click to expand...
Click to collapse
Oh my god! the worst of my nightmares :crying:
My error was, when reading a guide to flash TWRP, to go to the official website and download the latest -jb release and not to use the recommended one. As you said they must include some type of message at the download page.
After that, I was able to boot Android using ADB reboot, but then, trying to go back I flashed the official ASUS system partition. The result was that the command erased the working partition but doesn't flash nothing.
Now I think my better choice is to wait some time. If nobody found a solution then buy a motherboard at eBay and try to replace it.
Thanks for your support folks!
Best regards.
+1 for Asus
Wow, Asus fixed my tablet under warranty without any cost
I received it yesterday after it traveled from Spain (were I live) to Czech Republic and back in 14 days.
When I called to Asus I tell the guy at the phone that I brick the tabled trying to root. He told me that if the tablet was rooted and my answer was not. And he told me then that it's under warranty. :good:
So guys with the same problem, and with the tablet under warranty, try with Asus!
Best regards.
First how to find location of boot image in device? I want to take current boot image. Do modifications and later flash that boot image back to device.
I have searched correct block device and did some image files with dd command but they were not boot images. I tried with several tools.
Here is some listing from the phone with adb shell commands.
Code:
[email protected]:/proc # cat partitions
major minor #blocks name
179 0 30512256 mmcblk0
179 1 1 mmcblk0p1
179 2 10240 mmcblk0p2
179 3 10240 mmcblk0p3
179 4 6144 mmcblk0p4
179 5 665600 mmcblk0p5
179 6 129024 mmcblk0p6
179 7 1572864 mmcblk0p7
179 8 28077696 mmcblk0p8
179 64 2048 mmcblk0boot1
179 32 2048 mmcblk0boot0
Code:
[email protected]:/ # ls -l /emm*
lrwxrwxrwx root root 1970-01-01 06:30 [email protected] -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 1970-01-01 06:30 [email protected] -> /dev/block/mmcblk0p6
lrwxrwxrwx root root 1970-01-01 06:30 [email protected] -> /dev/block/mmcblk0p1
lrwxrwxrwx root root 1970-01-01 06:30 [email protected] -> /dev/block/mmcblk0p8
lrwxrwxrwx root root 1970-01-01 06:30 [email protected]_f -> /dev/block/mmcblk0p2
lrwxrwxrwx root root 1970-01-01 06:30 [email protected]_s -> /dev/block/mmcblk0p3
lrwxrwxrwx root root 1970-01-01 06:30 [email protected]_ro -> /dev/block/mmcblk0p4
lrwxrwxrwx root root 1970-01-01 06:30 [email protected] -> /dev/block/mmcblk0p7
[email protected]:/ #
Code:
[email protected]:/dev/block # ls -al
brw------- root root 7, 0 2014-03-12 12:54 loop0
brw------- root root 7, 1 2014-03-12 12:54 loop1
brw------- root root 7, 2 2014-03-12 12:54 loop2
brw------- root root 7, 3 2014-03-12 12:54 loop3
brw------- root root 7, 4 2014-03-12 12:54 loop4
brw------- root root 7, 5 2014-03-12 12:54 loop5
brw------- root root 7, 6 2014-03-12 12:54 loop6
brw------- root root 7, 7 2014-03-12 12:54 loop7
brw-rw---- root system 179, 0 2014-03-12 12:54 mmcblk0
brw------- root root 179, 32 2014-03-12 12:54 mmcblk0boot0
brw------- root root 179, 64 2014-03-12 12:54 mmcblk0boot1
brw------- root root 179, 1 2014-03-12 12:54 mmcblk0p1
brw-r----- root system 179, 2 2014-03-12 12:54 mmcblk0p2
brw------- root root 179, 3 2014-03-12 12:54 mmcblk0p3
brw------- root root 179, 4 2014-03-12 12:54 mmcblk0p4
brw------- root root 179, 5 2014-03-12 12:54 mmcblk0p5
brw------- root root 179, 6 2014-03-12 12:54 mmcblk0p6
brw------- root root 179, 7 2014-03-12 12:54 mmcblk0p7
brw------- root root 179, 8 2014-03-12 12:54 mmcblk0p8
drwxr-xr-x root root 2014-03-12 12:54 platform
[email protected]:/dev/block #
/dev/block/mmcblk0boot0 looked promising but I made image of it by by command dd if=/dev/block/mmcblk0boot0 of=/sdcard/boot.img
But the image was not boot image.
Code:
[email protected]:/ # mount
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
[email protected] /system ext4 ro,noatime,noauto_da_alloc,commit=1,data=ordered 0 0
[email protected] /data ext4 rw,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered 0 0
/[email protected]_f /protect_f ext4 rw,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered 0 0
/[email protected]_s /protect_s ext4 rw,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered 0 0
/[email protected] /storage/sdcard0 vfat rw,dirsync,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
[email protected]:/ #
I can make full image by dding /dev/block/mmcblk0 but it would be better to get the parts separately.
Is there easy way to find where the boot image is located?
I checked block device sizes
/dev/block/mmcblk0p8 is the internal flash area for user, about 28G. Boot image boot loader etc must be in mmcblk0p1 - mmcblk0p7
Size of the block devices
Code:
/dev/block/mmcblk0 31244550144
/dev/block/mmcblk0boot0 2097152
/dev/block/mmcblk0boot1 2097152
/dev/block/mmcblk0p1 1024
/dev/block/mmcblk0p2 10485760
/dev/block/mmcblk0p3 10485760
/dev/block/mmcblk0p4 6291456
/dev/block/mmcblk0p5 681574400
/dev/block/mmcblk0p6 132120576
/dev/block/mmcblk0p7 1610612736
/dev/block/mmcblk0p8 28751560704
/dev/block/mmcblk1 8178892800
I got these with script
Code:
#!/system/bin/sh
command="/sdcard/busybox blockdev --getsize64"
for f in /dev/block/mm*
do
result=`$command $f`
result="$f \t $result"
echo $result
done
Via Terminal Emulator:
"su
cat /proc/partitions"
When again other command: dd if=/dev/block/(boot_partition_which_showed under /proc/partitions) of=/sdcard/boot.img
Root your device and try MtkDroidTools.
Use MTK SP_Flash_tool to flash image back.
In proc partitions there were two boot related devices listed
179 64 2048 mmcblk0boot1
179 32 2048 mmcblk0boot0
I made images from both of those but there was nothing inside the images which looked like boot image.
I found that there is /dev/bootimage
Code:
[email protected]:/ # ls -l /dev/boo*
crw-r----- root system 234, 10 2013-01-01 06:30 bootimg
I made image from that. The image is 4.3G. Very large. Anyway I found bootimage inside that. Then I made another smaller one with
Code:
# dd if=/dev/bootimg of=/sdcard/testboot.img count=12000
I can unpack that image in linux with tool unpack-MT65xx.pl. I tried to repack the exact same files without modifying. But repacking the image with repack-MT65.pl generates file which is different.
cnexpat said:
Is there easy way to find where the boot image is located?
Click to expand...
Click to collapse
Looking for same