yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Mini] Doc_cheilvenerdi.org:
Deep Inside boot.img

Once dumped /data to data.rfs, I prepared a MicroSD with four primary partitions:

The first formatted "Win95 FAT 32" used by the system as /mnt/sdcard for data, music, photos, etc...

the second one formatted "ext2" because I'm actually using Link2SD and so I need a transitional partition,

the third one formatted "ext4" (not used yet, but I'll soon try to move there /system)

and the last one formatted "ext4": Here I want to move full /data.

I prepared a file called data.ext4 lightly larger then "data.rfs" formatted via loop device as an ext4 filesystem and I placed both files into the sdcard inside /mnt/sdcard/Temp,

I mounted them with the "-o loop" parameter into /sdcard/Loop.rfs and /sdcard/Loop.ext4 and copied all the files from "adb"

# busybox cp -a /sdcard/Loop.rfs/* /sdcard/Loop.ext4
#

For instance say that the fourth partition of the microSD is read by my Linux machine as "/dev/sdc4"...

I copied the files from data.ext4 into the /dev/sdc4 partition of the microSD.

I put the microSD into the smartphone and flashed the boot.img (prepared as posted above) with the following tweaks:

I added the file toolbox in the root directory of the ramdisk from "/system/bin"

I added the files "ext4.ko" and "jbd2.ko" into /lib/modules

I changed these lines into "init.rc" from:

# insmod fsr/rfs modules
insmod /lib/modules/fsr.ko
insmod /lib/modules/fsr_stl.ko
insmod /lib/modules/rfs_glue.ko
insmod /lib/modules/rfs_fat.ko
insmod /lib/modules/sec_param.ko

to

# insmod fsr/rfs modules
insmod /lib/modules/fsr.ko
insmod /lib/modules/fsr_stl.ko
insmod /lib/modules/rfs_glue.ko
insmod /lib/modules/rfs_fat.ko
insmod /lib/modules/sec_param.ko

[b]# insmod jbd2/ext4 modules
insmod /lib/modules/jbd2.ko
insmod /lib/modules/ext4.ko[/b]

and these lines from:

[b]mount rfs /dev/stl13 /data nosuid nodev check=no[/b]
chown system system /data
chmod 0771 /data

# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount rfs /dev/stl12 /system ro check=no

to:

# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount rfs /dev/stl12 /system ro check=no

[b]# mount /data using "service" mode
service init_data /system/bin/sh /init.data.sh
oneshot[/b]

chown system system /data
chmod 0771 /data

Finally I added the file /init.data.sh:

#!/system/bin/sh
sleep 5
/toolbox mount -o nosuid,nodev -t ext4 /dev/block/mmcblk0p4 /data
sleep 5

That's All!

On reboot My data are on sdcard!

This was my goal:

​

Now let's move /system! :cool:

Thanks, I've got it in mind: actually I prefer Lag from sdcard vs lifespan of my device!

Really interested!
[Samsung Galaxy Mini] stepph:
Exellent work !!

You are doing precisely what i planned in my mind ! ... sorry, but no time to help, or test now...

As I already explained, I like to try it on my own... and i'll do ASAP.

But - for others peoples:

- can i add you work to the first post - in order to keep an index ?

- have you some useful compiled file you want to share ? (*.ko)

please read here, and here too...

Then you can look here...It cames from samsung open sources , LA32C530 TV.

It should go with the RFS documentation - elsewhere in the forum - but slightly different version - i suppose not complete support for XSR.

I do havesome intersting ideas about this....but probably not the skills...
[Samsung Galaxy Mini] Doc_cheilvenerdi.org:
Indexed!

I'm Very pleased about it; You surely can add these posts to Thread Index (If you dare I can even insert cross-links to other posts whereever you want)

Now all the files used to move /data to /sdcard:

Kernel modules compiled on my own:

jbd2.ko

ext4.ko

I started from a Kernel downloaded from Samsung OpenSource Release Center

configured with the command

$ make tass_rev02_defconfig
$

The file .config was tweaked with the exact version of the kernel of my phone:

2.6.35.7-perf-CL561937

and they were stripped with the following command to reduce size:

$ arm-none-linux-gnueabi-strip ext4.ko --strip-unneeded
$ arm-none-linux-gnueabi-strip jbd2.ko --strip-unneeded
$

Should somebody need unstripped ones, let me know, cause they're slightly bigger.

P.S. the gnueabi toolchain was downloaded from CodeSourcery

Finally follows all files modified inside my ramdisk, ramdisk itself, repacked boot.img and the PDA archive ready for Odin!

init.rc

init.data.sh

toolbox

kernel.gz

ramdisk.cpio.gz

boot.img

CODE_S5570XIKQC_boot.tar.md5 (Beware that it's related to my specific Firmware: Brand Wind S5570XIKQC... USE AT YOUR OWN RISK!)

I also compiled (not needed here) other two widely used kernel modules:

tun.ko

cifs.ko

ThanksaLot! reading... :rolleyes:
[Samsung Galaxy Mini] denzel09:
Hi Doc, i have download this from checkfus for nobrand S5570XIKQC_S5570XWKQ5_S5570ITVKQ2_HOME.tar.md5

I think that it s same version. I can use your boot ready for odin?

Can you make a version also with slight oc?

If yes i m thinking to move from cm7 to original w/ your mod ;-)

Edit: Is it possible something like this also for system partition? I think that need only 256mb more or less..

and if i would use the last firm for mini, the KS7?

I not understand a thing, what this the utility to use link2sd now w/ data on sd?

Thanks
[Samsung Galaxy Mini] Doc_cheilvenerdi.org:
To finish the boot process using my boot image you need to partition Sdcard as stated above in 4 partitions with /data already copied in the last one... I could'nt look the ITV boot.img yet, so I cannot confirm that they are equal... Anyway if you have a " your working boot image" you can always flash it back even after failure boot...

I'm planning to move /system soon in the third partition (256 Mb), but till now never thought about OverClock... I have to read around it...

LInk2SD was previously installed on my system with many apps on /data/sdext2 (second partition filled by 150Mb apps) so I duplicated it just as a transitional filesystem... Now that all works, I moved all those apps back to "Internal memory": that is physically to the fourth wide filesystem...
[Samsung Galaxy Mini] denzel09:
I understand. Thank you so much. ;)
[Samsung Galaxy Mini] stepph:
Back to life

:D

My device is back from service center. they changed - free of charge ;) - the motherboard, and they installed some new FW... now I have GB 2.3.5 (PDA: XWKS7 Phone: NEKQ3 CSC:HUIKQ6).

Now i have to root it...
[Samsung Galaxy Mini] distan7:
Hi stepph, it's good to hear your phone is back alive. Any other discovery to share ?

Samsung Galaxy Mini GT-S5570

CyanogenMod 7.2.0-RC2 Unofficial by squadzone
[Samsung Galaxy Mini] stepph:
... little experiments this week...

I rooted my GB device: first i tried an update.zip, that worked, but old versions of su and busybox...

then i tried DooMLoRD_v3_ROOT-zergRush-busybox-su, that is good.

(as a fan of old strcrft, i really appreciate it !!).

Once rooted, i started - as in older posts - to remove and add apps from /system, in order to have - after a wipe - the device configured as i need (just to say, no youtube, no unifiedinbox, but rootexplore and ...)

I noticed two apps that i wasn't able to put on /system : TitaniumBackup -that i use often, not for backup purpose, and ES File Explorer. why ??

Odexed apps was pulled and backuped... for futur restore ...

Non odexed apps was backupped with ES File Explorer (pulled apk doesn't install anymore ... )

Then the new system was dumped ( STL dump...), ready to replace the original one (and CSC too) in ODIN package.

================================================== =====================================

... continue in [post 59]
[Samsung Galaxy Mini] stepph:
A new goal - 'Reverse' Tethering...

I have a new goal:

share the internet connection of my PC to the SGM, since i do not have a 3g data plan...

not for browsing (i have my PC, it has a bigger display :D ), but for market and ...some games requiring extra downloads...

...via wireless or USB cable (i prefer)

Let us see... some help ?

================================================== =====================================

... continue in [post 66]
[Samsung Galaxy Mini] distan7:
When I was using stock ROM, I never had TB in system app. But after modified stock ROM existed such as Andro-ID, I put TB into the flashable zip and flash it into system and it worked. Same trick up to CM 7 that I'm using now. Maybe it will help.

And for your new goal, it's called "reverse tethering". Well if you have WiFi-able PC then you could.simply turn on WiFi on your phone. But if you want to use USB cable, you could try installing "Connectify" on your PC

---------------------------------

CyanogenMod 7.2.0-RC2-KANG by squadzone
[Samsung Galaxy Mini] nishanty13:
If you have a dial up internet connection you can switch to wireless modem instead of normal one and can use the wifi. For more info contact your internet provider.

:D
[Samsung Galaxy Mini] roofrider:
I was looking for this a long time back.

well there is a way to reverse tether..found it on kaskus,an indonasian forum with the help of kakagi (fellow user).

It uses a simple script to achieve this..i cud give a link to that, but i feel u like to do things urself (which is better).

Anyway that method of reverse tethering does not enable the user to download apps from market or use any app that requires a net access cuz i think the market n apps were made to detect and use only wireless (wifi/data plan) connections (major drawback,almost useless).

it only enables us to browse the internet thru a browser.

I hope u cud come up with a perfect usb reverse tether hack.

btw@Distan7

I thought connectify share only wireless connections!!

will check again.

------------edit-----------

This thread might be useful.

The Genius Brut.all reverse tethered via blutooth too!!
[Samsung Galaxy Mini] nishanty13:
Man, USB reverse tether would really be a mess and would have restrictions. It is really cheap and better to have wireless modem. or

( I am not sure about this way)

If you are using USB data card then you can buy a Bluetooth for your PC and can try Bluetooth tether. I found an app for it few months ago ( I don't remember from where & now I don't have it)

which could also be used.
[Samsung Galaxy Mini] roofrider:
Maybe wireless modems are cheap...but it's android..anything is possible.

even if i wud only use it very rarely...i really like to see it happen.

It's just the joy of hacking.
[Samsung Galaxy Mini] nishanty13:
Yeah! That's a good point.
[Samsung Galaxy Mini] stepph:
THANK YOU ALL FOR SUGGESTIONS...

For WiFi -- since i do not have a router - i'm in office :rolleyes: -

an Ad-Hoc connection from my pc to mini is my first trial...

Not so simple, since Ad-Hoc network are not fully supported natively...

You have to modify a script...

This is the new /data/misc/wifi/wpa_supplicant.conf file

( copy the old file with wpa_supplicant.conf.NORMAL as backup,

since you need to switch back to the original one in order to connect to 'normal' wifi )

update_config=1
ctrl_interface=DIR=/data/misc/wifi GROUP=wifi
eapol_version=1
ap_scan=2
fast_reauth=1
network={
ssid="[COLOR="blue"]AndroSpot[/COLOR]"
scan_ssid=1
key_mgmt=NONE
wep_key0=[COLOR="Blue"]"XXXXX"[/COLOR]
mode=1
priority=1
}

modify owner & permission

chown wifi.wifi wpa_*
chmod 0660 wpa_*

On my Win XP PC i tried Connectify (probably manual configuration shall do, but too lazy to search parameters...) ...

... manually set IP and gateway, and proxies, and .... device share my connection !!

you are right... at first i thouth it was problems with firewall, but ...

Useless, since if i want to browse, i have my PC....

BlueTooth could be the second test...but i expect the same useless result...

For Cable : as suggested, I imagine a sort of tunneling (via adb shell), but i'm not experienced with linux net setup...

---------------------------------------------------------------------------------------------

... continue in [post 74]
[Samsung Galaxy Mini] stepph:
one post, one question...

how can i mount *.rfs image in my devices ?

i tried:

> mount -o loop -t rfs /sdcard/myname.rfs /mnt/mymntfolder

but it doesn't work...

ioctl LOOP_SET_FD failed: Device or resource busy

:confused:
[Samsung Galaxy Mini] distan7:
Execute this before mount loop :

mknod /dev/loop0 b 7 0

---------------------------------

CyanogenMod 7.2.0-RC3-KANG by squadzone
[Samsung Galaxy Mini] stepph:
again :

ioctl LOOP_SET_FD failed: Device or resource busy
[Samsung Galaxy Mini] roofrider:
A question.

The danger is only in stl5 and not the rest of stl 1-15?

Edit:

I gather it's only stl5 that bricks.

Was just wondering cuz ls -l /dev/block/ shows more than what is in proc/partitions especially ram 0-7 and vold directory and a platform. I dumped only ram0 but not sure how to open it on mobile.
[Samsung Galaxy Mini] distan7:
Stepph,

Here's the complete syntax for mounting system.rfs and also data.rfs and cache.rfs that I found from here : http://www.doxbo.com/doc/android:developer:aosp

Mount RFS files

With android shell:

busybox mknod /dev/loop0 b 7 0

mkdir /disk

chmod 0777 /disk

busybox mount /sdcard/code/factoryfs.rfs /disk

With linux:

mount -o loop /home/user/factoryfs.rfs /home/user/mounted

I tried before (with a little modification) and it worked, but I forget whether I was on stock ROM or on CM7.

---------------------------------

CyanogenMod 7.2.0-RC3-KANG by squadzone
[Samsung Galaxy Mini] stepph:
Thanks !! this works...:)

(i believe the magic word busysbox befor cmds was the key )!!!
[Samsung Galaxy Mini] stepph:
i tried with all the partitions, and the device was broken...

after that, i read that stl5 is -- danger - stay away --.

i do not tried anymore with others, since i fear...two month without my toy...

for that i know, partition in ROM (BML0) are mapped in BMLxx and STLxx as

a result of low level driver of NAND chipset.

I see- in both 'place' you say - the apps on SD (loopNN, and dm-NN) that match the mount report ("mount" or "cat /proc/mounts")

Other devices may refer to other hw resources ...

may be ramXX may be blocks of RAM? a way to dump the internal memory?

if this is the case, probably you get a hex dump - not very usefull - perhaps to crack or reverse some process ?

dunno if there is dangers in these...
[Samsung Galaxy Mini] stepph:
Reverse tethering

from the links provided, some googling and testing, i got the following:

0) on my Win XP pc, i have (see numbers instead of AA, etc for privacy) :

>ipconfig

Configurazione IP di Windows
Scheda Ethernet Connessione alla rete locale (LAN):

Suffisso DNS specifico per connessione: mycompany.xxx.com
Indirizzo IP. . . . . . . . . . . . . : AA.BB.CC.62
Subnet mask . . . . . . . . . . . . . : 255.255.255.0
Gateway predefinito . . . . . . . . . : AA.BB.CC.1

This internet connection is shared, forcing the eth adapter as 192.168.0.1

1) write a batch file net.conf.sh

ifconfig usb0 192.168.0.2 netmask 255.255.255.0 up
route add default gw 192.168.0.1 dev usb0

# iptables -F # not needed, can remove this line
# iptables -F -t nat # not needed, can remove this line

setprop net.dns1 AA.BB.XX.YY # (retrived from my connection)
setprop net.dns2 AA.BB.KK.WW # (retrived from my connection)

setprop "net.gprs.http-proxy" "proxy.mycompany.com:8080" # (retrived from my connection)

in order to configure the device. i push it on the phone, put it in /data/misc/ and set permission to execute to everyone...

-- edit -- Doc_cheilvenerdi.org suggested to put it in into /system/xbin ... it is in the system path, so you havent to write the full path string to call it... ---

2) then i enable USB tethering. USB connection become a eth connection to my pc, and now i see

>ipconfig

Configurazione IP di Windows

Scheda Ethernet Connessione alla rete locale (LAN):
Suffisso DNS specifico per connessione: mycompany.xxx.com
Indirizzo IP. . . . . . . . . . . . . : AA.BB.CC.62
Subnet mask . . . . . . . . . . . . . : 255.255.255
Gateway predefinito . . . . . . . . . : AA.BB.CC.1

Scheda Ethernet Connessione a Samsung GT-S5570:

Suffisso DNS specifico per connessione:
Indirizzo IP. . . . . . . . . . . . . : 192.168.0.1
Subnet mask . . . . . . . . . . . . . : 255.255.255.0
Gateway predefinito . . . . . . . . . :

Note that ADB is disabled...

3) run the script - via root explorer - and - via a terminal emulator -

i see

>netcgf
...
usb0 UP 192.168.0.2 255.255.255.0 xxx
...

Now ping 192.168.0.1, ping AA.BB.CC.1 give that packet flows...

...but still no browser connection...

... still investigate on it ...

=================================================

... continue in [post 76], thank to received support.
[Samsung Galaxy Mini] stepph:
Great feedback... some improvement follows

this was also my notice, when comparing with Linux tutorials and guides...

but since it works, seem not important to my eyes.

It's ok... :)

exactly as you wrote.

ok, i copied it, but i don't know what they are ...

removed from previous post, too.

Once opon a time, when i was a young student, some teachers try to PUSH (no adb yet) this info into my mind... they should be there, floating in empty spaces...

I'm to lazy to bring them back to life - study and application are needed. :o

goood explanation !!

As i easily found with google, there is a flag to set into windows register...

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\IPEnableRouter = 1

perhaps WinXP-built-in-network-bridge can work, too - but i do not try to set it up.

ok.

So intead of 8.8.8.8, i put AA.BB.XX.YY, that are my 'main' internet connection DNS (corrected in previus post, too)

Hope this works, otherwise, i'm lost...what is Android "DNS resolv conf" ?

PS:

More than Helpful !!

The result was that i can Browse internet...

ping www.google.com worked... When i write "www.google.com" in browesr bar, i get the main page of google, and can search , look at my http gmail, etc... - so routing enad DNS working. Still, no market, no sync.

while browsing, i get a annoing alert appearing in each page, "do you want to set up your connection ?" style.

Other services are simply not availlable.

As found in this link , Android is not aware of connection:

so...keep trying...

=======================================================

... continue here ...
[Samsung Galaxy Mini] Olanda1970:
Forza Stepph !!! Wish U and everybody here to succeed in this adventure. Thanks! Marry X-mass and an healthy 2012!:)
[Samsung Galaxy Mini] stepph:
Happy new year, Doc, Olanda1970 ... and everybody else...

I see we spent our holidays doing the same investigations...

With usb tethering, to manually set ip and dns on SGM ... instead of busybox command, i used the fields in device gui...

In my sniffing tests, i have to set-up my market account, so cannot 'reach' download section.

I also googled for a way to decrypt SSL stream, in order to check what data are exchanged between SGM and Google, but it was 'simply' impossible.

For me everything is harder since my proxy/firewall may block some ports/protocols - and its policy is not clear to me.

But still i don't get a points - far away from usb cables... i get my device working with a wifi access point...why i can't get it working using my internet-connected pc as access point ?

Santa Claus bring me a 3g data-plan - i.e. i used my wife's iphone sim :D - so i can autenticate the market account... i'll redo some test, in order to check if something is changed...
[Samsung Galaxy Mini] stepph:
... Here or here some detailed explanation - italian only - on Reverse tethering from Next to Ubuntu...

Thanks to the author !! :p

(see his avatar...have you ever seen that face?)

Seems that leaving the 3g connection open, everything works - with no data exchanged on 3G connection ...

...I'll give it a try, and report !

=======================================================

... continue here ...
[Samsung Galaxy Mini] Doc_cheilvenerdi.org:
My Market NOW downloads!

Following your idea, I confirm (:cool:) that leaving 3G connection up, after setting usb0 network I'm able to download from Market and to send/receive gmails!

P.S. Just sniffed 3G traffic while downloading 10Mb from Market via usb and I only received a Dns request from my 3G provider but my Next didnt respond to it... great!
[Samsung Galaxy Mini] flatzki:
thx for info dude
[Samsung Galaxy Mini] Doc_cheilvenerdi.org:
Tethering and Adb Shell...

Once started the USB Tethering on the phone you loose the adb connection from PC...

...it seems bothering but I figured out (here on this forum) that you can easily restore it with the following commands:

Phone Side

setprop service.adb.tcp.port 5555
stop adbd
start adbd

PC Side

adb tcpip 5555
adb connect 192.168.0.101:5555
adb shell

That's all...

P.S. Last... to revert to "adb via USB" here are the commands:

setprop service.adb.tcp.port -1
stop adbd
start adbd
[Samsung Galaxy Mini] stepph:
edited scripts in above post to insert adb shell via tcp/ip, according to Doc's instructions...

Also, added this scrip to revert back to normal adb

/system/xbin/resetadb.sh

#!/system/xbin/busybox sh
setprop service.adb.tcp.port -1
stop adbd
start adbd

ADB working now ! :)

Thank you Doc !! - for private support too - i'm investigating... -
[Samsung Galaxy Mini] stepph:
GET IT WORKING !!!

Using a proxy apps, i start to browse from my NEXT, passing trough Win XP LAN connection !!

Market works, but no download... some apps see the connection and dowload, some other still wait for wifi or 3g connection...

I'm goig to try with 3g connection open, in order to check market, and others...

...But i'll look for another way to set up a proxy....

---- edit ----

I tried openig 3g connection

before

usb tethering, and now i dowload from market, use facebook, and every app i tried see the connection.

From

# busybox ifconfig

pdp0 Link encap:Point-to-Point Protocol
inet addr:1.80.237.86 P-t-P:1.80.237.86 Mask:255.255.255.0
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1350 Metric:1
RX packets:82 errors:0 dropped:0 overruns:0 frame:0
TX packets:101 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
[COLOR=seagreen]RX bytes:58504 (57.1 KiB) TX bytes:9834 (9.6 KiB)[/COLOR]
usb0 Link encap:Ethernet HWaddr DA:07:DA:BF:B4:5B
inet addr:192.168.42.129 Bcast:192.168.42.255 Mask:255.255.255.0
inet6 addr: fe80::d807:daff:febf:b45b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:17302 errors:0 dropped:0 overruns:0 frame:0
TX packets:11510 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
[COLOR=red]RX bytes:19403356[/COLOR][COLOR=red] (18.5 MiB) TX bytes:1775724 (1.6 MiB)
[/COLOR]

i see that the 3g net is used very little - just the time to activate tethering...

...GOOD...
[Samsung Galaxy Mini] cutedrummerboy:
hey stepph, i found something interesting for this thread. as my contribution i share this link :D check this out: http://particle.blurringexistence.net/samsung-gt-s5660/partition-layout

thanks to Doc_cheilvenerdi.org for help me to find out this thread.
[Samsung Galaxy Mini] cutedrummerboy:
i have successfully backed up my bml5 or /efs partition with this method http://xdaforums.com/showthread.php?t=1335548 now my question is can i flash this image with odin??

P.S. how can i open this .img file??
[Samsung Galaxy Mini] stepph:
can't help with flashing or unblocking....

... about open this file, can you submit first ten bytes ?

to check if it is a know header ?
[Samsung Galaxy Mini] cutedrummerboy:
oh sure, but i have no idea that how can i read first ten bytes. here is an attachment hope this can help you.