[Q]Android vendor/modules drivers question - General Questions and Answers

I work with olinuxino A13 and Im using it as a touch screen control for different machines
using MODBUS protocols with a FTDI chip serial connection on USB.
I have found drivers for android and I put them in /system/vendor/modules/ftdi_sio.ko
and initialize them in preinstall.sh like this:
Code:
/system/bin/insmod /system/vendor/modules/ftdi_sio.ko
chmod 0666 /dev/ttyS0
chmod 0666 /dev/ttyS1
chmod 0666 /dev/ttyS2
chmod 0666 /dev/ttyS3
chmod 0666 /dev/bus/usb/*
And it works.
Now I have personal tablet with same android version 4.0.3 and 3.0.8 kernel
with cortex A5 dualcore processor.
Im trying the same thing and It doesnt work... also there isnt a /system/vendor/modules folder only /system/vendor/ so I created it but still.
I need this for test and portability when going on work trips...
Im no good with linux, so am I missing something or I do something completely wrong?
When I manually insmod ftdi_sio.ko in ADB I get this:
<3>[ 112.575894] ftdi_sio: version magic '3.0.8 preempt mod_unload modversions
ARMv7 ' should be '3.0.8-tcc preempt mod_unload ARMv7 '
Can I edit a compiled .ko?

Related

[HOWTO] openvpn on samsung galaxy i5800

step by step guide how to install openvpn on the galaxy 3 i5800, android 2.1 (eclair), linux kernel 2.6.29
requirements: rooted galaxy i5800 and busybox installed in /system/xbin, adb from android sdk, phone conntect via usb, usb-debugging mode turned on
install attached tun.ko (I compiled this from the original samsung kernel sources, see opensource.samsung.com)
Code:
adb push tun.ko /sdcard/tun.ko
adb shell
su
mount -o remount,rw /dev/block/stl6 /system
cp /sdcard/tun.ko /system/xbin/
create symlinks for busybox route and ifconfig (required by openvpn)
Code:
cd /system/xbin
mkdir bb
cd bb
ln -s ../busybox ./ifconfig
ln -s ../busybox ./route
create directory for openvpn config files
Code:
mkdir /sdcard/openvpn
create symlink for cp (unix command for copy). otherwise the install-script of the OpenVPNInstaller (see below) will fail!!!
Code:
ln -s /system/xbin/busybox /system/xbin/cp
download OpenVPNInstaller from Android Market
run and configure OpenVPNInstaller
specify directories: busybox is in /system/xbin, ifconfig and route are in /system/xbin/bb
copy vpn-config files (config, certs, key) to /sdcard/openvpn (i.e. via adb push or mounting the phone as a mass-storage unit)
download OpenVPN Settings from Android Market
run and configure OpenVPN Settings
activate "load tun kernel module"
Tun module settings:
- Load module using insmod (instead of modprobe!!)
- Path to tun module: /system/xbin/tun.ko
Path to configurations:
/sdcard/openvpn
Path to openvpn binary
/system/xbin/openvpn
Excellent. Worked on my Galaxy 3 Apollo (i5800L)
Thanks!
tun.ko for galaxy s 9000 android 2.2 froyo
hi,
I also compiled the tun.ko device driver for the galaxy s 9000 running android 2.2 froyo. I took the sources from see opensource.samsung.com (GT-I9000_OpenSource_Froyo_update_JPM.zip).
have fun...
best regards sukkubus
Trying this but get an error about ifconfig failed and could not execute an external program... Anyone have any ideas?
here is a portion of the logs
Code:
D/OpenVPN-DaemonMonitor[/sdcard/tmp/blackvpn_uk.conf]-daemon-stdout(11804): Sat Nov 13 15:12:48 2010 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 172.16.27.1,route 172.16.27.1,topology net30,ping 10,ping-restart 60,ifconfig 172.16.27.206 172.16.27.205'
D/OpenVPN-DaemonMonitor[/sdcard/tmp/blackvpn_uk.conf]-daemon-stdout(11804): Sat Nov 13 15:12:48 2010 OPTIONS IMPORT: --ifconfig/up options modified
D/OpenVPN-DaemonMonitor[/sdcard/tmp/blackvpn_uk.conf]-daemon-stdout(11804): Sat Nov 13 15:12:49 2010 /system/xbin/bb/ifconfig tun0 172.16.27.206 pointopoint 172.16.27.205 mtu 1500
D/OpenVPN-DaemonMonitor[/sdcard/tmp/blackvpn_uk.conf]-daemon-stdout(11804): Sat Nov 13 15:12:49 2010 Linux ifconfig failed: couldnot execute external program
D/OpenVPN-DaemonMonitor[/sdcard/tmp/blackvpn_uk.conf]-mgmt(11804): >FATAL:Linux ifconfig failed: could not execute external program
D/OpenVPN-DaemonMonitor[/sdcard/tmp/blackvpn_uk.conf]-daemon-stdout(11804): Sat Nov 13 15:13:57 2010 PUSH: Received control messag
e: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 172.16.27.1,route 172.16.27.1,topology net30,ping 10,ping-restart 60,ifconfig 172.16.27.206 172.16.27.205'
D/OpenVPN-DaemonMonitor[/sdcard/tmp/blackvpn_uk.conf]-daemon-stdout(11804): Sat Nov 13 15:13:57 2010 OPTIONS IMPORT: --ifconfig/up options modified
D/OpenVPN-DaemonMonitor[/sdcard/tmp/blackvpn_uk.conf]-daemon-stdout(11804): Sat Nov 13 15:13:57 2010 /system/xbin/bb/ifconfig tun0 172.16.27.206 pointopoint 172.16.27.205 mtu 1500
D/OpenVPN-DaemonMonitor[/sdcard/tmp/blackvpn_uk.conf]-daemon-stdout(11804): Sat Nov 13 15:13:57 2010 Linux ifconfig failed: could not execute external program
D/OpenVPN-DaemonMonitor[/sdcard/tmp/blackvpn_uk.conf]-mgmt(11804): >FATAL:Linux ifconfig failed: could not execute external program
I appear to very nearly have this working
Turns out my busybox is in /sbin and if you link from /system/xbin/bb/(ifconfig or route) directly to /sbin/busybox then the ifcong and errors are removed.
It now states I am connected to another network, however my local IP is still showing at the other end point... so close but not quite yet.
ln -s /sbin/busybox /system/xbin/bb/ifconfig
ln -s /sbin/route /system/xbin/bb/route
EDIT: FIXED..
Ok, so the link for route doesnt work at all, route add and route delete fails, however the sym link for ifconfig to /sbin/busybox does work.
So for route, I copied the entire busybox binary to /system/xbin/bb and named it route
cp /sbin/busybox /system/xbin/bb/route
that now works !! Took a reboot and some time for it all to sync up, but now connecting perfectly.
You also need to find the static openvpn binary and replace the obe the comes with the openvpn installer. Also find the correct tun file for your Android build.
But can confim it does work, so worth messing around, you will get there
BYW, this is on an Samsung Galaxy S i9000
busybox
hi adiep,
you may not use the pre-installed busybox from samsung (which is found in /sbin). It is a reduced version of busybox that does not include suitable ifconfig- and route-commands for openvpn. thus you have to install a full version of busybox... normally this is done, when you root your phone according to descriptions found in this forum.
you can alternatively install titanium backup (which installs its own busybox) and copy the "full" busybox from titanum backup to /system/xbin.
best regards,
sukkubus
cifs.ko for mounting windows (aka smb) shares
hi,
just in case someone needs this: i compiled the cifs.ko kernel module for the galaxy i5800 phone.
with this module you can mount windows network shares (aka samba, smb, cifs). for instance CifsManager (see android-store) is a suitable app/frontend for doing this (hint for galaxy i5800: switch to insmod instead of modprobe in the CifsManager-settings for the proper use of the module).
best regards,
sukkubus
sukkubus06 said:
hi,
just in case someone needs this: i compiled the cifs.ko kernel module for the galaxy i5800 phone.
with this module you can mount windows network shares (aka samba, smb, cifs). for instance CifsManager (see android-store) is a suitable app/frontend for doing this (hint for galaxy i5800: switch to insmod instead of modprobe in the CifsManager-settings for the proper use of the module).
best regards,
sukkubus
Click to expand...
Click to collapse
I've just copied cifs.ko to /system/lib and choose insmod with cifs.ko path is: /system/lib/cifs.ko
but when do the mounted share i just got the "mount:Invalid Agrument" error, Pls help!
P/S: my mount point already change to /sdcard/cifs/xxx ... do we need any chmod for specific folder or .ko module?
Done for 2.1, just make sure apply the user name and password inside each connection otherwise the "invalid argument" issue stop you there.
Do we have any update about the modules cifs.ko for FROYO 2.6.32 kernel?
TIA
will this work on the nexus one?
tun.ko and cifs.ko for android froyo (2.2.) galaxy gt i5800
kenblat said:
Done for 2.1, just make sure apply the user name and password inside each connection otherwise the "invalid argument" issue stop you there.
Do we have any update about the modules cifs.ko for FROYO 2.6.32 kernel?
TIA
Click to expand...
Click to collapse
here you go... tun.ko and cifs.ko for froyo!
best regards
sukkubus
I have a question about media streaming from a linux media shared folder to my gt-i5800
I managed to open the share through cifs.ko + cifs manager + es explorer (enabled root)!
My problem is that the player i'm using doesn't support superuser access to open the files in that share (rock player lite)
I have full access through a windows PC to that linux share with the same user/pass i'm loggin from my galaxy3...
Any ideas?
I have Galaxy 3 i5800 with Froyo 2.2 installed.
Which version should I use?

[Tutorial] How to compile a kernel module outside the kernel

I've decided to make a short tutorial and present the way I compile kernel modules (outside the kernel sources).
I've built few kernel modules (governors - ineractive and smartass, cifs, nls, etc) and I started receiving private messages asking how I did it.
For kernel modules that come with the kernel itself - cifs / tun for example - they just work if you compile the kernel and activate correct config parameters.
Some other modules (such as the smartass governor that doesn't come with the kernel) you compile outside the kernel source. However they require changes since kernel does not export the symbols the module needs to use - so you have to know what k_all_syms are needed, grab them from the phone and update the kernel module.
So there will be changes there. However, the main steps are:
a) follow tutorials to get the kernel / android ndk to compile. People seem able to do this.
b) then take the module you want (For example cpufreq_smartass.c from here: http://pastebin.com/rR4QUCrk ) and copy it in a new folder on the disk.
c) create a Makefile like the one below, but with your paths of course:
Code:
KERNEL_DIR=/home/viulian/android_platform/kernel-2.1.A.0.435/kernel
obj-m := cpufreq_smartass.o
PWD := $(shell pwd)
default:
$(MAKE) ARCH=arm CROSS_COMPILE=/home/viulian/android_platform/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules
clean:
$(MAKE) -C $(KERNEL_DIR) SUBDIRS=$(PWD) clean
d) execute make
Of course, the module source needs to be adjusted as you need to put in the frequencies, and also update the k_all_syms pointers .. But you can retrieve them from /proc/kallsyms on the device itself - just look for the method name, and use the address you see in the log.
If you still can't get it to compile, try to compile a very basic hello_world kernel module. I used the code below when testing:
Code:
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_ALERT */
MODULE_LICENSE("GPL");
MODULE_AUTHOR("viulian, 2011");
MODULE_DESCRIPTION("Demo module for X10i");
int init_module(void)
{
printk("<1>Hello world\n");
// A non 0 return means init_module failed; module can't be loaded.
return 0;
}
void cleanup_module(void)
{
printk(KERN_ALERT "Goodbye world 1.\n");
}
It is not perfect, but if you manage to insmod-it and check dmesg, you will see "Hello world" written there.
One more thing, linux kernel is fussy about the module versions. Even if nothing is changed between two kernel versions related to what a module needs, is enough a small difference in module's modinfo value to make the kernel to refuse the module.
For this, you need to trick your local kernel and adjust EXTRAVERSION value in kernel's main Makefile to have the exact version of the one on the device:
In X10 stock kernel (GB 2.3.3 release), the kernel version is 2.6.29-00054-g5f01537 visible in phone settings.
This means that the kernel on the phone will only accept modules that are compiled for that exact version. But the kernel version is just a string in the module .ko, so is a string comparison - the module might work perfectly, but is not loaded.
There is luck though, the string value comes from a define in kernel's Makefile, which you can change before you compile!
The Makefile in the kernel you are going to use to build the module will have to include these lines at the top:
Code:
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 29
EXTRAVERSION = -00054-g5f01537
Other than that, it should work .. Expect phone reboots and difficulty to debug if stuff goes wrong. Android kernel doesn't come with syslog functionality, kernel prints are found in /proc/kmsg. Dmesg works, but you can't execute if if phone reboots.
I usually had to keep another adb shell opening with 'cat /proc/kmsg' which showed as much as possible from the module's outputs.
Happy compiling on your risk!
Good
Sent from my GT-S5570 using Tapatalk
Nice really nice.
Anyone help me.have someone who could compile the linux bluetooth modules please? Iam noob in linux
http://www.multiupload.com/58OPISAYNH
Anyone please can make a video tutorial?
That's really nice of you for sharing this.
Guide to Compiling Custom Kernel Modules in Android
I've spent the better part of today trying to figure out how to compile and load a custom kernel modules in android to aid me in my research. It has been in entirely frustrating experience, as there is almost no documentation on the topic that I can find. Below you will find my attempt at a guide. Hopefully this will help save someone else the hassle.
PREREQUISITES
Disclaimer: This list may be incomplete, since I've not tried it on a fresh install. Please let me know if I've missed anything.
Install the general android prereqs found here .
Download and un(zip|tar) the android NDK found here .
http://developer.android.com/sdk/ndk/index.html
Download and un(zip|tar) the android SDK found here .
http://developer.android.com/sdk/index.html
Download and untar the kernel source for your device. This can usually be found on the website of your device manufacturer or by a quick Google search.
Root your phone. In order to run custom kernel modules, you must have a rooted phone.
Plug your phone into your computer.
PREPARING YOUR KERNEL SOURCE
First we must retrieve and copy the kernel config from our device.
Code:
$ cd /path/to/android-sdk/tools
$ ./adk pull /proc/config.gz
$ gunzip ./config.gz
$ cp config /path/to/kernel/.config
Next we have to prepare our kernel source for our module.
Code:
$ cd /path/to/kernel
$ make ARCH=arm CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- modules_prepare
PREPARING YOUR MODULE FOR COMPILATION
We need to create a Makefile to cross-compile our kernel module. The contents of your Makefile should be similar to the following:
Code:
obj-m := modulename.o
KDIR := /path/to/kernel
PWD := $(shell pwd)
CCPATH := /path/to/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
COMPILING AND INSTALLING YOUR MODULE
Code:
$ cd /path/to/module/src
$ make
$ cd /path/to/android-sdk/tools/
$ ./adb push /path/to/module/src/modulename.ko /sdcard/modulename.ko
RUNNING YOUR MODULE
Code:
$ cd /path/to/android-sdk/
$ ./adb shell
$ su
# insmod /sdcard/modulename.ko
---------- Post added at 07:40 PM ---------- Previous post was at 07:37 PM ----------
IMPORNTANT TOO
Preparing a build environment
To build an Android kernel, you need a cross-compiling toolchain. Theoretically, any will do, provided it targets ARM. I just used the one coming in the Android NDK:
$ wget http://dl.google.com/android/ndk/android-ndk-r6b-linux-x86.tar.bz2
$ tar -jxf android-ndk-r6b-linux-x86.tar.bz2
$ export ARCH=arm
$ export CROSS_COMPILE=$(pwd)/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
For the latter, you need to use a directory path containing prefixed versions (such as arm-eabi-gcc orarm-linux-androideabi-gcc), and include the prefix, but not “gcc”.
You will also need the adb tool coming from the Android SDK. You can install it this way:
$ wget http://dl.google.com/android/android-sdk_r12-linux_x86.tgz
$ tar -zxf android-sdk_r12-linux_x86.tgz
$ android-sdk-linux_x86/tools/android update sdk -u -t platform-tool
$ export PATH=$PATH:$(pwd)/android-sdk-linux_x86/platform-tools
not yet ((((
Come on, please make video tuto
that's interesting.
Thanks for sharing
Any takers to do a video status? Come on people it would be good for newbies like me and many that tme around. When teaching the community grows.
hi
i'm traing to compile module for acer a500.
but i have got an error: Nothing to be done for `default'.
my makefile:
Code:
obj-m += hello.o
KDIR := /home/hamster/android
PWD := $(shell pwd)
CCPATH := /home/hamster/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
acer kernel code is located in /home/hamster/android
could you help me?
thanks
Thanks man. The step "modules_prepare" is what did the trick for me!
Makefile including tabs
hamsterksu said:
hi
i'm traing to compile module for acer a500.
but i have got an error: Nothing to be done for `default'.
my makefile:
Code:
obj-m += hello.o
KDIR := /home/hamster/android
PWD := $(shell pwd)
CCPATH := /home/hamster/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
acer kernel code is located in /home/hamster/android
could you help me?
thanks
Click to expand...
Click to collapse
This is probably because you need to add a tab in front of your $(MAKE). Without the tab it will not recognize the command.
Help with compiling module
I am trying to compile a module for Galaxy S. I am getting this error.
# insmod hello_world.ko
insmod: init_module 'hello_world.ko' failed (Exec format error)
These are the module related options that I have enabled in the .config
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
Further this is the cat /proc/kmsg out put
<3>[53597.457275] hello_world: version magic '2.6.35.7-I900XXJVP-CL264642 preempt mod_unload ARMv7 ' should be '2.6.35.7-I9000XXJVP-CL264642 preempt mod_unload ARMv7 '
Why am I getting this error??
These are the steps I followed,
1. Downloaded the GT-I9000_OpenSource_GB.zip from samsung open source.
2. Change the EXTRAVERSION to EXTRAVERSION = .7-I900XXJVP-CL264642 (kernel version shown on phone is [email protected] #2)
I tried with EXTRAVERSION = [email protected] as well.
3. Added this line to the main make file -
core-y := usr/ TestModule/
5. Place the TestModule/ with the module code on the root directory.
6. Created the TestModule/Makefile and added this entry
obj-m := hello_world.o
4. On the read me of the kernel source it says to install Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI, which I did.
5. Execute 'make aries_eur_defconfig'.
6. Execute make (again this is how the readme in the source says)
I have compiled this module for the emulator and it works fine, What am I doing wrong here?
Thanks in advance.
hamsterksu said:
hi
but i have got an error: Nothing to be done for `default'.
Code:
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
Click to expand...
Click to collapse
be sure to have {tab} not space or other symbol before: $(MAKE) in:
Code:
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
Hello,
I'm trying to load a module in my GS3 but I encounter problems about version. Maybe it's just a mismatch between the kernel i use to compile and the one on my phone.
I have a 3.0.31-742798 kernel version on my GS3, so I put this info in the makefile like viulian said but it didn't work.
I manage to compile and put the module on the phone, but when I want to insmod it, I've got
Code:
insmod: init_module 'hello_world.ko' failed (Exec format error)
and the /proc/kmsg say
Code:
... disagrees about version of symbol module_layout
And there no config.gz on the /proc/ dir like fabricioemmerick suggest to use
EDIT: I try to modify the symbol by copying the one of module from the phone. Have another error.
btw , with modinfo I found that the compilation always add -gc33f1bc-dirty after the subversion. Maybe something in the compilation goes wrong. Still use the stock kernel and the toolchain from the ndk sourcecode
m00gle said:
Hello,
I'm trying to load a module in my GS3 but I encounter problems about version. Maybe it's just a mismatch between the kernel i use to compile and the one on my phone.
I have a 3.0.31-742798 kernel version on my GS3, so I put this info in the makefile like viulian said but it didn't work.
I manage to compile and put the module on the phone, but when I want to insmod it, I've got
Code:
insmod: init_module 'hello_world.ko' failed (Exec format error)
and the /proc/kmsg say
Code:
... disagrees about version of symbol module_layout
And there no config.gz on the /proc/ dir like fabricioemmerick suggest to use
EDIT: I try to modify the symbol by copying the one of module from the phone. Have another error.
btw , with modinfo I found that the compilation always add -gc33f1bc-dirty after the subversion. Maybe something in the compilation goes wrong. Still use the stock kernel and the toolchain from the ndk sourcecode
Click to expand...
Click to collapse
Maybe your kernel source code version and your phone kernel version is different. If both are 3.0.31 but just the subversion is different, you can
try "insmod -f" to load. The -f option will ignore the version.
How can I get a dmesg of a specific kernel module using adb shell or any other way?
ravike14 said:
How can I get a dmesg of a specific kernel module using adb shell or any other way?
Click to expand...
Click to collapse
I'm not sure I understand the question ... you can just dmesg and grep by the module name ? Or some string that the module outputs ? You have full control
viulian said:
I'm not sure I understand the question ... you can just dmesg and grep by the module name ? Or some string that the module outputs ? You have full control
Click to expand...
Click to collapse
That's the part I don't understand, the grep part.. When I enter grep with my commamd I get as it's not a recognized command.. I'm using Windows is that the reason?
I'm using 'adb shell dmesg > dmesg.txt' how do I add the grep part for it and and the module name.. I did alot research but all are Linux kernel specific debugging guides.. What would be the exact command to grep a specific module.ko logs?
Sent from my HTC_Amaze_4G using XDA Premium 4 mobile app
ravike14 said:
I'm using 'adb shell dmesg > dmesg.txt' how do I add the grep part for it and and the module name.. I did alot research but all are Linux kernel specific debugging guides.. What would be the exact command to grep a specific module.ko logs?
Click to expand...
Click to collapse
I think I understand now
The order is this:
a) DroidSSHd from here: http://code.google.com/p/droidsshd/downloads/list
b) Busybox installer from the market.
c) Putty on your windows to connect to the phone
Now you can dmesg + grep once you are connected to the phone (don't forget to su before and allow DroidSSHd root).
You need to be connected to the phone since it is much more easier. Use the phone as your remote Linux machine.

[Q] running busybox/linux comands on boot up

is there a way to run a bash script on startup. i am trying to check the presence of a running program (that uses excessive cpu and drains my battery) then kill the process-id if it is running:
Code:
$ uname -a -m -p
Linux localhost 2.6.35.7-SPH-D710.EL13-CL806482 #2 SMP PREEMPT Tue D
ec 13 02:56:30 KST 2011 armv7l GNU/Linux
$ crontab -l
crontab: must be suid to work properly
$ su -
# crontab -l
crontab: unknown uid 0
# ls /etc/rc.d
ls: /etc/rc.d: No such file or directory
# ls /etc/rc.local
ls: /etc/rc.local: No such file or directory
the bash script runs fine. i am just tired of having to log into connectbot, navigate to the directory, and run the program each time i restart my fone.
schneidz said:
is there a way to run a bash script on startup. i am trying to check the presence of a running program (that uses excessive cpu and drains my battery) then kill the process-id if it is running:
Code:
$ uname -a -m -p
Linux localhost 2.6.35.7-SPH-D710.EL13-CL806482 #2 SMP PREEMPT Tue D
ec 13 02:56:30 KST 2011 armv7l GNU/Linux
$ crontab -l
crontab: must be suid to work properly
$ su -
# crontab -l
crontab: unknown uid 0
# ls /etc/rc.d
ls: /etc/rc.d: No such file or directory
# ls /etc/rc.local
ls: /etc/rc.local: No such file or directory
the bash script runs fine. i am just tired of having to log into connectbot, navigate to the directory, and run the program each time i restart my fone.
Click to expand...
Click to collapse
Put it in init.d folder to run on every boot, if you mean that.
Sent from my GOCLEVER TERRA L70 using Tapatalk
i created this file:
Code:
-rwxr-x--- 1 root shell 612 Jul 13 20:45 /system/etc/init.d/S80kill-acore.ksh
but it doesnt run on bootup.

[Tool][bin] Official Toybox for android

What is toybox?​
Toybox combines many common Linux command line utilities together into a single BSD-licensed executable. It's simple, small, fast, and reasonably standards-compliant.
Toybox's main goal is to make Android self-hosting by improving Android's command line utilities so it can build an installable Android Open Source Project image entirely from source under a stock Android system. After a talk at the 2013 Embedded Linux Conference explaining this plan (outline, video), Google merged toybox into AOSP and began shipping toybox in Android Mashmallow.
Toybox aims to provide one quarter of a theoretical "minimal native development environment", which is the simplest Linux system capable of rebuilding itself from source code and then building Linux From Scratch and the Android Open Source Project under the result. In theory, this should only require four packages:
1) Set of posix-ish command line utilities
2) Compiler
3) C library
4) Kernel.
This provides a reproducible and auditable base system, which with the addition of a few conveniences (vi, top, shell command line history...) can provide a usable interactive experience rather than just a headless build server.
Why is toybox?​
The 2015 toybox talk starts with links to three previous talks on the history and motivation of the project: "Why Toybox", "Why Public Domain", and "Why did I do Aboriginal Linux (which led me here)?". If you're really bored, there's even a half-finished a history page.
The toybox maintainer's earlier minimal self-hosting system project, Aboriginal Linux, got its minimal native development environment down to seven packages in its 1.0 release (busybox, uClibc, gcc, binutils, make, bash, and linux) and built Linux From Scratch under the result. That project was the reason toybox's maintainer became busybox maintainer, having done so much work to extend busybox to replace all the gnu tools in a Linux From Scratch build that the previous maintainer handed over the project (to spend more time on buildroot).
Despite the maintainer's history with busybox, toybox is a fresh from-scratch implementation under an android-compatible license. Busybox predates Android, but has never shipped with Android due to the license. As long as we're starting over anyway, we can do a better job.
These days, toybox is replacing busybox in Aboriginal Linux one command at a time, and each toybox release is regression tested by building Aboriginal Linux with it, then building Linux From Scratch under the result with the new toybox commands. The list of commands remaining is tracked in the roadmap, and the replacing busybox in Aboriginal Linux is one of the main goals for toybox' 1.0 release.
Building LFS requres fewer commands than building AOSP, which has a lot more build prerequisites. In theory some of those can be built from source as external packages (we're clearly not including our own java implementation), but some early prerequisites may need to be added to bootstrap AOSP far enough to build them (such as a read-only version of "git": how does repo download the AOSP source otherwise?)
Source: http://www.landley.net/toybox/about.html
Downloads:
http://www.landley.net/toybox/bin/
GitHub:
https://github.com/landley/toybox
In case
Busybox vs toybox, who's the best?
Armv7 build?
Inviato dal mio Nexus 4 con Tapatalk 2
Waiting armv7 build. Thanks
Very interesting project!!:good: I've been doing as much of my development that I can on Android, but this will be a way to keep it all localized! This is exactly what we need:victory:. Great development!!:good::highfive:
What's the time frame for a Armv7 build? (no rush, just anxious with anticipation)
Can anyone suggest me which one to download for moto x play
hello i have toybox on my marshmallow(low end device) , i want to how to make swapfile on the SD card(VRAM),(RAM runout fast) all apps for VRAM use busybox so they wont work
so ive tried ot use terminal shell with "swapon" but i guess i missing something, i searched all over the net didnt found to much on toybox
what command\string i need?
sorry if i am on the wrong thread and sorry for my bad English
PS
i can adjust my ZRAM but its zram its swapfile on the RAM also its limited to 0-200MB and i need more
thanks
I obtain this toybox from my Xperia m, cm 13 rom, from this path /sbin/toybox and this is for armv7 arch.
https://mega.nz/#!toURVICL!M7048C6RhYlhuZcoxXzvF5Zm7ALvZIql93asmysJas0
Any updates for this?
Sent from my ? LG G4 H811 ???
Deleted
ToyBox:
https://forum.xda-developers.com/android/software-hacking/tool-official-toybox-android-t3290884
BusyBox + ToyBox:
https://forum.xda-developers.com/an...zip-busybox-v1-26-2-flashable-binary-t3581875
download modif, BB 1.28.3, TB Armv7 build:
https://drive.google.com/file/d/1jM4CMB3sF_wRvUaLv5n8hVkLA65glbZj/view?usp=drivesdk
use Terminal Emulator:
typing: busybox (enter)
typing: toybox (enter)
@Paget96
toybox does not require a separate dev developed binary for android devices like busybox does?
like meefik, stericson, osm0sis ones....!
Edit:- answer is here https://github.com/landley/toybox/issues/122
HemanthJabalpuri said:
@Paget96
toybox does not require a separate dev developed binary for android devices like busybox does?
like meefik, stericson, osm0sis ones....!
Click to expand...
Click to collapse
Nope
Sent from my WAS-LX1 using Tapatalk
usage is sometimes different between toybox and busybox. since twrp has started replacing busybox with toybox some scripts won't work properly anymore. this mean sometimes it is necessary to port flashable zip (for example when awk is used). for those who want to test shell scripts on pc i share my little wrapper shell script for quick testing applets syntax
Code:
acpi arch ascii base64 basename blkid blockdev bunzip2 bzcat cal cat
catv chattr chgrp chmod chown chroot chrt chvt cksum clear cmp comm
count cp cpio crc32 cut date devmem df dirname dmesg dnsdomainname
dos2unix du echo egrep eject env expand factor fallocate false fgrep
file find flock fmt free freeramdisk fsfreeze fstype fsync ftpget
ftpput getconf grep groups gunzip halt head help hexedit hostname
hwclock i2cdetect i2cdump i2cget i2cset iconv id ifconfig inotifyd
insmod install ionice iorenice iotop kill killall killall5 link ln
logger login logname losetup ls lsattr lsmod lspci lsusb makedevs
mcookie md5sum microcom mix mkdir mkfifo mknod mkpasswd mkswap mktemp
modinfo mount mountpoint mv nbd-client nc netcat netstat nice nl nohup
nproc nsenter od oneit partprobe passwd paste patch pgrep pidof ping
ping6 pivot_root pkill pmap poweroff printenv printf prlimit ps pwd
pwdx readahead readlink realpath reboot renice reset rev rfkill rm
rmdir rmmod sed seq setfattr setsid sha1sum shred sleep sntp sort
split stat strings su swapoff swapon switch_root sync sysctl tac tail
tar taskset tee test time timeout top touch true truncate tty tunctl
ulimit umount uname uniq unix2dos unlink unshare uptime usleep uudecode
uuencode uuidgen vconfig vmstat w watch wc which who whoami xargs
xxd yes zcat
Do you plan to add dd and gzip?
Painfully they are missing.
posix [dd] Partially implemented
lsb <gzip> Not started yet
http://www.landley.net/toybox/status.html
Very usefult. It helps me.
Thank you very much
I have two Xiaomi phones with A11.
Both have /sytem/bin/toybox installed
Is it common that toybox is pre-installed by default?

need help about rooting

i can't root Samsung galaxy a02 -- SM-A022F/DS Build No: A022FXXU2BUI3 , android 11 , i dont know what to do for rooting and i dont have firmware file (bootloader unlocked)
To get the superuser access ( AKA root ) to be able to control various aspects of Android OS means you need to perform a certain modification that will root your phone's Android. An unlocked bootloader isn't needed to root Android.
Here is what you have to do to root your device's Android:
Replace Android's Toybox binary - what is a restricted version by default - by unrestricted Toybox v0.8.5.
This e.g. can get achieved by means of a Windows command script making use of ADB coomands.
jwoegerbauer said:
To get the superuser access ( AKA root ) to be able to control various aspects of Android OS means you need to perform a certain modification that will root your phone's Android. An unlocked bootloader isn't needed to root Android.
Here is what you have to do to root your device's Android:
Replace Android's Toybox binary - what is a restricted version by default - by unrestricted Toybox v0.8.5.
This e.g. can get achieved by means of a Windows command script making use of ADB coomands.
Click to expand...
Click to collapse
hi , i dont know what is toybox or i dont know really what to do can you tell me step by step please? i have ADB already
dleaderp said:
hi , i dont know what is toybox or i dont know really what to do
Click to expand...
Click to collapse
Typically people do a Google search like "Android Toybox" ...
To save you this search: Toybox is a suite of Linux commands ported to Android.
The commands supported are
Code:
acpi arch ascii base64 basename blkid blockdev bunzip2 bzcat cal cat
catv chattr chgrp chmod chown chroot chrt chvt cksum clear cmp comm
count cp cpio crc32 cut date devmem df dirname dmesg dnsdomainname
dos2unix du echo egrep eject env expand factor fallocate false fgrep
file find flock fmt free freeramdisk fsfreeze fstype fsync ftpget
ftpput getconf grep groups gunzip halt head help hexedit hostname
hwclock i2cdetect i2cdump i2cget i2cset iconv id ifconfig inotifyd
insmod install ionice iorenice iotop kill killall killall5 link ln
logger login logname losetup ls lsattr lsmod lspci lsusb makedevs
mcookie md5sum microcom mix mkdir mkfifo mknod mkpasswd mkswap mktemp
modinfo mount mountpoint mv nbd-client nc netcat netstat nice nl nohup
nproc nsenter od oneit partprobe passwd paste patch pgrep pidof ping
ping6 pivot_root pkill pmap poweroff printenv printf prlimit ps pwd
pwdx readahead readlink realpath reboot renice reset rev rfkill rm
rmdir rmmod sed seq setfattr setsid sha1sum shred sleep sntp sort
split stat strings su swapoff swapon switch_root sync sysctl tac tail
tar taskset tee test time timeout top touch true truncate tty tunctl
ulimit umount uname uniq unix2dos unlink unshare uptime usleep uudecode
uuencode uuidgen vconfig vmstat w watch wc which who whoami xargs
xxd yes zcat
As you might see su is the ROOT functionality.
dleaderp said:
can you tell me step by step please? i have ADB already
Click to expand...
Click to collapse
Actually I'm working on a Windows command script that makes use of ADB what does the job. I'll publish it here when finished:
[TOOL][ADB]][Windows] A 100% Safe Non-systemless Root Tool - No Soft-bricked Adroid Guaranteed
Grant Root Privileges to Regular Users Using Devices With Android 6 and up by Simply Upgrading Android's Multi-command Applet Toybox.
forum.xda-developers.com
jwoegerbauer said:
Actually I'm working on a Windows command script that makes use of ADB what does the job. I'll publish it here when finished:
Click to expand...
Click to collapse
happy to hear that xd
i got a last question, i think my phone's storage is shrunked after i used firmware is it possible ? if yes how can i fix it. it was 32 gb now its 8gb
i fixed i used another firmware i'll be wait for your ADB

Categories

Resources