Toast-Kernel w/ vpn goodies - Hero CDMA Android Development

I have been testing this out for about a week now. My main goal is to fix the "VPN" support on the hero so its actually usable. So far what i have done is recompiled the kernel from toasts-eclair, created a boot.img, modules and a gumbo.sh to load the VPN modules.
This does include MT and OpenGL support in kernel.
This has been tested on DarchDroid v1 and the new Eris 2.1 hero rom by flipz and toast.
Everything works from the kernel side but I am still trying to see if anyone has a "WORKING" VpnServices.apk for this or can point me in the right direction.
boot.img installl
copy boot.img to /sdcard/
cat /dev/zero > /dev/mtd/mtd2
flash_image boot /sdcard/boot.img
adb remount
cd /system/lib
unzip /sdcard/modules.zip
Now push the gumbo.sh.txt to /system/init.d/gumbo.sh
if it doesnt exist create the init.d dir.
now reboot and you should have all the VPN kernel drivers for IPSEC/L2TP/PPTP
Also note depending on your rom, (non-aosp) you may have to boot into recovery to use flash_image.
Included the kernel config file from my kernel so if anyone wants to change the kernel.

Related

Trying to build a Clean 1.6 ROM, just rooted and a2sd for ADP1?

I have unpacked the boot.img from the HTC's new 1.6 ROM and try to learn from Cyanogen and TheOfficial's a2sd implementation.
I wonder if I don't need any extra features but root and a2sd, can I just use the original kernel without any loaded kernel modules? Can I just change the init.rc and add the a2sd script into boot.img? It seems cyanogen's a2sd script loads some modules.
I just try to minimize the changes to the "original" ROM. Is this possible?
you can use the original kernel, you need to change ro.secure to 0 in init.rc in the ramdisk to allow you to remount in adb, though this isn't essential. Also, you need to include busybox in either bin or xbin and either symlink the necessary (or all) functions or just call the functions expiclitly with "busybox mount"....

[Guide] - How to compile the CDMA kernel source and Flash it to your phone (Updated)

You should do a nandroid backup and reboot your phone before trying to flash anything to your phone. This how to involves flashing directly to mtd2, if you don't know what you are doing then please use one of the custom roms available in the Sticky Wiki.
#### Update One Fixed scripts
#### Update Two Added instructions to compile and install the wlan.ko module
#### Update Three Fixed get-CDMAHero-source.sh typo
#### Update Four Added Instructions for Jaunty repo's for Ubunut 9.10
First off i would like to give credit to all the people who have made information and scripts available. I used bits and peices of info and tools written by and or made available by these people.
Armin Coralic http://blog.coralic.nl for creating some nice scripts and making them available
chuckhriczko for helping me out in the middle of the night.
LoxDev for creating a wonderfull how to about creating img's and zip's
tkirkton for helping out with enabling legacy jaunty repos to install java 1.5
Second I am writing this How To, so a complete newbie would be able to understand.
REQUIREMENTS....
Ubuntu Desktop 9.04 or better 32bit (cause thats what i used)
Android SDK (Needed to push and pull files as well as shell access to the phone. You will need to set this up by following the instructions found at http://www.android.com)
Legacy repo's enabled in apt to allow java 1.5 to install
Root access. I ran all commands below as root
I created a dir called "heroc" in my /root directory.
Download zip file below and unzip it in the heroc dir that you should have created.
STEPS
.5 Enable Legacy Repo's to allow java 1.5 to install (below is a cut from tkirktons post on page 7)
Code:
in Ubuntu 9.10, the Java 1.5 package doesn't even list. Here's what I had to do to get it to load:
1. Access a repository from the previous build (9.04 Jaunty will work: commands to put into /etc/apt/sources.list -
deb [URL]http://mirrors.us.kernel.org/ubuntu[/URL] jaunty main restricted universe multiverse
deb [URL]http://mirrors.us.kernel.org/ubuntu[/URL] jaunty-backports main restricted universe multiverse
deb [URL]http://mirrors.us.kernel.org/ubuntu[/URL] jaunty-security main restricted universe multiverse
deb [URL]http://mirrors.us.kernel.org/ubuntu[/URL] jaunty-updates main restricted universe multiverse
2. Set the max age higher than the default. This can be accomplished by editing the /etc/apt/apt.conf.d/20archive. Here's what my lines in that file look like:
APT::Archives:MaxAge "2880";
APT::Archives:MinAge "2";
APT::Archives:MaxSize "1000";
Making these two changes should work...although I have the Intrepid, Hardy and Dapper repositories in mine as well (didn't know which one would work, so I overkilled it).
Run the script again after making the changes and let me know if it works.
.
to update just run
Code:
# apt-get update
1. Create your work environment by running createandroidRepo.sh. This will take some time depending on your internet connection. Make sure you are in the heroc dir.
Code:
# unzip Scripts.zip
# chmod a+x *
# ./createAndroidRepo.sh
This will create a dir call my android and setup all the files and programs needed to compile the kernel. This will take some time to complete.
2. You need to download the source using the get-CDMAHero-source.sh
Code:
# ./get-CDMAHero-source.sh
This will download the source, and extract it to its own directory.
3. you will need to have your .config file handy for the next steps. If you don't have it then you will need to get it by doing the following
Code:
# adb pull /proc/config.gz /root/heroc/config.gz
# gunzip config.gz
The first command will pull the gzipped config from your phone and place it into the heroc dir. the second command will extract the file as "config"
4. This is where it gets fun. We now have everything downloaded and are going to start the process of compiling our kernel.
Code:
# cd heroc_ef05d31a
# export ARCH=arm
# export CROSS_COMPILE=arm-eabi-
# export PATH=$PATH:~/heroc/myandroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# make menuconfig
After you run "make menuconfig" it will bring up a the config menu for our kernel. Go to the bottom and select "Load an alternate configuration file". It will then prompt you to select the config file you want to use. You will need to point it to where you have the config file. So type in "/root/heroc/config"
After you have loaded the config file you can edit what ever you want. however if you don't know what do disable or enable then i wouldn't mess around to much.
Next you will need to save your config file. Choose "Save an alternate configuration file", and save it as "/root/heroc/heroc_ef05d31a/.config"
You can now exit menuconfig
5. Time To Compile the kernel and wlan.ko module
Code:
# make
# export KERNEL_DIR=/root/heroc/heroc_ef05d31a/
# cd myandroid/system/wlan/ti/sta_dk_4_0_4_32/
# make
The kernel will take some time. go grab a drink and have a snack. If all goes well you should end up with a zImage file in "~/heroc//arch/arm/boot/". After the kernel is compiled you need to compile the wlan.ko module by executing the last three commands
6. Next we need to copy the zImage back to the heroc dir
Code:
# cp /root/heroc/heroc_ef05d31a/arch/arm/boot/zImage /root/heroc/zImage
7. Ok so now we need to get the boot image from our phone. We need this cause it has more than just the kernel. I contains the ramdisk image as well. and we need to take the boot image and decompress it and remove the old kernel and add our new compiled kernel, then recompress it to newboot.img
Code:
# adb shell
# cat /dev/mtd/mtd2 > /sdcard/mtd2.img
# exit
# adb pull /sdcard/mtd2.img /root/heroc/mtd2.img
# mv mtd2.img boot.img
The first two commands will open a terminal shell to your phone and copy the boot image to your sdcard. the last two commands will pull the the boot image from your phone, place it in your heroc dir and rename the file to boot.img
8. Now we will split apart the boot.img using some scripts.
Code:
# ./extract-kernel.pl boot.img
# ./extract-ramdisk.pl boot.img
# rm boot.img-kernel
# cp zImage boot.img-kernel
# ./mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
# ./mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
The first command extracts the stock kernel from boot.img. The second command extracts the ramdisk from boot.img. The third command will delete the stock kernel. the fourth command renames our zImage to boot.img-kernel. The fifth command takes boot.img-ramdisk folder and zips it up into ramdisk-boot. The sixth comand takes our kernel (renamed to "boot.img-kernel") and ramdisk-boot and combines it back to form a new file called newboot.img.
9. Now we need to flash our "newboot.img" file to our phone. You should reboot your phone before flashing this will insure that you don't get any out of memory errors and will keep your phone from booting into fastboot (Thx Obelisk79).
Code:
# adb push newBoot.img /sdcard/newBoot.img
# adb shell
# cat /dev/zero > /dev/mtd/mtd2 (you may get an error here. don't worry about it)
# flash_image boot /sdcard/newBoot.img
# reboot
The first command will push your boot image to the phone. the second command will bring up shell access to your phone. the third command will zero out mtd2 and get it ready to write your image. the fourth command will flash boot(mtd2) with newboot.img. the last command will reboot your phone
10. After the phone reboots we need to get the wlan.ko file to the phone so that wireless will work
Code:
# adb push /root/myandroid/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko /sdcard/wlan.ko
# adb shell
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cp /sdcard/wlan.ko /system/lib/modules/wlan.ko
# exit
Now you have a kernel that you compiles with everything work with the exception of power mgmt.
Just as soon as i figure out how to make an update.zip i will post instructions on how to do this
Added it to the CDMA Hero Guides wiki article.
gu1dry said:
Added it to the CDMA Hero Guides wiki article.
Click to expand...
Click to collapse
dang you beat me to it.
Not sure why, but had to run dos2unix on the the first script, not sure if it is all of them, but it was giving me the error
/bin/bash^M: bad interpreter: No such file or directory
Click to expand...
Click to collapse
dos2unix took care of the issue. Also Thanks for the guide, greatly appreciated!!!
make sure you run the script with the "./" , also you may need to chmod +x the files.
Is there a way to get this to run on the Emulator? I tried to specify the zImage after I compiled it but it won't boot when specifying it. Or will that not work for the HTC zImage?
Excellent guide. Can't wait to try it.
blehzz said:
Is there a way to get this to run on the Emulator? I tried to specify the zImage after I compiled it but it won't boot when specifying it. Or will that not work for the HTC zImage?
Click to expand...
Click to collapse
Check out this link
Check out this link
Click to expand...
Click to collapse
Thanks will have a look. Seems to be the Android kernel and not the HTC kernel though, but will read further into it
blehzz said:
Thanks will have a look. Seems to be the Android kernel and not the HTC kernel though, but will read further into it
Click to expand...
Click to collapse
not sure but i think this will work for you
Code:
# emulator -kernel /path/to/your/zImage
First script didn't work for me on ubuntu. Copying and pasting line by line works.
i'll repack the scripts again
not sure but i think this will work for you
Click to expand...
Click to collapse
that's what i tried... emulator never runs when i specify that zImage it built successfully.
Has anybody tried this yet with Ubuntu running under VMware on a PC running Windows? I know that (in theory) VMware's USB compatibility is spectacularly good (it somehow manages to give the guest OS direct ownership and control of the host PC's USB root hub), but up to now I've only tried it to run XP/32 under Vista/64 and Windows 7/64.
FYI, you can download VMware player for free (as in beer) and use it to run Ubuntu 9.04 with their complete blessing. Just make sure you download a guest OS that configures the hardware (memory, cpu, etc) the way you want it to be, because changing the hardware config is one of the few things you genuinely can't do with the free player. If someone here has the full version (and can find somewhere to host it so the bandwidth charges didn't eat him alive), he could even create an Ubuntu distro that's already set up and configured to build Android kernels for others here to download and use.
To use the first script: open up Synaptics, then download "tofromdos". Now, run "fromdos createAndroidRepo.sh", and it should work then
ROM?
Can someone post how to compile a kernel, and make a ROM, and put it all together in a update.zip? Would be really REALLY nice!
Jason(bikcmp)
Thanks for this guide I'm compiling a kernel right now Just a question, how do I change the kernel version name... like you did in that one screenshot?
bikcmp said:
Can someone post how to compile a kernel, and make a ROM, and put it all together in a update.zip? Would be really REALLY nice!
Jason(bikcmp)
Click to expand...
Click to collapse
Its coming
bikcmp said:
Can someone post how to compile a kernel, and make a ROM, and put it all together in a update.zip? Would be really REALLY nice!
Jason(bikcmp)
Click to expand...
Click to collapse
its in general options in menuconfig.

[HACK] (!update 04/26/2010) JIT enabled Dalvik VM on Android 1.6 (Dusted Donuts)

Update (fix for /cache/dalvik-cache 04-26-2010): Really only use this if your having issues using the symbolic link fixes posted by other members or are just out of free space on /cache. First the new issues people are experiencing is in cm-based-kernels from 4.2.15.x and not JIT enabled DalvikVM and people using danger/death spl will experience problems faster. Lack of space on /cache is a problem and will cause market downloads to fail as well as email attachments. The other problem is the kernel fails for various and unknown reasons to mount bind /cache/dalvik-cache to /data/dalvik-cache.
The other issue is the use to dalvik-cache clearing scripts and options in RA recovery, stop clearing your dalvik-cache, the .dex files are created when missing and you do not get any benefits by doing so and cause more wearing leveling of NAND, plus the script in RA recovery doesn't appear to look at /cache/dalvik-cache for dex files. This little update script (when installed correctly).
Understand that /cache/dalvik-cache is a newer option as a means to free up space on /data is by using /cache/dalvik-cache as a first storage of dex files then using the standard /data/dalvik-cache for over flow of dex files and newer installed apps. Somewhere along the way something may throw this and you get douplicate dex files in both locations, one way to check is to boot into recovery and
Code:
mount -a
and check dalvik-cache directories in both /cache and /data for douplicate dex files.
The script will fix these issues, or should at least:
Endless loop FCs on boot
broken /cache/dalvik-cache mount
no binded mount
missing user apps
missing system apps
failed market downloads
non-working symlink patches and installers (no need to run these, they will break this patch)
fixes duplicate dex files in both /cache/dalvik-cache and <target>/dalvik-cache (because it deletes /cache/dalvik-cache)
Will not Fix:
your ignorance
your unwillingness to read
your unwillingness to learn
your compulsive ROM flashing disorder
your compulsive dalvik-cache clearing syndrome
version 1.1.1(updated 4/27/2010 @ 10:10 PM) is current and was slapped together from Phonekenstein, it doesn't look for the existance of /cache/dalvik-cache it assumes it's there and deletes it wether it's a directory, a symlink or a file, re-creates a new empty /cache/dalvik-cache with Android default permissions and mount binds it to /data/dalvik-cache (be it a directory, a symlink or another binded mount) /cache/dalvik-cache will follow the target /data/dalvik-cache (no worries for apps2sd users or non-apps2sd users).
Script will turn on the blue LED when booting so you know it executed (if it annoys you then edit the script and make it pink)
Tested on Cyanogen MOD 4.2.15.1 and SuperD 1.10.3:
with and without apps2sd
with and without a /dev/block/mmcblk0p2 (apps2sd script nulled)
with and without a custom /dev/block/mmcblk0p4
with mount binded /ext/dalvik-cache (mmcblk0p4) to /data/dalvik-cache
with /data/dalvik-cache as a symbolic link to /ext/dalvik-cache (mmcblk0p4)
All scenarios experienced no failures as long as you set your permissions correctly on all targets and files and /cache/dalvik-cache followed and binded flawlessly.
install is simple and can be done through terminal:
1. download 86dalvik-cache-fix <--Long press and chose "save link as" (also attached to this post)
2. open terminal and issue these commands:
NOTE: COMMANDS ARE CASE sensitive in LINUX and as such ANDROID!!!!!!
ALL OFF THESE COMMANDS ARE IN lower case. SO Turn off your Auto-Caps options in your keyboard options. These command assume you downloaded the script using your the web browser on your G1/Magic whatever phone and the file is located in /sdcard/download (the default location for web browser downloads).
Code:
su
mount -o rw,remount /system
cp /sdcard/download/86dalvik-cache-fix.txt /system/etc/init.d/86dalvik-cache-fix
chown 0:2000 /system/etc/init.d/86dalvik-cache-fix
chmod 755 /system/etc/init.d/86dalvik-cache-fix
sync
reboot
Why 86dalvik-cache-fix? We want the script to execute after all scripts in /system/etc/init.d/ including /system/sd/userinit.sh (if you are using one) and before script 99. 86 because in 1987 everything got 86'd.
If you are having a problem getting the script to execute, copy it or merge it into /system/sd/userinit.sh (even if you aren't using a mmcblk0p2(ext partition)) it may make it work with FastTest builds, however the permissions on his builds appear to be root everything and I have problems getting the script to execute out of /system/etc/init.d even with root permissions.
--------------------------------------------------------------------------------------------------------------
Primer: Read this about Dalvik VM http://en.wikipedia.org/wiki/Dalvik_virtual_machine
Read this to: Google Groups post about JIT compiler for Dalvik VM from Android-Platform Link
From the post we see that this particular compiled library is ALPHA, so results can vary, but from reading most posts in this thread the results are right near the talked about 3x faster code, stability is going to vary on what apps and or widgets are running. More Widgets = slower performance as these have processes that are eating cycles. When testing with Linpack wait for the advertisement to load first then tap the benchmark button and remove your finger from the touch screen. Background process such that interrupt or having auto-rotate enabled while testing is going to give you slower benchmarks.
In short your apps should load faster and run faster, particularly 3D games. The web browser is faster and you can actually scroll through pages even while graphics are still loading.
The reboot when enabling it is long even appearing to hang at the G1 Screen for 5 minutes or more but once it starts booting past this you will know that your ROM is compatible. The cause is that the dex files are being optimized, after about a third reboot, your ROM should feel pretty snappy and launching apps should be quicker as well as switching apps. The snappiness lasts as well and as some may have said that it's a placebo effect are wrong. Bench mark readings prove it and more importantly a few ROM builders have included this in their 2.1 ROMs as experimental.
The libdvm.so that t3steve cross compiled for the DROID at the time was for Android 2.0, the library works for with newer ROMs Android 1.6 that have some eclair pieces built into the kernel, CyanogenMOD has been using bits and pieces for a while now, if other ROM builders have been using his kernel and framework than a good chance it will work for your phone as well.
I have nothing to do with the compiling of this or the exact functions of enabling JIT except that I had a hunch that the combo might work and it did, so I'm sharing it.
If you aren't good at typing in commands, or don't know how to extract a zip file and understand that a sub folder may or may not exist where you have extracted said zip file to, well.... you may run into some issues, maybe a video tutorial for basic command line on youtube would be a good place to learn.
I wanted to make a very detailed post on www.andoidonroids.com about how to mash the JIT enabled Dalvik VM library into Android 1.6 Donuts I'm calling the hack "Dusted Donuts" and take from the name for what you will. I have been using the JIT enabled Dalvik VM for about two weeks and i runs decent but not perfect. Anyhow a death in the family Sunday has kept me from making a decent post and haven't had the time to get to the website and post and cross post and give credit where due.
No doubt that aaraya1516 broke the news on http://forum.xda-developers.com/showpost.php?p=5703076&postcount=193 as he was first to break the hack on FastTest, not taking anything away from him on that.
My testing goes back two weeks or more even during the 580mhz & 780mhz hack, I was waiting for someone to compile a boot.img with some 2.x stuff and sure enough the carlospants boot.img from ctso worked with enabling JIT for Dalvik VM, but as we know now the overclocking doesn't work at the moment.
Thank Cyanogen and t3hSteve of which may not know that this was entirely possible. Cyanogen mixed in enough Eclair into his Donuts (he's like Willy Wonka) that makes it possible to use the cross compiled JIT enabled Dalvik VM library from 2.1 for the Motorola DROID 2.0.1 libdvm.so that t3hSteve of www.alldroid.com compiled for the custom roms on Droid.
WARNING: Using other methods supplied from other forum members that include replacing the build.prop may cause problems, using the build.prop from the original VMLIBS.ZIP (which is here for reference and original source for libdvm.so) is definitely going to cause ROM and application problems. Hello....use your head here... the VMLIBS.ZIP is for Motorola DROIDS, why would you put the build.prop file for a DROID on your G1 and expect your apps or ROM to work afterwards? It's so simple, you need 1 file, it's called libdvm.so it goes in /system/lib a file by the same name already exists there and it's in your best interest to at least back it up before overwriting it and gives you the ability in the event that your system doesn't boot up you can restore it through recovery console and get your phone to boot past the G1 screen.
FYI: Some ROMs have the option dalvik.vm.execution-mode=int:fast in the /system/build.prop file, this would need to be changed to dalvik.vm.execution-mode=int:jit or commented out or deleted. If you want to play with advanced options create /data/local.prop and fiddle in there with options available from typing dalvikvm -h in your console or terminal app.
Required:
1. Android 1.6 ROMS with a bit Eclair stuff in the Kernel and framework such as Cyanogen ROM 4.2.x, Super D 1.8 - 1.92, WG Y2.6, FastTest, KingKlick Eclair and more.. This libdvm.so works on Android 2.1 as well as it seems it should.. 1 st bootup is slow and I recommend you let it sit even when desktops are up for a couple of minutes and then reboot it, 2nd and 3rd bootups are faster and smoother response overall even for long durations, days.
FIX YOUR FILE SYSTEM FIRST !!!!!! Got to do it from Recovery Console, It's partly the cause of poorly running ROMS and takes seriously longer to type the command than to fix your unknowingly faulty file system. EXT2 is the worst offender and the built in function to repair falls short, even more so when checking EXT4.
Code:
#e2fsck -fcpDC0 /dev/block/mmcblk0p2
#reboot recovery
For the lazy fingers
#e2fsck -fcpDC0 /*/*/*0p2
#reboot recovery
1. Download www.androidonroids.com/dusted-donuts (File has 3 scripts backup, install, restore, 2 folders, 1 libdvm.so)
2. Extract zip to root of /sdcard or where ever you like (the zip has a folder containing the files named dusted-donuts)
3. Open Terminal or go to Recovery Console
FYI when running the install through Terminal your system may freeze or reboot and if it does I highly recommend that you prepare to enter Recovery Mode and check your file system. EXT2 corrupts quickly choosing this for apps2sd to use is not the best option especially if you are using custom ROMs that may lockup or reboot, basically that's a crash.
Code:
$su
#mount -o rw,remount auto /sdcard
#cd /sdcard/dusted-donuts
#sh backup
#sh install
#sync
#reboot
Check the Dalvik VM execution mode. look at the bottom line with_jit means the it is installed , and look at all of those options that can be jammed into your build.prop and local.prop files
Code:
$su
#dalvikvm -h
Phone won't boot past G1 screen? Go to recovery console and restore libdvm.so (give it at least 5 minutes first before giving up)
Code:
#mount -o rw,remount auto /sdcard
#cd /sdcard/dusted-donuts
#sh restore
#sync
#reboot
---------------------------------------------------------------------------------------------------------------------
prefer to use VMLIBS.ZIP from t3hSteve? This is how you can install using that.
Required:
1. Android 1.6 ROMS with a bit Eclair stuff in the Kernel and framework such as Cyanogen ROM 4.2.x, Super D 1.8 - 19.2, WG Y2.6, FastTest, KingKlick Eclair and more.. This libdvm.so works on Android 2.1 as well as it seems it should..
How to install: (easier to go in recovery mode but can be done through terminal)
1. Download the VMLIBS.ZIP from t3hSteve of allroid.com http://alldroid.org/download/file.php?id=1374
2. You only need the libdvm.so file of which appears to be JIT enabled by default.
3. Backup the original libdvm.so #cp /system/lib/libdvm.so /sdcard/libdvm.so
4. Copy the JIT enabled libdvm.so #cp -f /sdcard/vmlibs/libdvm.so /system/lib/libdvm.so
5. Set permissions on the file #chmod 644 /system/lib/libdvm.so
Optional for disabling: (easier to do vi through recovery console, since the back key escapes out of terminal)
To disable JIT MODE but want to keep the libdvm.so create a local.prop in /data and add dalvik.vm.execution-mode=int:fast
#vi /data/local.prop
press the i key to enter vi interactive mode
type dalvik.vm.execution-mode=int:fast
press back key to exit vi interactive mode
to write the file out and quit vi type :wq
or
restore your backed libdvm.so file from the sdcard.
-----------------------------------------------------------------------------------------------------------------------
Enjoi! the dusted donuts,
-Licknuts (me? I'm like Varuca Salt, I want another pony)
Vendor G1 roms around 1.2 Mflops, Custom G1 roms are around 2.4 MFlops/s and with JIT compiled Dalvik VM 3.6 MFlops/s. At most you will see 3.5 MFlops/s fairly consistently with a minimal load on your system and highs at 3.7 Mflops/s. Test before and after using Linpack from the Market, it's free.
The 13.236 Mflops/s is not normal and you will probably not see with your testing, I have seen 5.x & 7.x but these are far and few between and this took a while with tweaked configurations/settings with a persistent app to kill processes, it is attainable and I hope a ROM developer finds the sweet spot to exploit.
Looks nice.
Pre-JIT enabled: 2.194 Mflops/s
Post-enabled: 3.459 Mflops/s
Not quite getting the results you have there.
Running SuperD 1.9.2 Black W/ Nexus Theme. I copied it twice to make sure that the libdvm.so was copied correctly to the directory. Rebooted the phone, same results. Looks very promising though. If I did something wrong, lemme know.
Managed to get #10 on G1 Benchmarks with 3.583 Mflops/s... still nowhere near 13.~ Mflops/s
same here. Running Super D 1.9 on my magic
before JIT I got 1.xxxx Mflops/s
after i have 2.xxxx Mflops/s
how do you get the 13 Mflops/s ?
-edit-
with swap disabled i'm getting 3.5 Mflops/s
h.nocturna said:
Looks nice.
Pre-JIT enabled: 2.194 Mflops/s
Post-enabled: 3.459 Mflops/s
Not quite getting the results you have there.
Running SuperD 1.9.2 Black W/ Nexus Theme. I copied it twice to make sure that the libdvm.so was copied correctly to the directory. Rebooted the phone, same results. Looks very promising though. If I did something wrong, lemme know.
Managed to get #10 on G1 Benchmarks with 3.583 Mflops/s... still nowhere near 13.~ Mflops/s
Click to expand...
Click to collapse
I got 9 seconds on the pi benchmark
What will this do??
samsara00 said:
same here. Running Super D 1.9 on my magic
before JIT I got 1.xxxx Mflops/s
after i have 2.xxxx Mflops/s
how do you get the 13 Mflops/s ?
-edit-
with swap disabled i'm getting 3.5 Mflops/s
Click to expand...
Click to collapse
So I guess this only works with Swap off?
sabin123 said:
What will this do??
Click to expand...
Click to collapse
Speed your *hit up!
it works with and without swap.
Just the benchmark result is better when swap is turned off.
Got nearly the same as samsara00:
Rom: SuperD 1.9.2
Before (swap off): ~ 2.3 MFlops/s
After JIT enabling (swap off): ~ 3.5 MFlops/s
But the increase to 13.x seems so unreal, why is there only one result that high in the toplist of greene.com!?
Now to find out if this actually speeds up everyday use lol
CM4.2.14.1
Before: 2.3
After: 3.5
Wow! This made my 3G connection faster too. Was only getting 1500kbps before, now getting on average 3200kbps. Awesome. I'm located in Toronto, on Rogers.
Question: Is this Google's JIT? Will Myraids Dalvik Turbo be faster?
Doesn't boot past the G1 screen when using Dwangs 1.17.1 Assume thats because it has no Eclair in it, but it was worth the dream .
Waw!! great works!!
left is before - right one is after
on CM 4.2.14.1, enabled Swap 64MB, CC ON, RAM Hacked
So do we copy the zip to the root of our sd card? Do I extract it first and just copy the one file? The instructions are kind of vague.
G1ForFun said:
So do we copy the zip to the root of our sd card? Do I extract it first and just copy the one file? The instructions are kind of vague.
Click to expand...
Click to collapse
Not to be rude, but if you don't understand those directions, this isn't the sort of thing you should try to do yourself. Wait for a ROM builder to add this in. The directions are perfectly clear, you just need to understand command line use.
If you want to learn something about CLI use, install Linux on your computer and learn to use it without the GUI. If you don't want to do that, google for "cygwin" and use the bash shell they provide for Windows based machines.
Personally, I used adb and just pushed the darn file lol works perfectly fine, like everything else I've ever pushed. Just don't forget to set the permissions for the file.
tried in a terminal and with adb getting read-only file system when trying to copy over the libdvm.so file
SilentTweak said:
Personally, I used adb and just pushed the darn file lol works perfectly fine, like everything else I've ever pushed. Just don't forget to set the permissions for the file.
Click to expand...
Click to collapse
Nothing wrong with adb. Hell, I used SSH to do it. Just about anything will work, you just have to know what you're doing.
Damn.... I just rebooted and it took about half the time it used to.
Tried the Linpack benchmark, getting about 3.5 with SuperD 1.9.2 w/Compcache 16M swappiness=10. Fresh reboot, obviously. Lock your CPU to 528 (min and max) for more consistent results. When I have 128min 528max, it gives different results depending on the current CPU speed. SetCPU or Overclock Widget helps a lot here. No instability noticed yet, but this should probably be considered an unstable hack for now till we all get more experience with it. I know OpenEclair removed the JIT VM because of stability problems.
Sgt.EddieWinslow said:
tried in a terminal and with adb getting read-only file system when trying to copy over the libdvm.so file
Click to expand...
Click to collapse
Do "adb remount" first
ttabbal said:
Not to be rude, but if you don't understand those directions, this isn't the sort of thing you should try to do yourself. Wait for a ROM builder to add this in. The directions are perfectly clear, you just need to understand command line use.
If you want to learn something about CLI use, install Linux on your computer and learn to use it without the GUI. If you don't want to do that, google for "cygwin" and use the bash shell they provide for Windows based machines.
Click to expand...
Click to collapse
Obviously they are not clear to me. Why argue the point?
I have worked plenty with cmd type interfaces...so please...put down your know it all stick and be helpful.
edit: hope this helps somebody else...look better instructions posted in the fasttest thread!
download files here and copy them on the sdcard
created a folder /sdcard/jit and put the three files in it
make a folder /sdcard/dalbk and copy the original files
adb pull /system/build.prop .
Open in WordPad/Textpad and add as the last line: dalvik.vm.execution-mode=int:jit
SAVE IT, copy/push it on the /sdcard/jit folder
Sgt.EddieWinslow said:
tried in a terminal and with adb getting read-only file system when trying to copy over the libdvm.so file
Click to expand...
Click to collapse
Code:
C:\Android\tools>adb shell
# su
su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system/lib/libdvm.so
chmod 777 /system/lib/libdvm.so
# cp -f /sdcard/vmlibs/libdvm.so /system/lib/libdvm.so
cp -f /sdcard/vmlibs/libdvm.so /system/lib/libdvm.so
# chmod 644 /system/lib/libdvm.so
chmod 644 /system/lib/libdvm.so
# reboot
Damn.... I just rebooted and it took about half the time it used to.
Click to expand...
Click to collapse
Indeed
Licknuts result : 3.1-3.5 (with Super-D 1.9.2)
My method of installing it:
adb remount
adb push libdvm.so /system/lib/libdvm.so
Then open console and type:
su
chmod 644 /system/lib/libdvm.so
reboot
I'm about to try this myself.. has anyone noticed an overall increase in speed? Benchmarks are great but it's all about how it actually performs!
I'll post my own findings in a bit.

[HOWTO] Enable init.d on stock *rooted* Desire roms

If you are like me and you like your stock Desire rom, you rooted it using unrEVOked or some other methods, you made some custom adjustment to it and you really don't want to load a fully fledged 3rd party rom but still, you'd like to tweak it a little bit more, you'll quickly realize that you are going to need a working init.d system in order to start custom scripts on boot.
This thread will try to explain how to add init.d support to your rom, without needing to flash a new rom and wipe everything, we're just going to flash a new boot.img.
Requirements
Rooted HTC Desire
New modified boot.img, supported firmware versions: 2.10.405.2, 2.29.405.2/5, check your firmware version here: (Settings -> About Phone -> Software information -> Software number)
Download this one: View attachment boot_2.10.405.2.zip if your "Software number" is: 2.10.405.2
Download this one: View attachment boot_2.29.405.2_5.zip if your "Software number" is: 2.29.405.2 or 2.29.405.5
Make sure you download the one matching your "Software number", the wrong one will cause boot loops and weird behaviors.
ADB shell access
flash_image binary, usually provided by unrEVOked under /data/local/flash_image but if you don't have grab it here: View attachment flash_image.zip
busybox correctly installed under /system/xbin
HOW-TO
NOTE: if your Desire is not S-OFF (meaning you can't write to the /system directory), you'll need to do the whole procedure in recovery mode.
Do a nandroid backup, this in order to save your current boot.img, and also because it's never a bad idea
Make sure the nandroid backup went ok
Check your exact firmware version (Settings -> About Phone -> Software information -> Software number) and download the corresponding modified boot.img
Copy and unzip the downloaded boot.img to your sdcard or wherever you like it
Obtain adb shell access, become root (su) and wipe the existing boot image with:
Code:
cat /dev/zero > /dev/mtd/mtd2
ignore the "write: No space left on device", it's normal.
Flash the new boot image:
Code:
flash_image boot /sdcard/boot.img
where "/sdcard/boot.img" is the path where you copied the downloaded boot.img
Remount the /system partition read-write if you're not in recovery mode:
Code:
mount -o remount,rw /system
or mount it if you are in recovery mode:
Code:
mount /system
Create the init.d directory where all the custom boot scripts will be executed:
Code:
mkdir /system/etc/init.d
and set permissions:
Code:
chmod 755 /system/etc/init.d
Important: unzip and copy the View attachment 99complete.zip script to the newly created /system/etc/init.d/99complete, set permissions:
Code:
chmod 755 /system/etc/init.d/99complete
and ownership:
Code:
chown root.shell /system/etc/init.d/99complete
Failure to do so will cause a boot loops.
Cross your fingers and reboot! If anything goes wrong you can always boot into recovery and fix errors or you can restore the nandroid backup (you can just restore the boot.img if you don't want to do a full restore).
From now on, every script you put inside /system/etc/init.d will be executed at boot before almost any other initializations. Make sure you set the correct permissions to your scripts (i.e. 755).
Thanks to: teppic74 for providing stock roms with init.d support (thread) where I extracted the boot images.
Technical explanation
The provided boot.img are the original HTC provided boot.img with the init.rc script modified to stop the init process until the cm.filesystem.ready property is set to 1:
Code:
start sysinit
on property:cm.filesystem.ready=1
class_start default
where the sysinit service is the service in charge of starting all the scripts inside /etc/init.d:
Code:
# Execute files in /etc/init.d before booting
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
and the last of this script, 99completed, only sets that property to 1 so the normal system boot can continue:
Code:
#!/system/bin/sh
sync;
setprop cm.filesystem.ready 1;
of course changing init.rc is only possible by flashing a new boot.img with init.rc modified inside the ramdisk because that file, even if you can see it under / will be overwritten at every boot.
Another small modification of the new boot.img is the default.prop, in which rc.secure is set to 0 allowing to gain direct access through "adb shell"
Sounds great
Thx for your work!
So if I get that right, it's the same as if we'd flash teppic74 ROM, and nandrestoring everything except system & boot?
Just our stock ROM with init.d support?
Does that also mean we could flash the optional mods from teppic74 thread like a2sd?
Ty again!
Puenos said:
Sounds great
Does that also mean we could flash the optional mods from teppic74 thread like a2sd?
Ty again!
Click to expand...
Click to collapse
Well you could but effectively all you need is an apps2sd+ script and you can adb push it to the correct location. /system/etc/init.d
Really? I would have tried flashing either a2sd provided in teppic74's thread or even a2sd script by DT? last I would have compared to firerat's script. But if all you need to do is pushing via adb.. Is there a script out for a2sd especially for stock/sense? (like kali advised using firerat with CM?)
Thank you
Not sure to be honest, I haven't used sense for a long time. But assume if the one teppic uses on his, works - it should work for you too.
I'm just using Sense because of it's Mail-widget, haha
But I guess I'll just give it a try then, will report back, when I've managed so set everything up without having my phone exploding, hehe
But thank you very much
exactly this boot.img will just enable init.d support, no need to flash a new system.img but you just need to create the init.d directory and put the 99complete script, after that you can install any mod you like, also the ones provided in teppic74's thread.
You can also try data2whatever by melethron (that's what I'm using), just make sure you have busybox correctly installed.
hope you enjoy it and happy new year!
well I hv software number 2.11.832.3 so what I hv to do...?
r3vb07inf said:
well I hv software number 2.11.832.3 so what I hv to do...?
Click to expand...
Click to collapse
unfortunately I don't have a boot.img for that software number, you'll need to manually extract your boot.img, modify a file (init.rc) and reflash it, if you don't know how to do it I can try to do it for you but I'll need a download link for your original firmware version
You could make a universal (froyo) update zip using Koush's AnyKernel installer, then you're able to update the ramdisk only and add the init.d folder/script. Thats how i did it for CM7.
worstenbrood said:
You could make a universal (froyo) update zip using Koush's AnyKernel installer, then you're able to update the ramdisk only and add the init.d folder/script. Thats how i did it for CM7.
Click to expand...
Click to collapse
interesting, an update script that can extract the boot.img, unpack, change files, repack it and reflash it...is it safe? I may think about building an update.zip this way but I'm pretty scared by how safe it can be to automatically mess with a boot.img..
EDIT: one problem of this is that the init.rc needs to be extracted and modified, but it may be different from one firmware and another
moebius83 said:
interesting, an update script that can extract the boot.img, unpack, change files, repack it and reflash it...is it safe? I may think about building an update.zip this way but I'm pretty scared by how safe it can be to automatically mess with a boot.img..
EDIT: one problem of this is that the init.rc needs to be extracted and modified, but it may be different from one firmware and another
Click to expand...
Click to collapse
Should be the same between all froyo rom's. Check this update zip, it's for gingerbread tho, you have to replace the ramdisk-new.gz with a froyo one (with edited init.rc offcourse). It also contains /system/etc/init.d/99complete.
Edit: Don't be scared, everyone who releases custom kernels uses this method. The other way around then, keep the original ramdisk and merge it with the new kernel.
Hello there
Really appreciate all your efforts
Kindaa feeling real dumb in comparison! lol
Anyways
My Desire specs :
2.2
2.32.415.3
Baseband 32.49.00.32U_5.11.05.27
Now this has built in arabic enabled support and that is the main reason I would like to keep it
Am yet to run into a custom ROM that would provide that without having to downgrade my version
Also, had a lotta fun trying to root, just couldn't root, up untill a few days back when unrevoked came out with thier new 3.3 version
I noticed you had only two software versions from which to start...
So what about my case? could you please help this newbie along?!!
docnasef said:
Hello there
Really appreciate all your efforts
Kindaa feeling real dumb in comparison! lol
Anyways
My Desire specs :
2.2
2.32.415.3
Baseband 32.49.00.32U_5.11.05.27
Now this has built in arabic enabled support and that is the main reason I would like to keep it
Am yet to run into a custom ROM that would provide that without having to downgrade my version
Also, had a lotta fun trying to root, just couldn't root, up untill a few days back when unrevoked came out with thier new 3.3 version
I noticed you had only two software versions from which to start...
So what about my case? could you please help this newbie along?!!
Click to expand...
Click to collapse
Same thing happens to me. My spec:
2.2
2.13.707.1
32.44.00.32U
Can you help as well? Or where or how (from RUU) can I find the ramdisk-new.gz as worstenbrood's mention.
mumu_li said:
Same thing happens to me. My spec:
2.2
2.13.707.1
32.44.00.32U
Can you help as well? Or where or how (from RUU) can I find the ramdisk-new.gz as worstenbrood's mention.
Click to expand...
Click to collapse
Thanks "worstenbrood" then I can extract boot.img from stock rom. Based on the guide, I made a new boot.img. But with this new boot.img, the phone hangs at the first screen(waiting at least for 15 mins). I don't know why. I also did as worstenbrood suggest and the system boot loopless.
Can somebody help?
I attached my boot.img (original and modified) for your information.
mumu_li said:
Thanks "worstenbrood" then I can extract boot.img from stock rom. Based on the guide, I made a new boot.img. But with this new boot.img, the phone hangs at the first screen(waiting at least for 15 mins). I don't know why. I also did as worstenbrood suggest and the system boot loopless.
Can somebody help?
I attached my boot.img (original and modified) for your information.
Click to expand...
Click to collapse
did you create the /system/etc/init.d directory and the 99complete file with the correct permissions? as noted on the OP this is needed because that file will tell the boot process to continue, otherwise you'll be stuck at the boot screen
EDIT: also, do you have busybox installed under /system/xbin?
docnasef said:
Hello there
Really appreciate all your efforts
Kindaa feeling real dumb in comparison! lol
Anyways
My Desire specs :
2.2
2.32.415.3
Baseband 32.49.00.32U_5.11.05.27
Now this has built in arabic enabled support and that is the main reason I would like to keep it
Am yet to run into a custom ROM that would provide that without having to downgrade my version
Also, had a lotta fun trying to root, just couldn't root, up untill a few days back when unrevoked came out with thier new 3.3 version
I noticed you had only two software versions from which to start...
So what about my case? could you please help this newbie along?!!
Click to expand...
Click to collapse
@ moebius83
If you could help, I would really appreciate it...
Please take into consideration That I am more or less android dumb!
I attached the url for my original RUU if that helps?
http://www.mediafire.com/?ih3lbbm7yfag7d2
Would REALLY appreciate your help.
Thanks m8!
mumu_li said:
Thanks "worstenbrood" then I can extract boot.img from stock rom. Based on the guide, I made a new boot.img. But with this new boot.img, the phone hangs at the first screen(waiting at least for 15 mins). I don't know why. I also did as worstenbrood suggest and the system boot loopless.
Can somebody help?
I attached my boot.img (original and modified) for your information.
Click to expand...
Click to collapse
i created a update.zip which replaces the ramdisk only and add /system/etc/init.d/99complete. It should work for every froyo release.
worstenbrood said:
i created a update.zip which replaces the ramdisk only and add /system/etc/init.d/99complete. It should work for every froyo release.
Click to expand...
Click to collapse
great job, I was just going to make the same update.zip, you were faster, I'll link it on the OP, thanks again!

[KERNEL] Enabling Netfilter/AFWall+ on Ainol Novo 7 Paladin (MIPS)

I spent entirely too much time on this, so I'll post my boot.img and my findings here in case it's useful to anyone else in the future.
Paladin ROMs:
This page and this thread have working links to CWM and Superuser zips.
This page has a link to an ICS 4.0.3 ROM running Linux 3.0.8. I installed this ROM, but was disappointed with the kernel's feature set. Important options like CONFIG_IP_NF_TARGET_REJECT and CONFIG_IP_NF_TARGET_LOG were disabled.
This page has a custom ROM by "pinkflozd". I wasn't able to find this image in the wild. It may have a newer kernel (3.0.23?) but AFAICT it doesn't have the Netfilter changes I needed either.
Custom kernel build:
I stumbled across this kernel and used it as a baseline. Then I enabled:
Various missing Netfilter features (e.g. LOG and REJECT targets)
CONFIG_TUN
CONFIG_CIFS
The process looks like:
Install CWM
Find the .zip file for the ROM you want to use, e.g. the ICS 4.0.3 link above
Install that ROM and make sure the stock kernel works
Create a new boot.img with the desired options enabled
Flash the new boot.img with CWM
Basic steps to create the new boot.img:
Code:
git clone -b paladin-3.0.8 git://github.com/cernekee/linux
cd linux
git submodule init
git submodule update
cd paladin
cp /path/to/boot.img orig.img
make NDK=/opt/android-ndk-r9b
# if desired, edit kernel code or .config, and rerun "make"
The scripts under linux/paladin/ will extract the ramdisk from orig.img, then create a new boot.img based on your kernel source tree. For more details on the kernel build, see paladin/README .
Kernel installation:
To flash the new image, reboot into CWM, then:
Code:
adb push boot.img /tmp/
adb shell "dd if=/tmp/boot.img bs=1048576 seek=3 count=8 of=/dev/block/mmcblk0 ; sync"
# hit the reset button again
Other random findings:
I did not have any luck with the "z4root" app, although ro.secure=0 on this ROM so "adb shell" always gives you a root shell. It did take some work to find Superuser/su binaries that worked on MIPS.
Enabling Netfilter's conntrack option seemed to cause dhd.ko to become unstable, possibly because it affected binary compatibility with existing kernel modules. So I left it alone.
This ROM is missing native iptables/ip6tables binaries, so AFWall needs to be set to use the builtin copies. The latest AFWall betas do ship with MIPS binaries now (the purpose of this exercise was to test them).
Checking the box to enable IPv6 crashes AFWall instantly. Need to investigate this.
AFWall's inbound connection option probably will not work, due to the lack of conntrack in the kernel.
This ROM appears to be missing some Java libraries needed for ICS+ VpnService apps to work.
NDK r9b is the first NDK release with support for the "MXU" SIMD instructions supported by the Ingenic JZ4770 chip. Prior to this, most people used Ingenic's special toolchain to build the kernel.
To forcibly boot into CWM, hold down VOL+ while pressing the reset button.

Categories

Resources