yashsingh1/xdaforums huggingface dataset:
[Upgrading, Modifying and Unlocking] CyrilLD:
Yersterday, I successfully built the 2.6.27 LG kernel, with no changes.

A few minutes ago, I tested for the first time to repack this self-compiled kernel in a new boot-perso.img, with a modified default.prop and init.rc (light changes)

I fastbooted this img....waiting...reboot ...and... It's working !!:D

In the config --> about the phone (bad french translation) menu of the phone, it's not anymore "2.6.27 LGE@new4" in the kernel version, but "...@new1". I want it a prove that it worked héhé !!

I also have a r/w filesystem without making adb remount. (test with a ringtone duplication with dd)

Great great ... everything is going the good way...

But ! I have some questions for you Zac!!

After the kernel build, it makes 6 modules (code from modules.order):

kernel/arch/arm/mach-msm/reset_modem.ko
kernel/arch/arm/mach-msm/dma_test.ko
kernel/drivers/misc/logger_test.ko
kernel/drivers/net/wireless/bcm4325/wireless.ko
kernel/drivers/input/evbug.ko
kernel/drivers/power/msm_battery.k

What am I supposed to do with these files ? Adding them in the ramdisk in boot.img and manually copy them to /system/lib/modules ?

After playing with compiling, could we include these modules directely in the system.img for a "clean" boot.img + system.img distribution ?

Now I can start playing with others kernels revisions ... I'v made an diff with .config from LG and android 2.6.29 ....a lot of changes. What tool do you use to merge "automatically" theses versions ? (general tool for kernel upgrading procedure I suppose...)

Thanks a lot :rolleyes:
[Upgrading, Modifying and Unlocking] Zacpod:
Awww ya! Feels good doesn't it! :)

I added them to /lib/modules in the ramdisk, but it should be possible to roll them right in to the source so they don't have to be modules. The only one you really need is the wireless.ko - and it's important for now that it get copied to /system/lib/modules since that's where everything looks for it. Actually - I think that one needs to stay a module as I don't think the kernel will be able to turn the wifi off otherwise.

The commands you're looking for are "patch" and "meld"

Patch will already be part of whatever linux/osx you're using, but you'll have to install Meld. ("apt-get install meld" in Ubuntu)

Patch can be a pain to work with. the -p1 flag is your friend. It strips the first (or 2 or 3 or...) directory off the filenames. The command I was using was "patch -p1 -N < patch.diff"

I'm still struggling trying to get the Android Msm kernel sources downloaded. Repo doesn't seem to want to bring the kernel down, and I've resorted to just cloning the git tree. Pain in the arse. I'll post a little how-to when I have it figured out. So far everything I try fails, and google isn't giving me much to go on. I don't know why they don't just include the kernel as part of the main repo. Bah humbug! ;)
[Upgrading, Modifying and Unlocking] CyrilLD:
Yehhhh !!! very exciting !

Thank's a lot ... I'm gonna try to learn these tools right now !

Android repo tree is ...hum ...:mad:

I found a way to "repo sync" the kernel project, who is'nt enabled by default. Once you have a successfully repo-init, you must add the following line to your .repo/manifest.xml :

for version .29

<project path="kernel" name="kernel/msm" revision="refs/heads/android-msm-2.6.29"/>

edit : re-sync after that ... and you'll get the kernel project coning into your working folder (+-300Mo)
[Upgrading, Modifying and Unlocking] Zacpod:
OMG Thank you! I've been banging my head against the wall for an hour trying to figure out how to get the msm kernel downloaded! :D

Downloading now. I think my wife is going to be miss me this weekend, lol, I'm going to be glued to my laptop trying to make the kernel work! ;)
[Upgrading, Modifying and Unlocking] harnish:
LOL. It's regex to be honest ... I tried doing it with sed but ran into issue trying to identify unprintable characters (ie: 0xFF). It was just easier to do with PERL.

:) That will be most helpful. If the issue is the ramdisk, the ramdisk.img is gziped cpio archive so we should be able to easily modify it.

HOWEVER, that looks more like it can't read the system directory at all ... I left my micro-usb cable at home today so I can't check ... but I'm fairly certain sh is in the /system/bin directory if nothing else.
[Upgrading, Modifying and Unlocking] harnish:
This might be redundant but ...

I've opened up the ramdisk for the emulator and confirmed that the init.rc file controls what is mounted, with what options, in what mode, owned by whom. Modification to this file from the Eve firmware (and figuring out a way to flash it back on) would easily give us root without ever touching the system partition (which, I admit, isn't going well).
[Upgrading, Modifying and Unlocking] vinnybobdog:
From a gw620 owner I just wanted you to let you guys know that I'm watching this thread with trepidation and thank you for all the time and hard work!
[Upgrading, Modifying and Unlocking] Zacpod:
Sweet - that's where I'll concentrate my efforts then. Perhaps LG used a modified gzip, or some other compression method, to pack the ramdisk. Assuming the header is correct, I'll work on trying to decompress the ramdisk.
[Upgrading, Modifying and Unlocking] fugdup:
Like the rest of us watching you guys work your magic. I am as well a GW620 owner and I just want to take my hat off to you. I have been in contact with both LG canada and Rogers re: possible Android OS 1.6 or 2.0 upgrades and they are both giving me the run around. So once again thanks for all your hard work, we can't wait to see you break this phone(in a good way of course).
[Upgrading, Modifying and Unlocking] Zacpod:
Those disassembly shots are now posted over here.
[Upgrading, Modifying and Unlocking] Zacpod:
I'm not having any more luck extracting the ramdisk.

I've tried a few different extraction methods, including manually calculating offsets and pulling the data directly out of the mbn with a hex editor, and nothing is working. The offsets listed in the header don't match up with gzip magic numbers, and the places in the file where gzip magic numbers do appear don't continue on with a valid gzip header.

I tried using lha to decompress a few sections, as I know some linux kernels use lha instead of gzip, but had no luck. Frustrated.
[Upgrading, Modifying and Unlocking] ouinouin:
tryin with lzma ?

did someone tried to do the extraction with lzma, i now its in use in latest linux initrd's.

i hope this phone will be rooted soon. its certainly the best android-keyboard device at this time.
[Upgrading, Modifying and Unlocking] Zacpod:
Ah! Thanks! I was thinking LHA and LZMA were the same for some reason!

I'm booted up in MacOS right now, so the LZMA tools I have access to are a little feeble and don't give any feedback. I'll reboot in to Linux a little later and see if I have any luck.
[Upgrading, Modifying and Unlocking] Zacpod:
Though, actually...

I just created a test archive using lzma with a port of 7zip.

Using the file command, it correctly identifies the file as a 7zip archive.

Using the file command on the ramdisk results in it identifying the file as "data"

Hrm... I wonder if it's a squashfs or something similar... If it's an pre-compressed file system would there be any need to cpio/gzip it? Maybe we can mount it directly as a squashfs. I'll try that too when I reboot.
[Upgrading, Modifying and Unlocking] ouinouin:
squashfs possible or jffs.

you can try squashfs or jffs widely used in openwrt distros and other embedded environments.

is it possible to share the file you extracted , i dont have a windows to proceed to extraction of the mbn file.
[Upgrading, Modifying and Unlocking] Zacpod:
Ya, I'm actually compiling OpenWRT as we speak - that's why I was thinking of squashfs. :)

I've zipped up the extracted MBNs and have uploaded it to my webhost. Here's the link. :)

Glad to have more help!
[Upgrading, Modifying and Unlocking] Zacpod:
The file is uploaded here.
[Upgrading, Modifying and Unlocking] ouinouin:
what i think about the stuff

helle , thanks for your archive.zip

i m not a developper but i ve got good general linux knowledge, (openwrt and debian like systems.

the system looks divieded in multiple sections :

one bootloader binary i assume its the amss.mbn

some config binary data like

partition.mbn (i assume like in the redboot environment, we can find the memory offsets of the given partitions ..)

the zImage_ramdisk.mbn contains certainly the kernel AND the ramdisk filesystem so you have to split this file at the good place and i assume you will find a ramdisk filesystem structure preceeded by the kernel. (lets remember historically, the max size of the kernel was 1.44mB due to the floppy limits. and a X86 kernel compiled to work on a lot of different machines sizes about 700KB so we can assume the split is under 700KB

maybe the file exctractmagic table is here to show us how the files are splitted.

having a look at a redboot bootloader structure can help for whom who doesnt know about embedded bootloaders.
[Upgrading, Modifying and Unlocking] ouinouin:
doc on arm bootloaders

http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#section_other_bootloaders

interresting details saying in the arm code, the initrd can be appended to the zImage file.

(for memory, the ramdisk could be in cramfs format.)

im trying to boot the file via qemu maybe it ll give me more.

it sounds the method employed is named bootpimage, to append the initrt to the kernel, its a common method in arm world, im trying to find the definition of the bootpimage over the net, but im not a coder, and cant read a lot of source code to find how to handle the file.

after search maybe the split between kernel and ramdisk image is at offset : 1f 8b 08 (just after the words booting the kernel in a hex editor :D :)
[Upgrading, Modifying and Unlocking] Zacpod:
Ya, that's one of the first places we tried. Offset 17927 where the gzip magic numbers 1f8b08 start. Sadly, the result is not a valid gzip file. :(
[Upgrading, Modifying and Unlocking] ouinouin:
strange, the magic is repeated multiple times in the file.

the first occurence probably corresponds to the gzipped part of the kernel itself.

maybe have a look at the second one

i think a part of the solution is in the make bootpImage scripts used in the kernel source for arm , which strips kernel and ramdisk alltogether.

y also tried to mount system.mbn after havin burned it with nandsim and mtd tools, mount is possible with yaffs2 module but seeing nothing in the mount point.

here is the beginning of a dmesg , showing once decompressed, we have got yaffs, we can also see the mtd partitions mapping. once uncompresed, the initrd takes 586kB of memory.

the usb port can be in 4 modes : mass storage, adb, modem and diag!!??

two additional modes come after : ethernet and nmea.

the qualcomm 7200A also support usb on the go, maybe its possible to plug goodies like usb>serial ports and so on.

physically, there is five test points just above the simcard contacts. maybe its a serial port
[Upgrading, Modifying and Unlocking] Zacpod:
Nice! Did you pull that dmesg out of the firmware?

Diag mode... I wonder if that's the mode it's in when you hold down 1 at power-up...
[Upgrading, Modifying and Unlocking] ouinouin:
i did a dmesg > /sdcard/dmesg.txt in my phone, using connectbot for command lines.

i also tried to do a cat /dev/mtd/mtd0 mtd1 to mtd6

and the only partitions i ca dump are filled with FF FF FF FF..... (mtd0 and mtd1) the system cant let me read the others.

i also tried to gunzip the ramdisk.img furbished with the android sdk, it starts with the gzip magic but i cant decompress it. so may be the first to to is to find the right method against the cupcacke sdk ramdisk.img