[Fire TV 2 Kernel Module] Xbox One Controller Support - Fire TV Android Development

This is the XPAD linux kernel module, built for the Fire TV 2. Kindly enough, Amazon built their kernel with module support, so we can load modules. We'll have to wait until we get kexec before we can fully replace the kernel.
Note: I added modules for the Fire TV 1, but I don't own a Fire TV 1 so they're unsupported. I've had others tell me they work great though.
Demo Video
Prerequisites:
rooted amazon fire tv 2
Instructions:
Download the Zip and extract the two modules
Copy the modules to your fire tv wherever you like
Open a shell.
Type these commands, accept root permission on your FireTV if prompted:
Code:
su
mount -o remount,rw /system
cp /system/usr/keylayout/Vendor_045e_Product_0291.kl /system/usr/keylayout/Vendor_045e_Product_02d1.kl
chmod 644 /system/usr/keylayout/Vendor_045e_Product_02d1.kl
mount -o remount,ro /system
reboot
When your FireTV comes back up, open a shell again.
Type these commands, accept root permission on your FireTV if prompted:
Code:
su
insmod <module location>/ff-memless.ko
insmod <module location>/firepad.ko
Your controller should instantly work. Upon every reboot you'll have to 'insmod' the modules again.
A nice way to deal with this is D4rKn3sSyS's Module Loader Apk from 2011.
You can find that here: http://forum.xda-developers.com/showthread.php?t=1228605
Basically, you need to give it permanent root access, add your modules in the list, save them, and go into the settings of the app to enable it on boot. (Use the Menu key on your remote to enter the settings)
Enjoy!
Use at your own risk!
Source can be found here:
https://gitlab.com/miketweaver/android_kernel_amazon_sloane
Thanks goes to:
zeroepoch - For root. You rock, my friend.
xpad developers - They coded the module. I just changes a few function names to make it work on the firetv2.
Prebuilt Kernel Modules (DIY instructions found in next post)
Download Mirrors:
Fire TV 1 - OUTDATED
Fire TV 2

DIY/Build Instructions
Only if you want to build yourself. Prebuilt modules are found in the post above.
These instructions are geared towards a linux machine, though you may be able to adapt it to a windows environment.
Build Setup
Download and extract the AArch64 compiler
http://developer.android.com/ndk/downloads
Clone the repo
Code:
$ git clone https://gitlab.com/miketweaver/android_kernel_amazon_sloane.git
$ cd android_kernel_amazon_sloane/
Setup the build environment
Code:
$ export PATH=<path_to_ndk>/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin:$PATH
Create the kernel config
Code:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- mt8173_sloane_defconfig
Set Firepad to be a module in the kernel config
Code:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- menuconfig
Device Drivers -> Input Device Support -> Joysticks/Gamepads
Hit <M> to set "X-box Gamepad Support" as a module
(optional) Hit <space> to add "X-Box gamepad rumble support (NEW)" and "LED Support for Xbox360 controller 'BigX' LED (NEW)", if desired.
Build the kernel and modules
Code:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j<num_cores>
Copy the kernel and modules
Code:
$ cp arch/arm64/boot/Image <target_dir>/
$ find . -name '*ko' -exec cp '{}' ~/<target_dir>/ \;
The module you're looking for is "firepax.ko" and (optional) "ff-memless.ko".
Clean kernel sources (optional)
Code:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- mrproper

I added information about a good module loader.
http://forum.xda-developers.com/showthread.php?t=1228605
This solves the issue with the modules not surviving reboot.

It looks like you forgot to add the new files to the repo since they were untracked, although the old files were removed. I'm not trying to build it just an observation.

Any chance this can be done for the first Fire TV?

Sizzlechest said:
Any chance this can be done for the first Fire TV?
Click to expand...
Click to collapse
I don't have a firetv 1, but I should be able to cross compile for it. Give me a bit to check if I can build the kernel for it. Once I get it done, would you be willing to test?

zeroepoch said:
It looks like you forgot to add the new files to the repo since they were untracked, although the old files were removed. I'm not trying to build it just an observation.
Click to expand...
Click to collapse
Wow, that's a rookie mistake. Thanks for pointing that out. Fixed.
I also added the build instructions, for those who want to build themselves, or would like a guide on building the kernel for the fire tv 2.

Awesome! Thanks @bash-ninja ... I'm still trying to compile the aftv2 kernel with some of zeroepoch's fixes, but you're howto guide definitely helps. I might go buy a used xbox one controller just to test this.. lol.
Good work! :good:

z_thompsonpa said:
Awesome! Thanks @bash-ninja ... I'm still trying to compile the aftv2 kernel with some of zeroepoch's fixes, but you're howto guide definitely helps. I might go buy a used xbox one controller just to test this.. lol.
Good work! :good:
Click to expand...
Click to collapse
The guide is a simple adaptation of the Readme found in @zeroepoch's repo. The thanks goes to him!

bash-ninja said:
I don't have a firetv 1, but I should be able to cross compile for it. Give me a bit to check if I can build the kernel for it. Once I get it done, would you be willing to test?
Click to expand...
Click to collapse
Absolutely!

Sizzlechest said:
Absolutely!
Click to expand...
Click to collapse
Go ahead and give these a try:
https://www.androidfilehost.com/?fid=24269982087021362

I wanted to report that it works on my FireTV 1. BTW, how do I handle button mappings? I tried it with Pacman 256 and Crossy Road and the controls don't seem to work correctly. Pacman 256 works with the analog stick, but not the dpad. Crossy Road doesn't work at all.

Sizzlechest said:
I wanted to report that it works on my FireTV 1. BTW, how do I handle button mappings? I tried it with Pacman 256 and Crossy Road and the controls don't seem to work correctly. Pacman 256 works with the analog stick, but not the dpad. Crossy Road doesn't work at all.
Click to expand...
Click to collapse
Did you setup the .kl file? If you have, and rebooted, it should work just like the xbox 360 controller.
Code:
adb shell
$ su
$ mount -o remount,rw /system
$ cp /system/usr/keylayout/Vendor_045e_Product_0291.kl /system/usr/keylayout/Vendor_045e_Product_02d1.kl
$ chmod 644 /system/usr/keylayout/Vendor_045e_Product_02d1.kl
$ mount so remount,ro /system
$ reboot
I'm not home, but when I am, I'll take a look at those games and see if they work with the mapping I already have.
Edit: @Sizzlechest, I tested out Crossy Road. It didn't work with my controller, but neither did the generic controller I plugged in via USB. Whatever is causing issues in that game it's not just the Xbox Controller, but it's many others. There's something wrong with their app. (Makes sense pac-man 256 is having issues too because it's made by the same people) The apps I've tried and work are Asphalt, Minecraft, Moonlight Gaming, KOTOR, Prince of Persia, and Lego Star Wars.

I've never hooked up 360 controller, but for xbox one does this work wireless or wired usb?

YoColdRain said:
I've never hooked up 360 controller, but for xbox one does this work wireless or wired usb?
Click to expand...
Click to collapse
Plugged in via USB. The only devices that support the Xbox One wireless dongle are Windows 7, 8, and 10.
As far as I'm aware, no one has reversed engineered the Wireless dongle yet.
The 360 works wireless or wired, I've been told. I don't own a 360 controller.

hi ninja it doesnt work for me on my firetv1
do I need specific version of the firmware? I didn't update it after the initial root.
shell output:
Code:
[email protected]:/ $ su
su
[email protected]:/ # mount -o remount,rw /system
mount -o remount,rw /system
[email protected]:/ # cp /system/usr/keylayout/Vendor_045e_Product_0291.kl /system/usr/keylayout/Vendor_045e_Product_02d1.kl
_045e_Product_0291.kl /system/usr/keylayout/Vendor_045e_Product_02d1.kl <
[email protected]:/ # chmod 644 /system/usr/keylayout/Vendor_045e_Product_02d1.kl
chmod 644 /system/usr/keylayout/Vendor_045e_Product_02d1.kl
[email protected]:/ # mount so remount,ro /system
mount so remount,ro /system
[U]Usage: mount [-r] [-w] [-o options] [-t type] device directory[/U]
1|[email protected]:/ # reboot
reboot
thanks

godlike1984 said:
hi ninja it doesnt work for me on my firetv1
do I need specific version of the firmware? I didn't update it after the initial root.
only indication is this:
Code:
[email protected]:/ $ su
su
[email protected]:/ # mount -o remount,rw /system
mount -o remount,rw /system
[email protected]:/ # cp /system/usr/keylayout/Vendor_045e_Product_0291.kl /system/usr/keylayout/Vendor_045e_Product_02d1.kl
_045e_Product_0291.kl /system/usr/keylayout/Vendor_045e_Product_02d1.kl <
[email protected]:/ # chmod 644 /system/usr/keylayout/Vendor_045e_Product_02d1.kl
chmod 644 /system/usr/keylayout/Vendor_045e_Product_02d1.kl
[email protected]:/ # mount so remount,ro /system
mount so remount,ro /system
[U]Usage: mount [-r] [-w] [-o options] [-t type] device directory[/U]
1|[email protected]:/ # reboot
reboot
thanks
Click to expand...
Click to collapse
Looks like a typo on my part of the tutorial.
The command should be:
Code:
mount -o remount,ro /system
Also, is your controller a regular Xbox one? (not an elite/etc)

yes it is the normal one the newer model with regular jack for headphones... I am afraid it still doesn't work on my side... did i do something wrong using the typo that could prevent it from running?

After chatting with @godlike1984 it looks like his controller is registering as a covert forces controller (idVendor=045e, idProduct=02dd) instead of the regular xbox controller (idVendor=045e, idProduct=02d1). I'm going to see if I can get access to one to fix it. It may take awhile. If someone has a covert forces controller and has it working, let me know.

Any chance we can get something for wired 360 controllers, especially the Rock Candy ones. Helf the time the triggers respond and the same goes with the right stick.

Related

[Q] tun.ko and vpn for Dell Streak

I am trying to connect to my company's vpn server (Cisco) with an application named vpnc.
but it needs a tun.ko module which I can't find on the Dell Streak.
I find tun.ko for other devices but I can't use them as a module on the Dell Streak. It does not accept the exec format.
Can anyone compile a tun.ko for Dell Streak ? Or is there any compiled tun.ko for it ?
Thanks.
I'd appreciate any help...
I misunderstood the OP query
As the OP said, tun.ko needs to be specific to the device.
The one you found says:
"tun for Android 2.2 (Froyo) Nexus One devices"
We are both looking for one for the Streak - in my case at 2.1 level.
Thanks for looking.
Post #12 Here http://forum.xda-developers.com/showthread.php?t=630703&page=2 appears to have all the instructions, but I don't have the skills.
mardibloke said:
As the OP said, tun.ko needs to be specific to the device.
The one you found says:
"tun for Android 2.2 (Froyo) Nexus One devices"
We are both looking for one for the Streak - in my case at 2.1 level.
Thanks for looking.
Post #12 Here http://forum.xda-developers.com/showthread.php?t=630703&page=2 appears to have all the instructions, but I don't have the skills.
Click to expand...
Click to collapse
is there really that much difference between the streak and the nexus?
I misunderstood what the OP meant by "other devices" I Presumed he meant linux not android,
have you thought about asking on that google code page for them to compile it for you?
-----edit scratch that..
having read that thread..
I think you need the streak source code..
Best get involved in the attempts to get Dell to release it to comply with the GPL.
actually, we don't need the source code of Streak.
we just need to compile tun.ko for Streak.
I don't know how to do that.
I asked in the project site but nobody answered.
mrmrmrmr said:
actually, we don't need the source code of Streak.
we just need to compile tun.ko for Streak.
I don't know how to do that.
I asked in the project site but nobody answered.
Click to expand...
Click to collapse
according to the thread mardibloke posted you need the source as he checks out the nexus-one specific head..
Finaly! I figured out how to build tun.ko module for the stock kernel.
If anybody wants to repeat that:
* I have Android OpenSource installed in /opt/android
* In /opt/android I did: git clone git://android.git.kernel.org/kernel/msm.git kernel-nexus
* In kernel-nexus I did:
- git checkout -b origin/android-msm-2.6.29-nexusone
- git checkout HEAD^
(The last operation reverses one revision, I needed a previous revision from the tree. Different revisions generate modules with different vermagic values)
(Actually, instead of previous two this should work as well - it should checkout the correct revision: git checkout 4bc62c230b2942bea72c3b5258e3e4f1d6cb534b )
- make ARCH=arm CROSS_COMPILE=/opt/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- distclean
- adb pull /proc/config.gz
- gunzip config.gz
- mv config .config
- Edited .config: changed "# CONFIG_TUN is not set" to: "CONFIG_TUN=m"
- make ARCH=arm CROSS_COMPILE=/opt/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- modules
- The driver ends up in: drivers/net/tun.ko
- You can verify if it is going to match the kernel by running:
+ strings drivers/net/tun.ko | grep 2.6.29
+ It should produce "vermagic=2.6.29-01117-g4bc62c2 preempt mod_unload ARMv7"
+ The "2.6.29-01117-g4bc62c2" should be the same as the "Kernel version" in "Settings->About phone" on your phone.
* Now you can upload the module to your phone. I did:
- adb shell mount -o remount,rw /dev/block/mtdblock3 /system
- adb push drivers/net/tun.ko /system/lib/modules/
- adb shell mount -o remount,ro /dev/block/mtdblock3 /system
- And you can use adb shell, enter /system/lib/modules and run: insmod tun.ko
- It should work
Click to expand...
Click to collapse
Made some progress, but now stuck getting the tun.ko file copied onto my streak.
Streak 2.1 does not appear to have cp or pull commands.
Cannot push the file over via adb, to where I need it
Cannot move the file
Any help really appreciated.
>adb push tun.ko /system/lib/modules/tun.ko
failed to copy 'tun.ko' to '/system/lib/modules/tun.ko': Permission denied
>adb push tun.ko /sdcard/tun.ko
877408 KB/s (158130 bytes in 0.000s)
>adb shell
$ su
su
# mount -o remount,rw /dev/block/mtdblock3 /system
mount -o remount,rw /dev/block/mtdblock3 /system
#
# mv /sdcard/tun.ko /system/lib/modules/tun.ko
mv /sdcard/tun.ko /system/lib/modules/tun.ko
failed on '/sdcard/tun.ko' - Cross-device link
how did you get it compiled for the streak without the kernel source?
Can we see if I get it working before I comment on that
couldn't you just put in on your sd card and copy over to system/lib/modules once you mount it r/w with root explorer?
I don't appear to have the cp command available
You see I tired to move it (as mv command was available), and that failed.
I'm new to Linux, so maybe I missed something obvious?
>adb shell
$ su
su
# mount -o remount,rw /dev/block/mtdblock3 /system
mount -o remount,rw /dev/block/mtdblock3 /system
#
# mv /sdcard/tun.ko /system/lib/modules/tun.ko
mv /sdcard/tun.ko /system/lib/modules/tun.ko
failed on '/sdcard/tun.ko' - Cross-device link
more coffee, and found CAT is available..
cat /sdcard/tun.ko > /system/lib/modules/tun.ko
appears to have worked, off for some more testing.
can you share that ?
Attached is tun.ko that as you will see below appears to run on my 2.1 Streak
VPNC not currently connecting for me though :/
Code:
[email protected]:~/mydroid/kernel-streak$ adb push drivers/net/tun.ko /sdcard/tun.ko
1572 KB/s (161314 bytes in 0.100s)
[email protected]:~/mydroid/kernel-streak$ adb shell
$ su
# mount -o remount,rw /dev/block/mtdblock3 /system
# cat /sdcard/tun.ko > /system/lib/modules/tun.ko
# mount -o remount,ro /dev/block/mtdblock3 /system
# cd /system/lib/modules
# insmod tun.ko
# exit
$ exit
[email protected]:~/mydroid/kernel-streak$
thank you for sharing. but why doesn't vpnc connect ?
Sorry don't know why vpnc does not connect.
To be honest, I don't know how to tell tun is running properly.
Any advice, places to check logs etc appreciated.
Was interested if it worked for you, as I may just have my vpnc config wrong for our work connection.
Nothing bad has happened since I installed, and ran the tun.ko that I attached, but clearly I should say using it is at your own risk.
For example i see:
Known issues¶
Usernames can not contain the @ symbol
and my usernames do have the @ symobol for my work credentials
w00t! or whatever you say after spending 3 evenings trying to get this working.
Am connected fine, using the tun.ko file I already attached.
Final issue for me was solved by some debug with using a shell on my Streak and command:
Code:
/data/data/org.codeandroid.vpnc_frontend/files/vpnc --script /data/data/org.codeandroid.vpnc_frontend/files/vpnc-script --no-detach --debug 1
To see what was going on, turns out I *just* needed to install Busybox.
So I think what you need to be the same as me is:
2.1 UK Build 6941
Rooted
Busybox install - on marketplace
Then the tun.ko file I posted, and use the commands shown in the same post.
Any problems, just ask.
Did I mention, pretty pleased
it's obvious that you are pleased
let's see:
I have only Android 1.6 on my Dell Streak.
Would that work ?
it's rooted already.
installing BusyBox right now. (why is that needed btw ?)
done !
copied tun.ko to /system/lib/modules
insmod is fine. I can see the module loaded by "lsmod"
configured my company vpn.
btw, my user also has @ sign , is that a problem ?
leave password empty. it asks for password. fine....
"failed to connect"
what do I have to check ?

[WIP] [DEV] [HOWTO] Ubuntu on Nook Color! UPDATE 1/5/11

DISCLAIMER: You know the risks, bricking, breaking etc. I'm not, nor is anyone else responsible if something goes wrong with your device, especially should it turn into a cave troll and bludgeon someone to death.
You will have to be rooted for this to work.
Update 1/5/11
Changed the install and loader scripts re-compressed and uploaded, new download link. Stream lined the installation process (removed 5 steps)
Update 1/4/11
reflect changes to ubuntu.sh and bootubuntu scripts and streamlining the process. Added screenshots
_________________________
I was over at nexusonehacks.net and looking at the ubuntu on nexus one hack and was thinking that this could be ported to the nook color. The idea is to run ubuntu from an img on the sd card.
The following is a modified version of the "how to" orginally posted here
http://nexusonehacks.net/nexus-one-hacks/how-to-install-ubuntu-on-your-nexus-oneandroid/
Credits
The guys at NexusOneHacks
xda user munday who has modified the scripts to work for the nook color
Devs at XDA Developer for the Ubuntu ARM image for HTC HD2
Saurik (Jay Freeman) for the Debian G1 script, which was hacked for Ubuntu on Nexus One! and then re-hacked for the Nook Color by munday
Here we go:
1) Go download the ubuntu file here: http://www.megaupload.com/?d=67BU4Y3T
2) Extract the contents using 7zip http://www.7-zip.org/download.html
3) Copy the extracted folder "ubuntu" to the root of your SD card
4) Unmount the nook from your pc, go into the app NookColor Tools (if you don't have it download it here courtesy of Ben 74 and click All Settings->Development then uncheck Auto Mount. This will prevent the SD card from being mounted automatically when plugged into the PC
5) Plug the Nook back into your pc and open a command line then navigate to your android sdk folder ie C:\android-sdk or wherever you have it and type
Code:
adb devices
Hit enter and make sure that the nook color comes up (should be the SN of your Nook)
Note: This can also be done from terminal emulator instead of adb...but it is kind of a pain
6) Now we want to go into the command line on the nook so type
Code:
adb shell
Hit enter and this should bring up a "#" sign.
7) Type
Code:
su
hit enter (I do this just as a force of habit)
8) Now we navigate to the ubuntu folder we just copied to our sd card by entering
Code:
cd /sdcard/ubuntu
hit enter. To confirm you are where you want to be you can type
Code:
ls
and it should list the contents of the ubuntu folder.
9) Run the setup script ubuntu.sh by entering the following:
Code:
sh ./ubuntu.sh
hit enter
10) Now type
Code:
bootubuntu
and hit enter
11) So now we have ubuntu command line up and running which should look like:
Code:
[email protected]:/#
We will need to get some packages to run a gui and then connect to it via VNC client. So we need to update a few things first. Type:
Code:
apt-get update
then
Code:
apt-get install tightvncserver
now we need the gui elements so enter this:
Code:
apt-get install lxde
12) Type the following:
Code:
export USER=root
vncserver -geometry 1024×600
this sets the resolution...you can change it to play around, but the native resolution for the nook is 1024x600. This is also where you will set the password for your vnc server...make sure to remember it
13) Next, we are going to add the following to /root/.vnc/xstartup file using cat command: (hit enter after each line and ignore the fact that it looks like it does it twice)
Code:
cat > /root/.vnc/xstartup
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
lxsession
After hitting enter after the last line press "Ctrl+D" twice then press enter
14) We need the vnc server to start every time we start ubuntu, type this:
Code:
cat > front
export USER=root
cd /
rm -r -f tmp
mkdir tmp
cd /
vncserver -geometry 1024×600
Same as before, hit enter after each line then after hitting enter for the last line press "Ctrl+D" twice then press enter.
15) Enter this
Code:
cat front /root/.bashrc > temp
Then
Code:
cp temp /root/.bashrc
16) Now on the nook open up your vnc viewer app (android vnc viewer or PocketCloud...or whatever you use)
Use the following settings:
Host Address: 127.0.0.1 (some don't require this)
Password: the password you set up in step 16
Port: 5901
Save and then click connect and you should be up and running on ubuntu! To leave ubuntu type exit from adb. This should kill ubuntu. Exit adb and then you can disconnect the nook from your pc.
To start ubuntu from the nook open up a terminal emulater and type:
Code:
bootubuntu
Hit enter, this should bring up the [email protected], hhen press "Home" key and open up your vnc app. Now you are ready to rock your Linux tablet!
You could also use gscript lite to automate the process of starting ubuntu so you don't have to type it in the terminal everytime. You can get gscript lite from the market or download the file I have attached.
It does seem a little laggy..just a little...for now anyway
To exit ubuntu: Disconnect the vnc client then hold the "Home" key (I use button savior which brings up a nice little task manager) and click the Terminal emulator when it pops up under running tasks. Once you are back in the terminal you can type:
Code:
exit
to shut down ubuntu.
Enjoy and make sure you thank munday and the guys at nexusonehacks and all the devs who helped make it possible.
-devastator
EDIT:
I noticed that after rebooting the nook would hang at the "Future of reading" screen....if this happens turn the device off remove the sd card the turn the nook back on. It should boot fine. After it's finished you can return the sd card and mount it. This is strange and I'm looking into it. I'm not sure if this is limited to me or if it is universal to all nooks. It also still fails at shutting ubuntu down for some reason. I'm still looking into this.g into this.
I got it going, just needed a few "busybox"-es here and there . It needs some work, right now to get X you have to use VNC.
It's sluggish but a bit more work might just yield something a bit more usable. I'll play more tomorrow night.
Here's my scripts:
ubuntu.sh
Code:
mount -o remount,rw /dev/block/mmcblk0p5 /system
busybox modprobe ext2
rm -f /data/local/bin/fsrw
rm -f /data/local/bin/bootubuntu
rm -f /data/local/bin/unionfs
rm -f /data/local/bin/installer.sh
rm -f /data/local/bin/mountonly
mkdir /data/local/mnt
#busybox clear
rm /system/bin/fsrw
rm /system/bin/bootubuntu
rm /system/bin/unionfs
rm -/system/bin/mountonly
busybox cp -f fsrw /system/bin
busybox cp -f bootubuntu /system/bin
busybox cp -f unionfs /system/bin
busybox cp -f mountonly /system/bin
cd /sdcard/ubuntu
busybox chmod 4777 *
cd /system/bin/
busybox chmod 4777 *
cd /
#busybox clear
echo " "
echo "Ubuntu Chroot Bootloader v0.1"
echo "Ubuntu Bootloader is now installed!"
echo "This process does NOT damage Android OS!"
echo " "
echo "Original Installer by Charan Singh"
echo "Modified for Ubuntu Chroot by Max Lee at NexusOneHacks.net"
echo " "
echo "To enter the Debian Linux console just type 'bootubuntu'"
bootubuntu
Code:
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox mknod /dev/loop2 b 7 0
mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "Setting localhost on /etc/hosts "
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "READY TO ROCK AND ROLL BABY! "
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo " "
busybox chroot $mnt /bin/bash
#After exit command is executed clear it all up
echo " "
echo "Shutting down Ubuntu"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
Then just followed the instructions at nexusonehacks.
note: to run bootubuntu i had to use sh and the use the full path:
Code:
# sh /system/bin/bootubuntu
other note: I was using adb not a term app on the nook.
Obligatory video
I can't post links yet so check: youtube.com/watch?v=TnXfZ6aagn8 for a really boring video
EDIT: switched the names, DOH!
I also had to use sh and the full path also. Thanks for the update on the script...gonna try it in the morning (it's 2am here) will also see if I can help to get it running smoother. What class SD card are you using? I imagine a class 4 or higher would yeild better results as far as responsiveness goes.
The sd is a class 2 that came in one of my dev phones. I'll pick up a faster one tomorrow after work and test it out.
It's just about 3am here now, we must be in the same time zone.
I'm going to bed now, but first here's a modded version of the script you had originally posted that also works now.
bootubuntu
Code:
#!/bin/sh
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
busybox [ ! -d /data/local/ubuntu ] && mkdir /data/local/ubuntu
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox mknod /dev/loop1 b 7 0
busybox losetup /dev/block/loop1 /sdcard/ubuntu/ubuntu.img
mount -t ext2 /dev/block/loop1 /data/local/ubuntu
#mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "Setting localhost on /etc/hosts "
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "READY TO ROCK AND ROLL BABY! "
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo " "
busybox chroot $mnt /bin/bash
#After exit command is executed clear it all up
echo " "
echo "Shutting down Ubuntu"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
busybox losetup -d /dev/loop1
#unregistering the loopback device just seems to die. need to fix or remove.
I'll look at the N1 formus tomorrow too and see if they have made progress in getting X to run fast or without need for VNC.
Nice work, I am addicted in seeing the crazy crap people are doing everyday.
Couldn't sleep so I'm messing around with it now...I'm using a class 4 and have it up and running. It does seem to be a little laggy, but I don't have a class 2 to compare it to. Let me know what you find out, I'll keep playing with it also to see if I can get it to be more responsive...but we are definately on our way to having a great little linux tablet in addition to android. You should also be able to use this for other builds of linux also by just changing out the .img file to a flavor of your choosing. I'm excited
I have also updated the OP with the how to and credits. Really appreciate your help munday.
I noticed that after rebooting the nook would hang at the "Future of reading" screen....if this happens turn the device off remove the sd card the turn the nook back on. It should boot fine. After it's finished you can return the sd card and mount it. This is strange and I'm looking into it. I'm not sure if this is limited to me or if it is universal to all nooks.
Edit:
Running into some strange occurrences...it appears that when you type exit from the terminal to kill ubuntu, I believe ubuntu stays running...anyway, I'm going to bed and will work on it more tomorrow.
devastatorx said:
You should also be able to use this for other builds of linux also by just changing out the .img file to a flavor of your choosing. I'm excited
Click to expand...
Click to collapse
Are there any increased risks with changing the version you use?
Well, you will want to make sure that the build supports ARM based devices.
munday said:
Then just followed the instructions at nexusonehacks.
note: to run bootubuntu i had to use sh and the use the full path:
Code:
# sh /system/bin/bootubuntu
Click to expand...
Click to collapse
I fixed this, the scripts were backwards, I have updated the OP to reflect the changes and bootubuntu now works
devastatorx said:
I fixed this, the scripts were backwards, I have updated the OP to reflect the changes and bootubuntu now works
Click to expand...
Click to collapse
sweet, i can't wait to get home to play more!!!
I've tried running ubuntu.sh from the terminal emulator (With su) and from ADB, and have not had success with either.
The readout is:
Code:
': File existste '/system/bin
': File existste '/system/bin
': File existste '/system/bin
: not found
: not found
cd: can't cd to /sdcard/ubuntu
: not found
: No such file or directory
: not found
cd: can't cd to /system/bin
: not found
: No such file or directory
: not found
cd: can't cd to /
: not found
: not found
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
etc., etc.
Is there a problem with how I copied the script? I assume the first part about the file existing is due to this being the third or fourth time I've tried running the script (Unsuccessfully), but I've no idea how to interpret the rest.
Thanks
munday said:
sweet, i can't wait to get home to play more!!!
Click to expand...
Click to collapse
I sent you a message
Link3737 said:
I've tried running ubuntu.sh from the terminal emulator (With su) and from ADB, and have not had success with either.
The readout is:
Code:
': File existste '/system/bin
': File existste '/system/bin
': File existste '/system/bin
: not found
: not found
cd: can't cd to /sdcard/ubuntu
: not found
: No such file or directory
: not found
cd: can't cd to /system/bin
: not found
: No such file or directory
: not found
cd: can't cd to /
: not found
: not found
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
etc., etc.
Is there a problem with how I copied the script? I assume the first part about the file existing is due to this being the third or fourth time I've tried running the script (Unsuccessfully), but I've no idea how to interpret the rest.
Thanks
Click to expand...
Click to collapse
Try using these, just unrar and then copy them in your ubuntu folder, if it asks to overwrite just click yes...also you have autmounting of the sd card turnned off in nook color tools settings right?
Yeah, it must have been an error on my end. Using the updated scripts you posted worked like a charm.
Thanks!
Link3737 said:
Yeah, it must have been an error on my end. Using the updated scripts you posted worked like a charm.
Thanks!
Click to expand...
Click to collapse
Good to hear!
I'm currently working on making this a port to the SD card so that with the sd card in it boots into ubuntu from power off, and with the sd card out it boots to android then you replace the sd and use it for storage like normal. It will also run a lot snappier....well that's the idea anyway.
devastatorx said:
Good to hear!
I'm currently working on making this a port to the SD card so that with the sd card in it boots into android from power off, and with the sd card out it boots to android then you replace the sd and use it for storage like normal. It will also run a lot snappier....well that's the idea anyway.
Click to expand...
Click to collapse
Booting from SD in the same fashion as Nookie Froyo? That sounds like it would give a huge performance boost over the current method, I can't wait to see what you come up with.
This should be acheivable using the method mentioned in this topic:
http://forum.xda-developers.com/showthread.php?t=873243 thanks to clockworx.
Currently looking into this
devastatorx said:
This should be acheivable using the method mentioned in this topic:
http://forum.xda-developers.com/showthread.php?t=873243 thanks to clockworx.
Currently looking into this
Click to expand...
Click to collapse
I was thinking the exact same thing, the nook seems to like booting from sd, so we should be able to set up the partitions like the foryo sd and edit the init.rc and env.txt to boot ubuntu instead of android. Just a theory though. It's my plan for tonight anyway.
munday said:
I was thinking the exact same thing, the nook seems to like booting from sd, so we should be able to set up the partitions like the foryo sd and edit the init.rc and env.txt to boot ubuntu instead of android. Just a theory though. It's my plan for tonight anyway.
Click to expand...
Click to collapse
I also stumbled across this: http://androix.org/ Which talks about a native android xserver which does a way with the vnc aspect altogether. I downloaded and attempted to install but I get the error "There is a problem parsing the package" and I haven't had any luck plus there isn't much documentation.
Let me know how it goes munday, I'll be working on the same thing later (have to take the fiance out for dinner)
question
I was just curious, after installing ubuntu can we install flash as we would had we booted linux from netbook?

RW and RO mount shortcuts.

Okay, I got sick of typing
Code:
mount -o remount,rw /dev/block/mmcblk0p12 /system
or
Code:
busybox mount -o remount,rw /system
to mount the /system partition in RW mode so I created two very simple scripts that you can run through Script Manager to Mount RW and Mount RO.
I do quite a bit from ADB and I just found it more convenient to tap a shortcut on my home screen to mount the /system partition.
With the help of imchairmanm, I have fixed the scripts to be available globally, so all you have to do is type "mountrw" (without the quotation marks) to mount the /system partition in Read/Write mode, and type "mountro" (again, without the quotation marks) to mount the /system partition in Read Only mode.
So, now it can be run both ways!
Installation:
1. You must be rooted. (See my HowTo: Root your Motorola Droid X2 tutorial.)
2. You must have Busybox installed. If you are rooted, you have busybox installed. I've tested the scripts on BB 1.18.2, 1.19.2 and 1.19.3.
3. Download the mounts.zip file and extract it to a folder on your SDCard (internal or external, it doesn't matter). I use /mnt/sdcard/Scripts/Mounts/.
3. Download Script Manager from the market.
4. Open the Script Manager app and navigate to the folder you put the mount scripts in.
5. Tap the first mount script (mountro).
6. Tap the star and the Android superuser icon next to it. This configures the script as a favorite and to run the script as root.
7. Tap SAVE.
8. Repeat steps 5 through 7 for the second mount script (mountrw)
9. Now you can run each script from within Script Manager, or create shortcuts to them on your home screen.
To create the shortcuts, do the following:
1. Long press a blank area on your home screen and select Widget.
2. In the Choose Widget popup, scroll down to Script Manager Ads (if you have the free version) and tap it.
3. In the list, tap the mountro script. This will place the shortcut on your home screen.
4. Repeat steps 1-3 for the mountrw script.
Now, when you need to mount /system as RW all you need to do is tap the mountrw script, then when you are done, either reboot, or tap the mountro script.
The following is the code for each of the scripts:
mountro:
Code:
#!/system/bin/sh
# This mounts the /system file system as Read Only which is the default when
# Android is booted.
echo "Mounting /system in Read Only mode!"
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
echo "Done!"
mountrw:
Code:
#!/system/bin/sh
# This mounts the /system file system as Read Write in order to modify or add
# files to the /system file system.
echo "Mounting /system in Write mode!"
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
echo "Done!"
It's simple and no frills... The way I like it.
Alternative install:
I didn't realize it, but, I had already made a flashable zip. Just download mount_rw_ro-V1.1.zip and boot into the BSR and flash it from there.
If anyone has any suggestions, I'm open to them! Let me know!
Ciao!
Hm, I was curious since you said you couldn't get your scripts to run globally, so I tried them out by putting them in /system/xbin. After adjusting permissions and making sure owner and group were root, they ran fine and globally as-is. I wonder if the simpler version you started with would have worked or not?
imchairmanm said:
Hm, I was curious since you said you couldn't get your scripts to run globally, so I tried them out by putting them in /system/xbin. After adjusting permissions and making sure owner and group were root, they ran fine and globally as-is. I wonder if the simpler version you started with would have worked or not?
Click to expand...
Click to collapse
did you run them from /system/xbin? I put them in /system/xbin and then cd / to get back to root and tried to run them. They are not found.
Code:
# cd /system/xbin
cd /system/xbin
# pwd
pwd
/system/xbin
# ls -l mount*
ls -l mount*
lrwxrwxrwx root root 2011-12-05 13:08 mount -> /system/xbin/busybox
lrwxrwxrwx root root 2011-12-05 13:08 mountpoint -> /system/xbin/busybox
-rwxrwxrwx root root 316 2011-11-06 19:04 mountro
-rwxrwxrwx root root 328 2011-11-06 19:04 mountrw
# cd /
cd /
# pwd
pwd
/
# mountro
mountro
mountro: not found
# sh mountro
sh mountro
sh: Can't open mountro
#
That was the problem I was running into. I even tried sh mountro. The error "Can't open mountro" essentially means it can't find it.
If this is what you did, and you had different results, I would love to find out why. Thanks!
Ciao!
Yeah, that's what I meant by they are available globally. I can run them from anywhere in the filesystem. I'm not sure what the difference is. Mine have owner and group set to root and the applicable permissions set as well.
It runs through the script correctly, I get all of the echo messages, and if I cd to system afterwards, everything is rw or ro as it should be. I don't know what other information would be helpful for you, but I'll answer whatever other questions you might have. I don't quite understand why it'd ever have a problem with your scripts in the first place. It seems like a strange thing to happen.
Edit: I just ran through and ran the same commands as you did and they were all successful. It sounds like maybe something isn't right in your $PATH? That's the only thing I can think of. What does it say when you type "echo $PATH"? Either that or something with your terminal emulator or rom? Have you tried a different terminal? It shouldn't matter but you never know.
imchairmanm said:
Yeah, that's what I meant by they are available globally. I can run them from anywhere in the filesystem. I'm not sure what the difference is. Mine have owner and group set to root and the applicable permissions set as well.
It runs through the script correctly, I get all of the echo messages, and if I cd to system afterwards, everything is rw or ro as it should be. I don't know what other information would be helpful for you, but I'll answer whatever other questions you might have. I don't quite understand why it'd ever have a problem with your scripts in the first place. It seems like a strange thing to happen.
Edit: I just ran through and ran the same commands as you did and they were all successful. It sounds like maybe something isn't right in your $PATH? That's the only thing I can think of. What does it say when you type "echo $PATH"? Either that or something with your terminal emulator or rom? Have you tried a different terminal? It shouldn't matter but you never know.
Click to expand...
Click to collapse
I dunno what is going on. My path shows /system/xbin. Oh, I'm on Eclipse 1.3 (but that shouldn't matter)... Oh well.
Code:
# echo $PATH
echo $PATH
/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
It happens from the adb shell and from the terminal program on my DX2.
Hm. My $PATH is the same except it also includes /data/local/bin. That shouldn't matter. I'm on eclipse too and running the commands from the terminal in eclipse parts. I don't know why something in the path wouldn't execute. Does "which mountrw" find it? I had a problem earlier where I thought it wasn't finding a script I wrote, but it actually was failing at the first line because I had the wrong path to sh listed. If which finds your scripts I'd say it's more likely something with the script rather than the system. I'd also try writing a little hello world script and seeing if you can get that to execute globally too.
imchairmanm said:
Hm. My $PATH is the same except it also includes /data/local/bin. That shouldn't matter. I'm on eclipse too and running the commands from the terminal in eclipse parts. I don't know why something in the path wouldn't execute. Does "which mountrw" find it? I had a problem earlier where I thought it wasn't finding a script I wrote, but it actually was failing at the first line because I had the wrong path to sh listed. If which finds your scripts I'd say it's more likely something with the script rather than the system. I'd also try writing a little hello world script and seeing if you can get that to execute globally too.
Click to expand...
Click to collapse
Aw, CRAP! I've run into this problem when I develop on a Windows machine and try to run it on a linux box... ARGH! Thank GOD I use gvim. I was able to change the file format from DOS to UNIX, then save it and push it back out to /system/xbin. chmod'd it to 777 and ran mountrw/mountro and they work now... How can I be so friggin' dense... I know better than that...
Oh, to answer your question on the which command, yes, which finds them both.
What clued me in was you saying that the problem might be with the script. Thanks! It FINALLY works! I've updated the OP with the corrected files.
Also, does anyone want me to make this a flashable zip? Let me know.
Ciao!

[Q] cinergy hybrid stick (dvb-t xc3028L) on tf201

hi
this is a sequel from this thread
ive got a cynergy hybrid stick dvb-t tuner i would like to use on my transformer (tf201)
i first compiled every dvb-t kernel modules you get in linux kernel as explainned here
here are the modules i compiled for kernel 3.1.10-00002-g599d0cf :
www.mindthepressure.org/android/dvb_ko_3.1.10-00002-g599d0cf.tar.gz
which was more or less useless because this specific tuner works on linux with firmware xc3028L-v36.fw :
www.linuxtv.org/wiki/index.php/Xceive_XC3028/XC2028#How_to_Obtain_the_Firmware
http://linuxtv.org/wiki/index.php/DVB-T_USB_Devices/Full
Terratec Cinergy Hybrid Stick
Supported: ✔ Yes, in kernel since 2.6.35
USB ID: 0ccd:00a5
Tuner: xc3028L
Demodulator: ZL10353
USB Bridge: TM6010
firwmare: xc3028L-v36.fw
Click to expand...
Click to collapse
i succeed to get this tuner to work on linux just by installing xc3028L-v36.fw in /lib/firmware/
i tried randomly to put the same file in /etc/firmware/ on android but it doesn't seems to work this way
my tuner doesn't light on either when i launch this script
Code:
echo "Starting DVB support"
insmod dvb-core.ko # core support for DVB
insmod dvb-pll.ko # I am not sure if this is even needed
insmod rc-core.ko # Support for remote control, some drivers won't load otherwise
insmod dvb-usb.ko # Support for usb tuners
insmod zl10353.ko # Add here your driver. If more than one needed, add another line
# if firmware is needed, make sure the firmware is in the right folder, it should be /lib/firmware, but I'm not 100% sure
# Also some devices won't need the steps below
echo "Waiting for device"
sleep 5
cd /
mkdir /dev/dvb
mkdir /dev/dvb/adapter0
cd /dev/dvb/adapter0
ln -s /dev/dvb0.frontend0 frontend0
ln -s /dev/dvb0.demux0 demux0
ln -s /dev/dvb0.dvr0 dvr0
ln -s /dev/dvb0.dvr0 dvr0.ts
chmod -R 777 /dev/dvb* # The original script doesn't have it, but try adding a -R before 777 might ease things a bit
echo "DONE!"
(from here)
i get this error :
unable to chmod /dev/dvb/adapter0/dvr0.ts No such file or directory
must be a simlink to /dev/dvb0.dvr0 which does indeed not exist
i guess i'm missing something, probably much, but i don't know what
would *.fw firmwares work in an android environnement as they do on linux ?
thanks for any help !
i guess i need to compile tm6000.ko driver
http://www.linuxtv.org/wiki/index.php/Trident_TM6000
but i don't know how for i can't find it sources in kernel 3.1.10-00002-g599d0cf nor in v4l-dvb

[HOWTO] Run Gentoo Linux on the X+ (chroot)

Hi,
Can't really find a tutorial for our phone, so I'll be, well, making a tutorial
Some notes:
- Compiling is really slow, VERY. Probably RasPi speed.
- Putting the chroot in a specific location helps, due to our phone having weird mountpoints (try typing `mount` and see what happens)
- You can ADB shell into the phone, type "stop" so Zygote is stopped (less RAM usage, less CPU usage, basically pure Linux is running)
- ^ Remember to type "start" after finished playing with the chroot, or you get a frozen phone until forced reboot!
You may be able to adapt this guide to other distros too (although unlikely)
REQUIREMENTS
- Enough juice for playing games for a long time
- A WORKING busybox with "tar xvjpf" available
- You are rooted
1. First of all, su and mount root read/write.
Code:
su; mount -o remount,rw /
2. cd into /data/local
Code:
cd /data/local
3. mkdir linux (or other names if you prefer)
Code:
mkdir linux
4. cd into it
Code:
cd linux
5. Download a stage3 tarball USE ARMv7l, our phone isn't hard-floated and put it in current directory.
- If you use an external browser, make sure the permissions isn't set to r--------, chmod 755 to be sure
- If you use wget, you probably don't have to worry about permissions
6. Extract it. Replace blahblahblah with your file name
Code:
tar xvjpf blahblahblah.tar.bz2
7. Make a chroot script which contains all the necessary bind mounts and commands. Make sure it is in the same dir as your chroot!
Code:
#!/system/bin/sh
# Enable network forwarding to the chroot
sysctl -w net.ipv4.ip_forward=1
# Mount proc to "current directory"/proc
mount -t proc proc proc/
# Mount sys, bind
mount -o bind /sys sys/
# Mount dev, bind
mount -o bind /dev dev/
# Symlink proc/self/fd to dev/fd, or portage will fail
ln -s proc/self/fd dev/
# Write resolvconf
echo "8.8.8.8" > etc/resolv.conf
# Make sure the permissions are correct
chmod 755 etc/resolv.conf
# Chroot using /bin/bash as shell
chroot . /bin/bash
Then chmod 755 the script
Code:
chmod 755 chroot.sh
8. All Gentoo users should know this...
Code:
source /etc/profile
9. Edit /etc/portage/make.conf
Code:
nano /etc/portage/make.conf
10. Add these lines to it
Code:
# This will disable userfetch, making name resolution work.
FEATURES="-userfetch"
11. Adjust USE flags and other configs as necessary... save it
12. Enjoy Gentoo on your phone! :laugh::laugh:
13. Just Ctrl+D to exit chroot

Categories

Resources