Messing around with Galaxy S and replicant

Igor Almeida igor.contato at gmail.com
Fri Sep 30 04:52:28 UTC 2011


Hi guys,

I've been lurking around asking stuff about the Galaxy S (GT-I9000)
but never got a chance to summarize what I've been trying to do. Here
is an attempt to do just that, and would be great if you could show me
mistakes and give suggestions on where to go.

I took what seemed absolutely necessary from the cyanogenmod
galaxysmtd files and copy/pasted it to create a replicant_galaxysmtd
product, always keeping an eye on paulk's Nexus S gingerbread files:

https://gitorious.org/~igoralmeida/replicant/igoralmeida-manifest
https://gitorious.org/replicant_tests/android_device_samsung_galaxysmtd
https://gitorious.org/~igoralmeida/replicant/igoralmeida-android_vendor_replicant

Because there is no vendor/samsung tree, none of the binary blobs
would be included. There are also some kernel modules mentioned in
device/samsung for the galaxysmtd which I'm not sure are free, as well
as some scripts from teamhacksung and the cyanogenmod guys.

Anyway, 'make -jN bacon' seems to run ok [1] (trying to make
'distimages' before 'bacon' doesn't work: it dies prematurely with a
lot of 'ignoring old recipes' messages [2]) and creates the replicant
ota .zip files [3,4], so my next step was to compare it to
cyanogenmod's packages [4,5] and take a look at what was missing.

I don't understand the difference between the ota and update- packages
[7]. The same happens with cyanogenmod, but to a lesser extent [8]. I
also diff'd across builds, just for the sake of completeness [9,10].
>From [10] you can notice some important files are missing, especially
updater.sh ( https://github.com/CyanogenMod/android_device_samsung_aries-common/blob/gingerbread/updater.sh
 and /bml_over_mtd.sh) and some binaries for the actual flashing.
So the .zip package would probably not work from my recovery mode. Am
I right to assume the file in
META-INF/com/android/google/updater-script is the first thing called
when I "Apply a .zip file from sdcard" in recovery mode? I was looking
[quickly] for its origin, but couldn't find it.

I then went on to take a look at flashing via heimdall 1.3. The first
thing I did was download the PIT file and have it printed on my screen
[11] and then my understanding of the system starts to fade:
cyanogenmod was supposed to create YAFFS2 images, as suggested in
/proc/partitions, /proc/mtd and mount commands in the shell, showing
me a bunch of mtdblock* names for boot (0), recovery (1), system
(...), cache, efs, radio, datadata and reservoir (7); but the build
logs show system.img created with make_ext4fs. Also, while heimdall
DOES have flags for system/dbdata/etc, I assume they would obey the
partition layout with RFS from the PIT file, so I don't understand how
could cyanogenmod flash it without changing the partition layout and
filesystem types. My guess is that it works via bml_over_mtd, but I
could not find a website explaining the inner workings for that.

Apparently the Galaxy S is pretty robust when it comes to bricking if
all you do is above the bootloader, so this is not a "hey can you
confirm I won't brick it" so much as a "hey can you help me understand
how this porting thing could work here?" kind of e-mail. My next step
after that would be following the How_to_port wikipage, starting with
reference-ril and logcatting stuff.

Cheers

Stuff in http://igoralmeida.devio.us/replicant/ (except .zip files)
[1] LOG_MAKE_BACON
[2] LOG_MAKE_DISTIMAGES
[3] replicant_galaxysmtd-ota-eng.igor.zip
[4] update-cm-nightly-signed.zip
[5] cyanogen_galaxysmtd-ota-eng.igor.zip
[6] update-cm-7.1.0-RC1-GalaxyS-KANG-signed.zip
[7] Diff_replicants.html
[8] Diff_cyanogens.html
[9] Diff_otas.html
[10] Diff_updates.html
[11] GALAXYS_CMOD_PRETTY_PIT
[12] LOG_BRUNCH (pure cyanogenmod build log using their tree)

-- 
Igor Almeida


More information about the Replicant mailing list