How to write stock tar to SD card as image - General Questions and Answers

I'm working on making a tool for the Galaxy S series that will take a stock tar file, emulate a write operation (maybe use Heimdall for this?) that copies everything to an IMG file, then uses DD to write the first GB to an SD card. How can I go about doing this? Do I need to emulate the bootloader of a Samsung phone such that it writes to partitions within a mounted image, or is there a simpler way of doing it?

Related

Booting and Image from SD

Hi. I was wondering whether its possible to modify the SPL (I guess that's the part that will need to be modified first) in order to allow booting a full system from the SD card.
This would allow testing images without having to flash them to the device NAND.
The advantages would be that the process would be both faster (no NAND flashing) and probably safer (you can always get a new SD card).

[Q] Missing pb99diag and pb99img

Let's start with the history.
- Bought a HTC Desire.
- Used unrevoked, clockwordmod to flash Cyanogenmod (made backup of HTC Froyo/Sense installation).
- Used same tool to flash back the backup.
Now I want to install a new ROM with A2SD+. Used GParted Live CD to shrink the FAT32 partition (8 to 7GB) and created an EXT3 partion after the FAT32 one.
My problem: when booting into recovery by pressing volume down and the power button, the loader (hboot ??) is trying to find several pb99img and pb99diag files in the root of the SD card. Some posts talk about partitioning going wrong but I might have deleted the files from the card ("hey whats that file, don't know what it does, let's remove it).
Do I really need those files or should I wait 5 minutes (why does it even need that long to realize the files aren't present). If I need them, can I get them somewhere? Or just ignore it, continue to Clockwordmod Recovery and flash a new ROM from a ZIP file on the SD card?

[root tool] Toshiba Thrive 10.1" ICS

(Now, I know this is not in the right section or even in the device's page, but...)
Forewarning: I am NOT responsible for any damages caused by running this tool. (You ran it, not me.) Also, do NOT use on the Thrive 7 or ANY of the Excites! The Thrive 7 has an entirely different bootloader/partition layout than the 10.
Pio_masaki and I have been working hard for almost a year to get root on the ICS version of the Toshiba Thrive 10.
Last night, I was able to finally sneak past sealime.ko and have it work.
It uses the "root any ICS device" tool, with special modifications specifically for the Thrive 10.
(can't post any links, so it's on the "thrive-hackers" github page.)
Special note: While it is set up for OSX ADB, I have not been able to find any binaries.
Are you saying that we are close to a root method for Thrives running Toshiba ICS?
rohads said:
Are you saying that we are close to a root method for Thrives running Toshiba ICS?
Click to expand...
Click to collapse
Saying there is a method to root it now, yes, we got around sealime.ko. This means we can flash the HC bootloader which is unlocked, which allows custom recovery and kernels/ramdisks (boot.img) to be used.
BTW the link is https://github.com/Thrive-Hackers
congrats guys ! very awesome work !
jdsingles deodexed ROM w/ agat63's 1.3 kernel Suped up w/ CB 6.26.13
More specifically, it bypasses sealime to flash the unlocked bootloader. What we did was we MVd /dev/block/mmcblk0p6 to 0p9. It's a pure fluke Pio and I found out that it works. We found out that sealime was explicitly blocking write to 0p6, so he semi-sarcastically said to move it. I ran the mv command, whadda ya know? It worked!
'Course, getting the tool completed wasn't as simple as that...
PS: Could we get this moved to the Toshiba Thrive Development section?
Have instructions been written for the process?
worked for me
I used this tool on Jul 8 and it worked very well. I got it from thriveforums dot org. Thank you pio_masaki and AmEv.
I tried changing the recovery to the latest TWRP using "fastboot flash recovery twrp-2.4.1.0.img" while in bootloader. I was not able to, though as it kept giving me errors.
Does this bootloader not allow flashing a recovery? I noticed the rootme script uses adb commands to push the CWM recovery.
I am now running Dale's latest deodexed rooted ICS rom with the CWM recovery he included.
Other unrelated lessons learned:
If you can't mount your SD card in recovery, try a different card!
And, Dale packages his update.zip inside the downloaded zip file!
navyguy said:
I used this tool on Jul 8 and it worked very well. I got it from thriveforums dot org. Thank you pio_masaki and AmEv.
I tried changing the recovery to the latest TWRP using "fastboot flash recovery twrp-2.4.1.0.img" while in bootloader. I was not able to, though as it kept giving me errors.
Does this bootloader not allow flashing a recovery? I noticed the rootme script uses adb commands to push the CWM recovery.
I am now running Dale's latest deodexed rooted ICS rom with the CWM recovery he included.
Other unrelated lessons learned:
If you can't mount your SD card in recovery, try a different card!
And, Dale packages his update.zip inside the downloaded zip file!
Click to expand...
Click to collapse
Try fastboot flash:raw.
Is there any need to do a backup before rooting?
TubaMeister said:
Is there any need to do a backup before rooting?
Click to expand...
Click to collapse
Not explicitly, but it wouln't hurt in case your tablet got into contact with allspark.... er, the bootloader didn't flash, and you're stuck in a bootloop.
easy root and CWM recovery
walk thru
http://www.youtube.com/watch?v=MXeYJhKCgX8
adb driver
http://www.thriveforums.org/forum/t...vers-usb-adb-driver-installation-package.html
root tool
https://github.com/thrive-hackers/thrive-10-inch-ics-root,
follow this to install CWM
http://www.thriveforums.org/forum/d...0-clockworkmod-touch-recovery-v6-0-1-1-a.html
follow to install touch CWM
http://www.thriveforums.org/forum/d...0-clockworkmod-touch-recovery-v6-0-1-1-a.html
ROMs
http://www.thriveforums.org/forum/dalepl/
Uh oh
robyn402 said:
walk thru
http://www.youtube.com/watch?v=MXeYJhKCgX8
adb driver
http://www.thriveforums.org/forum/t...vers-usb-adb-driver-installation-package.html
root tool
https://github.com/thrive-hackers/thrive-10-inch-ics-root,
follow this to install CWM
http://www.thriveforums.org/forum/d...0-clockworkmod-touch-recovery-v6-0-1-1-a.html
follow to install touch CWM
http://www.thriveforums.org/forum/d...0-clockworkmod-touch-recovery-v6-0-1-1-a.html
ROMs
http://www.thriveforums.org/forum/dalepl/
Click to expand...
Click to collapse
I installed the drivers, used the root tool, the restore was successful, but now the tablet is stuck in a boot-loop mode.
The root tool was running, there was a line that said the screen would go blank, which it did, and it stayed there for several hours. When I came back to check on it, the tablet was off, so I turned it on. That's when I found the boot loop. It'll get to the home page, tell me that nova launcher has stopped, then loop back to the moving stars section of the boot screen.
Any ideas on what to do now?
DLeach4512,
if CWM is still alive, so just flash any ROM via CWM (flashing wipes all your data that exist in internal memory, so you need to make backup via CWM if you wish to save your data; and after flashing ROM you can import all data via Titanium Backup)
Kyonex said:
DLeach4512,
if CWM is still alive, so just flash any ROM via CWM (flashing wipes all your data that exist in internal memory, so you need to make backup via CWM if you wish to save your data; and after flashing ROM you can import all data via Titanium Backup)
Click to expand...
Click to collapse
You know, I feel kinda dumb because I didn't even try that!
Now i've tried it, and I see I can get into CWM.
I put a ROM on an SD card on my PC, then put that SD card into the Thrive and used CWM to install the .zip of the ROM I selected, and it won't install. It starts, then it says Installation aborted, but won't tell me why.
Any ideas where I should start unraveling this mystery?
1. check that your recovery is CWM and not stock recovery
2. check that you put on SD archive that contain folders named system and META-INF, file like boot.img, something other maybe (many ROMs archive contain "archive in archive", so you need to unpack archive from main archive and than put that internal archive on SD); after checking that all right try to flash that archive again
3. try another sdcard (full sized SDHC + formated in FAT32)
DLeach4512 said:
You know, I feel kinda dumb because I didn't even try that!
Now i've tried it, and I see I can get into CWM.
I put a ROM on an SD card on my PC, then put that SD card into the Thrive and used CWM to install the .zip of the ROM I selected, and it won't install. It starts, then it says Installation aborted, but won't tell me why.
Any ideas where I should start unraveling this mystery?
Click to expand...
Click to collapse
also make sure you open the zip and place the update.zip on your card -
From my GSIII - jd's Stock/Rooted/Deodexed 4.3
Kyonex said:
1. check that your recovery is CWM and not stock recovery
2. check that you put on SD archive that contain folders named system and META-INF, file like boot.img, something other maybe (many ROMs archive contain "archive in archive", so you need to unpack archive from main archive and than put that internal archive on SD); after checking that all right try to flash that archive again
3. try another sdcard (full sized SDHC + formated in FAT32)
Click to expand...
Click to collapse
Excellent!
1) I had to extract "update.zip" from the ROM I had downloaded.
2) I re-formatted the card I was using to FAT32 instead of FAT.
3) I was able to get the install started with no trouble after following your directions.
BIG THANK YOU FOR THAT!
I got a successful install message, and then it booted!
Thanks a million!
Problems after Mount Changes
I changed the mount as described on thriveforums.org to allow apks and data to go to the external sd rather than "shared" internal memory.
I now have the situation with less free memory available on the sd card than on internal. The CWM backups went on the physical card- a 32 G one almost full. Will look for a major mfr 64 Gig.
One or so issues with the revised mounts where the external sd card is now internal. They relate to making backups with dalepl's latest CWM 6.0.1: where to put CWM backups for now and are they being made correctly with the revised mounts?
The backup made prior to the mount change looks normal: a single, dated/numbered folder about 2.6 Gb, 6 files: boot.img, cache.ext4.tar, data.ext4.tar, nandroid.md5, recovery.img and system.ext4.tar. However, the one made after the mount change also has a dated, numbered folder of only 15.8 Mb and 7 files: .android_secure.vfat.dup, boot.img, cache.ext4.dup, data.ext4.dup, nandroid.md5, recovery.img and system.ext4.dup. There is a second folder associated with the later bu called "blobs", which is huge --2.76 Gb, 3292 folders and 6581 files. Is this an expected result and any one think it might be a valid bu?
Also, it went on to the external SD (now "internal") and total storage use is now almost 28 Gb out of 30.2. I now have the situation with less free memory available on the sd card than on internal. The stuff there looks ok, pix movies and music plus CWM bups of 5.5 G and App_Backup_Restore archived apks at 2.8 Gb. So, I copied the cwm backups folder to the real internal memory, now sdcard2. I assume this true internal memory might get wiped during a restore so, this is not a valid storage site for this? And, if I put copies on a spare card, will that really work if my downloaded apps are on the original card, eg does the CWM backup copy the external card apps?
As I note, for some reason this 'blobs' folder won't copy easily to a USB via the Thrive or Win 7 pc. It also won't copy to a Win 7 HD partition where I store my Thrive stuff. (Update: I was able to do a wireless transfer to my pc and then, from there, to a spare SD card.)
Any thoughts? Should I go back and change the mounts to default?
BTW, I find FolderMount has no real use with the changed mount on the Thrive unless someone tells me otherwise. With the Thrive mounting the external card as internal, files go to the physical card.
gberpa,
I don't understand your question - it is very long. But I know that custom recovery (CWM / TWRP) itself remounts sdcard and internal memory before wipe process so it will wipe correct memory (only internal memory). If you need to change the ROM you don't need to worry about mounting paths because after wipe mounting paths will be restored to original.
Partition layout of Toshiba Thrive 10.1" ICS
AmEv said:
Also, do NOT use on the Thrive 7 or ANY of the Excites! The Thrive 7 has an entirely different bootloader/partition layout than the 10.
Click to expand...
Click to collapse
Can you give us information on the Toshiba Thrive 10.1" ICS partition layout and their names, please?
We would like to compare it to ours Toshiba Excite Pro (AT10LE-A, tostab12BA). A Dirty Cow enabled KingoRoot has given us a temporary root.
[Q] How Root Toshiba Excite Pro AT10LE-A-108 by dexxxZ
https://forum.xda-developers.com/showthread.php?t=2583677&page=6
Sent from my takee 1 using XDA Labs

[Q] Replace Internal Data Partition for External SD

Let me start with: I know that there have been many posts on this, but before you get mad, I was unable to find an answer to what I specifically want to do.
For reference: I am a software developer and sysadmin with a decent amount of Linux experience, but not a lot of android specific experience.
Now that the introduction is out of the way:
What I would like to do is completely remove the "USERDATA" partition (the "Internal SD card"), grow the "SYSTEM" partition to fill that space, and then mount my SD Card (external) as the SD Card that the system sees.
I'm currently on Cyanogenmod 10.1 but want to upgrade to 11 soon.
The reason I want to do this is because:
I have all if my apps that I can set to install to SD Card
Both "internal" partitions are full (only about 200MB is available for pictures/etc. and I can no longer update apps)
Camera (and pretty much everything else as well) stores to the Internal SD card by default
If the system partition was 1.1+1.4=2.5GB and all of my apps were "installed" to a real SD card, it would be a lot more comfortable.
So, here's what I am thinking *might* work (maybe not in the right order, though?):
Point the fstab entry for the internal SD card to the external SD card
I have the PIT file. I will delete the "USERDATA " and grow "SYSTEM" to fill the space
When I write it out in steps, it seems pretty simple...
My concerns:
Will a ROM update (to CM11) re-partition back to the old way (and, in the process, break a bunch of stuff)?
I don't ever plan to go back to stock android or change to another ROM (other than upgrades).
Thanks for reading this long post and for any insight you may be able to provide.
--mobrien118
It's a wonderful idea if it works.
Sent from my SAMSUNG-SGH-T769 using xda app-developers app
Modifying partitions is a bit dangerous.
But I have to ask you why do you need another GB of /system storage?
There was a line you can put in the build.prop that flips your ext. SD with the internal one on cm10 I believe.
This'd interest me if I could get rid of usbdisk and sdcard0 merged.
It would need the phone to be repartitioned though, causing issues with the backups and ROMs.
You may even have to compile cm from source.
Its a lot of trouble
Sent from my SAMSUNG-SGH-T769 using Tapatalk
I just did so on S4 Mini with cm-11 Android 4.4.
First I was thinking of using symlinks and/or bind mounts to redirect to the the external sdcard, but that's a bit of a hassle because
1) Since 4.2: both emulated and external storage is mounted with a fuse layer on top not supporting symlinks
2) Since 4.4: no more global write access on external storage
So moving data was the simplest solution. Besides providing (much) more space my sdcard is also around 20% faster in sequential writes: 8.5 MB/s internal vs 10.5 MB/s external. Is it really 2014?
I haven't yet decided what to do with the original data partition, so for the moment I left it unused. Hence I haven't touched the internal partition table.
Quick summary
partition sdcard (gdisk)
I recommend using GPT, this lets you work with partition names rather than numbers. For the sake of still having an "official" external sdcard I made two partitions. Keep in mind that it's usually the first partition which gets automatically mounted as external sdcard. So I made the 2nd partition the new home for data. This partition however has to be manually specified in the ramdisks fstab which involves flashing the boot partition.
format the new partitions (mkfs.ext4)
copy the original /data directory tree to the new data partition
extract initrd from boot.img (abootimg)
extract files from initrd (gunzip & cpio)
replace the /data entry in fstab pointing at your new data partition
re-pack initrd and boot.img (gzip, cpio & abootimg)
flash boot.img onto the boot partition (dd)
If you use recovery, you also have to edit it's fstab (analog to boot.img mentioned above)
done
Alternatively has anyone tried an init.d script? I see those scripts get executed before the mounting of data & sdcard
Meanwhile the original userdata partition got replaced by 3 new partitions: system2, cache2 & userdata2 which are now used for a dual boot ROM.
I've only changed GPT, not PIT. ROMs and Recovery don't use PIT, so as long as Heimdall/Odin isn't involved it should not cause any issues.
Hey guys,
So after read all that, I am also vry interested in what the OP has suggested. I get that the pit doesn't need to be affected, but as the OP asked, when flashing a new rom or updating an existing, would the partition be reformatted back to the way android handles it, ie; back to the system and data seperate and the sdcard not being used as the internal partition?
I am no developer and only have minimal knowledge in linux and android programing, but I am a quick study and any guide to help me sort this would be greatly appreciated.
Also I am about to get a second S4 mini specifcally for doing things like this so if I brick I don't care?
My next question is could it be possible to code the PIT file to do this for you so that you can just flash that through odin, but again would flashing roms affect this.
Cheers,
Sora.
aguaz said:
I just did so on S4 Mini with cm-11 Android 4.4.
First I was thinking of using symlinks and/or bind mounts to redirect to the the external sdcard, but that's a bit of a hassle because
1) Since 4.2: both emulated and external storage is mounted with a fuse layer on top not supporting symlinks
2) Since 4.4: no more global write access on external storage
So moving data was the simplest solution. Besides providing (much) more space my sdcard is also around 20% faster in sequential writes: 8.5 MB/s internal vs 10.5 MB/s external. Is it really 2014?
I haven't yet decided what to do with the original data partition, so for the moment I left it unused. Hence I haven't touched the internal partition table.
Quick summary
partition sdcard (gdisk)
I recommend using GPT, this lets you work with partition names rather than numbers. For the sake of still having an "official" external sdcard I made two partitions. Keep in mind that it's usually the first partition which gets automatically mounted as external sdcard. So I made the 2nd partition the new home for data. This partition however has to be manually specified in the ramdisks fstab which involves flashing the boot partition.
format the new partitions (mkfs.ext4)
copy the original /data directory tree to the new data partition
extract initrd from boot.img (abootimg)
extract files from initrd (gunzip & cpio)
replace the /data entry in fstab pointing at your new data partition
re-pack initrd and boot.img (gzip, cpio & abootimg)
flash boot.img onto the boot partition (dd)
If you use recovery, you also have to edit it's fstab (analog to boot.img mentioned above)
done
Alternatively has anyone tried an init.d script? I see those scripts get executed before the mounting of data & sdcard
Click to expand...
Click to collapse
I just managed to replace my internal sd with the external sd following your ruff guide. thank you very much! At first I struggled a bit getting it to work, because I had encrypted my data partition before -.- this seems to change something in the fstab / mounting / boot-up process, I couldn't get my S4 mini to boot with just changing the fstab.qcom in boot.img. With my recovery (TWRP) it worked from the start editing recovery.img's fstab.twrp /data mount point.
After decrypting(formatting) /data and re-editing fstab.qcom in boot.img it finally works I'm so happy! Enjoying a lot of space on my sdcard now!
usefull threads / information I learnt from:
Partition structure of S4 Mini
Encryption of ExtSD & some fstab information
Editing initrd
abootimg ReadMe
(Links last tried 28.05.2015)

[Completed] Help Convert TNTpipo.img into and ext sd installable file/zip

Hello, i need a bit of help, ive got my original .img file from TNT.
i had windows when i installed it first time, i have Linux mint 17 now .
i tried with neighbors win 7 machine but i can tget the tablet recoged by any means, i think the usb port is buggered up
nothing works.
any way i can install from external sd card, is there any way to mod the img to install from sd card similar to the Decontaminatv3.1.zip
iv installed tnt software and can mount the system folder have a copy of it converted to ext4(was a real pain)
decontam just gets renamed to install.zip and goes right in, just wish there was a linux based converter that didnt require an enlarged brain to operate
put img file in folder
start app
press button to convert .img to install.zip
copy install.zip into sd card
done and happy!!
any body have any ideas?
IMG is a completely different Packing of Source files. Those typically can not be converted into Zip files as their signature is integrated.
Please post Device details so we can help further.

Categories

Resources