Extract repo from tar.gz - Android

I have planned to increase the space for my Ubuntu VM.
So I backed up the repo by archive it.
During compressing it does not show any errors. Then I moved the archive to local windows machine
But after I upgraded my VM, I tried to extract it, it shows more than one error.
Can't create folder, Files exist, No such file or directory etc...
Error log:
Code:
tar -h -zxf repo.tar.gz
tar: .repo/projects/prebuilts/qemu-kernel.git/objects: Cannot open: File exists
tar: .repo/projects/external/markdown.git/hooks/applypatch-msg.sample: Cannot open: Not a directory
tar: .repo/projects/prebuilts/python/darwin-x86/2.7.5.git/hooks: Cannot open: File exists
tar: .repo/projects/prebuilts/gradle-plugin.git/hooks/commit-msg.sample: Cannot open: Not a directory
tar: .repo/projects/external/libcap-ng.git/hooks: Cannot open: File exists
I tried it on command line as well as Archive manager
Do you have any idea?

I tried to compress the file using Archive manager. Its not compressed properly because of symbolic links.
That's why I can't able to uncompress again.
I tried again using terminal. It's working properly.

Related

CS918 Unpacking Archive Path Issue SH

Loyal AMLOGIC fanboy here messing around with a CS918 for only the third time . . . .
I am trying to run a shell to unpack an archive, there's a smali file that downloads the archive to /sdcard/Android/data, this part works fine.
The SH should then unpack to the same directory, this part fails.
My question is, does the directory path format require changing depending on your action (even though it's all going to the same place)?
I unpacked the rom's IMG file to see how other scripts are interacting with the filesystem and am seeing the following paths used by different files - but they all go to the same place:
/data/user/0/
/mnt/sdcard/Android/data/
/data/data/
Here is what the .sh file is trying to accomplish:
tar -xf /sdcard/Android/data/settings.tar -C /sdcard/Android/data/
rm /sdcard/Android/data/settings.tar
For the record, this works flawlessly on AMLOGIC using the path:
/storage/emulated/legacy/Android/data
Just incase anyone comes across this via searching:
The correct path is /mnt/sdcard/Android/data/ - but you have to run the batch as root

[Q] 1000 failures while trying to compile CM!

I'm tired of asking the same question again and again but for the thousandth and the last time I'll try my best to explain y'all the jeopardy I'm in.
I'm trying to build cm-10.2 from source for Sony Xperia E (nanhu) and everything started off just fine until I had to generate the skeleton files. I decided to use the mkvendor.sh to generate em. I have no clue why, but Sony seems to be in love with .elf files. And the best part, mkvendor only works with a standard boot.img file. Since I found mkvendor.sh the only convincing option, I decided to not use the other 2 options given here.
I extracted the kernel.sin from the ftf package of the kernel I downloaded, used flashtool to in turn extract kernel.sin which produced kernel.elf. I tried two things:
1) Unpack kernel.elf (flashtool elf extractor) and then pack em into a boot.img file (Failed as I couldn't pack em because I didn;t know how to use mkbootimg)
2) Rename kernel.elf to boot.img. as suggested by a developer of CM11 for Xperia E (Worked and was also accepted by mkvendor.sh)
I used mkvendor and it said that i don't have unpackbootimg binaries. I tried to make them by using:
make -j4 out/host/linux-x86/bin/unpackbootimg
Sadly I didn't know how to proceed so I got the binary from here and copied it to /usr/bin/ and made executable using:
sudo chmod a+x /usr/bin/unpackbootimg
Rebooted and it worked but you will see below that it isn't fixed 100% but it just works. I moved on and decided to use the script again on the renamed kernel.elf file(i.e. boot.img)
This is the following error I encounter while using mkvendor:
[email protected]:~/tools/FlashTool$ cd ~/source/cm/branch/cm-10.2
[email protected]:~/source/cm/branch/cm-10.2$ ./build/tools/device/mkvendor.sh sony nanhu ~/Desktop/boot.img
Arguments: sony nanhu /home/carbogen-chemist/Desktop/boot.img
Output will be in /home/carbogen-chemist/source/cm/branch/cm-10.2/device/sony/nanhu
*** Error in `unpackbootimg': free(): invalid next size (fast): 0x09793170 ***
./build/tools/device/mkvendor.sh: line 84: 3943 Aborted (core dumped) unpackbootimg -i $BOOTIMAGEFILE > /dev/null
gzip: ../boot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
cp: cannot stat ‘/tmp/carbogen-chemist/bootimg/boot.img-zImage’: No such file or directory
Creating initial git repository.
~/source/cm/branch/cm-10.2/device/sony/nanhu ~/source/cm/branch/cm-10.2
Initialized empty Git repository in /home/carbogen-chemist/source/cm/branch/cm-10.2/device/sony/nanhu/.git/
[master (root-commit) d49b660] mkvendor.sh: Initial commit of nanhu
7 files changed, 95 insertions(+)
create mode 100644 AndroidBoard.mk
create mode 100644 AndroidProducts.mk
create mode 100644 BoardConfig.mk
create mode 100644 cm.mk
create mode 100644 device_nanhu.mk
create mode 100644 recovery.fstab
create mode 100644 system.prop
~/source/cm/branch/cm-10.2
Done!
Use the following command to set up your build environment:
lunch cm_nanhu-eng
And use the follwowing command to build a recovery:
. build/tools/device/makerecoveries.sh cm_nanhu-eng
Since the script seems to look up for boot.img-ramdisk.gz and boot.img-zImage, I decided to investigate a bit further. I renamed boot.img to kernel.elf and used flashtool elf extractor to unzip kernel.elf. I obtained four files as a result of the extraction:
1) kernel.elf.bootcmd
2) kernel.elf.cert
3) kernel.elf.Image
4) kernel.elf.ramdisk.gz
Since mkvendor needed boot.img-ramdisk.gz and boot.img-zImage, I renamed all the files:
1) kernel.elf.bootcmd >> kernel.img-bootcmd
2) kernel.elf.cert >> kernel.img-cert
3) kernel.elf.Image >> kernel.img-zImage
4) kernel.elf.ramdisk.gz >> kernel.img-ramdisk.gz
Now I repackaged them using mkelf.py script. Since I couldn't find any command specific to nanhu, I edited it to fit for the device:
python mkelf.py -o edited.elf [email protected] [email protected],ramdisk [email protected],cmdline
This command throws no error and produces edited.elf. All of the files are packed in except kernel.img-cert as I didn't know the arguments for it ([email protected]?x????????,cert). I rename the edited.elf to boot2.img.
But I get the same error as the one I get when I use the unedited kernel (boot.img)
What should I do to get out of this format abyss? Would I have better luck with mkbootimg? If so, could you point me out to a thread or tell me here itself how to use it?
Thank you all!
TheUltimateNoobist said:
I used mkvendor and it said that i don't have unpackbootimg binaries. I tried to make them by using:
make -j4 out/host/linux-x86/bin/unpackbootimg
Sadly I didn't know how to proceed so I got the binary from here and copied it to /usr/bin/ and made executable using:
sudo chmod a+x /usr/bin/unpackbootimg
Rebooted and it worked but you will see below that it isn't fixed 100% but it just works. I moved on and decided to use the script again on the renamed kernel.elf file(i.e. boot.img)
Click to expand...
Click to collapse
Fixed it myself. How did I miss that note at cyanogenmod porting?
Cd'ed to my working directory. Ran :
sudo make -j4 otatools
and grabbed unpackbootimg from WORKING_DIR/out/host/linux-x86/bin/unpackbootimg and pasted to /usr/bin
Made it executable by running:
sudo chmod a+x /usr/bin/unpackbootimg
Reboot!
It would also be very helpful if anyone could point out what the correct config for Xperia E is. (For EG >> blue_mint_defconfig is for Xperia T, semc_zeus_defconfig is for Xperia Play)
There is a file called README_Xperia, which contains the configuration names for the different phones in the kernel source can be used for. But my source doesn't contain it. So I would be very grateful if someone pointed it out!
Thank you!
TheUltimateNoobist said:
I'm tired of asking the same question again and again but for the thousandth and the last time I'll try my best to explain y'all the jeopardy I'm in.
I'm trying to build cm-10.2 from source for Sony Xperia E (nanhu) and everything started off just fine until I had to generate the skeleton files. I decided to use the mkvendor.sh to generate em. I have no clue why, but Sony seems to be in love with .elf files. And the best part, mkvendor only works with a standard boot.img file. Since I found mkvendor.sh the only convincing option, I decided to not use the other 2 options given here.
I extracted the kernel.sin from the ftf package of the kernel I downloaded, used flashtool to in turn extract kernel.sin which produced kernel.elf. I tried two things:
1) Unpack kernel.elf (flashtool elf extractor) and then pack em into a boot.img file (Failed as I couldn't pack em because I didn;t know how to use mkbootimg)
2) Rename kernel.elf to boot.img. as suggested by a developer of CM11 for Xperia E (Worked and was also accepted by mkvendor.sh)
I used mkvendor and it said that i don't have unpackbootimg binaries. I tried to make them by using:
make -j4 out/host/linux-x86/bin/unpackbootimg
Sadly I didn't know how to proceed so I got the binary from here and copied it to /usr/bin/ and made executable using:
sudo chmod a+x /usr/bin/unpackbootimg
Rebooted and it worked but you will see below that it isn't fixed 100% but it just works. I moved on and decided to use the script again on the renamed kernel.elf file(i.e. boot.img)
This is the following error I encounter while using mkvendor:
[email protected]:~/tools/FlashTool$ cd ~/source/cm/branch/cm-10.2
[email protected]:~/source/cm/branch/cm-10.2$ ./build/tools/device/mkvendor.sh sony nanhu ~/Desktop/boot.img
Arguments: sony nanhu /home/carbogen-chemist/Desktop/boot.img
Output will be in /home/carbogen-chemist/source/cm/branch/cm-10.2/device/sony/nanhu
*** Error in `unpackbootimg': free(): invalid next size (fast): 0x09793170 ***
./build/tools/device/mkvendor.sh: line 84: 3943 Aborted (core dumped) unpackbootimg -i $BOOTIMAGEFILE > /dev/null
gzip: ../boot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
cp: cannot stat ‘/tmp/carbogen-chemist/bootimg/boot.img-zImage’: No such file or directory
Creating initial git repository.
~/source/cm/branch/cm-10.2/device/sony/nanhu ~/source/cm/branch/cm-10.2
Initialized empty Git repository in /home/carbogen-chemist/source/cm/branch/cm-10.2/device/sony/nanhu/.git/
[master (root-commit) d49b660] mkvendor.sh: Initial commit of nanhu
7 files changed, 95 insertions(+)
create mode 100644 AndroidBoard.mk
create mode 100644 AndroidProducts.mk
create mode 100644 BoardConfig.mk
create mode 100644 cm.mk
create mode 100644 device_nanhu.mk
create mode 100644 recovery.fstab
create mode 100644 system.prop
~/source/cm/branch/cm-10.2
Done!
Use the following command to set up your build environment:
lunch cm_nanhu-eng
And use the follwowing command to build a recovery:
. build/tools/device/makerecoveries.sh cm_nanhu-eng
Since the script seems to look up for boot.img-ramdisk.gz and boot.img-zImage, I decided to investigate a bit further. I renamed boot.img to kernel.elf and used flashtool elf extractor to unzip kernel.elf. I obtained four files as a result of the extraction:
1) kernel.elf.bootcmd
2) kernel.elf.cert
3) kernel.elf.Image
4) kernel.elf.ramdisk.gz
Since mkvendor needed boot.img-ramdisk.gz and boot.img-zImage, I renamed all the files:
1) kernel.elf.bootcmd >> kernel.img-bootcmd
2) kernel.elf.cert >> kernel.img-cert
3) kernel.elf.Image >> kernel.img-zImage
4) kernel.elf.ramdisk.gz >> kernel.img-ramdisk.gz
Now I repackaged them using mkelf.py script. Since I couldn't find any command specific to nanhu, I edited it to fit for the device:
python mkelf.py -o edited.elf [email protected] [email protected],ramdisk [email protected],cmdline
This command throws no error and produces edited.elf. All of the files are packed in except kernel.img-cert as I didn't know the arguments for it ([email protected]?x????????,cert). I rename the edited.elf to boot2.img.
But I get the same error as the one I get when I use the unedited kernel (boot.img)
What should I do to get out of this format abyss? Would I have better luck with mkbootimg? If so, could you point me out to a thread or tell me here itself how to use it?
Thank you all!
Click to expand...
Click to collapse
Nevermind :/ Fixed it myself.
Repacked the edited files using mkbootimg.
mkbootimg --kernel kernel.img-zImage --ramdisk kernel.img-ramdisk.gz --cmdline kernel.img-bootcmd -o boot.img

[Q] How do I fix a "Read-only file system" error during ROM flashing?

Hi Kitchen Experts ( What's Cookin?)
I do not seem to be able get rid of an error while flashing my phone with a ROM I built from a flashable ROM from SAMMOBILE, which I unpacked and replaced the zImage with one I compiled from opensource.samsong.com Basically the Kitchen ROM's zip file upacks fine, but then I see the following in my phone's logs: ( Below I put relevant sections:
Installing '/sdcard/DCIM/hltespr_signed_111514_202215.zip'...
Checking for MD5 file...
I:Cannot find file /sdcard/DCIM/hltespr_signed_111514_202215.zip.md5
Skipping MD5 check: no MD5 file found.
I:Zip does not contain SELinux file_contexts file in its root.
Creating filesystem with parameters:
...
minzip: Extracted file "/system/app/EasyOneHand.odex"
minzip: Error writing 32768 bytes from zip file from 0xbec0437c: Read-only file system
minzip: Process function elected to fail (in inflate)
minzip: Can't extract entry to file.
minzip: Error extracting "/system/app/EasySettings.apk"
symlink: failed to symlink /system/bin/ionice to toolbox: No such file or directory
I updated permissions of the system folder in my WORKING_DIRECTORY of Android Kitchen, and I also used an App called ES file manager to change all the mount points on my phone to R/W; here are the procedures I followed for changing the mount points to R/W . I also validated that my mount points are correct. I am not sure what else to look at. Please let me know if I should post the permissions for my system folder in Kitchen or the output of any command on my phone. I'll gladly do it to address this issue.
I did a search online and found a number of people who had a similar problem, but the solution is not documented. I searched for "zip file ROM can not write to android", and reviewed all the resulting links. I do wipe the flash data and delivic cache before, try the ROM, and wipe again and try it. There is no change. I get the same result. Am I looking at the right things? I have built my ROM twice using the interactive and quick method each time.

[Q] Proprietary files missing in CyanogenMod BLOB

I'm building CM12 for XL. While trying to extract proprietary BLOB, I could see that latest NIGHTLY builds (e.g. cm-12-20150308-NIGHTLY-taoshan.zip) have a different structure from earlier EXPERIMENTAL builds (e.g. cm-11-20150112-EXPERIMENTAL-taoshan.zip)
-----------------------------------
Structure of NIGHTLY build:
-----------------------------------
install
META-INF
system
file_contexts
system.new.dat
system.patch.dat
system.transfer.list
boot.img
--------------------------------------------
Structure of EXPERIMENTAL build:
---------------------------------------------
META-INF
system
file_contexts
boot.img
I failed to extract ANY proprietary file from NIGHTLY build, because 'system' directory contains a single file: system\build.prop. On the contrary, the size of system.new.dat is very large: 427MB. I could extract all but three files from EXPERIMENTAL build as 'system' directory contains a collection of other required files, as expected. Ultimately, following three files are missing from the BLOB:
Code:
cp: cannot stat '/home/androbuild/original/system/bin/led_deamon': No such file or directory
cp: cannot stat '/home/androbuild/original/system/bin/led_deamon': No such file or directory
cp: cannot stat '/home/androbuild/original/system/etc/firmware/libpn544_fw.so': No such file or directory
cp: cannot stat '/home/androbuild/original/system/etc/firmware/libpn544_fw.so': No such file or directory
cp: cannot stat '/home/androbuild/original/system/vendor/lib/libtime_genoff.so': No such file or directory
cp: cannot stat '/home/androbuild/original/system/vendor/lib/libtime_genoff.so': No such file or directory
Because of 'libtime_genoff.so' being missing, my build is failing after running for ~7 hours. Any idea how to obtain three files as mentioned above?

Cyanogenmod 12 mkvendor.sh problem

Hi guys i have a question, i want to get my device tree with the mkvendor.sh on the cyanogenmod source build/tools/device folder, y run this line using the previusly boot.img extracted:
./build/tools/device/mkvendor.sh dell yellowtail ~/boot.img
But the problem is that that some files are missing, i got this:
Code:
Arguments: dell yellowtail /home/quevon24/boot.img
Output will be in /home/quevon24/android/system/cm12/device/dell/yellowtail
gzip: ../boot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
cat: /tmp/quevon24/bootimg/boot.img-base: No such file or directory
cat: /tmp/quevon24/bootimg/boot.img-cmdline: No such file or directory
cat: /tmp/quevon24/bootimg/boot.img-pagesize: No such file or directory
cp: cannot stat
«/tmp/quevon24/bootimg/boot.img-zImage»: No such file or directory
Creating initial git repository.
~/android/system/cm12/device/dell/yellowtail ~/android/system/cm12
Reinitialized existing Git repository in /home/quevon24/android/system/cm12/device/dell/yellowtail/.git/
On master branch
nothing to commit, working directory clean
~/android/system/cm12
Done!
My boot.img is from a dell venue 8 3830, its from a android 4.4 stock image from here: http://forum.xda-developers.com/showpost.php?p=51090040&postcount=2
Anyone can help and explain me please?
Thanks

Categories

Resources