[Q] The problem of Unpacking and repacking stock rom .img files - Galaxy S II Q&A, Help & Troubleshooting

http://forum.xda-developers.com/showthread.php?t=1081239
I had take this way to Unpacking and repacking the 9100 rom,but the output.img is size 512M。
who can hlep me to make it size ok。and the error is:
[email protected]:~# /root/ext4_utils/simg2img factoryfs.img output.img
[email protected]:~# mkdir tempdir; mount -o loop output.img tempdir
[email protected]:~# /root/ext4_utils/mkuserimg.sh -s /some/directory/with/foles ./factoryfs_custom.img ext4 ./temp 512M
in mkuserimg.sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Can not find directory /some/directory/with/foles!
[email protected]:~#

/some/directory/with/foles
Click to expand...
Click to collapse
This should be the name of the directory where you want the img file being made of. In your case tempdir, I presume.

NitroOnTheRocks said:
This should be the name of the directory where you want the img file being made of. In your case tempdir, I presume.
Click to expand...
Click to collapse
thanks i will try again

NitroOnTheRocks said:
This should be the name of the directory where you want the img file being made of. In your case tempdir, I presume.
Click to expand...
Click to collapse
thanks i will try it again

NitroOnTheRocks said:
This should be the name of the directory where you want the img file being made of. In your case tempdir, I presume.
Click to expand...
Click to collapse
by the end ,the"/some/directory/with/foles"is output.img's mount files
thanks

Can someone please advise me why I am getting mount: unknown filesystem type ext4 when I try to mount the output.img.
Thanks

ronlkh said:
Can someone please advise me why I am getting mount: unknown filesystem type ext4 when I try to mount the output.img.
Thanks
Click to expand...
Click to collapse
Does your system has ext4 support? What are you using?

Related

[Q] To devs... How to extract System.img

Hi guys..
Sorry If I'm posting this in the wrong section...
But can anyone guide me how to extract System.img from a Stock ROM as I'm planning to cook a custom ROM
If you would like to see some of my previous work for SGS1 look at my signature
You can try unyaffs in a cygwin environment or wunyaffs which is for windows.
For some reason I get access violation errors with stock roms for the Tab.
With HTC roms it was possible to dump the system.img with magiciso. Again with Tab roms this no longer works.
In CWM, after mounting /system:
make_ext4fs -l 568m -s /sdcard/system.img /system
This gives you a sparse system.img which you can turn into a Linux-mountable ext4 image with simg2img
Sorry i writed on wrong thread
In Linux you can do
mkdir tmp
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system/
sudo umount ./tmp
Sent from my Samsung Galaxy Tab 10.1 using Tapatalk
jamezelle said:
In Linux you can do
mkdir tmp
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system/
sudo umount ./tmp
Sent from my Samsung Galaxy Tab 10.1 using Tapatalk
Click to expand...
Click to collapse
I'm getting an error
Code:
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Nokia7Vista said:
I'm getting an error
Code:
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Click to expand...
Click to collapse
See the message I posted up above? You have to run the system.img through simg2img to make it mountable.
Sent from my Samsung Galaxy Tab 10.1
mabalito said:
See the message I posted up above? You have to run the system.img through simg2img to make it mountable.
Sent from my Samsung Galaxy Tab 10.1
Click to expand...
Click to collapse
oh ok,, Thanks
Nokia7Vista said:
oh ok,, Thanks
Click to expand...
Click to collapse
Hope this helps and welcome to the GT10.1 forum
Sent from my Samsung Galaxy Tab 10.1
You could always create a regular (non-sparse) image file using dd then mount it.
Command should be similar to ****, though I'm not sure if the busybox version of dd accepts bs=1M, it may require bs=1048576. (That's MB converted to B) And count is the number of MB you want the image to be.
Code:
dd if=/dev/zero of=squeeze.img bs=1M count=512
Then mount it like this:
Code:
mount -o loop,noatime -t ext4 /sdcard/debian/squeeze.img /data/local/debian/
*Pulled from a thread I wrote awhile back, you may be able to get away without using the "noatime" option.

[Q] mounting system.img... What's wrong?

I've tried to edit content of system.img
Instruction:
[email protected]:/home/user# cd android
[email protected]:/home/user/android# ./sin2img.py system.sin system.img
[email protected]:/home/user/android# mkdir system; mount -o loop system.img system
download Superuser.apk and su
[email protected]:/home/user/android# cp Superuser.apk system/app/
[email protected]:/home/user/android# cp su /system/bin/
[email protected]:/home/user/android# chmod 644 system/app/Superuser.apk
[email protected]:/home/user/android# chmod 06755 system/bin/su
[email protected]:/home/user/android# ./mkuserimg.sh -s /system ./system2.img ext4 ./temp 1024M
Click to expand...
Click to collapse
on "mount -o loop system.img system" i've got a message that I need to define filesystem type
$ mount -o loop -t ext4 system.img system
mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error
$ dmesg -c
[160126.975391] EXT4-fs (loop1): VFS: Can't find ext4 filesystem
$ mount -o loop -t yaffs2 system.img system
mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error
$ dmesg -c
[160228.951512] yaffs: dev is 7340033 name is "loop1" rw
[160228.951518] yaffs: passed flags ""
[160228.951523] yaffs: yaffs: Attempting MTD mount of 7.1,"loop1"
Click to expand...
Click to collapse
OS - Ubuntu 11.10 x64
Question is - What's wrong? )))
that is because that system.img is not well decripted.
i got that message just when rooting the italian firmware
Yakandu said:
that is because that system.img is not well decripted.
i got that message just when rooting the italian firmware
Click to expand...
Click to collapse
I'm rooting russian firmware. Did you resolve ths problem with italian?
nope, i dont know why some system.img are corrupted or not ext4
Yakandu said:
nope, i dont know why some system.img are corrupted or not ext4
Click to expand...
Click to collapse
Ok, thank you.
The only way to have root on the italian rom is to put on the modified kernel "DoomKernel" then flash back the kernel.elf inside the ftf... doom kernel is a self rooting kernel so it will do the magic
NightSky256 said:
The only way to have root on the italian rom is to put on the modified kernel "DoomKernel" then flash back the kernel.elf inside the ftf... doom kernel is a self rooting kernel so it will do the magic
Click to expand...
Click to collapse
why would they be corrupted? could it be they are encrypted somehow?
Have you tried extracting the system.sin using flashtool? It extracts a system.ext4 file.
Sent from my LT22i using xda app-developers app

Stock rom editing

Can anybody tell me how i can mount a system.img (under the linux)?
I would like to change any files and repack to odin flashable file.
Is this possible or not??
Thx
TiBiSMART said:
Can anybody tell me how i can mount a system.img (under the linux)?
I would like to change any files and repack to odin flashable file.
Is this possible or not??
Thx
Click to expand...
Click to collapse
I hope this will help you..
http://www.freeyourandroid.com/guide/building_roms_for_odin
TiBiSMART said:
Can anybody tell me how i can mount a system.img (under the linux)?
I would like to change any files and repack to odin flashable file.
Is this possible or not??
Thx
Click to expand...
Click to collapse
i helped myself (and http://andwise.net/?p=403)...
mkdir sys
./simg2img system.img sys.raw
mount -t ext4 -o loop sys.raw sys/
change what you want...
./make_ext4fs -s -l 1610612736 -a system new_system.img sys/
put the system.img to the odin flashable tar (extension only .tar not tar.md5!!!)

Mounting SDCard with execute permissions on HTC ONE

I've installed LinuxOnAndroid with Fedora 19, I'm trying to get the /dev/fuse /sdcard to mount with exec permissions.
Currently it's only mounting /dev/fuse without execute permissions.
techjohnny said:
I've installed LinuxOnAndroid with Fedora 19, I'm trying to get the /dev/fuse /sdcard to mount with exec permissions.
Currently it's only mounting /dev/fuse without execute permissions.
Click to expand...
Click to collapse
Have you edited fstab?
I'm sorry, but I think it requires kernel mods.
You could use the dd command to make a .img on internal memory or the sdcard, then use
Code:
mkdir /data/extramem
busybox -o loop /sdcard/made.img /data/extramem
Lgrootnoob said:
Have you edited fstab?
I'm sorry, but I think it requires kernel mods.
You could use the dd command to make a .img on internal memory or the sdcard, then use
Code:
mkdir /data/extramem
busybox -o loop /sdcard/made.img /data/extramem
Click to expand...
Click to collapse
Finally found my answer here:
https://linuxonandroid.uservoice.com/knowledgebase/articles/74683-how-to-i-give-linux-more-space
Yes, creating a loop device and mounting was exactly what had to be done.
Thanks.
techjohnny said:
Finally found my answer here:
https://linuxonandroid.uservoice.com/knowledgebase/articles/74683-how-to-i-give-linux-more-space
Yes, creating a loop device and mounting was exactly what had to be done.
Thanks.
Click to expand...
Click to collapse
Alright, cool.

[SOLVED] Missing apps after reboot - Apps linked to SD card (Link2SD)

Hello!
I linked some apps to SD card second partition with Link2SD app.
After restarting my device the linked apps were missing.
I used the quick reboot feature, which fixed the problem temporary.
Do I really have to quick reboot my phone after every reboot to access the linked apps or is there a way to fix this problem?
write your own mount script.
aIecxs said:
write your own mount script.
Click to expand...
Click to collapse
I don't know how to, but I found the file which has the problem.
What should I make writeable: Group/Global?
Is it safe to change those settings?
Sorry, I'm a noob
get yourself a root explorer and find the /data/adb/service.d directory. there should be mount script for Link2SD. please show the contents of this file.
aIecxs said:
get yourself a root explorer and find the /data/adb/service.d directory. there should be mount script for Link2SD. please show the contents of this file.
Click to expand...
Click to collapse
I found the folder, but it's empty.
okay then create one. set permissions executable. replace mmcblk1p2 with proper partition.
/data/adb/service.d/40link2sd
Bash:
#!/system/bin/sh
test -d /data/sdext2 || exit 1
umount -l /data/sdext2
until grep -q /data/sdext2 /proc/mounts; do
mount -t ext4 -o rw,nosuid,nodev,noatime,nodiscard /dev/block/mmcblk1p2 /data/sdext2
sleep 1
done &
edit: fixed typo: grep (missing file name)
aIecxs said:
okay then create one. set permissions executable. replace mmcblk1p2 with proper partition.
/data/adb/service.d/40link2sd
Bash:
#!/system/bin/sh
test -d /data/sdext2 || exit 1
umount -l /data/sdext2
until grep -q /data/sdext2; do
mount -t ext4 -o rw,nosuid,nodev,noatime,nodiscard /dev/block/mmcblk1p2 /data/sdext2
sleep 1
done &
Click to expand...
Click to collapse
Thanks for your help, but as I said I'm a beginner so there are a few things I don't understand.
- What is the extension of the file?
- How to exactly set the RWX settings?
- Should I put a space after mmcblk1p2, then type ext4?
no suffix. like in your screenshot. spaces matter.
aIecxs said:
no suffix. like in your screenshot. spaces matter.
Click to expand...
Click to collapse
space matter. Like this?
/dev/block/mmcblk1p2 ext4/data/sdext2
no. exactly as in post #6
aIecxs said:
no. exactly as in post #6
Click to expand...
Click to collapse
you said replace mmcblk1p2. what does that mean? how to?
check cat /proc/partitions from terminal which is the 2nd partition of your MicroSD card. if you did not create 2nd partition yet, will tell you.
aIecxs said:
check 'cat /proc/partitions' which is the 2nd partition of your MicroSD card. if you did not create 2nd partition yet, will tell you.
Click to expand...
Click to collapse
i have the second partition, but what do you mean replace mmcblk1p2 ?
which is the block device name of your second partition?
aIecxs said:
which is the block device name of your second partition?
Click to expand...
Click to collapse
ext4? im not sure if you meant that
get a terminal emulator app (or connect phone to PC adb shell) and check the output of following command:
Code:
cat /proc/partitions
aIecxs said:
get a terminal emulator app (or connect phone to PC adb shell) and check the output of following command:
Code:
cat /proc/partitions
Click to expand...
Click to collapse
if your 2nd partition is mmcblk1p2 then just mount /dev/block/mmcblk1p2 as in post #6 (nothing to replace)
aIecxs said:
if your 2nd partition is mmcblk1p2 then just mount /dev/block/mmcblk1p2 as in post #6 (nothing to replace)
Click to expand...
Click to collapse
How can I check that? I dont understand the output of the command
you can double check first partition with grep /dev/block/vold /proc/mounts
Code:
:/ $ grep /dev/block/vold /proc/mounts
/dev/block/vold/public:179,129 /mnt/media_rw/8075-15FD vfat rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
in my case 1st partition is
179 129 1935608 mmcblk1p1
therefore next minor is 2nd partition
179 130 1935607 mmcblk1p2

Categories

Resources