[Q] How to convert stock ROM from rfs to ext4? - Galaxy Ace S5830 Q&A, Help & Troubleshooting

Hi sorry if i sound noob but i would like to try converting my stock rom from .rfs to ext4 without breaking anything (My setup is exactly as described in my signature). I understand that ketut has created a script to make this happen.
ketut.kumajaya said:
Just want to share my command list to convert Galaxy Ace firmware from rfs to ext4.
Code:
cd /home/user/rfs2ext4
dd if=/dev/zero of=system.rfs bs=4096 count=53696
losetup /dev/loop0 system.rfs
mkfs.ext4 -T ext4 -b 4096 -m 0 -J size=4 -O ^resize_inode,^ext_attr,^huge_file,^has_journal /dev/loop0
tune2fs -c 100 -i 100d -m 0 /dev/loop0
mkdir /tmp/ext4
sudo mount /dev/loop0 /tmp/ext4
chmod 755 fix-*.sh
cp fix-*.sh /tmp
mkdir /tmp/rfs
sudo mount -o loop source/system.rfs /tmp/rfs
sudo cp -a /tmp/rfs/* /tmp/ext4
cd /tmp/ext4
sudo ../fix-system.sh
cd /home/user/rfs2ext4
sudo umount /tmp/ext4
sudo umount /tmp/rfs
dd if=/dev/zero of=data.rfs bs=4096 count=46400
losetup /dev/loop0 data.rfs
mkfs.ext4 -T ext4 -b 4096 -m 0 -J size=16 -O ^resize_inode,^ext_attr,^huge_file /dev/loop0
tune2fs -c 100 -i 100d -m 0 /dev/loop0
mount /dev/loop0 /tmp/ext4
sudo mount -o loop source/data.rfs /tmp/rfs
sudo cp -a /tmp/rfs/* /tmp/ext4
cd /tmp/ext4
sudo ../fix-data.sh
cd /home/user/rfs2ext4
sudo umount /tmp/ext4
sudo umount /tmp/rfs
dd if=/dev/zero of=csc.rfs bs=4096 count=6464
losetup /dev/loop0 csc.rfs
mkfs.ext4 -T ext4 -b 4096 -m 0 -J size=4 -O ^resize_inode,^ext_attr,^huge_file /dev/loop0
tune2fs -c 100 -i 100d -m 0 /dev/loop0
mount /dev/loop0 /tmp/ext4
sudo mount -o loop source/csc.rfs /tmp/rfs
sudo cp -a /tmp/rfs/* /tmp/ext4
cd /tmp/ext4
sudo ../fix-csc.sh
cd /home/user/rfs2ext4
sudo umount /tmp/ext4
sudo umount /tmp/rfs
tar -H ustar -c boot.img recovery.img data.rfs system.rfs > CODE_S5830XWKPN_CL375596_REV03_blackhawk.tar
md5sum -t CODE_S5830XWKPN_CL375596_REV03_blackhawk.tar >> CODE_S5830XWKPN_CL375596_REV03_blackhawk.tar
mv CODE_S5830XWKPN_CL375596_REV03_blackhawk.tar CODE_S5830XWKPN_CL375596_REV03_blackhawk.tar.md5
tar -H ustar -c csc.rfs > CSC_S5830OXXKP7_CL375596_REV03_blackhawk.tar
md5sum -t CSC_S5830OXXKP7_CL375596_REV03_blackhawk.tar >> CSC_S5830OXXKP7_CL375596_REV03_blackhawk.tar
mv CSC_S5830OXXKP7_CL375596_REV03_blackhawk.tar CSC_S5830OXXKP7_CL375596_REV03_blackhawk.tar.md5
tar -H ustar -c arm11boot mibib oemsbl qcsbl > APBOOT_S5830XWKPN_CL375596_REV03.tar
md5sum -t APBOOT_S5830XWKPN_CL375596_REV03.tar >> APBOOT_S5830XWKPN_CL375596_REV03.tar
mv APBOOT_S5830XWKPN_CL375596_REV03.tar CAPBOOT_S5830XWKPN_CL375596_REV03.tar.md5
tar -H ustar -c amss > MODEM_S5830XWKP6_CL375596_REV03.tar
md5sum -t MODEM_S5830XWKP6_CL375596_REV03.tar >> MODEM_S5830XWKP6_CL375596_REV03.tar
mv MODEM_S5830XWKP6_CL375596_REV03.tar MODEM_S5830XWKP6_CL375596_REV03.tar.md5
Click to expand...
Click to collapse
My question is how do you do it? Do you create a .sh script with this and then just run it using script manager or do you have to run this script in recovery?
Thanks

you can do this without scipt it's easy, first,flash CF-Root kernel in recovery , then go to the app drawer then open the EXT4 app, then covert to ext4 this operation will take about 2-3 min in recovery,of course you need to have CWM4,at the end it wiil reboot you phone so enjoy it
Press the thanks butom if I helped

that ketut's script can only be use on odin files, cannot be use on already installed rom. btw cfroot ext4manager app should be able to do it directly from the phone.

slaid480 said:
you can do this without scipt it's easy, first,flash CF-Root kernel in recovery , then go to the app drawer then open the EXT4 app, then covert to ext4 this operation will take about 2-3 min in recovery,of course you need to have CWM4,at the end it wiil reboot you phone so enjoy it
Press the thanks butom if I helped
Click to expand...
Click to collapse
already have CF Root kernel and CWM 5.0.26
an0nym0us_ said:
that ketut's script can only be use on odin files, cannot be use on already installed rom. btw cfroot ext4manager app should be able to do it directly from the phone.
Click to expand...
Click to collapse
ketut mentioned it is possible to do so on a pre-existing ROM but he doesn't recommend it haha.
Hmmm, i do not know why i don't have the ext4manager app even though i am on CF Root b82 kernel. Do i have to download the ext4manager app separately?
=====================================================================================================================
EDIT
I found the ext4manager on chainfire's post. Will install v1.3 and do the necessary file system conversion... and pray it works!
=========================================================
Update
It was my tardiness that led me to use chainfire's original ext4manager where i should have been using the version modified by ketut!
It worked like a breeze, install and the whole thing was done under a minute in recovery. I am very very happy with the results for i managed to gain about 400 points in Quadrant. Well, i couldn't get a OC kernel to work with my Stock ROM but this mod is ain't exactly that bad in coaxing out some performance.

slaid480 said:
you can do this without scipt it's easy, first,flash CF-Root kernel in recovery , then go to the app drawer then open the EXT4 app, then covert to ext4 this operation will take about 2-3 min in recovery,of course you need to have CWM4,at the end it wiil reboot you phone so enjoy it
Press the thanks butom if I helped
Click to expand...
Click to collapse
hey i have installed and tried that but it seems like ext4 manager is showing no ext4 partitions found ? did it converted to ext4 or still am on rfs

Lijop said:
hey i have installed and tried that but it seems like ext4 manager is showing no ext4 partitions found ? did it converted to ext4 or still am on rfs
Click to expand...
Click to collapse
did you use ext4manager from ketut's thread?
http://forum.xda-developers.com/attachment.php?attachmentid=714285&d=1315543936
ext4manager MUST detect your cf root kernel. if it does, it will automatically show the various partitions and the file system applicable.

happily1986 said:
did you use ext4manager from ketut's thread?
http://forum.xda-developers.com/attachment.php?attachmentid=714285&d=1315543936
ext4manager MUST detect your cf root kernel. if it does, it will automatically show the various partitions and the file system applicable.
Click to expand...
Click to collapse
CF-Root-S5830-v3.7-b82-ex. am using this. chainfire stuff

Lijop said:
CF-Root-S5830-v3.7-b82-ex. am using this. chainfire stuff
Click to expand...
Click to collapse
thats just the kernel itself. scroll down and find CF Root S5830 ext4 v1.3 in the post by ketut if you want to. btw the link i posted earlier on is the actual download link for the ext4 manager that has been modified to work for S5830 by ketut.

Will this method work on all Galaxy ACE versions. My wife has the version for Latin America, same as the one sold in Brazil and Chile.
Not sure about the ROM version for this one though.

Does stock ROM kernel even support ext4???

could u help for installing CF Root ?
i have a stock rom 2.3.3
thanks in advance

http://acetips.wordpress.com/2011/10/11/flash-cf-root-ace-gb/

ducutu said:
http://acetips.wordpress.com/2011/10/11/flash-cf-root-ace-gb/
Click to expand...
Click to collapse
Like a Michael Jackson music video...

Related

[Q] How to make an Odin Flashable Rom?

I was wondering if it is possible to make an Odin flashable ROM with only the CWM ROM? If not how could i make a Odin flashable ROM?
How to make an Odin flashable ROM
This needs a UNIX compatible OS - like Linux or Mac OS X.
On Windows, you can use "Cygwin".
Use the dd (datadump) command to make the .rfs files
Of course you need to connect your phone via USB and have ADB prepared on your computer.
# Get Root access first
Code:
su
# Do this first to mount the /system R/W
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# Dump the needed data / partitions to your /sdcard
Code:
dd if=/dev/block/stl9 of=/sdcard/factoryfs.rfs bs=4096
dd if=/dev/block/stl11 of=/sdcard/cache.rfs bs=4096
dd if=/dev/block/bml7 of=/sdcard/zImage bs=4096
dd if=/dev/block/bml12 of=/sdcard/modem.bin bs=4096
# Make the tar ball
Code:
tar -H ustar -c factoryfs.rfs cache.rfs modem.bin zImage > darky.tar
# MD5 it for a security check
Code:
md5sum –t darky.tar >> darky.tar
# Rename the tar file
Code:
mv darky.tar darky.tar.md5
Optional:
Make your own pit file
The pit file is used to set the partition layout (Partition Information Table).
# Dump the pit
Code:
dd if=/dev/block/bml2 of=/sdcard/darky.pit bs=4096
I hope I could help you with that
- darkyy.
Didnt workd
@Darky Didnt workd for my galaxy-FIT
pratyush.creed said:
@Darky Didnt workd for my galaxy-FIT
Click to expand...
Click to collapse
maybe because your galaxy-FIT is an entirely different device???
How doing this using phone runing cyanogenmod7?
Hey darky, how can i do this with a phone runing cyanogenmod 7? and after doing that, how can i install the rom with odin?
Thanks ;-)
http://forum.xda-developers.com/showthread.php?t=1082288
Don't work, i have the same error /dev/block/stl10: cannot open for read: Nosuch file or directory

[BRAINSTORM] Booting directly into recovery

For reference, these are my thoughts on the matter.
We have 3 ways to do this:
1. Get hold of SBL, change it and flash it
Currently impossible afaik.
2. Get an init.d bash script to reboot into recovery if key is pressed
Most likely possible taking these 2 assumptions into account:
a) Bash allows to detect a pressed key, something like this:
Code:
_key()
{
local kp
ESC=$'\e'
_KEY=
read -d '' -sn1 _KEY
case $_KEY in
"$ESC")
while read -d '' -sn1 -t1 kp
do
_KEY=$_KEY$kp
case $kp in
[a-zA-NP-Z~]) break;;
esac
done
;;
esac
printf -v "${1:-_KEY}" "%s" "$_KEY"
}
_key x
case $x in
$'\e[15~') reboot recovery ;;
esac
Replacing this key code for one of OB's.
But for this, we need assumption number 2:
b) Key codes mapping is the same for recoveries.
Now, while this is the method of the greatest chance to work, it is also fairly useless. Developers will often break the boot before the init.d scripts are ran. So, this code should be ran before. Hence, the third method.
3. Start a custom service in init.rc (@ ramdisk) that will detect pressed key
This would be the perfect solution as it can't be broken from kernel (zImage) or system changes. However, init.rc has its own programming language (android init language) and there's no way to run this kind of listener.
However, it is possible to run an external script located for example in /system/bin/. These can be both an executable compiled from c (higher chances of working) or a bash scripting like the aforementioned one (lower chances of working since android probably doesn't start a console on boot).
Code for this would be something like:
Code:
service exampleservice /system/bin/exampleservice
user exampleservice
group exampleservice
oneshot
So uh, am I missing anything?
Anyone has other ideas?
a lot of times i heared about pressing "G" and "Power" would boot into some kind of save mode... if thats true i guess its easyer to reprogramm that keycombo to do something else... so does that keycombo anything? i couldnt figure out^^
Sent from my LG-P970 using XDA App
Are others devices has the key combination code in SBL?
I wish I have enough knowledge about android system so i can help...
i04055 said:
Are others devices has the key combination code in SBL?
I wish I have enough knowledge about android system so i can help...
Click to expand...
Click to collapse
Yes there are devices heaving the key-combo in SBL if that answers your question. The "Samsung Galaxy S GT-I9000" e.g. has them there afaik. With that device it was possible flashing the SBL to add a "booting directly into recovery" key-combo...
So I don´t know why there should not be a solution to do the same to the OB but Noejn surely has good reason for telling its impossible.
But hey what about booting into recovery on every system startup and only boot into the system through the recovery? It´s a "quick & dirty" solution even if its possible but better than developing the way we do isn´t it? I´m not sure if its easier to change the startup that way than to add or modify a key-combo but maybe someone here does?
I'm sure (or hope..) someone can, but perhaps we should move this Thread to another part of the Forum so someone with the knowledge how to do this will read it.
d0n22 said:
But hey what about booting into recovery on every system startup and only boot into the system through the recovery? It´s a "quick & dirty" solution even if its possible but better than developing the way we do isn´t it? I´m not sure if its easier to change the startup that way than to add or modify a key-combo but maybe someone here does?
Click to expand...
Click to collapse
Yeah, i prefer that way if poosibble rather than nothing.
But if put it that way, when the phone get bootloop is it still posibbe to boot into recovery?
Sent from my LG-P970 using XDA App
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
racht said:
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
Click to expand...
Click to collapse
yeah ,from this we can see what is running before logo screen and we can mod that file
so.. is that mean we can boot to recovery mode same as x8?
racht said:
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
Click to expand...
Click to collapse
soundes quite promising... have you tried it?
Can this be usefull?
http://forum.xda-developers.com/showthread.php?t=991276
Noejn have you abandoned us ? Or are u planning to take a look at this ? Would be nice if u get OB up and running
recovery
Hi,
has there been any success with booting into recovery mode?
BR,
J
logitec said:
Hi,
has there been any success with booting into recovery mode?
BR,
J
Click to expand...
Click to collapse
No,I try to boot directly into recovery through boot.img,but I get a big "error" form the LG Security Team!
Hijacking a daemon would work if Optimus Black had those binaries. I took a quick glance at a backup and I didn't see chargemon in /system/bin.
Besides, a xRecovery is limited as it's dependent on system files so a /format can't be done which isn't really that "comfy", especially when changing fs.
But yeah, better than nothing. Still, the method you described is only possible in Xperia phones, as far as I know.
I still say injecting a service on the init.rc is the way to go.
However, I can't test this now.
racht said:
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
Click to expand...
Click to collapse
Good news, I'm getting close.
ok, thank you for everithing
Noejn said:
Good news, I'm getting close.
Click to expand...
Click to collapse
good news indeed^^ im working on it as well but im not feeling like getting close :-\ pls let me know what you did and how you did it as soon as its done... again thank you very much for your efforts!
Sent from my LG-P970 using XDA App
d0n22 said:
good news indeed^^ im working on it as well but im not feeling like getting close :-\ pls let me know what you did and how you did it as soon as its done... again thank you very much for your efforts!
Sent from my LG-P970 using XDA App
Click to expand...
Click to collapse
Well, I've succeed injecting the script on boot.
However, I'm getting some problems on the event0 > keycheck; I don't think at this time of boot /dev entries are up.
But I've already thought of a workaround and I'll test it tomorrow.
I´m thinking, if i compile kernel of ubuntu and install it in recovery partition, not possible then run ubuntu in native mode from sdcard with dualboot?

[I9001] [SCRIPT] [ODIN] How to create an Odin package from a cwm-zip (or backup)

The script (see below) works as follows:
1. It takes the correct files from the BaseRom folder and copies them to the BuildOdin folder
2. If boot or recovery images exist in NewRom folder (extracted from the cwm zip) it will copy them to the BuildOdin folder too
3. It will create the system.img.ext4 file in the BuildOdin folder
4. It will copy the system folder in the NewRom folder to the system.img.ext4 file
5. It will tar and md5 the files in BuildOdin folder
So make sure you have:
1. The adsp.mbn, amss.mbn, cache.img.ext4 and preload.img.ext4 in the BaseRom folder
2. The boot.img and recovery.img in the NewRom folder (or BaseRom)
3. The system folder in the NewRom folder
And run the script
Code:
#!/bin/sh
echo 'Requesting password to allow running as root...'
sudo echo 'Thanks :)!'
# Make folder
if [ ! -d "BuildOdin" ]
then
mkdir BuildOdin
fi
# Copy BaseRom files
cp BaseRom/adsp.mbn BuildOdin/adsp.mbn
cp BaseRom/amss.mbn BuildOdin/amss.mbn
cp BaseRom/cache.img.ext4 BuildOdin/cache.img.ext4
cp BaseRom/preload.img.ext4 BuildOdin/preload.img.ext4
# Copy boot image
if [ -s NewRom/boot.img ]
then
cp NewRom/boot.img BuildOdin/boot.img
else
cp BaseRom/boot.img BuildOdin/boot.img
fi
# Copy recovery image
if [ -s NewRom/recovery.img ]
then
cp NewRom/recovery.img BuildOdin/recovery.img
else
cp BaseRom/recovery.img BuildOdin/recovery.img
fi
# Create system image
mysyssize=`du -s -h NewRom/system | awk 'BEGIN{FS="[M]"} {print $1}'`
mysyssizeincreased=$((mysyssize+50))
echo 'Filesize will be' $mysyssizeincreased 'MB'
echo 'dd empty image...'
dd if=/dev/zero of=BuildOdin/system.img.ext4 bs=1M count=$mysyssizeincreased >&- 2>&-
echo 'make it ext4...'
mke2fs -F -T ext4 BuildOdin/system.img.ext4 >&- 2>&-
echo 'mounting...'
sudo mount -t ext4 -o loop BuildOdin/system.img.ext4 /mnt >&- 2>&-
echo 'copying system...'
cp NewRom/system/* /mnt -rp
sync
echo 'unmounting...'
sudo umount /mnt
# Create Odin and Odin MD5 files
cd BuildOdin
echo 'tarring...'
tar -cf MyOdinpack.tar adsp.mbn amss.mbn boot.img cache.img.ext4 preload.img.ext4 recovery.img system.img.ext4
echo 'copying...'
cp MyOdinpack.tar MyOdinpack.tar.md5
echo 'md5sum...'
md5sum -t MyOdinpack.tar>>MyOdinpack.tar.md5
echo 'done!'
It looks like it works. I do have some stuff I am wondering about:
1. I have added 50 MB to the filesize, with 30 MB additional I still got a not enough diskspace error. Wondering why...
2. Will it work this way? When looking at a cwm-zip it does contain a system folder but they also contain some other stuff... who knows... anyone care to test?
Well, looks like it's not all that easy. The script works, it creates a file with the exact same files as the one created with dd on the device, but for some reason when using it in Odin, it doesn't work...
Creating the Odin package is superfast now, but will still require some more testing. I guess I should do it with a ROM that I have done before... but too lazy atm...
Btw, this way I could create an Odin package from a CWM backup too If ever needed, just let me know
Regards,
Nika.
you could try making system.img file, then rename it to system.img.ext4. Sound foolish probably, but sometimes these double extensions are just added as an indicator. in this case for the system to look up what partition type to take. (I could be horribly wrong tho. But there are like 0 tools on internet for an ext4 maker so not many options available)
Maybe create an empty ext4 image on PC, mount loopback in cwm and copy files to it.
Sent from my GT-I9001 using XDA App
Create image on your phone using busybox
Edit: I updated the script.
I played a bit with the busybox:
my working dir is /sdcard/external_sd/imgtest!
DD a file of ~300MB
busybox dd if=/dev/zero of=myimg.img bs=1M count=300
Create a ext4 filesystem on this img
busybox mke2fs -F -T ext4 -L Image myimg.img
Create a new /dev node, named "loop99", type "block device" (b), and some major and minor number
busybox mknod /dev/block/loop99 b 7 99
Prepare your new loop device with an img file (delete is with losetup -d /dev/block/loop99)
busybox losetup /dev/block/loop99 /sdcard/external_sd/imgtest/myimg.img
Mount it finally
busybox mount /dev/block/loop99 /sdcard/external_sd/imgtest/mymnt
Now you may copy what you want, say /system, to this img.
And unmount it (make sure it's not in use anymore)
busybox umount /dev/block/loop99
Maybe invoke some commands to check the size of /system? A quick one liner would be
busybox df /system -h | grep /system | awk 'BEGIN{FS="[M]"} {print $2}' | awk 'BEGIN{FS="[.]"} {print $1}'
Could be part of the shell script, saved to a variable and increased by some MB just to make sure^^
A very quick and dirty script:
#!/bin/sh
mysyssize=`busybox df /system -h | grep /system | awk 'BEGIN{FS="[M]"} {print $2}' | awk 'BEGIN{FS="[.]"} {print $1}'`
mysyssizeincreased=$((mysyssize+20))
mkdir /sdcard/external_sd/myimages
mkdir /sdcard/mnt/
mkdir /sdcard/mnt/mymnt
cd /sdcard/external_sd/myimages
echo Filesize is $mysyssizeincreased
echo Now dd a new image for your folder
echo dd in progress...
busybox dd if=/dev/zero of=myimgfile.img bs=1M count=$mysyssizeincreased
echo mke2fs with type ext4 on your file...
busybox mke2fs -F -T ext4 -L Imagename myimgfile.img
echo create new dev-node...
busybox mknod /dev/block/loop99 b 7 99
echo apply loopback setup on this node...
busybox losetup /dev/block/loop99 /sdcard/external_sd/myimages/myimgfile.img
echo mounting new image...
busybox mount /dev/block/loop99 /sdcard/mnt/mymnt
echo done!
echo
echo now copy your system files over preserving permissions...
cp /system/* /sdcard/mnt/mymnt -rp
sync
busybox umount /sdcard/mnt/mymnt
losetup -d /dev/block/loop99
rm /dev/block/loop99
echo done!
echo done!
echo done!
echo
Click to expand...
Click to collapse
Save as a .sh script and execute it. I tried with some ssh server on phone and shell on my PC.
Worked fine, but to be sure a test with a restore would be needed, so treat it as highly experimental.
Very nice, much appreciated!!! Will try (convert) them on ubuntu one of these days as I'd prefer to do the job on a dual-cpu machine
Well then you should skip the steps with mknod and so on. Mount is much more powerful there, so you should be able to do it with these commands:
dd if=/dev/zero of=/tmp/image bs=1M count=300
mkfs.ext4 /tmp/image
mount -o loop /tmp/image /mnt
Hmmm... getting a "is not a block special device" message when ext4-ing in linux. Either the command file is incorrect, or I need to suppress that message somehow... more news soon
Okay!! Here's the first version of the script:
Code:
#!/bin/sh
echo 'Requesting password to allow running as root...'
sudo echo 'Thanks :)!'
# Make folder
if [ ! -d "BuildOdin" ]
then
mkdir BuildOdin
fi
# Copy BaseRom files
cp BaseRom/adsp.mbn BuildOdin/adsp.mbn
cp BaseRom/amss.mbn BuildOdin/amss.mbn
cp BaseRom/cache.img.ext4 BuildOdin/cache.img.ext4
cp BaseRom/preload.img.ext4 BuildOdin/preload.img.ext4
# Copy boot image
if [ -s NewRom/boot.img ]
then
cp NewRom/boot.img BuildOdin/boot.img
else
cp BaseRom/boot.img BuildOdin/boot.img
fi
# Copy recovery image
if [ -s NewRom/recovery.img ]
then
cp NewRom/recovery.img BuildOdin/recovery.img
else
cp BaseRom/recovery.img BuildOdin/recovery.img
fi
# Create system image
mysyssize=`du -s -h NewRom/system | awk 'BEGIN{FS="[M]"} {print $1}'`
mysyssizeincreased=$((mysyssize+50))
echo 'Filesize will be' $mysyssizeincreased 'MB'
echo 'dd empty image...'
dd if=/dev/zero of=BuildOdin/system.img.ext4 bs=1M count=$mysyssizeincreased >&- 2>&-
echo 'make it ext4...'
mke2fs -F -T ext4 BuildOdin/system.img.ext4 >&- 2>&-
echo 'mounting...'
sudo mount -t ext4 -o loop BuildOdin/system.img.ext4 /mnt >&- 2>&-
echo 'copying system...'
cp NewRom/system/* /mnt -rp
sync
echo 'unmounting...'
sudo umount /mnt
# Create Odin and Odin MD5 files
cd BuildOdin
echo 'tarring...'
tar -cf MyOdinpack.tar adsp.mbn amss.mbn boot.img cache.img.ext4 preload.img.ext4 recovery.img system.img.ext4
echo 'copying...'
cp MyOdinpack.tar MyOdinpack.tar.md5
echo 'md5sum...'
md5sum -t MyOdinpack.tar>>MyOdinpack.tar.md5
echo 'done!'
It looks like it works. I do have some stuff I am wondering about:
1. I have added 50 MB to the filesize, with 30 MB additional I still got a not enough diskspace error. Wondering why...
2. Will it work this way? When looking at a cwm-zip it does contain a system folder but they also contain some other stuff... who knows... anyone care to test?
The script works as follows:
1. It takes the correct files from the BaseRom folder and copies them to the BuildOdin folder
2. If boot or recovery images exist in NewRom folder (extracted from the cwm zip) it will copy them to the BuildOdin folder too
3. It will create the system.img.ext4 file in the BuildOdin folder
4. It will copy the system folder in the NewRom folder to the system.img.ext4 file
5. It will tar and md5 the files in BuildOdin folder
So make sure you have:
1. The adsp.mbn, amss.mbn, cache.img.ext4 and preload.img.ext4 in the BaseRom folder
2. The boot.img and recovery.img in the NewRom folder (or BaseRom)
3. The system folder in the NewRom folder
And run the script
Regards,
Nika.
Well, looks like it's not all that easy. The script works, it creates a file with the exact same files as the one created with dd on the device, but for some reason when using it in Odin, it doesn't work...
Creating the Odin package is superfast now, but will still require some more testing. I guess I should do it with a ROM that I have done before... but too lazy atm...
Btw, this way I could create an Odin package from a CWM backup too If ever needed, just let me know
nikagl said:
Well, looks like it's not all that easy. The script works, it creates a file with the exact same files as the one created with dd on the device, but for some reason when using it in Odin, it doesn't work...
Creating the Odin package is superfast now, but will still require some more testing. I guess I should do it with a ROM that I have done before... but too lazy atm...
Btw, this way I could create an Odin package from a CWM backup too If ever needed, just let me know
Click to expand...
Click to collapse
I've been searching the forums for a general way to make Odin-flashable ROMs from CWM backups. I'm particularly interested in doing this for Samsung Galaxy 10.1/8.9/7.7 tabs (Honeycomb). Many tutorials use ADB and datadumps, which is fine but is very device-specific, and I haven't found one for the Honeycomb Galaxy Tabs. Using CWM backups seem cleanest and least-device specific way.
So I *AM* interested in how you would start with a full CWM backup, and (not using any base ROMs) get an Odin-flashable .tar.md5 file.
hmmmm bht ho gya hia yaar
kblam said:
I've been searching the forums for a general way to make Odin-flashable ROMs from CWM backups. I'm particularly interested in doing this for Samsung Galaxy 10.1/8.9/7.7 tabs (Honeycomb). Many tutorials use ADB and datadumps, which is fine but is very device-specific, and I haven't found one for the Honeycomb Galaxy Tabs. Using CWM backups seem cleanest and least-device specific way.
So I *AM* interested in how you would start with a full CWM backup, and (not using any base ROMs) get an Odin-flashable .tar.md5 file.
Click to expand...
Click to collapse
Hi kblam,
Well... it's still a work in progress. Not sure why it doesn't work at the moment, but here's my current script:
Code:
#!/bin/sh
echo 'Requesting password to allow running as root...'
sudo echo 'Thanks :)!'
# Make folder
if [ ! -d "BuildOdin" ]
then
mkdir BuildOdin
fi
# Copy BaseRom files
cp BaseRom/adsp.mbn BuildOdin/adsp.mbn
cp BaseRom/amss.mbn BuildOdin/amss.mbn
cp BaseRom/cache.img.ext4 BuildOdin/cache.img.ext4
cp BaseRom/preload.img.ext4 BuildOdin/preload.img.ext4
# Copy boot image
if [ -s NewRom/boot.img ]
then
cp NewRom/boot.img BuildOdin/boot.img
else
cp BaseRom/boot.img BuildOdin/boot.img
fi
# Copy recovery image
if [ -s NewRom/recovery.img ]
then
cp NewRom/recovery.img BuildOdin/recovery.img
else
cp BaseRom/recovery.img BuildOdin/recovery.img
fi
# Create system image
mysyssize=`du -s -h NewRom/system | awk 'BEGIN{FS="[M]"} {print $1}'`
mysyssizeincreased=$((mysyssize+50))
echo 'Filesize will be' $mysyssizeincreased 'MB'
echo 'dd empty image...'
dd if=/dev/zero of=BuildOdin/system.img.ext4 bs=1M count=$mysyssizeincreased >&- 2>&-
echo 'make it ext4...'
mke2fs -F -T ext4 BuildOdin/system.img.ext4 >&- 2>&-
echo 'mounting...'
sudo mount -t ext4 -o loop BuildOdin/system.img.ext4 /mnt >&- 2>&-
echo 'copying system...'
cp NewRom/system/* /mnt -rp
sync
echo 'unmounting...'
sudo umount /mnt
# Create Odin and Odin MD5 files
cd BuildOdin
echo 'tarring...'
tar -cf MyOdinpack.tar adsp.mbn amss.mbn boot.img cache.img.ext4 preload.img.ext4 recovery.img system.img.ext4
echo 'copying...'
cp MyOdinpack.tar MyOdinpack.tar.md5
echo 'md5sum...'
md5sum -t MyOdinpack.tar>>MyOdinpack.tar.md5
echo 'done!'
Taking out all unnessesary comments and commands, what it's supposed to do is the following:
1. First copy the files from the BaseRom (the ones you usually do not extract either):
Code:
cp BaseRom/adsp.mbn BuildOdin/adsp.mbn
cp BaseRom/amss.mbn BuildOdin/amss.mbn
cp BaseRom/cache.img.ext4 BuildOdin/cache.img.ext4
cp BaseRom/preload.img.ext4 BuildOdin/preload.img.ext4
2. Then take the boot and recovery from another folder as they usually need to be based on another kernel (f/e Skyhigh kernel ) and/or recovery (f/e CWM/Faemod):
Code:
cp NewRom/boot.img BuildOdin/boot.img
cp NewRom/recovery.img BuildOdin/recovery.img
3. Take the size of the new image (based on the system folder size + 50):
Code:
mysyssize=`du -s -h NewRom/system | awk 'BEGIN{FS="[M]"} {print $1}'`
mysyssizeincreased=$((mysyssize+50))
4. Create an empty system image
Code:
dd if=/dev/zero of=BuildOdin/system.img.ext4 bs=1M count=$mysyssizeincreased >&- 2>&-
5. Convert it to ext4
Code:
mke2fs -F -T ext4 BuildOdin/system.img.ext4 >&- 2>&-
6. Mount it and copy the new system files (can be unzipped from the cwm-zip) and unmount
Code:
sudo mount -t ext4 -o loop BuildOdin/system.img.ext4 /mnt >&- 2>&-
cp NewRom/system/* /mnt -rp
sync
sudo umount /mnt
7. The rest is same to building other md5 odin files. Combine them with tar and calculate and add the md5 sum
Code:
tar -cf MyOdinpack.tar adsp.mbn amss.mbn boot.img cache.img.ext4 preload.img.ext4 recovery.img system.img.ext4
cp MyOdinpack.tar MyOdinpack.tar.md5
md5sum -t MyOdinpack.tar>>MyOdinpack.tar.md5
As mentioned - I am not sure why the system image created this way does not work yet (I only tested it once) - maybe someone else is willing to test?
Regards,
Nika.

[GAPPS][NATIVESD]NativeSD installer for JB Gapps

Hi All,
Workaround http://forum.xda-developers.com/showpost.php?p=37246757&postcount=11
I've put together aroma installer for installing Google Apps to NATIVESD Jelly bean ROM's.
Theoretically it should work for all rom's, but I haven't tested it yet
You can download it from: gapps-jb-20121011_NativeSD_v1.zip - 90.33 MB
Changelog:
v1: 20.01.2012 attempt to add suport for PAC
Old version:gapps-jb-20121011_NativeSD.zip - 90.33 MB
IF you want to say thanks to anyone, say thanks to Securecrt, Xylograph for giving us NATIVESD
HypoTurtle for providing code for universal installer His work
Hi, has anyone tried it, is it working? I would appreciate to get feedback on which ROMs is it working or not.
Thanks
Sent from my HTC HD2 using xda premium
Does't work for me
Sent from my HTC HD2 using xda premium
samehfarahat said:
Does't work for me
Sent from my HTC HD2 using xda premium
Click to expand...
Click to collapse
What is your setup? ROM name, etc..?
PAC 1.2a
Sent from my HTC HD2 using xda premium
OK, I'll check it out during the weekend
GAPPS NativeSD installer Does not Work
Doesn't work for me either
I am using "16JAN2013][ROM][JB][4.1.2]C.A.M.P.S_HD2_v1.3[CM10/AOKP/MIUI/PA/SONY][WIP][NATIVESD] "
Please help!
Thanks
Hi guys,
I think I found the issue at least for PAC rom. I was caused by slightly different way of mounting partitions. I'm uploading new zip right now, first post should be updated in few minutes.
Please let me know if it's working for you now.
If you do not want to wait, you can replace contents of mount_NativeSD.sh file with following script:
Code:
#!/sbin/sh
mmcblk0p2=`ls /dev/block/mmcblk0p2`
# Mount the ext4 partition
if [ $mmcblk0p2 == "/dev/block/mmcblk0p2" ]
then
mkdir -p /ext4p
mount -t ext4 /dev/block/mmcblk0p2 /ext4p
cp /ext4p/NativeSD/initrd.gz /tmp/initrd.gz
mkdir /tmp/ramd
cd /tmp/ramd
gzip -d -c ../initrd.gz | cpio -i -d
#!/bin/sh
if [ -a "init.android" ]
then
sed -n '/rom_name=/w romname.txt' /tmp/ramd/init
sed -i 's/rom_name=//' romname.txt
else
if [ -f "mountfs.sh" ]
then
sed -n '/rom_name=/w mount.txt' mountfs.sh
sed -n '1w romname.txt' mount.txt
sed -i 's/rom_name="//' romname.txt
sed -i 's/"//' romname.txt
else
sed -n '/--bind/,/system/w initrc.txt' init.rc
sed -n '1w romname.txt' initrc.txt
sed -i 's,exec /bin/busybox mount --bind /NativeSD/,,
s,/system /system,,
s/ *//g' romname.txt
sed -i 's/[[:blank:]]//g' romname.txt
fi
fi
export ROM_NAME=`cat romname.txt`
mount --bind /ext4p/$ROM_NAME/system /system
mount --bind /ext4p/$ROM_NAME/data /data
#the sd-ext directories are ready, so flag the updater-script
echo "NativeSD=true" >> /tmp/nfo.prop
else
#no ext4 partition found
echo "NativeSD=false" >> /tmp/nfo.prop
fi
asisislam said:
Doesn't work for me either
I am using "16JAN2013][ROM][JB][4.1.2]C.A.M.P.S_HD2_v1.3[CM10/AOKP/MIUI/PA/SONY][WIP][NATIVESD] "
Please help!
Thanks
Click to expand...
Click to collapse
If new version is still not working for you, please post initrd.gz from your NATIVESD folder.
I tried the gapps-jb-20121011_NativeSD_v1.zip
for 2 ROMs:
[Dec. 9, 2012][ROM][720p] NexusHD2-JellyBean-4.1.2-CM10 V1.3a [NativeSD]
and
[16JAN2013][ROM][JB][4.1.2]C.A.M.P.S_HD2_v1.3[CM10/AOKP/MIUI/PA/SONY][WIP][NATIVESD]
Unsuccessfull in both cases, I got the following error message:
Applying to SD-EXT
Mounting EXT PArtition
file_getprop: failed to stat "/tmp/nfo.prop": No such file or directory
(Attached are the initrd.files)
Well it seems that just about every ROM has a bit different method of setting ROM name. It's going to be very hard to create automatic script.
In the meantime you can do the following.
1. download zip file
2. create new file called mount_NativeSD.sh anywhere with following contents
Code:
#!/sbin/sh
# Set the ROM name
ROM_NAME=[COLOR="Red"]ROM_NAME[/COLOR]
export ROM_NAME
mmcblk0p2=`ls /dev/block/mmcblk0p2`
# Mount the ext4 partition
if [ $mmcblk0p2 == "/dev/block/mmcblk0p2" ]
then
mkdir -p /ext4p
# mkdir -p /sdcard/NativeSD/$ROM_NAME
# mkdir -p /boot /boot_dir
mount -t ext4 /dev/block/mmcblk0p2 /ext4p
# mkdir -p /ext4p/$ROM_NAME/system /ext4p/$ROM_NAME/data
mount --bind /ext4p/$ROM_NAME/system /system
mount --bind /ext4p/$ROM_NAME/data /data
# mount --bind /sdcard/NativeSD/$ROM_NAME /boot
# mount --bind /sdcard/NativeSD /boot_dir
#delete the old system
# rm -rf /system/*
#clean the dalvik-cache
# rm -rf /data/dalvik-cache/*
#the sd-ext directories are ready, so flag the updater-script
echo "NativeSD=true" >> /tmp/nfo.prop
else
#no ext4 partition found
echo "NativeSD=false" >> /tmp/nfo.prop
fi
3. Replace red text with desired ROM name (eg. JellyBelly, PA_LEO, PAC, etc...)
4. replace mount_NativeSD.sh file inside the zip with the file you just created (name should be mount_NativeSD.sh)
hi, I tried with JellyTime R32 but it doesn't work, I tried replacing the rom name with JellyTime and JellyTime_R32 but I got file_getprop: failed to stat "/tmp/nfo.prop": No such file or directory . Here is my init file..
dcos said:
Hi All,
Workaround http://forum.xda-developers.com/showpost.php?p=37246757&postcount=11
I've put together aroma installer for installing Google Apps to NATIVESD Jelly bean ROM's.
Theoretically it should work for all rom's, but I haven't tested it yet
You can download it from: gapps-jb-20121011_NativeSD_v1.zip - 90.33 MB
Changelog:
v1: 20.01.2012 attempt to add suport for PAC
Old version:gapps-jb-20121011_NativeSD.zip - 90.33 MB
IF you want to say thanks to anyone, say thanks to Securecrt, Xylograph for giving us NATIVESD
HypoTurtle for providing code for universal installer His work
Click to expand...
Click to collapse
You can choose the programs ?

Need Firmware for NB4

dumping firmware AT&T Samsung Note 3 credit to A.S._id
need root and busybox installed
su
mkdir /sdcard/NB4
dd if=/dev/block/mmcblk0p1 of=/sdcard/NB4/NON-HLOS.bin bs=256 count=14803
dd if=/dev/block/mmcblk0p2 of=/sdcard/NB4/modem.bin bs=256 count=203079
dd if=/dev/block/mmcblk0p14 of=/sdcard/NB4/boot.img
dd if=/dev/block/mmcblk0p15 of=/sdcard/NB4/recovery.img
I don't need below, but for anyone who needs the scripts
If you want system.img.ext4
make_ext4fs -s -l 2501M /sdcard/NB4/system.img.ext4 /system
to make flashable for odin
cd /sdcard/NB4/
tar -c ./* >> N900AATTBNB4_ODIN_DUMP.tar
md5sum -t N900AATTBNB4_ODIN_DUMP.tar >> N900AATTBNB4_ODIN_DUMP.tar
mv N900AATTBNB4_ODIN_DUMP.tar N900AATTBNB4_ODIN_DUMP.tar.md5

Categories

Resources