ksplice in android we need developers/hackers - G1 Android Development

ok this is a simple one ksplice works in perl and perl works in ase.apk/gscripts.
however we need to get a verified working ksplice in our android for another project. as this will benefit other projects on here i made a new post. ideas how-to's and files are welcome i will update first post along with who did what so we all benefit.

Quick correction: GScript only runs shell scripts. Android-Scripting ( http://code.google.com/p/android-scripting/ ) on the other hand allows shell, and has interpreters for Beanshell, Lua, Python, and Perl.

isnt ksplice to project to mod kernel without having to compile or reboot?

That's exactly what it is. We've found a use for the project in the RAM mod, which requires a kernel patch to re-allocate memory from the GPU. What we're hoping is to be able to re-patch this on the fly so that when the GPU needs the memory back we can restore it programmatically without having to reboot the device.

Related

Android Native Linux compiling

I'm not sure if this is the right forum, but XDA is really the only place I can figure to ask.
I've been looking for a way to compile linux applications to run on the command line, for instance nano or lynx. I've found the "agcc hello.c -o hello
" method, but the builds I'm trying for are defendant on ./configure.
I've got a working toolchain, and can even compile android itself, and I've got agcc working. I just can't figure out how to get them all working together.
Any help?
In the ./configure, you need to point it to your compiler (i.e. "agcc").
Try "./configure --help" to see the options it is looking for to make this configuration.
I think you have to set up an arm-eabi cross compiler.
You can try the android native development kit:
http://developer.android.com/sdk/ndk/1.5_r1/index.html
I think this is designed to make native components for the normal dalvik android apps, but it may have useful information.
maxisma said:
I think you have to set up an arm-eabi cross compiler.
Click to expand...
Click to collapse
He did.... agcc is a script that runs it.
RoboPhred said:
You can try the android native development kit:
http://developer.android.com/sdk/ndk/1.5_r1/index.html
I think this is designed to make native components for the normal dalvik android apps, but it may have useful information.
Click to expand...
Click to collapse
NDK creates libraries that can be called from within native apps (i.e. shared objects). It does not create native executables.
This should help?
http://forum.xda-developers.com/showthread.php?t=431329
I've made a wee bit of progress.
My current set up is this:
Step 1: Download this
Step 2: Push it to /system/sd/usr
Step 3: Remount system AND root partitions, then symlink /system/sd/usr to /usr. Then, mkdir /tmp.
Step 4: Push sources to /system/sd. Change working directory to your extracted source file, then run ./configure --host=armv6l-unknown-linux-gnueabi --with-build-cc=/bin/gcc
Step 5: ????
Step 6: Profit
I'm still working out the bugs here, and I'll report back when I've got something working. Currently, I'm trying to compile GNU Make for Android.
check the apps section i think i rememeber somone already compiling nano for android...
i wanted to compile sshfs but then again there is a lot of things i wanna do... LOL

[SCRIPT] BarebonesAndroid

Hello everyone! My name is geeksunny and I am fairly new to the community. Been a lurker for a quite a while now but I finally have something to share!
BarebonesAndroid
What it is
What I have here is a Bash script to automate backing up your /system/app directory and then steps through a list of packages offering to remove them from your device. It runs on your Linux PC and uses ADB to interface with your device.
I wrote this for myself to automate the process of trimming my system down after I flash a new ROM. I recently bought a Nook Color and have been flashing CyanogenMod 7 nightlys to it pretty frequently. I also use a Motorola Droid phone and this comes in handy for the same reason on that device as well.
Seeing as how this was written with CyanogenMod 7 in mind, I am not sure how well it will work with other ROMs. I think it would work as it uses generic uninstall commands. It is based off of the packages that come in CM7 so those packages are the only ones considered by this script.
Note: I'm pretty rusty with my Bash scripting and kinda threw this together in my spare time. It may not be the prettiest script in the world but it gets the job done!
Requirements
To use this script you must...
- Be running a Linux/Unix based OS. (I use Ubuntu for my SDK machine. I don't have a Mac and do not know for sure if this will run on OSX.)
- Have ADB set up correctly and talking with your device.
- Have read/write access to your device's /system folder. (Be rooted.)
How to use it
Unzip and run ./BarebonesAndroid.sh in your terminal.
if ./BarebonesAndroid.sh is not executable, run this command:
Code:
chmod 775 BarebonesAndroid.sh
- It will first ask you to confirm that the device is connected and recognized by ADB.
- It will then ask if you want to back up your /system/app directory before removing any packages. If yes, you can specify a directory for the script to back them up to. It will default to ./apkBackup
- After this it will begin ask you one-by-one if you want to remove a given package. Enter Y or N for each package.
- When the script is finish it will reboot your device.
Future plans
I originally wrote this for myself but thought this could be useful to others out there. Right now the requirements aren't all that accessable to the average user (Linux OS with ADB set up). If there is a demand for it, I may write a Windows batch script version, or maybe convert it into a cross-platform command-line application. Let me know what you think of this idea!
I do have a book on Android development and my eventual goal is to turn this in to a native app!
Regarding the script...
- Add support for multiple devices. Right now it asks that you only have one device connected at a time. This is because I haven't had experience with multiple devices hooked up at once. I plan to fix that in the future.
- Add more error checking and failproofing.
- Streamline the experience. Make things a little more graceful than going through a set list one-by-one.
- Sort the apps. Perhaps add categories.
- Check installed packages and only offer to remove them if they are installed.
Thats it! Thanks for looking!
Thanks dude, good work!

[Q] Help on Compiling a Custom Kernel for Better Security

Hi everyone,
This is my first time posting but I've hung around the forums for a while now. I've started a project to add more strict security controls to the Android platform. Sure, we have permissions that a user must accept in order to install an application, but that isn't enough.
A good place to start would be to enable some of the security functionality back into the Linux kernel (Linux security modules). I have been doing my homework and know what challenges need to be over come yet I am running into great difficulty just getting the kernel to compile the way I want.
Since security modules have been disabled in the kernel itself, the kernel needs to be re-configured and re-compiled with the features enabled. I am working with the Nexus S kernel source code directly from Google using git (specifically the kernel/samsung.git project). When I get it I use the make ARCH=arm herring_defconfig to generate the .config file. I have found out (the hard way) that if the .config file isn't set up correctly, the compilation errors are endless.
But anyway, once the .config file is generated, I want to go into and enable the configurations I need. I do so, save, and exit. As soon as I go to make the kernel and compile the entire thing, it overwrites my edited version of .config and compiles it the way it wants to.
Anyone now a way around this?
Edit:
Solved the problem. Found a way around it using a make ARCH=arm menuconfig. Should have known...

[REVISION] [TOOL/LIB] Flashy v2.0.2 Alpha GUI Flasher/remote control using .net/mono

This is my revision of the Flashy tool, look below for the original thread and an explanation what it's meant for.
Don't know if it's worth the effort, but made a repo at github aswell, here is the link, any feedback is much appreciated.
For commiters, pls keep the master branch clean to "stable" builds, for commiting while development the workinprogress branch is ment for.
Changelog is below.
Will split it up to source changes and tool changes soon.
theq86 said:
Hello devs,
I made a tool to quickly flash image files to the device. it uses fastboot and adb as backends, but offers a UI to do the work. This is not only a handy GUI tool, but a full object oriented library for the .NET Framework, which the tool builds upon. You can use the wrapper library to access the most important adb and fastboot commands from within any .NET program, thus building new real applications instead of batch files. it is up to you if you want a console application, a gui or even a windows or webservice, as long as you program in a .NET environment.
Flashy is just an example what is possible to do. You can use it to flash any file to your device without having to employ the console or write fastboot commands.
Recent changes:
* added splashscreen flashing capabilities to the library and the flashtool
If you found bugs or have improvement ideas, feel free to write in this thread.
Attachments:
1) the handy Flashy-Tool
2) The .NET Wrapper's source code. Public domain, feel free to download, change, compile, sell for a million bucks or print out for your grandma
3) The Flash Tool's source code, also PD
Click to expand...
Click to collapse
Original Thread
Changelog:
v2.0.2_ alpha
Workers administrate themselvs now
Library documented (can be extended)
Gui partialy documented
fixed fastboot output
splited timouts for fastboot and adb (finetuning needed)
added readline method to base of adb and fastboot
changed return type of execute methods, stream isn't returned anymore, readline replaces it
some minor changes
v2.0.1_ alpha
Windows & Mono support (Unix/Linux/MacOs)
Redesigned most parts of the library and gui (still something left)
Cleaned up sourcecode
Added adb shell support with custom commands (atm no preset, you have to type them yourself)
Added logcat support with custom filters (atm no preset, you have to type them yourself)
Custom path to adb (atm not split up in two paths for adb and fastboot) can be set
Check if adb and fastboot are present inside the directory, otherwise fastboot is disabled
Possibility to disable fastboot at the gui
Deleted most of the Messageboxes, using textbox at the mainwindow instead
Synchrone and Asynchrone (atm buggy, maybe using another approach for it) processing at the library, Gui asynchrone (library is still used synchrone for stability, but uses the output stream directly [works fluid with logcat])
Choosen adb-path is stored for following starts
and everything else i missed, sry it's late and i'm tired^^
reserved for future
did somebody already flash any spashscreen to DS?
docertabum said:
did somebody already flash any spashscreen to DS?
Click to expand...
Click to collapse
Yes did it now, but had a little bug, the gui tried to execute the command with adb instead of fastboot, my fault, shouldn't change (or copy and paste) code as late as i did yesterday, sry.
Added the fixed version.
Unfortunately there is no output of the progress shown atm (even if the same stream is used as with adb) but it works, have tried it myself (you need an nb file like usual when you try to flash a splash with fastboot, will also look if i can change this [convert it internal]), will take a look at it later, now it's first time to go home^^
Tectas said:
Got a little finding for you, the gui itself isn't that big impact, but i really like the library to setup your own Applications, even if it wouldn't be that much effort to build one yourself, it's nice to have.
In the op isn't mono mentioned, but it should work as well, will test it later.
Hope you enjoy it.
Original Thread
Added changelog, binarys and source of my revised version, hope you enjoy it
Click to expand...
Click to collapse
eheh... Always wanted to learn C# or derivatives. Maybe this is the incentive I needed. Terrific work, thanks mate!
Cheers
lowveld said:
eheh... Always wanted to learn C# or derivatives. Maybe this is the incentive I needed. Terrific work, thanks mate!
Cheers
Click to expand...
Click to collapse
If you want to, I can create a git repo for it
If it's pushed further like I want to, it will grow up to an allround tool.
Ah, but missed to document the source yet, will catch up later
Swifted from my Desire S far away from my PC
New version is up, enjoy it
Swifted from my Desire S far away from my PC
Added github repo, latest binary zip is also uploaded to it (but no changes since yesterday yet).
Just to keep you updated:
Been working on full async support for the library, it's not finished yet, (but not much is left).
Implemented it with almost the same pattern as in the GUI and just as a side node, in future it will always run async, if you use sync mode, it just fakes it by not starting more then one async process at the same time.
If someone wants to take a look at the current source, the workinprogress branch on github is at the current state.
Next I will take a look at is, more fastboot commands and goldcard creation (thx to the voters).
Fastboot is easy to implement and will come soon, the goldcard will take some time, because I need to figure out how I can generate the image.
Additional to this I will give the mainwindow a small beauty cure (I don't like the radio buttons^^) and will implement the interactive shell (to be honest, I already integrated the possibility in the lib, but haven't tested it yet [yes that's what I voted for ]).
And the last thing on my schedule is (except of bugfixes, if needed) the ability to store from the user flashed images or nb files, that he can choose them from a list if he needs one of them once more (i.e. Boot.img after a romupdate)(first step to recovery feature ).
Other things will also come for sure, but that's enough by now I think^^
If someone else wants something else, or got something that may should be on the list too, pls tell me.
Swifted from my Desire S far away from my PC

Got kexec-mod, kexec-tools working, atags in progress - Should Also Work With DroidX

I realize people gave up slightly on the whole kexec thing over radio worries, but I now have the module compiling and inserting without error into the Droid2/DroidX gingerbread kernel. Next comes cross compiling the kexec-tools for userspace, to allow us to attempt inserting a different kernel.
To build, you'll need a compiled DroidX kernel from source, as well as the android NDK.
To build, make sure you have downloaded the DroidX GB kernel source and compiled it. There are guides everywhere on how to build Android kernels. Just make sure you use the proper cross compiler.
http://sourceforge.n....l.tgz/download
When you build, make sure to use
Code:
make mapphone_defconfig
Once the kernel is built, clone my repo and edit envsetup.sh to reflect the correct paths to your kernel source directory and the android NDK.
https://github.com/i...kexec-mod-d2-dx
Then, source it:
Code:
source envsetup.sh
Then, just run
Code:
make
and cross your fingers. You should then have a fresh kexec_load.ko file!
To see if it loads, you'll need to copy it to your sdcard, and then on the phone, using a console, do the following:
Code:
su (click allow)
insmod /sdcard/path/to/kexec_load.ko
If you don't get any errors, it inserted! Now, of course, to actually use it, we'd need the kexec-tools built, which I haven't gotten ready yet...but they're coming! To remove the module (no reason to leave it in memory for now):
Code:
rmmod kexec_load
Happy hacking, and help is always appreciated!
This looks great! If you need any help just ask
Thanks! I probably could actually use some. I'm looking at eternity project's git repos now, and am trying to figure out how they managed to get atags working, with the whole procfs thing...still scratching my head there.
I'm looking at eternity project's git repos now, and am trying to figure out how they managed to get atags working, with the whole procfs thing...still scratching my head there, though I do have an atags module working, except it doesn't do anything without atags in the procfs (http://lists.infradead.org/pipermail/kexec/2011-January/004795.html).
kexec-tools:
https://github.com/i...xec-tools-dx-d2
To build, see the README.
Then, copy the binaries from /build/sbin/* to your device, and the move them to the /system/bin directory, and chmod them 770 to make them executable.
mod-atags:
https://github.com/i...mod-atags-d2-dx
Now, if I/we can just get atags and procfs stuff taken care of, we'll be able to go to the next step. I already have atags compiling as a module, but it won't stay inserted because we have no atags in the procfs. Note I can't just trace through code like this and know what everything is doing, but I know enough to hack at it and be dangerous
I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?
calebcoverdale said:
I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?
Click to expand...
Click to collapse
No idea. I haven't even gotten the kernel to change yet, so I haven't gotten to mess with radio yet. The method itself should/would work though, but radio will require reverse engineering...perhaps find a similar phone with an open bootloader and disassemble and attempt to clone it's modules.
The latest change I made may or may not work, it was an attempt to remove atags from the kexec module based on an old patch I found, which added the functionality. This at leaset made kexec -l zImage work, but when I run kexec -e, the kexec binary complains about atags not being there...hrmmmph.
I may have to revert it (and will if we can get atags somehow) ...but if we can get the kexec bin to ignore /proc/atags or just find a way to rip them out of the running kernel, we'll be in business.
The commit: https://github.com/ilikenwf/kexec-mod-d2-dx/commit/12dffe0ea286be0fe9ab0303a5a35ed92be4ee2c
I'm also looking into 2ndboot.
I like where this is going! Keep working!
Sent from my DROID2 using xda premium
Okies, so, I emailed aliasxerog (original kexec-mod writer), and I hope he'll get back to me. Even though his twitter says he's a "former android developer," maybe he'll be willing to give me some hints so I can pick up where he left off.
I also got the froyo version of the module building properly based on his module, yet again, (all after SBF'ing my phone back down to motoblur froyo - yech!) but neither currently work... (note there's a gingerbread and a froyo branch on my repo): https://github.com/i...kexec-mod-d2-dx
The froyo one throws the following error, which stops me dead in the water:
Code:
Could not find a free area of memory of 3007dc bytes...
The gingerbread one loads the kernel into memory but won't execute it due to our not having atags.
We've moved our git repos to an organization for easier collaboration:
https://github.com/organizations/D2-DX-Customboot
links are imcomplete.
use URL lable pls.
Cross compiler version ?
hello,
Sorry but I am not able to use the sourceforge link that you provided to download kernel source .. Also please share what cross compiler version is to be used....
Thanks in advance.

Categories

Resources