Usb to LAN KY-QF9700 with drivers for android - Acer Iconia A500

Hi everybody,
I just bought Usb to LAN adapter and realize that CD contains drivers for Android.
I have copy drivers to my Acer 501 and run Terminal. Now the problem starts.
First I did is chmod to all files in that directory. "chmod -R 777 qf9700_android.o" and so on
when I type "dmesg" I get:
<6>[ 1654.189933] usb 1-1: new full speed USB device using tegra-ehci and address 5
<6>[ 1654.189933] usb 1-1: New USB device found, idVendor=0fe6, idProduct=9700
<6>[ 1654.189933] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
<6>[ 1654.189933] usb 1-1: Product: USB 2.0 10/100M Ethernet Adaptor
and I'm stuck here. This is "makefile" file, and I don't know what is the path to KERENEL_DIR
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
KERNEL_DIR := /lib/modules/$(shell uname -r)/build
#KERNEL_DIR := /usr/src/linux-2.6.29/linux-2.6.29.i686/
KERNEL_VERSION := $(shell uname -r)
PWD := $(shell pwd)
MODULE_NAME := qf9700_android
obj-m := $(MODULE_NAME).o
all:
@echo "Building QF9700_ANDROID USB2NET chip driver..."
@(cd $(KERNEL_DIR) && make -C $(KERNEL_DIR) SUBDIRS=$(PWD) CROSS_COMPILE=$(CROSS_COMPILE) modules)
clean:
-rm -f *.o *.ko .*.cmd .*.flags .mii.mod.o.d *.mod.c Module.symvers Module.markers modules.order version.h
-rm -rf .tmp_versions
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
and when I run ./Makefile I get this:
/////////////////////////////////
/////////////////////////////////
#./Makefile
shell: not found
KERNEL_DIR: not found
shell: not found
KERNEL_VERSION: not found
MODULE_NAME: not found
MODULE_NAME: not found
obj-m: not found
all:: not found
/////////////////////////////////
/////////////////////////////////
So, is there any good soul how can help?
much appreciated.
yes yes, one more thing. This is the list of all files which are in this folder.
.qf9700_android.ko.cmd
.qf9700_android.mod.o.cmd
.qf9700_android.o.cmd
Makefile
Module.markers
Module.symvers
modules.order
qf9700_android.c
qf9700_android.h
qf9700_android.ko
qf9700_android.mod.c
qf9700_android.mod.o
qf9700_android.o
README

Hey
can u please upload the contents of that cd
even i m trying to use this on my android tablet
thanks

ngotova7 said:
Hi everybody,
I just bought Usb to LAN adapter and realize that CD contains drivers for Android.
I have copy drivers to my Acer 501 and run Terminal. Now the problem starts.
First I did is chmod to all files in that directory. "chmod -R 777 qf9700_android.o" and so on
when I type "dmesg" I get:
<6>[ 1654.189933] usb 1-1: new full speed USB device using tegra-ehci and address 5
<6>[ 1654.189933] usb 1-1: New USB device found, idVendor=0fe6, idProduct=9700
<6>[ 1654.189933] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
<6>[ 1654.189933] usb 1-1: Product: USB 2.0 10/100M Ethernet Adaptor
and I'm stuck here. This is "makefile" file, and I don't know what is the path to KERENEL_DIR
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
KERNEL_DIR := /lib/modules/$(shell uname -r)/build
#KERNEL_DIR := /usr/src/linux-2.6.29/linux-2.6.29.i686/
KERNEL_VERSION := $(shell uname -r)
PWD := $(shell pwd)
MODULE_NAME := qf9700_android
obj-m := $(MODULE_NAME).o
all:
@echo "Building QF9700_ANDROID USB2NET chip driver..."
@(cd $(KERNEL_DIR) && make -C $(KERNEL_DIR) SUBDIRS=$(PWD) CROSS_COMPILE=$(CROSS_COMPILE) modules)
clean:
-rm -f *.o *.ko .*.cmd .*.flags .mii.mod.o.d *.mod.c Module.symvers Module.markers modules.order version.h
-rm -rf .tmp_versions
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
and when I run ./Makefile I get this:
/////////////////////////////////
/////////////////////////////////
#./Makefile
shell: not found
KERNEL_DIR: not found
shell: not found
KERNEL_VERSION: not found
MODULE_NAME: not found
MODULE_NAME: not found
obj-m: not found
all:: not found
/////////////////////////////////
/////////////////////////////////
So, is there any good soul how can help?
much appreciated.
yes yes, one more thing. This is the list of all files which are in this folder.
.qf9700_android.ko.cmd
.qf9700_android.mod.o.cmd
.qf9700_android.o.cmd
Makefile
Module.markers
Module.symvers
modules.order
qf9700_android.c
qf9700_android.h
qf9700_android.ko
qf9700_android.mod.c
qf9700_android.mod.o
qf9700_android.o
README
Click to expand...
Click to collapse
Don't the CD have the install for the drivers..?

This will be very useful
Hey, can this be done on my SGS2 ?? I have the same model (KY-QF9700) just laying around, i already have a MicroUSB to Normal USB cable for my phone, it work for my USB mouse, was wondering will it work for the USB LAN also.

same here. got this adapter and noticed that there are android-drivers on the CD but i dont know how to install them and no ideas how to use it. any tutorials or hint here ? search didnt bring any solutions 4 me.

First off: Make sure you've got busybox installed. Then try 'insmod qf9700_android.ko' (without the quotes) inside the directory where qf9700_android.ko is located. If this tells you something about incompatibilities, you'll have to compile the driver yourself. For that you'll need the Android SDK and ARM crosscompiler on your computer, along with the sources for your kernel (if it's thor's, you're screwed, he's in violation of the GPL because of that). Then run the makefile with your crosscompiler (adjusting the paths to fit your setup first, of course) and insmod the resulting qf9700_android.ko on your tab...
The insane way to go is trying the same trick on your tab using a debian chroot instead of the Android SDK... You won't need a crosscompiler then, as the android ARM gcc (crosscompiler) produces almost the same code as debian's ARMEL gcc (and it's certainly compatible)...
If all goes well, you'll have a working driver either way, though painful experience suggests that you're in for a rough time... wish you luck, you'll need it. If you're completely stuck, try posting the files, so others can give it a shot (I will if I find the time).
Hey, can this be done on my SGS2?
Click to expand...
Click to collapse
Theoretically, yes... if it recognizes the adapter at all it'll work just the same way I described above.

I did not get it,i am new in android .Can you please explain a little more step by step?

Hi, I´m using a GT-N8000 and it is the result of the 'insmod qf9700_android.ko'
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
some sugestions? I need this adapter for test my LAN wired network
thanks!

Help Lan adapter USB-LAN
Hi, I´m using a rooted and busybox installed GT-N8000 and it is the result of the 'insmod qf9700_android.ko'
some sugestions? I need this adapter for test my LAN wired network
thanks!

I have edited the code of my Make file to
-----------------------------------------------------------------------------------------------------
KERNEL_DIR := /proc/sys/kernel/
KERNEL_VERSION := $(shell uname -r)
PWD := $(shell pwd)
MODULE_NAME := jp1081_android
obj-m := $(MODULE_NAME).o
all:
@ECHO "Building JiaPeng NET JP1081 USB2NET chip driver for android platform..."
@(cd $(KERNEL_DIR) && make -C $(KERNEL_DIR) SUBDIRS=$(PWD) CROSS_COMPILE=$(CROSS_COMPILE) modules)
clean:
-rm -f *.o *.ko .*.cmd .*.flags .mii.mod.o.d *.mod.c Module.symvers Module.markers modules.order version.h
-rm -rf .tmp_versions
---------------------------------------------------------------------------------------------------------
then chmod 777 * in my makefiles directory
But now I can´t execute the ./Makefile "can´t execute: Permission denied"

Any Update?
Update: http://forum.xda-developers.com/showthread.php?t=2705323

Related

[APP] [4.0.3+] App Backup (Simple backup app) [update 7/26]

Hello XDA :victory:
I just finished making a simple yet useful backup app for Android 4.0.3+ (Root needed)
It can:
Make a Nandroid backup of the following partitions: /data, /cache, /android-secure, /sd-ext, /system
Copy all user installed APK's into the sdcard
Simple, yes, but somewhat useful
Screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Change log:
7/26
-Option to make a full Nandroid backup
-Changed some GUI
To install:
1. Install this APK.
2. copy this file AND this file to system/bin and set permissions as 655, or run this in adb:
1. "adb push xdevilium_onandroid_data_backup system/bin"
2. "adb push xdevilium_onandroid_backup system/bin"
3. "adb shell chmod 655 system/bin/xdevilium_onandroid_data_backup"
4. "adb shell chmod 655 system/bin/xdevilium_onandroid_backup"
Credits: The creator of "onandroid" script (sorry, i forgot the username )
I see that you are using an old version of Online Nandroid. I would really appreciate if you could keep it upto date.
Btw, great attempt at an app.
ameer1234567890 said:
I see that you are using an old version of Online Nandroid. I would really appreciate if you could keep it upto date.
Btw, great attempt at an app.
Click to expand...
Click to collapse
I can't, sorry, I lost the source code and I'm working on Newgen and XDA ROM HUB now
Is it similar to the "App2zip"?
Two issue, i can download apk file but i can't download other 2 files, i receive a text web page.
Eg:-
echo "##########################################"
echo "XRH Nadroid Data Backup"
echo "* This tool backups /data partition."
echo "* It is fully compatible with nandroid."
echo "* Based on 'onandroid' By Ameer Dawood"
echo "##########################################"
echo ""
# Define constants
path="/sdcard/clockworkmod/backup"
safety=7
name="none"
tz="u"
req_power=10
sdcard_temp_mount="/mnt/sdcard4nandroid"
logfile=/data/local/tmp/onandroid.log
# Logging function
mkdir -p /data/local/tmp
[ -f $logfile ] && busybox rm $logfile
logmsg(){
message="$*"
dtime=`busybox date +%T`
echo -e "$dtime $message"
echo "$dtime $message" >>$logfile
if [ "`busybox which log`" != "" ]; then
log -p i -t onandroid "$message"
fi
}
# Process arguments
if [ $# -gt 0 ]; then
if [ $1 == "--help" ]; then
# Display usage instructions
clear
echo ""
echo "Usage: xrh_backup_script [OPTIONS] [NAME]"
echo ""
Click to expand...
Click to collapse
android addicts said:
Is it similar to the "App2zip"?
Two issue, i can download apk file but i can't download other 2 files, i receive a text web page.
Eg:-
Click to expand...
Click to collapse
Right click, save page as
I'm having trouble getting this to work. Is there anyway you can all the install steps into the app for me
Sent from my SCH-I800 using Tapatalk 2

[SCRIPT] Install an apk file or push a file to sdcard using a right-click

Here's a little script to push a file to the root of your sdcard, by right-clicking on the file and selecting "Send to Android" it save you time if you use swap (app not partition) so you dont need to turn off swap and activate USB mass storage then turn on swap again every time you want to copy a file to sdcard
If the file is an apk file, you have the option to install it or just copy it to your sdcard.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
It uses adb.exe from the Android SDK. It's quite basic, but I guess could be adapted or made more complex quite easily.
Instructions
------------
1. Adding the right-click context menu
Place the pushfile.vbs file somewhere safe on your system.
Edit the .reg file so that the path to the vbs file is correct.
Double click on the .reg file, and accept the changes to the registry.
2. Edit pushfile.vbs
Open up the vbs file using Notepad.
If you already have adb.exe on your system (it's part of the Android SDK), edit line 6 of the file so that it points to your existing adb.exe
If your path has spaces, use double quotes around the whole file path, e.g --> ""C:\Program Files\Android SDK\tools\adb.exe""
Save the file and exit.
If you don't have the Android SDK, copy the adb.exe in the zip file into C:\windows\system32
Edit line 6 of pushfile.vbs so that it looks like this:
Code:
adb = "C:\windows\system32\adb.exe"
Save the file and exit.
Click to expand...
Click to collapse
The download is at the bottom of this post.
Linux users
Create this script in ~/.gnome2/nautilus-scripts/
Call it something sensible like "Send\ to\ Android". Just edit the path to your adb.
Code:
#!/bin/sh
export adb=~/AndroidSDK/tools/adb
export tmp=/tmp/.out
for arg
do
if [ `echo $arg | awk -F "." {'print $2'}` = "apk" ]; then
zenity --question --text="Do you want to install $arg?" --no-wrap --ok-label="Install" --cancel-label="Push to sdcard" --title="Question"
if [ "$(echo $?)" == "0" ]; then
$adb install -r "$arg" 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
else
$adb push "$arg" /sdcard/ 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
fi
else
$adb push "$arg" /sdcard/ 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
fi
done
[ -f $tmp ] && rm -f $tmp
Now you can push files to /sdcard or install apk's by using right-click - scripts - Send to Android
thanks to st0kes Original Thread
Thanks! it could be useful at some point...
Thanks! Very useful.
Sent from my Sensation 4G using xda premium
Good start off point!
even simpler solution
create a .cmd file
Code:
@echo off
path-to-adb.exe push %1 "/mnt/sdcard/external_sd/music/%~n1"
this will let you copy folders for example music albums
place it in %APPDATA%\Microsoft\Windows\SendTo
justsayin' said:
Here's a little script to push a file to the root of your sdcard, by right-clicking on the file and selecting "Send to Android" it save you time if you use swap (app not partition) so you dont need to turn off swap and activate USB mass storage then turn on swap again every time you want to copy a file to sdcard
If the file is an apk file, you have the option to install it or just copy it to your sdcard.
It uses adb.exe from the Android SDK. It's quite basic, but I guess could be adapted or made more complex quite easily.
The download is at the bottom of this post.
Linux users
Create this script in ~/.gnome2/nautilus-scripts/
Call it something sensible like "Send\ to\ Android". Just edit the path to your adb.
Code:
#!/bin/sh
export adb=~/AndroidSDK/tools/adb
export tmp=/tmp/.out
for arg
do
if [ `echo $arg | awk -F "." {'print $2'}` = "apk" ]; then
zenity --question --text="Do you want to install $arg?" --no-wrap --ok-label="Install" --cancel-label="Push to sdcard" --title="Question"
if [ "$(echo $?)" == "0" ]; then
$adb install -r "$arg" 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
else
$adb push "$arg" /sdcard/ 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
fi
else
$adb push "$arg" /sdcard/ 1>> $tmp 2>> $tmp
export result=$(tail -n1 $tmp)
zenity --info --text="$result"
fi
done
[ -f $tmp ] && rm -f $tmp
Now you can push files to /sdcard or install apk's by using right-click - scripts - Send to Android
thanks to st0kes Original Thread
Click to expand...
Click to collapse
just what i was looking for :laugh:

[Q] Backtrack on S4

Hello,
Backtrack doesn't work on S4 i9505 4.3 android edition.. everything goes error!!!
Has anybody this problem before?
How to fix the problem? plus i can't access or find /proc/config.gz file to see if s4 support loop!!
boss-619 said:
Hello,
Backtrack doesn't work on S4 i9505 4.3 android edition.. everything goes error!!!
Has anybody this problem before?
How to fix the problem? plus i can't access or find /proc/config.gz file!!
Click to expand...
Click to collapse
i got it to work with a custom kernel with loop function and i used: (following is copy-paste and not written by me and is applied for the grey screen on vnc)
Here’s the sollution…
open the file /root/.vnc/xstartup in your favorit editor (I use nano..)
nano /root/.vnc/xstartup
comment out every line in the file and add the following:
xrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
Your file should look like this
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
#[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
#x-window-manager &
xrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
gnome-session &
Now reboot your box and run the vnc server again, It should work now..
Note: vnc sends your password in clear text over the network. If you use it to connect to a pc on the ‘internet’
make sure you tunnel your traffic over SSH !!
Have Fun…..
you can read the org. text here: h t t p :// hezik.nl/remote-control-your-backtrack-5-box-using-vnc-server
i hope this helps a bit
hagall said:
i got it to work with a custom kernel with loop function and i used: (following is copy-paste and not written by me and is applied for the grey screen on vnc)
Here’s the sollution…
open the file /root/.vnc/xstartup in your favorit editor (I use nano..)
nano /root/.vnc/xstartup
comment out every line in the file and add the following:
xrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
Your file should look like this
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
#[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
#x-window-manager &
xrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
gnome-session &
Now reboot your box and run the vnc server again, It should work now..
Note: vnc sends your password in clear text over the network. If you use it to connect to a pc on the ‘internet’
make sure you tunnel your traffic over SSH !!
Have Fun…..
you can read the org. text here: h t t p :// hezik.nl/remote-control-your-backtrack-5-box-using-vnc-server
i hope this helps a bit
Click to expand...
Click to collapse
The problem isn't with vnc, see my screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Has anyone the solution to fix the problem??
please fix this thread to share how can we run backtrack on S4!!
Have u tried installing with https://play.google.com/store/apps/details?id=com.zpwebsites.linuxonandroid app ? I had that problem before to, and i found a fix for i but dont got it in my head atm.. but with linux installer u dont have to change that manually
DrBlaze. i9505 xda-premium app.
The processor in the I9505 might be a limiting factor. Qualcomm doesn't use 'standard' ARM architecture as such, they license the instruction set & do their own cores (as opposed to the Exynos which is a 'standard' ARM processor). The Linux install apps on GP all state they're only guaranteed to work on a phone that has a true ARM processor. Could be the reason why you're having problems.
hagall said:
Have u tried installing with https://play.google.com/store/apps/details?id=com.zpwebsites.linuxonandroid app ? I had that problem before to, and i found a fix for i but dont got it in my head atm.. but with linux installer u dont have to change that manually
DrBlaze. i9505 xda-premium app.
Click to expand...
Click to collapse
I already have installed linux on android, but i got the same message!

Minfree script to /etc/init.d

Please script to /etc/init.d to set the minfree. I don't want any application, I want the script to autostart.
The script will be ok? I'm not asking about the value.
Code:
#!/system/bin/sh
#Created by hinxnz
#Set Minfree and Adj values
bb=$(find /system/ -name 'swapon')
if [ -n "$bb" ] && [ -e "$bb" ] ; then
bb=${bb%/*}
cd $bb
./busybox chmod 664 /sys/module/lowmemorykiller/parameters/minfree
./busybox echo "0,1,2,5,7,16" > /sys/module/lowmemorykiller/parameters/adj
./busybox chmod 444 /sys/module/lowmemorykiller/parameters/adj
./busybox chmod 664 /sys/module/lowmemorykiller/parameters/minfree
./busybox echo "9933,10728,14950,17510,20019,31385" > /sys/module/lowmemorykiller/parameters/minfree
./busybox chmod 444 /sys/module/lowmemorykiller/parameters/minfree
fi
Tell someone? The above and below are not working:
Code:
echo "0,1,2,5,7,15" > /sys/module/lowmemorykiller/parameters/adj
echo "5120,7680,11520,15360,20480,25600" > /sys/module/lowmemorykiller/parameters/minfree
This is the Nexus 7 2013 forum. I think you want this thread.
I know that this forum Nexus 7 2013. To him I need a script.
WSZR said:
I know that this forum Nexus 7 2013. To him I need a script.
Click to expand...
Click to collapse
Does the kernel you are using support init.d? What kernel?
If you have a kernel that supports it, is the perms set so it can execute? is it getting executed at all at startup?, maybe have it echo a value into a file to make sure it is getting executed. Does it execute and work if you run it manually?
I use ElementalX, supports init.d. BusyBox installed. In the terminal script "echo" works. Changing "minfree" in applications "Kernel Tweaker" works.
I can't verify startup. I tried the script from entering text into a blank file, not be made.
Code:
echo test > /data/data/file
In "init.d" is script to configure the kernel and perhaps to perform.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I don't know how to manage permissions in "init.d". File with the script I gave full permissions. A postscript of permissions must be before the script?
The script is executed:
Code:
#!/system/bin/sh
chmod 664 /data/data/file
echo test > /data/data/file
chmod 444 /data/data/file
I'll try to convert to "minfree".
WSZR said:
I use ElementalX, supports init.d. BusyBox installed. In the terminal script "echo" works. Changing "minfree" in applications "Kernel Tweaker" works.
I can't verify startup. I tried the script from entering text into a blank file, not be made.
Code:
echo test > /data/data/file
In "init.d" is script to configure the kernel and perhaps to perform.
I don't know how to manage permissions in "init.d". File with the script I gave full permissions. A postscript of permissions must be before the script?
Click to expand...
Click to collapse
I use the same kernel.
The script for minfree that you try to run from init.d, did you set the perms to 777 on it? It sounds like you have, but I am just making sure.
Have you tried appending the lines (from your post #2 above), to /etc/init.d/99elementalx to see if they get executed?
Something else to try:
Backup 99elementalx first, then try placing these lines in 99elementalx at the bottom, just above "exit 0". (This assumes you have the binary busybox in /system/xbin (you should, it's the proper place for it for this device), or a path that is in your $PATH environment.)
Code:
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "0,1,2,5,7,16" > /sys/module/lowmemorykiller/parameters/adj
chmod 444 /sys/module/lowmemorykiller/parameters/adj
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "9933,10728,14950,17510,20019,31385" > /sys/module/lowmemorykiller/parameters/minfree
chmod 444 /sys/module/lowmemorykiller/parameters/minfree
#test to see if executed
echo test > /sdcard/minfreetest.txt
Reboot, and see if there is the word test in /sdcard/minfreetest.txt.
If so, cat your minfree and adj files and see if they have your desired values.
mdamaged said:
I use the same kernel.
The script for minfree that you try to run from init.d, did you set the perms to 777 on it? It sounds like you have, but I am just making sure.
Have you tried appending the lines (from your post #2 above), to /etc/init.d/99elementalx to see if they get executed?
Something else to try:
Backup 99elementalx first, then try placing these lines in 99elementalx at the bottom, just above "exit 0". (This assumes you have the binary busybox in /system/xbin (you should, it's the proper place for it for this device), or a path that is in your $PATH environment.)
Code:
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "0,1,2,5,7,16" > /sys/module/lowmemorykiller/parameters/adj
chmod 444 /sys/module/lowmemorykiller/parameters/adj
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "9933,10728,14950,17510,20019,31385" > /sys/module/lowmemorykiller/parameters/minfree
chmod 444 /sys/module/lowmemorykiller/parameters/minfree
#test to see if executed
echo test /sdcard/minfreetest.txt
Reboot, and see if there is the word test in /sdcard/minfreetest.txt.
If so, cat your minfree and adj files and see if they have your desired values.
Click to expand...
Click to collapse
When added to 99elementalx script works.
Strange that in a separate file does not work, even though other scripts are running.
Thanks for your help.
WSZR said:
When added to 99elementalx script works.
Strange that in a separate file does not work, even though other scripts are running.
Thanks for your help.
Click to expand...
Click to collapse
Well try this.
Comment out those lines from 99elementalx and create a new file /etc/init.d/98minfree
Put the contents in it below:
Code:
#!/system/bin/sh
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "0,1,2,5,7,16" > /sys/module/lowmemorykiller/parameters/adj
chmod 444 /sys/module/lowmemorykiller/parameters/adj
chmod 664 /sys/module/lowmemorykiller/parameters/minfree
echo "9933,10728,14950,17510,20019,31385" > /sys/module/lowmemorykiller/parameters/minfree
chmod 444 /sys/module/lowmemorykiller/parameters/minfree
#test to see if executed
echo newtest > /sdcard/minfreetest.txt
save it as /etc/init.d/98minfree ...then chmod it 777 (rwxrwxrwx), then reboot, and see if it worked.
If you have to leave it in 99elementalx to make it work, it will get wiped the next time you flash the kernel again. Alternatively, you can just forget init.d, and use tasker to execute the commands.

[HOWTO] Add /etc/init.d support and enable OTG on boot [ROOT REQUIRED]

[UPDATE #1] I've added a zip file with the 2 scripts, with UNIX line endings , as suggested below by @aftvNews . Cheers.
[UPDATE #2] I've added a zip file with the 2 extra scripts to go into /etc/init.d, as requested by @Axecaster . These will need the same ownership and permissions as enableotg. They disable SELinux and set the permissions on the recovery directories. Cheers.
Having had a look around the android image on my Fire TV Stick (v1) [ FireOS 5.2.1.1 @rbox ] I found that a script, which doesn't exist, called /system/bin/factoryadb.sh was being run by /init.build.rc on boot.
I was able to create a simple script to run scripts in /etc/init.d on boot.
UPDATE (05/04/19): Now I've got root access on my FireTV Gen 2 [ FireOS 5.2.6.9 ] I can see the see these instructions will also work, although the OTG enabling is not needed
NOTE: I've only tested this on a 1st generation Fire TV Stick but may work on Fire TV boxes if they also call /system/bin/factoryadb.sh from /init.build.rc
Before you do this please make sure factoryadb.sh is NOT on your FireTV and that it is called from /init.build.rc by connecting to your FireTV via adb and running the following commands
Code:
adb shell
su
grep factoryadb /init.build.rc && ls -l /system/bin/factoryadb.sh
Hopefully this will return
Code:
service factoryadb /system/bin/factoryadb.sh
/system/bin/factoryadb.sh: No such file or directory
Now continue ...
My factoryadb.sh script
Code:
#!/system/bin/sh
#
# Execute all scripts in /etc/init.d
if [ -d /etc/init.d ]
then
for f in `ls /etc/init.d/* 2>/dev/null`
do
if [ -s ${f} ]
then
echo Executing ${f} ... >/dev/kmsg
/system/bin/sh ${f}
fi
done
fi
NOTE: Make sure this file has UNIX line endings only. Notepad++ has an option to specify UNIX line endings.
I also have a simple script to enable OTG which I called enableotg, again MUST have UNIX line endings.
Code:
#!/system/bin/sh
echo 1 > /sys/devices/platform/bcmpmu_otg_xceiv/host
Connect to the Fire TV Stick via adb and run the following commands
Code:
adb push factoryadb.sh /sdcard/
adb push enableotg /sdcard/
adb shell
su
mount -o remount,rw /system
mkdir /etc/init.d
cp /sdcard/factoryadb.sh /system/bin/
cp /sdcard/enableotg /etc/init.d/
chown 0:0 /system/bin/factoryadb.sh /etc/init.d /etc/init.d/enableotg
chmod 755 /system/bin/factoryadb.sh /etc/init.d /etc/init.d/enableotg
mount -o remount,ro /system
reboot
When the FireTV Stick has rebooted then reconnect via adb and run the following commands
Code:
adb shell
su
dmesg | grep -e factoryadb -e Executing -e bcmpmu
You should see something similar to
Code:
<6>[ 3.005279] bcmpmu_otg_xceiv bcmpmu_otg_xceiv: Probing started...
<6>[ 3.007690] bcmpmu_otg_xceiv bcmpmu_otg_xceiv: Probing successful
<3>[ 4.998016] init: Warning! Service factoryadb needs a SELinux domain defined; please fix!
<4>[ 5.573242] Executing /etc/init.d/enableotg ...
<6>[ 5.579040] bcmpmu_otg_xceiv bcmpmu_otg_xceiv: Switching to Host
All is working and OTG should be working about 5 seconds after leaving the TWRP screen and long before Android has finished booting.
If you have an ethernet dongle attached it should have an IP address before the launcher starts
NOTE: The SELinux warning can be safely ignored.
Hope this helps.
Nicely done. Clever using the missing factoryadb.sh to roll your own init.d.
Might be easier for some if you just upload/attach your factoryadb.sh and enableotg files that others can download, so there's no need to worry about proper UNIX line endings.
Worked nicely on one of my gen 1 sticks running 5.2.4.1_r2.
OTG works for USB pendrive?
AFTVnews.com said:
Nicely done. Clever using the missing factoryadb.sh to roll your own init.d.
Might be easier for some if you just upload/attach your factoryadb.sh and enableotg files that others can download, so there's no need to worry about proper UNIX line endings.
Click to expand...
Click to collapse
Doh! Completely missed the section to "Attach Files" when I was writing the post
I've now added a zip file with the 2 scripts with UNIX line endings to the post.
Cheers
Awesome job figuring out this was possible! I can confirm the init.d part works just fine on the FireTV-v1 on Rbox v5.2.4.1_r2 (didn't test OTG scripts as I already have a full USB port).
I am going to be adding in your init.d support to my Playing with Fire MOD for the next release.
Now just got to get PS3 / Xbox One controller kernel plugins compiled and working for the Gen1 devices now that init.d works. :good:
dony71 said:
OTG works for USB pendrive?
Click to expand...
Click to collapse
I tried this on fire tv stick 1, usb storage does not work.
dmesg shows my Kingston USB pendrive being recognized by kernel,
but registered driver debus_usbdev ?
So I guess kernel doesn't have USB storage driver?
----------------------------------------------------------------------------------------------------
<6>[ 7.267791] usb 3-1: new high speed USB device number 2 using dwc_otg
<6>[ 7.538024] usb 3-1: New USB device found, idVendor=0951, idProduct=1642
<6>[ 7.538116] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 7.538238] usb 3-1: Product: DT 101 G2
<6>[ 7.538330] usb 3-1: Manufacturer: Kingston
<6>[ 7.538482] usb 3-1: SerialNumber: 001CC0EC3509EA50B0000232
<6>[ 47.829345] usbcore: registered new interface driver dbus_usbdev
<3>[ 60.385131] init: Warning! Service adb_usb needs a SELinux domain defined; please fix!
Does this enable the use of USB storage ? as ive had this setup for over 6 months now to enable usb pheripal support on boot (with a script booter). If not i guess its still good to do away with the extra apk i had installed to enable my script at boot.
What does this actually do? My FireTV already can read from usb drives.
tdfsu said:
What does this actually do? My FireTV already can read from usb drives.
Click to expand...
Click to collapse
Seems mainly for gen 1 sticks to enable usb peripherals. Each boot requires a command to be re-run to recognize usb keyboards, mice, wired networking port, etc. Someone correct me if I'm wrong, but this configuration could in-theory assign multiple scripts to run on boot without extra apps installed.
Axecaster said:
Seems mainly for gen 1 sticks to enable usb peripherals. Each boot requires a command to be re-run to recognize usb keyboards, mice, wired networking port, etc. Someone correct me if I'm wrong, but this configuration could in-theory assign multiple scripts to run on boot without extra apps installed.
Click to expand...
Click to collapse
Yes Gen2 sticks and the main FireTV's seem to have OTG already enabled but Gen1 sticks don't.
However even though I've only specified enabling OTG in my initial post, as Axecaster mentioned I do in fact have a number of scripts in /etc/init.d that run on boot.
e.g. Set SELinux to Permissive, set full R/W access on the recovery directories, cleanup some temp files on boot etc
I'm currently checking to see if I can set a static IP on the USB Ethernet adapter I use with my Gen1 stick which will most likely result in a new script in /etc/init.d
I also need to investigate the USB storage options more though. Might be the same issue as I'm having with NFS mounts. I can mount an NFS share but currently only root can see it!
Hope this helps.
tgellen said:
Yes Gen2 sticks and the main FireTV's seem to have OTG already enabled but Gen1 sticks don't.
However even though I've only specified enabling OTG in my initial post, as Axecaster mentioned I do in fact have a number of scripts in /etc/init.d that run on boot.
e.g. Set SELinux to Permissive, set full R/W access on the recovery directories, cleanup some temp files on boot etc
I'm currently checking to see if I can set a static IP on the USB Ethernet adapter I use with my Gen1 stick which will most likely result in a new script in /etc/init.d
I also need to investigate the USB storage options more though. Might be the same issue as I'm having with NFS mounts. I can mount an NFS share but currently only root can see it!
Hope this helps.
Click to expand...
Click to collapse
Have you checked or modified your "persist-usb-config" file yet? If your's has different values than this (from a FireTV-Box) edit it to match mine and see if that helps.
Code:
[email protected]:/ # cat /data/property/persist.sys.usb.config
diag,serial_smd,serial_tty,rmnet_bam,mass_storage,adb
As for your NFS shares issue you are going to need to do a Bind Mount to get non-root users able to access the directory. Im using the same bind-mount method to get a bunch of additional GApps installed on the FireTV by binding folders in /data/local/ --> /system/priv-app and using your /etc/init.d/ discovery to launch it automatically on boot.
[email protected]: # mkdir /data/local/nfs && chmod 0755 /data/local/nfs && chown 0:0 /data/local/nfs
init.d startup script:
Code:
#!/system/bin/sh
NFSPATH=/path/to/nfs
NFSDATA=/data/local/nfs
(mount -o bind $NFSPATH $NFSDATA) ; (mount -o remount nosuid,nodev,noexec,reltime,async $NFSPATH)
SimLynks said:
Have you checked or modified your "persist-usb-config" file yet? If your's has different values than this (from a FireTV-Box) edit it to match mine and see if that helps.
Click to expand...
Click to collapse
Result:
Code:
[email protected]:/ # cat /data/property/persist.sys.usb.config
[B]adb[/B][email protected]:/ #
I pulled the file, replaced "adb" with "iag,serial_smd,serial_tty,rmnet_bam,mass_storage,adb", pushed it back and rebooted the device.
Result: ADB is disabled and otg doesn't seem to work (usb flash drive)
Enabling ADB sets the file back to "adb" and after a reboot otg is working again.
after installing xposed framework on the fire tv stick this method for otg on boot not longer works.
any solutions?
thecoonx said:
after installing xposed framework on the fire tv stick this method for otg on boot not longer works.
any solutions?
Click to expand...
Click to collapse
Hmm. I installed this method after xposed framework. As far as I'm aware, everything seems to be working.
thecoonx said:
after installing xposed framework on the fire tv stick this method for otg on boot not longer works.
any solutions?
Click to expand...
Click to collapse
Axecaster said:
Hmm. I installed this method after xposed framework. As far as I'm aware, everything seems to be working.
Click to expand...
Click to collapse
So only setup your scripts after you are done flashing a PreRooted ROM &/or SuperSU &/or XPosed Framework. So in other words only after your done messing with things that mess with /System in TWRP. Or you will have to reset them again.
SimLynks said:
Have you checked or modified your "persist-usb-config" file yet? If your's has different values than this (from a FireTV-Box) edit it to match mine and see if that helps.
Code:
[email protected]:/ # cat /data/property/persist.sys.usb.config
diag,serial_smd,serial_tty,rmnet_bam,mass_storage,adb
As for your NFS shares issue you are going to need to do a Bind Mount to get non-root users able to access the directory. Im using the same bind-mount method to get a bunch of additional GApps installed on the FireTV by binding folders in /data/local/ --> /system/priv-app and using your /etc/init.d/ discovery to launch it automatically on boot.
[email protected]: # mkdir /data/local/nfs && chmod 0755 /data/local/nfs && chown 0:0 /data/local/nfs
init.d startup script:
Code:
#!/system/bin/sh
NFSPATH=/path/to/nfs
NFSDATA=/data/local/nfs
(mount -o bind $NFSPATH $NFSDATA) ; (mount -o remount nosuid,nodev,noexec,reltime,async $NFSPATH)
Click to expand...
Click to collapse
Hi SimLynks,
Thanks for your suggestion. The bind mount did make the directory available for the non-root user but unfortunately it's contents were still only visible to the root user
I'll keep on trying
Cheers.
tgellen said:
[UPDATE #1] I've added a zip file with the 2 scripts, with UNIX line endings , as suggested below by AFTVNews. Cheers.
[UPDATE #2] I've added a zip file with the 2 extra scripts to go into /etc/init.d, as requested by Axecaster. These will need the same ownership and permissions as enableotg. They disable SELinux and set the permissions on the recovery directories. Cheers.
Having had a look around the android image on my Fire TV Stick (v1) [FireOS 5.2.1.1 rbox] I found that a script, which doesn't exist, called /system/bin/factoryadb.sh was being run by /init.build.rc on boot.
I was able to create a simple script to run scripts in /etc/init.d on boot.
NOTE: I've only tested this on a 1st generation Fire TV Stick but may work on Fire TV boxes if they also call /system/bin/factoryadb.sh from /init.build.rc
Before you do this please make sure factoryadb.sh is NOT on your FireTV and that it is called from /init.build.rc by connecting to your FireTV via adb and running the following commands
Code:
adb shell
su
grep factoryadb /init.build.rc && ls -l /system/bin/factoryadb.sh
Hopefully this will return
Code:
service factoryadb /system/bin/factoryadb.sh
/system/bin/factoryadb.sh: No such file or directory
Now continue ...
My factoryadb.sh script
Code:
#!/system/bin/sh
#
# Execute all scripts in /etc/init.d
if [ -d /etc/init.d ]
then
for f in `ls /etc/init.d/* 2>/dev/null`
do
if [ -s ${f} ]
then
echo Executing ${f} ... >/dev/kmsg
/system/bin/sh ${f}
fi
done
fi
NOTE: Make sure this file has UNIX line endings only. Notepad++ has an option to specify UNIX line endings.
I also have a simple script to enable OTG which I called enableotg, again MUST have UNIX line endings.
Code:
#!/system/bin/sh
echo 1 > /sys/devices/platform/bcmpmu_otg_xceiv/host
Connect to the Fire TV Stick via adb and run the following commands
Code:
adb push factoryadb.sh /sdcard/
adb push enableotg /sdcard/
adb shell
su
mount -o remount,rw /system
mkdir /etc/init.d
cp /sdcard/factoryadb.sh /system/bin/
cp /sdcard/enableotg /etc/init.d/
chown 0:0 /system/bin/factoryadb.sh /etc/init.d /etc/init.d/enableotg
chmod 755 /system/bin/factoryadb.sh /etc/init.d /etc/init.d/enableotg
mount -o remount,ro /system
reboot
When the FireTV Stick has rebooted then reconnect via adb and run the following commands
Code:
adb shell
su
dmesg | grep -e factoryadb -e Executing -e bcmpmu
You should see something similar to
Code:
<6>[ 3.005279] bcmpmu_otg_xceiv bcmpmu_otg_xceiv: Probing started...
<6>[ 3.007690] bcmpmu_otg_xceiv bcmpmu_otg_xceiv: Probing successful
<3>[ 4.998016] init: Warning! Service factoryadb needs a SELinux domain defined; please fix!
<4>[ 5.573242] Executing /etc/init.d/enableotg ...
<6>[ 5.579040] bcmpmu_otg_xceiv bcmpmu_otg_xceiv: Switching to Host
All is working and OTG should be working about 5 seconds after leaving the TWRP screen and long before Android has finished booting.
If you have an ethernet dongle attached it should have an IP address before the launcher starts
NOTE: The SELinux warning can be safely ignored.
Hope this helps.
Click to expand...
Click to collapse
Can this be used in some way to enable otg while at the TWRP countdown bar ( as to use keyboard/mouse/airmouse within TWRP), As it's a whole lot easier to use than the ADB mouse, having to plug firestick into laptop/computer if you need to be in recovery, if it is possible it could be easier.
I use the airmouse/keyboard method myself when I go I to recovery but have to use my home made otg cable and swap over usb to computer after running the command to usb dongle for the airmouse (melee F10 pro). After the command has run while plugged into my laptop I unplug the laptop connection and plug in my dongle and I navigate TWRP with my remote.
It is any chance that we can enable OTG on no-rooted devices of firetv gen 1 ?I have firmware 5.2.6.7 so I think there is no way I can root the device. Thanks!
minute said:
It is any chance that we can enable OTG on no-rooted devices of firetv gen 1 ?I have firmware 5.2.6.7 so I think there is no way I can root the device. Thanks!
Click to expand...
Click to collapse
Sorry. Unfortunately you need root access to change the OTG value on the FireTV gen 1

Categories

Resources