How to stress test ext3 partition on android? - android

I've had several errors in kernel logs on device boot after all partitions were mounted.
ext3_free_blocks_sb: bit already cleared for block ######
After searching I've discovered that a bugfix for the same issue was already integrated in the kernel.
Then I've searched for similar commits on repository and didn't find anything so it seems like the bug was fixed on the mainstream and the issue is Android-related.
From the discussion on RedHat bugtracker about the bug I discovered that it can be reproduced with stress-test utility. Unfortunately, I don't know any of these for ext3 on Android.

The main difficulty with porting such diagnostic tools to Android is it's reduced kernel functionallity. In this case there is a bunch of filesystem stress utilities for regular linux:
Bonnie++
dbench
fsstress and other tools included in LTP
etc.
Most of them require specific headers or BASH script features which are missing in Android.
After rewiewing available set of tools in filesystem test case of LTP I came up with the following approach:
Find a tool with minimal subset of scripts, headers and syscalls.
Compile it using Android NDK.
Install BASH for Android to run required scripts.
Replace missing commands with their' Busybox equivalents.

Related

Is it possible to run containers on android devices?

I’m a mobile developer and recently adept at using containers with docker. I’m developing a container architecture for my graduate project. One of the modules of this architecture would need to be run on an android device. But I could not find information on how to run a container on an android device. It could be something simple like an alpine image with python.
Can anyone tell me if there is a possibility to run a container on an android device with docker, or even kubernetes?
In 2021, the answer is definitely yes.
Here is a tutorial on that topic, which shows you how to run docker directly on Android, without VMs nor chroot. Note that you do need to root your phone and build a custom kernel though.
If you only want a quick look of docker running on android without getting your hands dirty, check out this comment on GitHub.
It is possible to use it for running docker on an android device using an application like termux or userland to install a qemu package.
The best way is to use alpine linux terminal, an android app available on github.
This alpine term app has a QEMU to run like alpine ISO. All things are automated
and this works with x86_64 kernel on any android.
Some android phones have a KVM kernel so this device can run faster alpine term
Also my friends made a video on a YouTube channel to run docker on any android phone without root.
I must note that I am not an expert in Android development. But I researched on this topic, and #Emile's answer is the easiest and closest you can get - as it seems.
You can actually run Fedora (and not only) image on top of the Termux and then launch Python inside. This is obviously not a docker, but might be helpful.You can find more info here.
In addition, I've found this topic on Quora which is a similar question:
Think about it: Docker abstracts the OS and that is all. The Android
OS is quite a different kernel than linux distributions, even though
it is linux. It might be tricky to get applications meant for a linux
distribution to run on Android/Docker.
One of the main reasons to use docker is that it can provide
self-contained packages of applications which do not affect the rest
of the system. The Android applications, packaged as .apk files are
just that.
Other than that I was able to find this topic on StackOverflow which does not really resolve the issue. As the issue might be related to AUFS and some Kernel features needed by LXT which are not present in Android - now some of them is from what I remember.
Also there is a claim that it is possible on docker forum and weibo (use translation to English), but there is only a screenshot provided by user and no details on how to do it, besides "it took a lot of effort" statement. So it would seam that this is still a not well known part, or maybe someone will be able to actually provide more complementary information - maybe try on Docker forum or GitHub.
We open the Android container, which can run the docker container on the Android operating system. Not only can run Docker containers, but also other containers, such as podman. In addition, we have also enabled the container to support checkpoint and restore functions, and support the migration of containers across architectures and operating systems. See https://github.com/CGCL-codes/Android-Container for details.
Some people think it's impossible but it isn't you can run a full ubuntu on your phone by this android app https://play.google.com/store/apps/details?id=com.termux
You can even install gui envrioment and connect over vnc everything is supported in this so also docker or website hosting and so on
(Make sure you follow al install steps in the app https://play.google.com/store/apps/details?id=studio.com.techriz.andronix to install linuxes like arch or ubuntu fedora or more you have to install these it doesn't work by just opening termux)
YOU DON'T HAVE TO ROOT TO USE THIS METHOD

Building cyanogenmod for grouper does not create the CM-*.zip

I followed the instructions in the cyanogenmod wiki page to build a custom ROM for grouper (Nexus 7 wifi only model). However, the CM-DATE-UNOFFICIAL.zip file is not created. I get this error message --
No private recovery resources for TARGET_DEVICE grouper.
I followed the answer in this link to add below line
TARGET_KERNEL_CONFIG := cyanogenmod_grouper_defconfig
to ~/android/system/device/asus/grouper/BoardConfig.mk and did "make modules" and "make grouper_defconfig", "make grouper" to no avail.
From further research, I found that I might be missing the kernel. I followed the android documentation on building the kernel. However, this also did not solve the issue (I might have not placed the kernel at the right location). Can someone tell me what I am missing?
I was able to generate the zip file. The main issue was that Ubuntu by default uses OpenJDK while Cyanogenmod needs Oracle JDK. Downloading and using Oracle JDK and following rest of the steps mention in this xda-developers forum thread generated the zip file. Also make sure that you have plenty of swap space (atleast as much as your ram or twice of that if possible)
Another thing that is not mentioned in the wiki for building Cyanogenmod is that the kernel has to be built first. I followed this link to build the Android kernel.

android + scala + preinstalled scala libraries + disabled proguard throws ClassNotFoundException

Final purpose of this feat: Use android device for development by fast compiling without needing to use proguard each single time (which causes huge delays)
First try is on Sony Ericsson Xperia Mini Pro
I have installed in it Cyanogenmod which is already rooted and the root checker app has verified it.
This is the app I used to embed Scala library 2.9.1 inside android device:
https://github.com/jbrechtel/Android-Scala-Installer
The lines uses-library android:name="scala_... are now included inside the AndroidManifest
After the above actions I did some minor changes inside "project/Build.scala" like this line: useProguard in Android := false,
I am probably missing something because after recompiling and executing android:start-device I got java.lang.ClassNotFoundException
which is the error you are expecting to get when you have not done the previous steps (rooting device and installing scala libraries inside device)
Any ideas are welcome! Thank you
PS: Intellij is the chosen IDE for the current project so eclipse and the relative plugins is not an option
There is nothing wrong with what I have mentioned above!
BUT there is a command inside Android Scala Installer which requests the "/system" folder to be mounted as writable. Unfortunately this does not work on my gingerbread android phone and this might be the general case.
I simply commented out the operation of the mount /system as writable (and also the command mount /system as read only) and the libraries installed successfully!
Note that I set manually the permissions of /system as writable before installing libraries
In fact I forked the github repository and therefore you can find me implementation over here:
https://github.com/pligor/scala-android-libs
To summarize. Yes the only alterations needed in your scala android source code is to set the settings in Build.scala file for proguard to be false and you include the uses <uses-library android:name="scala_... inside Android Manifest.

Adding driver to android devices kernel

I would like to use a PCAN with my device.
I have the program for it, and an otg cable, but i need to install the driver first.
And i found a linux driver on the manufacturers site.
I downloaded the kernel source, arm toolchain, and read a few sites about building and compiling but i havent find anything about adding driver.
So my question is, how can i add or install this driver on android?
The device is galaxy tab 10.1 P7510.
Thanks for your help.
Right, what you need to do is this:
Unzip the tarball source
Go into the respective directory of the source - cd peak-linux-driver-7.7/ as quoted by the above PDF
cd peak-linux-driver-x.y
make clean
make su -c “make install”
When the build completes, issue this command
/sbin/modprobe pcan
However, having stated this, I do not see any reference to building with Android, so it looks like a fair bit of messing around with the source to get this to actually work on Android.
From what I can ascertain, this is more orientated towards the desktop PC only...
As is mentioned in a later comment clarifying this answer; the kernel would need to be recompiled from source as an arm v7 or v8 target.
The part not mentioned was that it would also have to be statically linked to avoid requiring glibc in Android or bionic lib c in your computer.

Generate core dump in android

I'm developping a android's aplication using some shared
libraries written by me and compiled with ndk-r5b. The application works,
y and the calls to the libraries works too, but I detected some errors,
segmentations faults, and I need to debug it, but, I don't know how debug
native code from android and I don't know if I can generate core dumps,
as in linux, for debug my libraries.
Any idea?
The ndk comes with ndk-gdb, which supposedly allows you to debug native applications. Also, if you download the whole andriod open source project, they also have some version of gdb used for debugging. Look in the docs/ folder of the ndk to learn about using it. This tutorial might also prove helpful: http://vilimpoc.org/blog/2010/09/23/hello-gdbserver-a-debuggable-jni-example-for-android/
However, as shown in a recent question I asked: Running ndk-gdb with package not found error on motorola phone I still can't get it to work.
Edit: You said in the comments you were using a Samsung Device: Samsung decide to wreck havoc on some of the crucial internals required for native debugging, but it's easily fixable if you have root access to the device. If you use the --verbose flag, you'll probably find that the error is different than that, a package unknown error. That's because it's looking in /data/system/packages.list, but samsung renamed that file to /dbdata/system/packages.list. So if you make a symlink to that file in /data/system/packages.list, (requires root access) it should work. Or at least so claims the ndk mailing list: http://osdir.com/ml/android-ndk/2011-03/msg00036.html

Categories

Resources