yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] wroclaw1:
Split, modify join intitramfs and keren. ???

Hello,

Did somebody manage to split the zImage into a kernel and intramfs. ??

I'm able to extract the initramfs but no luck with kernel. There is a lot of info on the net but it didn't help. So I'm a somewhat lost at the moment :mad:

(I want to modify init.rc in order to mount a NFS drive as / (root).

Mounting the rootfs via nfs seems not to work with this kernel. (Although if you peek in the kernel image you see this kernel comand line:

noinitrd root=/dev/nfs nfsroot=192.168.0.155:/home/zhjun/busybox,proto=tcp,nolock ip=192.168.0.20:192.168.0.155:192.168.0.1:255.255.255.0::eth0:off console=ttySAC2,11520

Any help is appreciated.
[Android Software/Hacking General [Developers Only]] omarahum:
Yeah, i figured out the CPU cycle thing when it would always freeze on the bootanimation when I had the framerate at 45, but started to boot ok after I lowered it to 15 (but the apple burning up into an Android looks better at 45). Even though it froze at the boot screen, if I waited 2 minutes, I was still able to connect through adb and repush with new settings or remove the custom animation. What I don't understand is why it's working (on and wifi icon is there)when ADW initially launches, but disconnects before everything finishes booting (icon disappears, but in settings: Wifi is On, but says disconnected).
[Android Software/Hacking General [Developers Only]] Christian Buchner:
would this article help in understanding the zImage?

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

EDIT: does anyone know whether or not it would be possible to boot Android 2.2 based on the existing kernel 2.6.32.9? If the android specific kernel interfaces haven't changed too much, we might be able to compile Android 2.2 ourselves. What do you think?
[Android Software/Hacking General [Developers Only]] jtbnet:
My Moto Droids are currently loaded with 2.2 in the form of Chevyno1's Simply Stunning 4.7 Rom and his kernels are 2.6.32.x based...
[Android Software/Hacking General [Developers Only]] wroclaw1:
spliiting zImage in kernel and initramfs images

Hi Christian,

Thanks for the link, but i already visited that web site. I'm now going trough it the hard way, step by step until i understand the process or conclude it's better to give up.

(This kind of quests help to learn new things. e.g now i know bit by bit how u-boot images are constructed and that the file zImage is in fact a uImage file )
[Android Software/Hacking General [Developers Only]] bowser84:
i dont mind playing around with stuff, i've done it with my HTC HD phone and over phones and dont see a problem me figuring it out.

my major concern is the facebook games stuff lol without that she basically wont use it so it wont be worth getting.

i may just wait for the adobe tablet that they are working on as they are the makers of flash and from looking about at previews it looks very promising.
[Android Software/Hacking General [Developers Only]] catttman:
Stuck in airplane mode

I was wondering what airplane mode does... it put a little airplane in the little Bars box icon on top and I cannot undo it? ((help))

I need help on how to get my pad out of airplane mode

I reset, restart its unchecked but still in the airplane mode ... any ideas?

It makes my location off ,does not show my location anymore now

after I messed with airplane mode setting

thanks:(
[Android Software/Hacking General [Developers Only]] jtbnet:
I've heard there is a bug in bluetooth handling (guess when bletooth not supported...) and there is an app on market ('AIRPLANE MODE TOGGLE') that will clear the issue... I found another way just now... install the standard 'Power Control' Widget on a homescreen and use it to enable 'Bluetooth, GPS, and Wireless' and you can then clear airplane mode...
[Android Software/Hacking General [Developers Only]] catttman:
Thank you All Cleared !!!
[Android Software/Hacking General [Developers Only]] jtbnet:
I had looked at this before... Really section 5 is the relevant info;

5. Loading the kernel image

Kernel images generated by the kernel build process are either uncompressed "Image" files or compressed zImage files.

The uncompressed Image files are generally not used, as they do not contain a readily identifiable magic number. The compressed zImage format is almost universally used in preference.

The zImage has several benefits in addition to the magic number. Typically, the decompression of the image is faster than reading from some external media. The integrity of the image can be assured, as any errors will result in a failed decompress. The kernel has knowledge of its internal structure and state, which allows for better results than a generic external compression method.

The zImage has a magic number and some useful information near its beginning.

Table 2. Useful fields in zImage head codeOffset into zImage	Value	Description

0x24	0x016F2818	Magic number used to identify this is an ARM Linux zImage

0x28	start address	The address the zImage starts at

0x2C	end address	The address the zImage ends at

The start and end offsets can be used to determine the length of the compressed image (size = end - start). This is used by several bootloaders to determine if any data is appended to the kernel image. This data is typically used for an initial RAM disk (initrd). The start address is usually 0 as the zImage code is position independent.

The zImage code is Position Independent Code (PIC) so may be loaded anywhere within the available address space. The maximum kernel size after decompression is 4Megabytes. This is a hard limit and would include the initrd if a bootpImage target was used.

Note

Although the zImage may be located anywhere, care should be taken. Starting a compressed kernel requires additional memory for the image to be uncompressed into. This space has certain constraints.

The zImage decompression code will ensure it is not going to overwrite the compressed data. If the kernel detects such a conflict it will uncompress the image immediately after the compressed zImage data and relocate the kernel after decompression. This obviously has the impact that the memory region the zImage is loaded into must have up to 4Megabytes of space after it (the maximum uncompressed kernel size), i.e. placing the zImage in the same 4Megabyte bank as its ZRELADDR would probably not work as expected.

Despite the ability to place zImage anywhere within memory, convention has it that it is loaded at the base of physical RAM plus an offset of 0x8000 (32K). This leaves space for the parameter block usually placed at offset 0x100, zero page exception vectors and page tables. This convention is very common.

*** But the problem for me was this is well know info and there are tools that are built to put this together and break this image apart again and they didn't seem to work for me when tried on the Zenithink zImage...
[Android Software/Hacking General [Developers Only]] omarahum:
JT showed a solution on his site, think it's what jtbnet was talking about http://www.jiongtang.com/fourm/android-f60/don-want-to-power-off-t1691.html Nevermind, just realized this was redundant info.
[Android Software/Hacking General [Developers Only]] jtbnet:
Yes, JT did note the market app for enabling disabling Airplane mode on his site... I was a bit curious which piece seemed to cause the problem thus tried the 'Power Control' Widget trick to try an narrow it down and it seems that just enabling bluetooth with Power Control also clears the issue when there really is Not a bluetooth device available... as it seems to toggle something that frees up the Airplane mode setting...
[Android Software/Hacking General [Developers Only]] jtbnet:
FYI... Haleron updated Zenithink 10" tablet

Not meant as a plug for this, as I haven't heard of anyone actually getting and reviewing one of these BUT... It does seem like an incremental improvement from looking at the packaging so I got in touch as I'd consider grabbing another improved unit...

These folks exchanged a few email messages with me today... one of the primary questions I was asking was whether they were also going to maintain the code on the unit as they have/are modifying it... their answer was Yes...

They have added the webcam support but are not planning on much additional 2.1 changes as they are working on stabilizing 2.2 with release hopefully mid Oct.

This is good news in a number of ways... I suggested that we have some willing and technical beta testers here and at slatedroid and they said they could use the help... so I guess we will see....

They did say they understand there are still some issues to get worked out and it will probably take till Oct. to smooth these out so seemed pretty straightforward...

I did feel a bit better about the future for these lesser expensive tablets based on the exchange, so will take the step and order one to be involved with it going forward so just figured it couldn't hurt to pass this info along...
[Android Software/Hacking General [Developers Only]] omarahum:
Isn't this the one that the TabletConnect blogger warned everyone about?
[Android Software/Hacking General [Developers Only]] wroclaw1:
Splitting & Merging the Kernel+initramfs

I have figured out where the initramfs is located in the kernel code. It's not a simple append the to end but placed as a single block near the beginning of the kernel image. (This is possible because the initramfs part is added during the kernel build process. So the kernel itself knows where it is and can de-compress it at startup time.

My current status:

* Layout of the 0927 kernel image is clear.

* I can extract the initramfs files

* I can re-pack the (modified) initramfs file back into a cpio compressed archive (Nearly the same size as the original archive, but the file order is different making a binary compare impossible)

* With a hex editor it's possible to copy the new initramfs section over the old one. (Asks for a automated process to avoid mistakes.)

Todo:

* Add a new U-boot header with a newly calculated CRC check.

* Test if the new kernel will boot. (That's why its so nice if you can boot from a network server. No need to flash during testing)

* And if it all works, try to automate the whole process.

At this moment i don't see real blocking points. Just still some hard work to do.

( That's the real fun, otherwise you would have just bought a out of the box working Ipad.:))

I will keep the forum updated.
[Android Software/Hacking General [Developers Only]] ajvctrindade:
Hi,

I finally made it, thanks for the help and tips.

Regards,

António Trindade
[Android Software/Hacking General [Developers Only]] lmemperador:
very good antonio... :)
[Android Software/Hacking General [Developers Only]] jtbnet:
I did see a number of bloggers taking stab's at these folks due to the likely unsanctioned 'Droid 10' naming... but as that is a US trademark not so sure it really has any affect in Columbia ... other than that I've not seen any technical review of a unit from these folks yet...
[Android Software/Hacking General [Developers Only]] jtbnet:
Great Progress...Nice Work! You're correct easy is rarely any fun :)
[Android Software/Hacking General [Developers Only]] Christian Buchner:
Would you be so kind to pack the contents of the initrd with tar+gz and put it on a share hosting site? I would like to learn what excatly this ZT-180 does during booting.
[Android Software/Hacking General [Developers Only]] lmemperador:
please, anyone knows what is the use of this checkbox?

in burntool

image attached
[Android Software/Hacking General [Developers Only]] fun_:
did you try mkimage in u-boot/tools/?
[Android Software/Hacking General [Developers Only]] Christian Buchner:
Switch your locale setting for non-Unicode programs to Simplified Chinese. Then the correct characters will show up. And maybe you can then copy & paste them into Google Translate ;)
[Android Software/Hacking General [Developers Only]] wasame:
it's factory default.
[Android Software/Hacking General [Developers Only]] wroclaw1:
Splitting & Merging the Kernel+initramfs

Current status:

* I can break the kernel in pieces, extract the initramfs.

* I can assemble the kernel from all the pieces ( initramfs newly pack with cpio and the resulting kernel is booting.

* When i make a change (Just adding an echo command) in for example init.rc the length of the cpio-ed initramfs files changes and the assemled kernel does NOT:mad: boot, I have updated the length in zimage header.

I will try to sort out where this goes wrong. May take some time.

Attached you find the file ZT-180-KernelSplit.pdf with some of the notes i took and file initramfs-ZT-180-0827.zip with the contents to the initramfs used.

Any idea on the variable length problem is welcome.
[Android Software/Hacking General [Developers Only]] wroclaw1:
Splitting & Merging the Kernel+initramfs

Yes, That partk works fine. I's the zImage which give me now a problem. I did not yet check why after the gzip compressed part, there a still a few bytes uncompressed code.

If the position of this code at the end of the zImage file is position depend, then there is a big problem i fear.
[Android Software/Hacking General [Developers Only]] insight3fl:
I dont know if this will help any of you developers, but here is the entire boot load sequence of the Odroit T (Samsung cortex A8 processor)
[Android Software/Hacking General [Developers Only]] Christian Buchner:
This is not too helpful, as it is just a dump of U-boot messages and kernel log done over a serial port, I suppose.
[Android Software/Hacking General [Developers Only]] wroclaw1:
For whom is interested, here is the boot log of the ZT-180 version 0827.

Indeed it doesn't tell you a lot.
[Android Software/Hacking General [Developers Only]] insight3fl:
Yes.. you are correct..... just trying to put in my two cents :)
[Android Software/Hacking General [Developers Only]] wroclaw1:
And appriciated.
[Android Software/Hacking General [Developers Only]] Christian Buchner:
Well it certainly tells you which company designed the system on a chip that the ZT-180 "CPU" really is. We now have another company (besides Zenithink) that could be asked for the GPL'ed source code. That would be InfoTM in Shanghai.

I find the copyright notices funny. Why did they put the year 2014 there. Is this a design from the future? Certainly feels sluggish enough to be from the past.

Also good to know the exact U-boot version that was (2009.08).

The compiler they used seems to be gcc 4.3.3 from the Codesourcery distribution "arm-2009q1-203-arm-none-linux-gnueabi", I think. In case one wants to build binary compatible kernel modules.
[Android Software/Hacking General [Developers Only]] wroclaw1:
This might tell us which video decoder is in the SoC : http://www.design-reuse.com/news/20109/video-codec-license.html

I Googled before on IMAX200, but that didn't bring much. I overlook the "InfoTM Microelctronics Co., Ltd" See if we can dig more up on this company&products.
[Android Software/Hacking General [Developers Only]] lmemperador:
thanks, good info.
[Android Software/Hacking General [Developers Only]] jtbnet:
Adhoc hotspot connection working DHCP/No static IPADDR required

I finally got this working reliably...

RT2870STA TxPower + Adhoc support Patch

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

For the TxPower + Adhoc Patch...;

adb connect Tablet-IPADDR:5555

adb -s Tablet-IPADDR:5555 shell

# mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system

- Edit the /etc/Wireless/RT2870/RT2870STA.dat file to

make Change to lower TxPower to 20% + Change NetworkType to Adhoc by

setting Adhoc SSID and NetworkType...

#The word of "Default" must not be removed

Default

CountryRegion=5

CountryRegionABand=7

CountryCode=

ChannelGeography=1

SSID=AndroidTether

#NetworkType=Infra

NetworkType=Adhoc

WirelessMode=5

Channel=0

BeaconPeriod=100

# Full 100% Power

#TxPower=100

# 20% TX Power Runs Much Cooler and better perf

TxPower=20

#

BGProtection=0

TxPreamble=0

...

- Edit /data/misc/wifi/wpa_supplicant.conf to to contain ONLY

the network relevant data you need such as;

# ap_scan gets cleared every time you switch to Infrastructure Connection

# Adhoc Priority Must be highest number of all networks to get picked up in scan

# Globals

ctrl_interface=ra0

update_config=1

ap_scan=2

# Adhoc network with None.

network={

ssid="AndroidTether"

scan_ssid=1

mode=1

key_mgmt=NONE

priority=999

}

...
[Android Software/Hacking General [Developers Only]] insight3fl:
I know I am a little behind the times here, but I finally got the emulator to complete boot to create an Id, but with two attempts (one using my existing gmail account) and one try creating a new one, I get to the "terms of service" part of activating market and it aborts and says "an error has occurred, please try again later" Has anyone else had this problem?

EDIT: Finally I got the id! After market came on line, (guess it really did not matter) I could not adb the the emulator from Eclipse console. I had to launch emulator with my AVD from command then run command again to be able to adb.
[Android Software/Hacking General [Developers Only]] Christian Buchner:
I found a similar press release on the licensing of the OpenGL capable graphics core.

Pretty boring actually.

http://findarticles.com/p/articles/mi_m0EIN/is_20090421/ai_n31581467/
[Android Software/Hacking General [Developers Only]] yukop4:
tried your patch-seems to improve my reception and dropout

somehow whenever you use the browser the wifi signal dips or it drops out

cheers ed
[Android Software/Hacking General [Developers Only]] insight3fl:
JB, Thanks for your efforts on this. I am trying to connect windows mobile phone running wmwifirouter. (not android phone like yours ) I have changed the SSID to "MightyROM" in both files. The zt still connects to my home network, but will not connect to the wifi router on the phone. It sees it (with Wifi Buddy program) but does not connect. I also tried to add the connection manualy (at that point wifi Buddy sees it as infrastructure but still does not connect)

What can I do to get this working?

EDIT: I added the files using root explorer rather than adb push. I assume that is not an issue. The files are there.
[Android Software/Hacking General [Developers Only]] jtbnet:
I use root explorer almost exclusively so not the issue... do need to make sure permissions on file are good but again simple with root explorer... I had the same issue when I wasn't careful to ensure that the priority of the adhoc network wasn't the largest number... I'd try;

- disable wifi

- ensure ap_scan=2 and priority of adhoc is largest of all networks in file

- ensure adhoc hotspot/router is started and close

- enable wifi

Has worked everytime for me since getting this straight...
[Android Software/Hacking General [Developers Only]] bhood:
Is anybody else having problems with the "com.android.vending" process crashing when you try to make a purchase on the Market? I can download free stuff just fine, but whenever I try to purchase (select "Credit Card" as my type and select "Ok"), the "com.android.vending" crashes and I cannot make a purchase.

Does anybody know what this might be and how I can fix it? It happens no matter what firmware I'm using. It's really irritating.
[Android Software/Hacking General [Developers Only]] Christian Buchner:
It worked for me on my test purchase. I had previously set up Google Checkout on my google account from my PC.
[Android Software/Hacking General [Developers Only]] insight3fl:
Actualy, I used your files you downloaded on Slatedroid and only changed the ssid name in each file. nothing else... (thanks for the download!) Not sure whey it does not work. I know others have been able to use android phones with these hacks, but I have tried many of them. My windows phone works perfect as wifi for my laptop and my wifes new macbook, so I know it works.

Thanks for your help!
[Android Software/Hacking General [Developers Only]] fun_:
I've just updated my unyaffs patch to use unyaffs.[ch] from here.

timestamp of directory is restored with new unyaffs, but it may not be important.
[Android Software/Hacking General [Developers Only]] jtbnet:
The only problem with using the files I provided is that the tablet will change them (ap_scan and priority) on it's own if you connect to a different ap than the adhoc one... thus you need to check them before connecting adhoc to ensure that ap_scan=2 and priority=largest anytime before trying to connect to the adhoc network...
[Android Software/Hacking General [Developers Only]] dmathieux:
AndroidTether - advise

Sorry, I'm new to this. How do I view and make the changes to the ap_scan and priority - on the fly? I can see the dat file but can't open it on my device.
[Android Software/Hacking General [Developers Only]] insight3fl:
Yes, priority =999 And scan is 2. checked each time
[Android Software/Hacking General [Developers Only]] jtbnet:
I use 'Root Explorer' which allows you to remount ReadWrite and long click the file to open in editor mode.

If you connect Infrastructure mode after initially placing the file then that Network gets added to the file with the highest priority and the ap_scan line disappears thus why you need to be able to edit the file if you are moving from Infrastructure-Adhoc-Infrastructure modes...
[Android Software/Hacking General [Developers Only]] jtbnet:
So then you must not have connected to an Infrastructure Network AP... as it seems like a bug to me but everytime you connect infrastructure it deletes the ap_scan=2 EVEN if you change to ap_scan=2 in what I had believed was complete default settings file in /etc/wifi/wpa_supplicant.conf...

The /data/misc/wifi/wpa_supplicant.conf file is the 'live' one that gets updated every time you connect to a different network and that file is where the priority of things keeps changing and the ap_scan line gets removed...

For example right now I have priority=999 for my adhoc, but as I'm connected infrastructure to my lab-3 network that network's priority got pushed to 1000 (greater than 999) and the ap_scan line got removed... thus till I fix the priorities and ap_scan line again I can't switch back to adhoc tether....

I hope this is clear though I know if is confusing... though of course if not confusing then getting this working wouldn't have taken me so long...
[Android Software/Hacking General [Developers Only]] jlcid:
Maybe this could be useful to compile new modules ...

h_ttp://sven.killig.de/android/N1/2.2/usb_host/
[Android Software/Hacking General [Developers Only]] insight3fl:
Jtb, I am familiar with the working file in \ misc. That is not where you re enter the priority...you do it each time in the "config file" in the etc.\ location i assume? Another quick question, do you manually create your ad hoc connection, or just FIND it on scan? Only wiifi buddy FINDS mine...and then when I add it manually it shows up on scan in wifiboddy as Infrastructure. but still will not connect. It never FINDS mine in wifi settings menu.

thanks
[Android Software/Hacking General [Developers Only]] jtbnet:
I added the adhoc initially Manually with proper SSID... each time I switch back to Infrastructure then want to switch back to adhoc I need to 'fix' the ap_scan and priority in the /data/misc version... as what surprised me was that that was where these needed to be updated as fixing in /etc/... doesn't help....

The proceedure for Other tablets was just using the /etc/... files and there's even an app for that.... thus why I was so confused till I found it worked reliably once I started only editing the /data/misc file after setting up the etc/Wireless/RT... file Once...
[Android Software/Hacking General [Developers Only]] insight3fl:
ok! I get it now and will give it a try. Thanks much!
[Android Software/Hacking General [Developers Only]] bhood:
Of course! That was it. I simply had not set up my Google Checkout account. Thanks for pointing that out, Christian.

( I wish Android had actually told me that was the problem, instead of just enigmatically crashing. :mad: )