DVB-T dongle running on Nexus 7 - Nexus 7 General

Note: The information below is quite dated. If you are interested in watching TV on Android without root with the RTL-SDR dongles check out Aerial TV on XDA.
--------
Ok guys, I am proud to announce that I was able to run a DVB-T tuner on my Nexus 7
If your kernel is 3.1.10-g52027f9 and your dongle is RTL2832U based
If you have a rooted Nexus 7 with kernel 3.1.10-g52027f9 and a RTL2832U based DVB-T dongle, then you can also have your dongle up and running in a matter of minutes. Here are the steps:
Download http://dl.dropbox.com/u/24106229/NexusDvb.rar
Install droidtv.apk from the rar (you can also find it at https://github.com/chrulri/droidtv)
Get a Terminal emulator and cd to the folder where you have extracted the rar. Type in:
su
sh startdvb
Make sure that all of the files and folders inside /dev/dvb have highest permissions.
Start DroidTV and enjoy!!!
Different dongle, kernel 3.1.10-g52027f9
If you have the same kernel and a dongle that has its drivers built in the kernel according to http://www.linuxtv.org/wiki/index.php/DVB-T_USB_Devices , then you can download this rar file - http://dl.dropbox.com/u/24106229/all-modules.rar (Last updated 20 Aug 22:22 GMT). Those are all of the kernel modules I compiled. You may be able to find your usb driver there.
Compiling kernel modules
If you don't have the same kernel or a dongle is not supported, you will need to get the kernel source and compile the modules yourself. Here's how you do that.
Make sure you are running Linux and have make and git already installed
Download dvbn7comp and put it into a new directory. Make sure dvbn7comp is executable by running chmod +x dvbn7comp inside the folder
Invoke the script like this ./dvbn7comp <kernel_version>. For example if you want to have the modules compiled for 3.1.10-g05b777c, you would run ./dvbn7comp 3.1.10-g05b777c
Wait - it may take a while. Usually about 15 minutes depending on your network and CPU speed.
After the script finishes running, the .ko files would be put in a directory called output_3.1.10-g05b777c
That's it!
Note: The script will download the kernel source and the toolchain and it will attempt to find the commit that contains the required kernel version. Then it will configure the kernel for DVB-T support and will compile the modules and copy them to the output folder. If you run the script again and the sources are already present, it will not download them again, so any subsequent runs of the script would be faster!
Patching the precompiled binaries [NEW]
phamthanhnam said:
For those who have another kernel version, you don't need to recompile dvb modules. If your kernel version is not in git revisions, you will just fail with 'fatal: ambiguous argument '3.1.10-xxxxxxxx': unknown revision or path not in the working tree'. Fortunately, there's a much faster and much simpler way to get dvb modules for your kernel version. You don't need git, make, toolchain, kernel source...
Nearly every Android kernel for Nexus 7 is based on 3.1.10 linux kernel (because of nvidia's closed source driver for graphics card), so kernel version for your Nexus 7 will be always 3.1.10-xxxxxxxx.
You can get directly precompiled binary modules (aka *.ko files) at post #1 and patch them for your kernel version:
Code:
perl -pi -e 's/3.1.10-g52027f9/3.1.10-xxxxxxxx/g' *.ko
Alternaties: Get precompiled binary modules at post #80 (more complete than modules from post #1) and patch them:
Code:
perl -pi -e 's/3.1.10-g22b4fcd/3.1.10-xxxxxxxx/g' *.ko
Alternaties 2: Post #129, the same way:
Code:
perl -pi -e 's/3.1.10-g05b777c/3.1.10-xxxxxxxx/g' *.ko
Basically this command replaces 'magic version' in *.ko files. Version mismatch will prevent insmod with an 'exec format error'.
Replace xxxxxxxx by your kernel-version, for example if your kernel version is 3.1.10-g30c5396, use:
Code:
perl -pi -e 's/3.1.10-g52027f9/3.1.10-g30c5396/g' *.ko
That's it!
More info: This way works with Cyanogen Mod kernels/ROMs!!!
Click to expand...
Click to collapse
How to modify the startdvb 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 dvb-usb-***** # 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!"
Troubleshooting
If any error message occurs, type in dmesg in the terminal. This will give more information why something failed.
How do I know if I'm successful
To check whether you have insmoded the kernels right and after connecting the device whether it has been discovered, use dmesg and look for message similar to "Found DVB device xxx in warm state".
I got it running!!!
If you got it running, please do share with us! It seems like there's a lot of fiddling for some devices to be done so any information will prove invaluable for somebody!!!
NOTE: I don't have the time to support this thread any more, sorry if I am not responding to it! All of the directions above are still valid and working! Browse the comments, you might find that someone has compiled the correct modules for your device/kernel or you might ask someone to do it for you! If you want any of the information above to be edited, please PM me!

Where to get the DVB tuner
Hi,
Thanks for posting. it is very interesting.
can you post where did you buy the tuner from and the price?
the only one i could find with RTL2832U is priced at 27$ from ebay.
How can i compile the kernel modules for a different device?
thanks.

Very cool!
Could a similar technique could be used for ATSC here in the U.S.?

I actually have compiled all of the drivers that come with the Linux kernel as well
You can get them from here - http://dl.dropbox.com/u/24106229/all-modules.rar
If your device is listed as compatible somewhere here - http://www.linuxtv.org/wiki/index.php/DVB-T_USB_Devices then you may be lucky You just need to know which kernel module to load with insmod (see the startdvb script to see how to do it).
If it's not there or you have a different kernel version, you will need to follow https://source.android.com/source/building-kernels.html . Except for you only need to build the modules, and you need to fiddle around with the Makefiles in order to force some of the components (like the dvb-usb.ko) to be compiled as modules. Good luck!
As far as the tuner I am using, it's http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=120958257586 this one. I actually got it for another purpose (http://sdr.osmocom.org/trac/wiki/rtl-sdr), which if I have the time I can try to build an app to bring it to the Android as well

another question
Thanks for the quick reply!
I couldn't find the right *.ko file in the modules you attached (it is supposed to be af9005 and af9015, and for my other dvb-t - IT9135)
Could i bother you to upload these, since i have no idea how to compile them.
I tried using af9013.ko that you attached but with no success, most likely because i had to use af9005 instead.
I added insmod af9013.ko to your script, attached is a screenshot from my emulator:
Thanks again. Your help is much appreciated!

another question
double post by mistake

Hi, I was wondering about this a few weeks ago.. great to see it working.. do you know if the Sony Play TV tuner would work? I have one of those...
Cheers,
Mick
martintzvetomirov said:
I actually have compiled all of the drivers that come with the Linux kernel as well
You can get them from here - http://dl.dropbox.com/u/24106229/all-modules.rar
If your device is listed as compatible somewhere here - http://www.linuxtv.org/wiki/index.php/DVB-T_USB_Devices then you may be lucky You just need to know which kernel module to load with insmod (see the startdvb script to see how to do it).
If it's not there or you have a different kernel version, you will need to follow https://source.android.com/source/building-kernels.html . Except for you only need to build the modules, and you need to fiddle around with the Makefiles in order to force some of the components (like the dvb-usb.ko) to be compiled as modules. Good luck!
As far as the tuner I am using, it's http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=120958257586 this one. I actually got it for another purpose (http://sdr.osmocom.org/trac/wiki/rtl-sdr), which if I have the time I can try to build an app to bring it to the Android as well
Click to expand...
Click to collapse
---------- Post added at 09:37 AM ---------- Previous post was at 08:49 AM ----------
Here is the driver i need... i assume i need to be able to produce a .ko file some way for it?
http://linuxtv.org/wiki/index.php/Sony_PlayTV_dual_tuner_DVB-T#Drivers

aspletec this
Hi.
In the file Martin attached with all the modules there is a module for you DVB-T, it's called dib0070.ko
Try this one.
micks_address said:
Hi, I was wondering about this a few weeks ago.. great to see it working.. do you know if the Sony Play TV tuner would work? I have one of those...
Cheers,
Mick
---------- Post added at 09:37 AM ---------- Previous post was at 08:49 AM ----------
Here is the driver i need... i assume i need to be able to produce a .ko file some way for it?
Click to expand...
Click to collapse

Thanks, once i copy it to the folder with the startdvb file.. what other steps do i need?
lionsh said:
Hi.
In the file Martin attached with all the modules there is a module for you DVB-T, it's called dib0070.ko
Try this one.
Click to expand...
Click to collapse

you need to update the startdvb script to inclue ismode yourdriver.ko
micks_address said:
Thanks, once i copy it to the folder with the startdvb file.. what other steps do i need?
Click to expand...
Click to collapse

I edited the startdvb file to reference the dib0070.ko but i get init failed.. i wonder doesn the nexus have enough power to power the tuner via USB?
Cheers,
Mick
lionsh said:
Hi.
In the file Martin attached with all the modules there is a module for you DVB-T, it's called dib0070.ko
Try this one.
Click to expand...
Click to collapse

micks_address said:
Thanks, once i copy it to the folder with the startdvb file.. what other steps do i need?
Click to expand...
Click to collapse
You need to add the line 'insmod dib0070.ko' to startdvb.
You will probably also need to copy the 'dvb-usb-dib0700-1.20.fw' firmware file from that link you posted earlier into /etc/firmware.

OK guys, my bad! I didn't originally submit all of the files. Please, redownload again - http://dl.dropbox.com/u/24106229/all-modules.rar
I didn't compile the usb drivers, the ones that you would actually need Now everything should be there.
lionsh said:
Thanks for the quick reply!
I couldn't find the right *.ko file in the modules you attached (it is supposed to be af9005 and af9015, and for my other dvb-t - IT9135)
Could i bother you to upload these, since i have no idea how to compile them.
Click to expand...
Click to collapse
You will need dvb-usb-af9005.ko and possibly dvb-usb-af9005-remote.ko
micks_address said:
Hi, I was wondering about this a few weeks ago.. great to see it working.. do you know if the Sony Play TV tuner would work? I have one of those...
Click to expand...
Click to collapse
You will need dvb-usb-dib0700.ko and the firmware from the web page you pointed me at.
micks_address said:
I edited the startdvb file to reference the dib0070.ko but i get init failed.. i wonder doesn the nexus have enough power to power the tuner via USB?
Click to expand...
Click to collapse
It was able to properly power my tuner without external power but surely this won't be the case with all of them. That can't cause the init to fail though! Use dmesg to get more info on why this has happened.
lionsh said:
you need to update the startdvb script to inclue ismode yourdriver.ko
Click to expand...
Click to collapse
Yes, that's right. So here's how to do it
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 ***** # 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!"
Hope this helps!
If any error message occur, type in dmesg in the terminal. This will give more information why something failed. Also to check whether you have insmoded the kernels right and after connecting the device it has been discovered, use dmesg again and look for message similar to "Found DVB device xxx in warm state"

Hi Martin,
first of all many thanks!
i used 9005,9005-remote and 9015 ko files and updated the script as follow:
Code:
echo "Starting DVB support"
insmod dvb-core.ko
insmod dvb-pll.ko
insmod rc-core.ko
insmod dvb-usb.ko
insmod dvb-usb-af9005.ko
insmod dvb-usb-af9005-remote.ko
insmod dvb-usb-af9015.ko
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*
echo "DONE!"
I receive several errors.
first i get 9015.ko file not found, i'm attaching screen shot with ls that clearly lists the file (WTF?!)
and *dvr0.ts file is also written as no such file/dir.
I even copied the .fw files for 9005 and 9015 to etc/firmware
can you take a look ,i must be missing something stupid.
also, is there a dvb-usb-IT9135.ko file?
many thanks for your contribution.

I created the files :
frontend0
demux0
dvr0
dvr0.ts
in /dev/dvb/adapter0 and now i don't get an error on running sh startdvb (except on *9015.ko being not found)
when i open droid tv and select DVB-T and some country using dvb-t i get an error of unable to determine frontend
so something still missing/wrong.
UPDATE
using dmesg i saw an error for init 9015.ko - Unknown symbol af9013_attach (err 0)
maybe the compilation of this driver was not right, since it is 9015 and not 9013?
I do hope that it's the lack og 9015.ko which is keeping me from watching DVB-T. If I had the dvb-usb-IT9135.ko file i could try a different DVB-T tuner.

Loving the progress on this, for me dtv isn't what I'm looking for I would love to see a working live video input displayed on my nexus for a project I'm working on using a usb composite video in Interface the type you use to rip vhs to the computer, I'm guessing and hoping the solution is pretty much the same? Any advise and help on this please?
Thanks

Great work on this, so far I've managed to get my DVB tuner properly configured and connected!
The only issue is Droid TV seems very unstable... Are there any alternatives?
I get reboots when scanning for channels. Might try recompiling a newer version of w_scan when I get a minute.
The channels I manually added only have a signal of 20% with no picture. The signal is fine when the tuner is connected to my PC though.
Maybe the Nexus doesn't give it enough power?

Hi,
Can you state which module do you use for your DVB-T tuner?
Psych0Chimp said:
Great work on this, so far I've managed to get my DVB tuner properly configured and connected!
The only issue is Droid TV seems very unstable... Are there any alternatives?
I get reboots when scanning for channels. Might try recompiling a newer version of w_scan when I get a minute.
The channels I manually added only have a signal of 20% with no picture. The signal is fine when the tuner is connected to my PC though.
Maybe the Nexus doesn't give it enough power?
Click to expand...
Click to collapse

lionsh said:
I created the files :
frontend0
demux0
dvr0
dvr0.ts
in /dev/dvb/adapter0 and now i don't get an error on running sh startdvb (except on *9015.ko being not found)
when i open droid tv and select DVB-T and some country using dvb-t i get an error of unable to determine frontend
so something still missing/wrong.
UPDATE
using dmesg i saw an error for init 9015.ko - Unknown symbol af9013_attach (err 0)
maybe the compilation of this driver was not right, since it is 9015 and not 9013?
I do hope that it's the lack og 9015.ko which is keeping me from watching DVB-T. If I had the dvb-usb-IT9135.ko file i could try a different DVB-T tuner.
Click to expand...
Click to collapse
I have an A-Link dongle that seems to be running Afatech inside. Among the things you have done, I also attached and insmodded af9013.ko and got my receiver mounted in warm state and its actually scanning the channels in DroidTV as we speak. (No luck on the first try).
I have dvb-usb-af9015, 9005, 9005-remote, af9013 and the af9015 firmware (in the etc/firmware folder).
These seemed to do the trick.

that is so strange, i tried all these combinations, including af9013.ko with no luck.
did you get an error on af9015 like i did?
i have copied the firmware also. did you d\l it from http://linuxtv.org/wiki/index.php/DVB-T_USB_Devices#DVB-T_USB_Devices?
when you ran startddvb script did you receive any errors? I get an error that the files in /dev/dvb/adapter0 are missing.
only when i create the files manually it passes, but then i can't initialize droid tv.
which kernel version do you use? i have 3.1.10 g52027f9
can you upload the files+script that you used?
Sikki said:
I have an A-Link dongle that seems to be running Afatech inside. Among the things you have done, I also attached and insmodded af9013.ko and got my receiver mounted in warm state and its actually scanning the channels in DroidTV as we speak. (No luck on the first try).
I have dvb-usb-af9015, 9005, 9005-remote, af9013 and the af9015 firmware (in the etc/firmware folder).
These seemed to do the trick.
Click to expand...
Click to collapse

Related

Making cifs.ko

Hey guys
Need your help here.
Have been desperately searching the forums/net for a cifs.ko for the galaxy tab but i do not think one exists.
Have decided to see if i can build one on my own (this will likely crash & burn)
Anyway, i've installed ubuntu in a VM
and pulled the following down
-GT-P1000 source code (from http://opensource.samsung.com)
-toolchains (wget http://www.codesourcery.com/public/...-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2)
unpacked the source
unpacked toolchains into /opt/toolchains
ran ./build_kernel.sh <--no errors
cd into source directory
-apt-get install ncurses-dev
make oldconfig
make menuconfig
set M for cifs (under fs -> networking)
exited
make prepare
make M=fs/cifs
and the cifs.ko was created!
upon copying into my tab and trying an insmod cifs.ko
I saw the following in my dmesg
cifs: Unknown symbol slow_work_register_use
cifs: Unknown symbol slow_work_enqueue
I'm guessing i need to make a slow-work.ko or hack the source of the cifs and remove all references of slow-work.
Anyone can advice how for either or better yet, make a cifs.ko for us
Thanks!
Hiya,
If you ever get it working, please do share... I know a fair number of people who have the Galaxy Tab including myself who are just waiting for someone bright enough to get samba mounting available so they can play their media files without having to copy directly to the device.
Kinda like the Holy Grail this is... Especially as iPad users are able to stream avi's using Buzz Player HD which is a media player with a built in method of connecting to smb shares from the app. I hate being one-upped by my iPad weilding wife!! Heh.
Cheers.
bullyfrog said:
Anyone can advice how for either or better yet, make a cifs.ko for us
Thanks!
Click to expand...
Click to collapse
There are several reasons why you may have missing symbols. One is that the original kernel was compiled with different driver options, so certain symbols are missing when compared to the new kernel/module you compiled. The easy fix is to install the new kernel too.
It could also be that the kernel versions are different, and the source you have is older or newer than the original.
If I have time later I plan on giving it a go myself, compile and install a complete kernel.
From another discussion thread on this forum:
-------
You'll need to change kernel/slow-work.c to be compiled as a module which is not very hard:
move kernel/slow-work.c in fs/slow-work/slow-work.c
remove "config SLOW_WORK" from init/Kconfig
create fs/slow-work/Kconfig with config SLOW_WORK as tristate and add it to fs/Kconfig (source fs/slow_work/Kconfig)
create fs/slow-work/Makefile with obj-$(CONFIG_SLOW_WORK) += slow-work.o and add it to fs/Makefile: obj-$(CONFIG_SLOW_WORK) += slow-work/
-------
Then, some useful commands:
adb shell
su
insmod slow-work.ko
insmod cifs.ko
lsmod | grep cifs
dmesg
mount -o username=guest -t cifs //IP/SHARE /mnt/cifs
(or CifsManager)
...also add "iocharset=utf8" in CifsManager's options field (non-latin characters support).
I too need to get started with compiling the Tab's sources...when I have time !
Ok, I compiled cifs.ko and slow_work.ko modules using the SCH-I800 kernel source (which is the Verizon Galaxy Tab model) so I'm not sure they'll work on other tabs, but I figured I'd post them here.
I haven't done much testing yet, but I ran:
busybox insmod slow_work.ko
busybox insmod cifs.ko
mkdir /mnt/cifs
busybox mount -o username=guest //myserver/share /mnt/cifs
It mounted successfully, and I was able to watch a video directly off the mount. It was a little choppy though, I'm not sure if the default video player has any buffering options or if there's one in the market that does.
As far as how I got it to compile, it was very much a hack based on info here. The rough method was:
Built cifs.ko from the steps listed in the first post, with the exception of using the SCH-I800 source instead.
After that:
mkdir fs/slow-work
cp kernel/slow-work.* fs/slow-work/.
added fs/slow-work/Kconfig with the config section copied from init/Kconfig, but with bool changed to 'tristate' and default changed to m.
edited fs/Kconfig and added 'source "fs/slow-work/Kconfig"'
Added fs/slow-work/Makefile containing: "obj-m += slow-work.o"
Added the line "obj-m += slow-work/" to the end of fs/Makefile
I also had to edit fs/slow-work/slow-work.c and removed the round_jiffies calls, they were coming up as unresolved symbols and it's a function in timer.c, wasn't sure if there was a way to pull that into a module.
make M=fs/slow-work
I'll post more as I play around with it, just wanted to get the modules up for people to play with. I should also probably look into using my busybox utilities as the default so I don't have to keep calling busybox to use the correct ones.
-Dan
CIFS on Sprint device
I'm using the updated Sprint GTab and your precompiled CIFS modules worked very well. It's just now CIFS Manager seems to keep telling me that the mount string isn't valid. I mounted with the mount command from the terminal (wow, this is tedious without a BT keyboard. Need a terminal with editable strings.) and it worked just great.
JK
Well done ! This works on my JK1-flashed Galaxy Tab.
Note: I use WifiKeyboard as my input method on the tablet, to ease typing in the Terminal Emulator (or ConnectBot). It works marvelously well !
The "insmod" commands worked perfectly (thanks again for compiling...personally I was stuck at the "libc" ELF headers in my toolchain Mac OS X setup...I will soon install a Linux virtual machine so I can use the default toolchain, which contains all the required "libc" stuff...I regularly compile RockBox on my Mac so I wonder what's wrong with this particular toolchain).
I switched on Samba/SMB/CIFS sharing on my Mac OS X laptop, via the "Sharing" panel in System Preferences.
Once in "su" shell mode, I pre-created the mount point: "mkdir /mnt/cifs". I then experimented various commands, including:
- EDIT - DroidWall configured with a whitelist *prevents* the "mount" command from connecting to the Samba share, despite allowing Terminal Emulator and ConnectBot to connect via wifi...as a result I have to disable DroidWall entirely, which sub-optimal Allowing all "root" applications to access wifi in DroidWall doesn't solve the problem: it makes a difference with commands like "ping" but the SMB mount fails to connect over the network...for some reason.
busybox mount -r -t cifs -o "username=MY_USERNAME,password=MY_PASS" //MY_IP/MY_SHARED_FOLDER /mnt/cifs
busybox mount | grep cifs
ls /mnt/cifs
umount /mnt/cifs
busybox mount -r -t cifs -o "username=guest" //MY_IP/MY_SHARED_FOLDER /mnt/cifs
Note that I chose to secure the mounted directory in read-only mode, but of course we could use "-w" instead, providing the file server accepts authenticated or anonymous connections with write credentials.
I still need to test transfer speeds...as this is often the problem with high-quality video. At any rate, I recommend using VLC Player on the server (e.g. laptop containing video/audio assets), and VLC Stream and Connect on the Android device: the live transcoding works really well !
CIFSManager
I'm a bit of a noob, actually. I put a double-slash in cifsmanager in front of the name, like you were doing in mount. It's just machine/share and not //machine/share. Makes all the difference, really.
Now I just wish there were a few more video codecs to be had.
JK
jknisley said:
Now I just wish there were a few more video codecs to be had.
Click to expand...
Click to collapse
RockPlayer ?
Wow. That's a fantastic player. And sorry to be off topic. Glad CIFS is working for us.
Cool, now all we need is a step by step guide for doing this for noob users like me who have no idea what Busybox is or where to save the cifs and slow work files etc... Hmm... Anyone fell nice and would like to help a guy out?
Cheers
overridex said:
Ok, I compiled cifs.ko and slow_work.ko modules using the SCH-I800 kernel source (which is the Verizon Galaxy Tab model) so I'm not sure they'll work on other tabs, but I figured I'd post them here.
I haven't done much testing yet, but I ran:
busybox insmod slow_work.ko
busybox insmod cifs.ko
mkdir /mnt/cifs
busybox mount -o username=guest //myserver/share /mnt/cifs
It mounted successfully, and I was able to watch a video directly off the mount. It was a little choppy though, I'm not sure if the default video player has any buffering options or if there's one in the market that does.
As far as how I got it to compile, it was very much a hack based on info here. The rough method was:
Built cifs.ko from the steps listed in the first post, with the exception of using the SCH-I800 source instead.
After that:
mkdir fs/slow-work
cp kernel/slow-work.* fs/slow-work/.
added fs/slow-work/Kconfig with the config section copied from init/Kconfig, but with bool changed to 'tristate' and default changed to m.
edited fs/Kconfig and added 'source "fs/slow-work/Kconfig"'
Added fs/slow-work/Makefile containing: "obj-m += slow-work.o"
Added the line "obj-m += slow-work/" to the end of fs/Makefile
I also had to edit fs/slow-work/slow-work.c and removed the round_jiffies calls, they were coming up as unresolved symbols and it's a function in timer.c, wasn't sure if there was a way to pull that into a module.
make M=fs/slow-work
I'll post more as I play around with it, just wanted to get the modules up for people to play with. I should also probably look into using my busybox utilities as the default so I don't have to keep calling busybox to use the correct ones.
-Dan
Click to expand...
Click to collapse
How did you manage to remount the filesystem r/w? I can't mkdir /mnt/cifs because fs is read only.
alias_neo said:
How did you manage to remount the filesystem r/w? I can't mkdir /mnt/cifs because fs is read only.
Click to expand...
Click to collapse
Are you in "su" mode ? (type "su" in the shell before typing any other commands)
daniel.weck said:
Are you in "su" mode ? (type "su" in the shell before typing any other commands)
Click to expand...
Click to collapse
Yes I am. I su'd, Superuser popped up and asked to grant permissions, did so, this then allowed me to insmod the modules (only root can do so) but won't let me mkdir.
overridex said:
Ok, I compiled cifs.ko and slow_work.ko modules using the SCH-I800 kernel source (which is the Verizon Galaxy Tab model) so I'm not sure they'll work on other tabs, but I figured I'd post them here.
I haven't done much testing yet, but I ran:
busybox insmod slow_work.ko
busybox insmod cifs.ko
mkdir /mnt/cifs
busybox mount -o username=guest //myserver/share /mnt/cifs
It mounted successfully, and I was able to watch a video directly off the mount. It was a little choppy though, I'm not sure if the default video player has any buffering options or if there's one in the market that does.
As far as how I got it to compile, it was very much a hack based on info here. The rough method was:
Built cifs.ko from the steps listed in the first post, with the exception of using the SCH-I800 source instead.
After that:
mkdir fs/slow-work
cp kernel/slow-work.* fs/slow-work/.
added fs/slow-work/Kconfig with the config section copied from init/Kconfig, but with bool changed to 'tristate' and default changed to m.
edited fs/Kconfig and added 'source "fs/slow-work/Kconfig"'
Added fs/slow-work/Makefile containing: "obj-m += slow-work.o"
Added the line "obj-m += slow-work/" to the end of fs/Makefile
I also had to edit fs/slow-work/slow-work.c and removed the round_jiffies calls, they were coming up as unresolved symbols and it's a function in timer.c, wasn't sure if there was a way to pull that into a module.
make M=fs/slow-work
I'll post more as I play around with it, just wanted to get the modules up for people to play with. I should also probably look into using my busybox utilities as the default so I don't have to keep calling busybox to use the correct ones.
-Dan
Click to expand...
Click to collapse
Mate, you rock! I too ran into problems with the round jiffies and put this side project on hold. Your modules work and thats what matters. Thank you
Sent from my GT-P1000
Hi there,
Where do I save the cifs.ko and slow-work.ko files? Anyone help please?
Cheers.
I’m a really beginner user and have a question to the install of cifs.ko .
I like to mount on my Samsung Galaxy Tab an SMB network share. The Tab is rooted.
1)Copy the cifs.ko on my Tab
2)Install busybox from the market on my Tab
3)Run Busybox
4)Write in Busybox
“busybox insmod cifs.ko
mkdir /mnt/cifs”
5)To mount I like to use the Cifs Manager
These 5 steps are correct or I have some errors in it? Where on the Tab I have to copy the file “cifs.ko”? Can I write in Busybox with the virtual keyboard?
Thanks for your help.
Stefan
For those of you struggling with commands, an easy way is to just copy the two files to your sdcard. You can put them to /sdcard/Android if you like. Issue the following commands in your terminal app
$su -
#cd /sdcard/Android
#insmod slow-work.ko
You should see no errors
Next pull down CifsManager from the market.
Using CifsManager, specify where the cifs.ko is located. The gui is pretty intuitive. If all goes well, you should be able to watch your shared videos off your tab
Sent from my GT-P1000
Well spank me sideways that worked a treat for a noob user like me Thanks a lot to everyone who as made this wonderful "feature" a reality.
bullyfrog said:
For those of you struggling with commands, an easy way is to just copy the two files to your sdcard. You can put them to /sdcard/Android if you like. Issue the following commands in your terminal app
$su -
#cd /sdcard/Android
#insmod slow-work.ko
You should see no errors
Next pull down CifsManager from the market.
Using CifsManager, specify where the cifs.ko is located. The gui is pretty intuitive. If all goes well, you should be able to watch your shared videos off your tab
Sent from my GT-P1000
Click to expand...
Click to collapse
Thanks a lot.That worked perfectly for me.But, for us, noobs would add 2 points that I had problems with
1."the two files" mentioned above could be found here :
http://forum.xda-developers.com/showpost.php?p=9275507&postcount=5
2. For not latin characters in filenames needed to to the following (from http://forum.xda-developers.com/showpost.php?p=9271775&postcount=4): ...also add "iocharset=utf8" in CifsManager's mount options field (non-latin characters support).
After that, everething worked perfect. Do I need to remount it each time after reboot?

[HOWTO] Mount Windows Shares using Cifs

We now have a working cifs.ko and nls_utf.ko. I was able to mount my win7 shares using cifs_manager and stream a few movies using mvideoplayer from the mounted share.
My initial problem seemed to be that I used the android ndk toolchain and the nook kernel is compiled with the codeSourcery toolchain.
After I re-compiled using the codeSourcery toolchain everything works (at least for now)
For those who want to try this.
Download the cifs.ko and nls_utf8.ko modules.
http://dl.dropbox.com/u/16190398/Nook Color 1.0/cifs.ko
http://dl.dropbox.com/u/16190398/Nook Color 1.0/nls_utf8.ko
Mount /system as read write and create a directory under /system/lib called modules. Copy the cifs.ko and nls_utf8.ko modules under this directory.
Type the following from your windows or linux console
adb shell
#mount -o remount,rw /dev/block/mmcblk0p5 /system
#su
#cd /system/lib
#mkdir modules
#exit
#exit
Now you are back in your windows or linux command prompt
adb push cifs.ko /system/lib/modules
adb push nls_utf8.ko /system/lib/modules
adb shell
#su
#insmod /system/lib/modules/cifs.ko
#insmod /system/lib/modules/nls_utf8.ko
if everything went well you should see no errors.
#lsmod
(THis should give you a list of running modules)
You should see something like
nls_utf8 1856 0 - Live 0xbf153000
cifs 240060 0 - Live 0xbf113000
#exit
#exit
Download cifs_manager from the android market and follow the instructions from
http://forum.xda-developers.com/showthread.php?t=756158
If you have Astro file manager installed then tapping on the mounted share from cifs_manager will automatically launch Astro and list the folder/files under that share.
BTW, you can copy the modules anywhere you like even under /sdcard/modules but the default path used by cifs_manager is /system/lib/modules. You can edit the path from cifs manager to point to the location of your cifs.ko module.
---- 05/06/2011 Update ------------
New version of cifs.ko, slow-work.ko for the 1.2 update. This is for kernel version 2.6.32.9
Note, cifs.ko requires some symbols from slow-work.ko so you will need to load slow-work.ko first. If you use cifs-manager, under advanced settings
you can check load modules at startup via insmod and put the path to multiple modules for e.g /system/lib/modules/slow-work.ko:/system/lib/modules/cifs.ko.
Everything seems to be working fine for me. Let me know if you run into issues.
http://dl.dropbox.com/u/16190398/Nook Color 1.2/slow-work.ko
http://dl.dropbox.com/u/16190398/Nook Color 1.2/cifs.ko
http://dl.dropbox.com/u/16190398/Nook Color 1.2/nls_utf8.ko
Alright! This is fantastic! I can even play my SNES roms over wifi. Thanks for sharing.
The only issue I have noticed is that you need to run the insmod commands every time you reboot the device, and I reboot a lot. For now I'm just using gScript to run the 2 commands whenever I need, but it would be great to have them run when the program starts. I know you're just sharing and this has been mentioned in the app thread, just wanted to make my observations known.
Edit: Found a nifty toggle in the settings of cifs managaer that runs the insmod command at startup. I guess I should look before I complain...
any chance you can provide your build environment, so that the rest of us can work on hacking the kernel.
thetoady said:
any chance you can provide your build environment, so that the rest of us can work on hacking the kernel.
Click to expand...
Click to collapse
Setting up the environment is ridiculously easy esp if you have access to a linux box. There is a very well documented wiki page which outlines the process of building your own custom kernel for the nook color.
http://nookdevs.com/NookColor:_Build_the_Original_Kernel
I downloaded the codesourcery tool chain and did the minimum install as I did not care about the IDE and added the path to my environment. THat was about it. Everything else I followed the wiki page.
Here is my .config file if you like. When you run "make menuconfig" you can choose to load an alternate config file instead of the default. Just put this .config (after renaming it to .config_myconfig or something) under your distro/kernel directory.
Let me know if you need anything specific and I'll try to help. I had to add the .txt extension to the config file for xda upload but you can rename it to anything you want.
Hrm, couldn't get that working on my system.
I'm getting this error:
Mountingthe share has failed with an error.
mount: Invalid argument
Thoughts?
pezhore said:
Hrm, couldn't get that working on my system.
I'm getting this error:
Mountingthe share has failed with an error.
mount: Invalid argument
Thoughts?
Click to expand...
Click to collapse
Seems more like an error in configuring CIFS_Manager.
If the module doesnt load you get a different error from Cifs_Manager
"No such device".
Can you try using adb shell and use insmod to load the module manually.
CHeck with lsmod if the module is loaded.
Can you post you cifs_manager screen for the share that you are trying to mount.
pezhore said:
Hrm, couldn't get that working on my system.
I'm getting this error:
Mountingthe share has failed with an error.
mount: Invalid argument
Thoughts?
Click to expand...
Click to collapse
I'm sure you noticed that there's an error in dascud instructions... the 2nd insmod command has a filename typo..
its should read
HTML:
#insmod /system/lib/modules/nls_utf8.ko
dascud.. thanks a ton... as mentioned in my previous post can you please make the change in your post
madrascafe said:
dascud.. thanks a ton... as mentioned in my previous post can you please make the change in your post
Click to expand...
Click to collapse
Done. Were you able to mount the CIFS shares ?
dascud said:
Done. Were you able to mount the CIFS shares ?
Click to expand...
Click to collapse
Yes. No problem at all. I even opened files from root explored & played some music. Thank you for this
firstly thanks dascud's great work! Awesome!
I found a problem when mount with option iocharset=utf8, cifsmanager report below error message then failed to mount
Mounting the share has failed with an error.
mount: Can not access a needed share library
When I remove iocharset=utf8, mount success but I failed to access any folder including non-western characters.
ctos said:
firstly thanks dascud's great work! Awesome!
I found a problem when mount with option iocharset=utf8, cifsmanager report below error message then failed to mount
Mounting the share has failed with an error.
mount: Can not access a needed share library
When I remove iocharset=utf8, mount success but I failed to access any folder including non-western characters.
Click to expand...
Click to collapse
CIfs_manager only loads the cifs.ko modules. You will need to load nls_utf8.ko manually or using a script to display non-western character set. I think you can use something like gscript for the purpose.
I've followed the instructions, but trying to launch the cifsmanager I get
Application not installed on Device
from reading the FAQ on the cifsmanager page, it says its a problem with the launcher. is this because I've updated the NC to 1.01? thanks
dascud said:
CIfs_manager only loads the cifs.ko modules. You will need to load nls_utf8.ko manually or using a script to display non-western character set. I think you can use something like gscript for the purpose.
Click to expand...
Click to collapse
gscript works for me. thanks a lot!
Sent from my LogicPD Zoom2 using XDA App
pezhore said:
Hrm, couldn't get that working on my system.
I'm getting this error:
Mountingthe share has failed with an error.
mount: Invalid argument
Thoughts?
Click to expand...
Click to collapse
I got this when I put the computer name in the share path. I switched to using IP address instead and it worked.
Hi,
Thanks for the files. I didn't follow the steps in the instructions because there is an easier way. Like mention before, ClifsManager only need cifs.ko.
I basically just copy cifs.ko to my sd card. In the CM setting, just change path to
/sdcard/cifs.ko
Setting up shares is easy too, share path is your ip/<sharefolder>, mount point /sdcard/<foldername> and your user/pwd. This worked with Windows 7.
ClifsManager is definitely one of the must have on the NC.
Is there any chance of getting an tun.ko driver built so that this can be used in conjunction with OpenVPN?
Thanks!
smlong426 said:
Is there any chance of getting an tun.ko driver built so that this can be used in conjunction with OpenVPN?
Thanks!
Click to expand...
Click to collapse
Here you go.
http://forum.xda-developers.com/showthread.php?t=889736
Will this, or any software for that matter, allow me to openly share one or more folders on the NC device (SD card), so I can access that NC shared directory from a windows box and copy files back and forth?
KryptoNyte39 said:
Will this, or any software for that matter, allow me to openly share one or more folders on the NC device (SD card), so I can access that NC shared directory from a windows box and copy files back and forth?
Click to expand...
Click to collapse
What you need is a Samba server for Nook. Looks like this has already been accomplished. Maybe you can post a howto once you get this working.
http://forum.xda-developers.com/showpost.php?p=8239139&postcount=128

[Q] Help!! wifi error after loading compiled franco kernel

Hi All,
This is my first thread on this forum. Please help in resolving an error that I am facing. I could compile and link successfully franco kernel after downloading the source from franco's github!!
The only problem I face is with wifi. It displays error in the wi-fi option!! This is some what similar to what we used to get in the initial version of gingerbread kernel what Franco had made earlier!! I get the same error even with the stock GB source code of LG or with paulo's kernel source!!! Strange!!!!
The wifi driver(bcm4325) seems to be same except for some tweaks to the original GB source(In the case of Franco's)!! In either case, I am getting the error. The only difference I see is that of the compiler option -Ofast(Optimization option) was used by Franco while since I updated to the latest version of gcc, I do not get the -Ofast option!! So it uses the -Os option instead!!
Error is(logcat):
D/WifiService( 1726): setWifiEnabledBlocking : Country code is COM
E/WifiService( 1726): Failed to load Wi-Fi driver.
Same compiling options were used to compile both zImage and modules?? What could be wrong here? I am not sure what could be wrong here!!! Can anybody help me on this??
Thanks in advace.
I get this on sense too
(but I replaced all that Android wifi stuff,so on Sense,its wierd )
-Os has always been ****... Other than that, unless you can somehow make the log more verbose, NFC. Can you get something more useful when you try to load the module manually with insmod?
I dont use -Ofast anymore. Did you manually add wireless.ko to lib/modules from your compiled kernel?
Sent from my u8800 using XDA Premium App
dr.notor said:
-Os has always been ****... Other than that, unless you can somehow make the log more verbose, NFC. Can you get something more useful when you try to load the module manually with insmod?
Click to expand...
Click to collapse
I tried it thro' the init.rc too. I dont any other ways to do insmod!!
But it failed even on that account!!
franciscofranco said:
I dont use -Ofast anymore. Did you manually add wireless.ko to lib/modules from your compiled kernel?
Sent from my u8800 using XDA Premium App
Click to expand...
Click to collapse
Yup franco. I copied to modules and then signed it with command:
"java -classpath testsign.jar testsign port.zip signed-port.zip"
I really can't understand why this is getting failed as the same compile options were used for both zImage and wireless.ko!! Rest all works fine except the wifi error!!! The idea i think is as long as all the executables are of same signature, then it should work fine, right?? I am confused on what could be the problem!!!
dr.notor said:
-Os has always been ****... Other than that, unless you can somehow make the log more verbose, NFC. Can you get something more useful when you try to load the module manually with insmod?
Click to expand...
Click to collapse
Today I will try with other compile options, either O1, O2.... etc.
Strange thing is that I face this problem with all other available kernels also!! Like for ex., original GB source from LG, paulo's kernel!! All of it!!
shashi_hv said:
I tried it thro' the init.rc too. I dont any other ways to do insmod!!
But it failed even on that account!!
Click to expand...
Click to collapse
Uh, I do not understand a word.
Code:
$ su
# busybox insmod /system/lib/modules/wireless.ko
What is the output of the above.
dr.notor said:
Uh, I do not understand a word.
Code:
$ su
# busybox insmod /system/lib/modules/wireless.ko
What is the output of the above.
Click to expand...
Click to collapse
Weird!!! Though I see the file being there thro' file manager, I get the error as "No such file or directory"!!
I was telling that I tried to insert this same command even in the init.rc file at the boot option!!
shashi_hv said:
Weird!!! Though I see the file being there thro' file manager, I get the error as "No such file or directory"!!
I was telling that I tried to insert this same command even in the init.rc file at the boot option!!
Click to expand...
Click to collapse
You have been already told that you need to manually add /system/lib/modules with the ones you want (such as wireless.ko or tun.ko or cifs.ko) to the ZIP you are flashing.
Flashing zImage only will not flash the modules!!!!
As for your file manager, I recommend this as a "file manager"
Code:
# ls -l /system/lib/modules
-rw-r--r-- 1 0 0 19948 Aug 1 2008 tun.ko
-rw-r--r-- 1 0 0 191854 Aug 1 2008 wireless.ko
dr.notor said:
You have been already told that you need to manually add /system/lib/modules with the ones you want (such as wireless.ko or tun.ko or cifs.ko) to the ZIP you are flashing.
Flashing zImage only will not flash the modules!!!!
As for your file manager, I recommend this as a "file manager"
Code:
# ls -l /system/lib/modules
-rw-r--r-- 1 0 0 19948 Aug 1 2008 tun.ko
-rw-r--r-- 1 0 0 191854 Aug 1 2008 wireless.ko
Click to expand...
Click to collapse
I know that notor!!!
I copied the tun.ko and wireless.ko to the appropriate folder and built the zip file which i flashed!!
The problem is very weird. I see the file wireless.ko if I browse thro' file manager. Even when i press tab in busybox, wireless.ko gets auto populated or even the ls command lists it!!
It is much more weird that if I tried to do insmode ....../tun.ko, i get the error as 'exec format error' but a 'no such file' for the wireless.ko!! Though I flashed both these of these!!
You know, go wipe the files in /system/lib/modules and flash your kernel and modules from the SAME KERNEL you have compiled.
Also, it is insmod, not insmode and generally if you are posting something, copy and paste the exact output of a command instead of telling us stories about what the output says.
Yup thats what i was thinking too.. i would wipe and try copying it once again.
Definitely i would have shown you the screen shots.. but i am not in a position to grab those and paste it here, as i am in office right now.. but the point is i understand some of linux system and familiar wirh it!!
I tried to create and flash the zip the standard way thats available on net and it did not worked!! Thats the point!! So wanted to know am i missing anything!!
Sent from my LG Optimus One P500 using XDA Premium App
Well, things like 'exec format error' clearly suggest that you flashed some weird corrupt junk...
dr.notor said:
Well, things like 'exec format error' clearly suggest that you flashed some weird corrupt junk...
Click to expand...
Click to collapse
I tried this!!!
1. su
2. rm -f /system/lib/modules/wireless.ko
3. rm -f /system/lib/modules/tun.ko
Now the files were not there in the directory. Flashed the same zip file which I used earlier and found the wireless.ko and tun.ko in the same path!!! But still the problem prevails!!
Just to confirm once again that I indeed copied the compiled wireless.ko and tun.ko and built the zip file!! No problem in that!!!
Why do not you try to do insmod of any existing file in the modules path and report what error you get?? I think even you should get the same error even in your phone too!! I tried this command on an already existing libra.ko in the same path and got the same error!!!
for a few weeks i has compiled my kernel with optimizations -O3 and got "no such device" when tried to insmod the wifi module ...
possibly the wifi module gets corrupted when the kernel is to much optimized...
andy572 said:
for a few weeks i has compiled my kernel with optimizations -O3 and got "no such device" when tried to insmod the wifi module ...
possibly the wifi module gets corrupted when the kernel is to much optimized...
Click to expand...
Click to collapse
Yeah. Just leave the thing alone. There is basically nothing you will optimize by subverting various crazy -O3 -fzomgoptimized -fflying-phone flags to kernel compile. Leave the stock CFLAGS stuff alone.
dr.notor said:
Yeah. Just leave the thing alone. There is basically nothing you will optimize by subverting various crazy -O3 -fzomgoptimized -fflying-phone flags to kernel compile. Leave the stock CFLAGS stuff alone.
Click to expand...
Click to collapse
On a different note, can anybody tell me who will load the wireless.ko and tun.ko at boot time? I mean is there any kind of scripts like the init.rc or any other *.sh scripts under /system/etc?
I tried to see in the init.qcom.wifi.sh script, but its based on the property 'wlan.driver.status'!! I dont see this property under getprop command, but added one using setprop, but no success!!!
Suggestion: restore the stock init **** and leave it alone. There is absolutely no need to mess with that to get WiFi working on any ROM. Others, like tun.ko, you need to load manually via initscript or whatever. Go fix your kernel compile and it will just work.

A working cifs.ko

Don't want to flash a full kernel just need the modules if possible. Many thanks
SordFish said:
Don't want to flash a full kernel just need the modules if possible. Many thanks
Click to expand...
Click to collapse
This is currently one of the top google results for "cifs ouya;" please delete or rename this thread, as there had been zero progress on it, but everyone who wants cifs on ouya is getting steered to it.
huh? no one compile it?
here you are
What I need to do with this files? can you explain with more detail please.?
download and extract them
Code:
adb push md4.ko /data/local/tmp/md4.ko
adb push nls_utf8.ko /data/local/tmp/nls_utf8.ko
adb push cifs.ko /data/local/tmp/cifs.ko
adb shell
su
mount -orw,remount /system
cat /data/local/tmp/md4.ko > /system/lib/modules/md4.ko
cat /data/local/tmp/nls_utf8.ko > /system/lib/modules/nls_utf8.ko
cat /data/local/tmp/cifs.ko > /system/lib/modules/cifs.ko
mount -oro,remount /system
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/nls_utf8.ko
insmod /system/lib/modules/cifs.ko
then use something like "CifsManager" to mount smb share
P.S. those modules are for 1.0.393-r1 only, and if Ouya release a newer firmware, you will lost the cifs functions.
>s added
needed some >s. I inserted them below
i just pasted it without looking and MAD pc speaker beeping action when it cats to the terminal
Code:
adb push md4.ko /data/local/tmp/md4.ko
adb push nls_utf8.ko /data/local/tmp/nls_utf8.ko
adb push cifs.ko /data/local/tmp/cifs.ko
adb shell
su
mount -orw,remount /system
cat /data/local/tmp/md4.ko > /system/lib/modules/md4.ko
cat /data/local/tmp/nls_utf8.ko > /system/lib/modules/nls_utf8.ko
cat /data/local/tmp/cifs.ko > /system/lib/modules/cifs.ko
mount -oro,remount /system
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/nls_utf8.ko
insmod /system/lib/modules/cifs.ko
Thanks.
WonderEkin said:
huh? no one compile it?
here you are
Click to expand...
Click to collapse
Err, I guess I should have noted that possibility as well, haha. Thanks.
hi, anyone have working cifs.ko in ouya?, the library is missing. the only option is cifmanager but can´t add at startup
I apologize for my ignorance, but what sort of practical applications would CIFS support offer on the OUYA? I side loaded an app called Samba Filesharing, and it seems to work fine, however the write speed is quite slow - under 3 MB/s from my laptop.
What would be the difference between following the steps above and just side loading the app I've mentioned? I'm very interested in using my OUYA as a file server in conjunction with a USB hard drive.
Thanks!
Sent from my iPhone using Tapatalk 2
So... figured I'd update this thread if anyone wants to test these...
Here's modules that should work on the current firmware ( OUYA 1.2.771 as of this writing ) as well as CIFSManager.
Install the same way as described by WonderEkin.
.. need some direction .. can't make this work .. "No such file or directory" .. share my directory from win8 with no security credential .. smb is working fine ..
realhuh said:
.. need some direction .. can't make this work .. "No such file or directory" .. share my directory from win8 with no security credential .. smb is working fine ..
Click to expand...
Click to collapse
Do these still work?

Fire TV 2 - Ubuntu (Headless) Install Guide

This guide is intend to help you with "installing" Ubuntu 14.04 (12.04 also works) on the Amazon Fire TV 2 after @rbox recovery has been setup. Only headless mode is possible, similar to Ubuntu Server, but it still makes a nice little ARMv8 development box. Starting X.org or running systemd based Linux distributions will likely never be possible due to features missing from the Amazon kernel. Creative use of the framebuffer is possible if desired, maybe eventually a terminal emulator could be started. As long as you don't mount and modify mmcblk0pX there should be no possible way to mess up Android or brick the device. It's 100% reversible by just removing the SD card. You accept all responsibility for what you do with this work should something go wrong and the device becomes inoperable. With disclaimers and precursor knowledge out of the way let's get started.
To follow this guide you will need:
A micro SD card (2 GB+ recommended)
A Linux system
To login into Ubuntu you will need either:
A 1.8 V TTY USB serial device connected to the UART
A pair of USB serial devices and a null modem cable
I actually used a pair of Xbee's for testing the ttyUSB0 stuff, so hence a pair of FTDI chips would also work.
Preparing the SD Card
To get started you need to first partition the micro SD card:
Type = MBR
Part 1 = 100 MB, Fat32 (vfat)
Part 2 = Remainder, Ext4
Extract the attached zip file to the root of the first partition (extracted filename must be "ramdisk-recovery.cpio.lzma"). This is an alternative initramfs that simply uses busybox to clean up from the partial Android boot and prepare the filesystem for regular Linux. Extract an Ubuntu core root filesystem archive, ubuntu-core-14.04.4-core-arm64.tar.gz, to the root of the second partition as the root user (to preserve ownership/permissions). Make sure you sync or eject the device when done with this work so the data gets flushed to the SD card.
Now we need to make a few changes to the root filesystem to avoid usability issues and allow logins.
Replace /etc/fstab with the following contents to correct some mount options. This "disables" SELinux which fixes dpkg errors and some other login annoyances.
Code:
/dev/mmcblk1p2 / ext4 defaults,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs ro,relatime 0 0
Replace /etc/init/console.conf with the following contents to allow logins from the UART. Once the root password has been set (root is disabled by default) you can remove "-a root" if desired.
Code:
# console - getty
#
# This service maintains a getty on console from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]
respawn
exec /sbin/getty -s -a root console
Create /etc/init/ttyUSB0.conf with the following contents to allow logins from an attached USB serial device. This should help people who don't want to take apart their device to solder wires onto the UART test points. SSH would of course be an alternative but it's not installed by default in Ubuntu core and this guide is about the building blocks not providing pre-made images (yet). Since udev doesn't work due to devtmpfs not being enabled in the kernel you will need to attach the USB serial device before booting for this to work. As before you can remove "-a root" later if desired once the root password is set. Also you should change the baud rate if needed.
Code:
start on (tty-device-added ttyUSB0)
stop on (runlevel [!2345] or tty-device-removed ttyUSB0)
respawn
exec /sbin/getty -L -a root 115200 ttyUSB0 vt102
Preparing the Fire TV
Until the search order for the initramfs file is changed by @rbox you will need to rename the initramfs on the system partition so it will continue to search for one on the SD card or USB stick. You need to connect to the device using adb either over USB or the network to execute the following commands.
Code:
adb$ su
adb# mount -o remount,rw /system
adb# mv /system/recovery/ramdisk-recovery.cpio.lzma /system/recovery/ramdisk-recovery.cpio.lzma.bak
adb# mount -o remount,ro /system
Right now this prevents "su" from working, which should be fixed by @rbox in due time. To get "su" working again you should extract the original recovery initramfs file to a USB stick and boot the device with that USB stick inserted instead of the previously created SD card. Then to restore "su" you can repeat the above steps just swapping the order of the files in the "mv" command.
Booting Ubuntu
After connecting your serial device of choice simply insert the SD card and power on the device. It's that easy! With luck you should get a shell prompt that is already logged in as root. It's a good idea to set the root password before going much further. The device isn't too useful without networking, so you can install more packages. To solve that connect an ethernet cable (since it's simpler) and type "dhclient eth0" to get online. At this point you can install openssh-server using apt-get or do anything else you'd normally do on an Ubuntu VM or headless Ubuntu system. I'm interested in hearing what people plan to do with a more-or-less high-end ARM development system.
Tips and Tricks
NOTE: These changes, unless otherwise noted, are performed while logged into the target Ubuntu system.
Setting the Hostname
You can change the hostname using the following command:
Code:
echo sloane > /etc/hostname
You should also create a simple /etc/hosts file that matches the chosen hostname.
Code:
127.0.0.1 localhost
127.0.1.1 sloane
Enable Ethernet at Boot
Create the file /etc/network/interfaces.d/eth0 with the following contents:
Code:
auto eth0
iface eth0 inet dhcp
Allow Users Network Access
Since we are stuck running an Android kernel you need to create the following group and add users who need network access (such as ping) to this special group.
Code:
groupadd -g 3003 aid_inet
usermod -G aid_inet -a root
usermod -G aid_inet -a <username>
Removing Failed Services
There are a few services that fail to start due to hardware limitations. We should just prevent them from starting in the first place. We have no VT support enabled in the kernel (boo) so we can just remove the ttyX login prompt services. Also the console setup doesn't work since our console is a serial device not a virtual terminal or other "graphical" type terminal emulator.
Code:
rm /etc/init/tty?.conf
echo manual > /etc/init/console-font.override
echo manual > /etc/init/console-setup.override
Fix /dev Hotplug
As stated before udev doesn't work due to missing kernel features. The busybox applet mdev is a simple replacement for most users. After installing the "busybox-static" package run the following command:
Code:
ln -s /bin/busybox /sbin/mdev
Now add the following line to /etc/rc.local before "exit 0".
Code:
echo /sbin/mdev > /proc/sys/kernel/hotplug
Pre-installing SSH
See: http://forum.xda-developers.com/showpost.php?p=65595013&postcount=13 (thanks @segfault1978)
Thanks a lot, that was exactly the thing I was searching for. Since before today the Raspi3 came out, this box is the cheapest ARMv8 development machine available. With your instruction I was able to login via SSH and install all required software for my development environment. No GUI needed for that, I'm doing all remotely via SSH. Again, thank you!
segfault1978 said:
Thanks a lot, that was exactly the thing I was searching for. Since before today the Raspi3 came out, this box is the cheapest ARMv8 development machine available. With your instruction I was able to login via SSH and install all required software for my development environment. No GUI needed for that, I'm doing all remotely via SSH. Again, thank you!
Click to expand...
Click to collapse
Awesome to hear that it worked for you. Just curious if you went the USB serial route or soldered to the UART pins.
There is also the Dragonboard 410c which is a quad core A53 but has a bit more than the raspberry pi. The price is higher though but it has been out probably a year or so. Just FYI. The raspberry pi 3 is a good deal.
zeroepoch said:
Awesome to hear that it worked for you. Just curious if you went the USB serial route or soldered to the UART pins.
Click to expand...
Click to collapse
None of these methods (since I was in my weekend and all cables and adapters reside in my office)
I placed all .deb-files for openssh-server including all requiremens onto the microSD card, and placed a call "dpkg -i /*.deb" with logging options in /etc/rc.local. I also configured network by mounting the sd card, editing /etc/network/interfaces, and last changed /etc/shadow to have a valid root account for login. It took my some try-and-error loops, but finally it worked as expected. Call me crazy, but I succeeded without any hardware.
---------- Post added at 09:09 PM ---------- Previous post was at 09:03 PM ----------
zeroepoch said:
There is also the Dragonboard 410c which is a quad core A53 but has a bit more than the raspberry pi. The price is higher though but it has been out probably a year or so. Just FYI. The raspberry pi 3 is a good deal.
Click to expand...
Click to collapse
Thank you for the hint, I'll have a look for the availability of this board in germany.
I'm facing a memory problem, resulting in a reboot of the device when all RAM is being used. My compile session takes more than 1.x GB of RAM for the quite complex compilation of all required packages. I can reproduce the situation where all memory is consumed and the device instantly reboots when hitting "no memory left" situation. Since "swapon" is not supported by the kernel (really?): is there any way to enable swap functionality, i.e. via a kernel module? How to overcome this situation where more memory is needed?
segfault1978 said:
None of these methods (since I was in my weekend and all cables and adapters reside in my office)
I placed all .deb-files for openssh-server including all requiremens onto the microSD card, and placed a call "dpkg -i /*.deb" with logging options in /etc/rc.local. I also configured network by mounting the sd card, editing /etc/network/interfaces, and last changed /etc/shadow to have a valid root account for login. It took my some try-and-error loops, but finally it worked as expected. Call me crazy, but I succeeded without any hardware.
Click to expand...
Click to collapse
That is pretty crazy, but since you knew the changes required it worked Not everyone I expected to have such experience. I figured someone might even try to do a qemu chroot or debbootstrap to preinstall openssh. Multiple ways to solve the same problem I guess.
segfault1978 said:
I'm facing a memory problem, resulting in a reboot of the device when all RAM is being used. My compile session takes more than 1.x GB of RAM for the quite complex compilation of all required packages. I can reproduce the situation where all memory is consumed and the device instantly reboots when hitting "no memory left" situation. Since "swapon" is not supported by the kernel (really?): is there any way to enable swap functionality, i.e. via a kernel module? How to overcome this situation where more memory is needed?
Click to expand...
Click to collapse
Looking at the default kernel config from the source code drop from Amazon I see:
Code:
# CONFIG_SWAP is not set
Swap can not be compiled as a module. Even if you chose to use a USB stick or something as the swap device It wouldn't work. Given that we can't change the kernel we can't try stuff like zram or zswap either. The only other suggestion I might have is if you're using "-j4" or something while compiling just remove that so it does a single threaded compile. I'm sure you already tried that. Beyond that you could look at using the Linaro AArch64 toolchain and cross compile. Since we're running Ubuntu you shouldn't need to worry about static binaries.
zeroepoch said:
Looking at the default kernel config from the source code drop from Amazon I see:
Code:
# CONFIG_SWAP is not set
Swap can not be compiled as a module. Even if you chose to use a USB stick or something as the swap device It wouldn't work. Given that we can't change the kernel we can't try stuff like zram or zswap either. The only other suggestion I might have is if you're using "-j4" or something while compiling just remove that so it does a single threaded compile. I'm sure you already tried that. Beyond that you could look at using the Linaro AArch64 toolchain and cross compile. Since we're running Ubuntu you shouldn't need to worry about static binaries.
Click to expand...
Click to collapse
Unfortunately, I'm not compiling with parallel processes (I'm compilig Icinga2 for arm64), I'm running
Code:
dpkg-buildpackage -us -uc
within the source package. One single cpp call consumes so much memory (which is crazy in my eyes, never seen such a big compiler process until today), so I'll investigate the option of cross compiling and afterwards creating the deb file outside of the machine.
Code:
cd /root/icinga2-2.4.3/obj-aarch64-linux-gnu/lib/base && /usr/bin/aarch64-linux-gnu-g++ -DI2_BASE_BUILD -Doverride="" -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -pthread -std=c++11 -Wno-inconsistent-missing-override -fPIC -I/root/icinga2-2.4.3 -I/root/icinga2-2.4.3/lib -I/root/icinga2-2.4.3/obj-aarch64-linux-gnu -I/root/icinga2-2.4.3/obj-aarch64-linux-gnu/lib -I/root/icinga2-2.4.3/third-party/execvpe -I/root/icinga2-2.4.3/third-party/mmatch -I/root/icinga2-2.4.3/third-party/socketpair -o CMakeFiles/base.dir/base_unity.cpp.o -c /root/icinga2-2.4.3/obj-aarch64-linux-gnu/lib/base/base_unity.cpp
I'm a novice in android devices: What would be required to use a custom kernel? A hacked boot loader, which is not available for the AFTV2?
segfault1978 said:
I'm a novice in android devices: What would be required to use a custom kernel? A hacked boot loader, which is not available for the AFTV2?
Click to expand...
Click to collapse
Yep... we need to be able to use fastboot to boot an unsigned kernel and initramfs (boot.img). I tried at one point to overwrite the boot partition with own image and it failed to boot. Since I had the preloader stuff worked out already I was able to restore the original boot image and get it working again.
On a side note, if you don't mind could you post the list of packages needed to install SSH server from rc.local? Others might find that useful. To get around the unset password issue you could have also saved a public key in /root/.ssh/authorized_keys which would also avoid you needing to change /etc/ssh/sshd_config to allow password logins as root.
segfault1978 said:
within the source package. One single cpp call consumes so much memory (which is crazy in my eyes, never seen such a big compiler process until today), so I'll investigate the option of cross compiling and afterwards creating the deb file outside of the machine.
Code:
cd /root/icinga2-2.4.3/obj-aarch64-linux-gnu/lib/base && /usr/bin/aarch64-linux-gnu-g++ -DI2_BASE_BUILD -Doverride="" -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -pthread -std=c++11 -Wno-inconsistent-missing-override -fPIC -I/root/icinga2-2.4.3 -I/root/icinga2-2.4.3/lib -I/root/icinga2-2.4.3/obj-aarch64-linux-gnu -I/root/icinga2-2.4.3/obj-aarch64-linux-gnu/lib -I/root/icinga2-2.4.3/third-party/execvpe -I/root/icinga2-2.4.3/third-party/mmatch -I/root/icinga2-2.4.3/third-party/socketpair -o CMakeFiles/base.dir/base_unity.cpp.o -c /root/icinga2-2.4.3/obj-aarch64-linux-gnu/lib/base/base_unity.cpp
Click to expand...
Click to collapse
I see you are not using -pipe which is good, but a quick search suggested something that might not be simple since this package has it's own build system but changing from -O2 to -O1 might help.
I noticed that Debian has the package available for the same version and already built for arm64.
https://packages.debian.org/sid/icinga2
Maybe you already tried that. You could try going back to jessie which is probably an older version but I think most jessie packages work with Ubuntu 14.04.
zeroepoch said:
Yep... we need to be able to use fastboot to boot an unsigned kernel and initramfs (boot.img). I tried at one point to overwrite the boot partition with own image and it failed to boot. Since I had the preloader stuff worked out already I was able to restore the original boot image and get it working again.
On a side note, if you don't mind could you post the list of packages needed to install SSH server from rc.local? Others might find that useful. To get around the unset password issue you could have also saved a public key in /root/.ssh/authorized_keys which would also avoid you needing to change /etc/ssh/sshd_config to allow password logins as root.
Click to expand...
Click to collapse
This is the list of packages I manually downloaded for ARM64 (unfortunately I used Debian packages which worked first, but leads to a hell situation afterwards when dealing with other dependencies; be sure to use Ubuntu packages in order to avoid problems afterwards):
Code:
busybox_1.22.0
libedit2_3.1
libgssapi-krb5
libk5crypto3
libkeyutils1
libkrb5
libkrb5support0
libwrap0
openssh-client
openssh-server
openssh-sftp-server
This is the piece of calls in /etc/rc.local, right before the exit:
Code:
dpkg --force-all -i /*.deb > /install.log 2>/install.err
echo $? >> /install.log
echo "installation finished" >> /install.log
It took about 1-2 minutes before SSH started to work automatically, you can mount the SD card afterwards in another system in order to check the written logfiles.
Here are some notes for getting wireless working. In addition to the normal OS steps (installing wpasupplicant or wireless-tools and editing /etc/network/interfaces or using wicd) you will need some firmware files from /system (/dev/mmcblk0p13).
Code:
mount -o ro /dev/mmcblk0p13 /mnt
cp -r /mnt/etc/firmware/ /lib/
cp -r /mnt/etc/Wireless /etc/
umount /mnt
segfault1978 said:
None of these methods (since I was in my weekend and all cables and adapters reside in my office)
I placed all .deb-files for openssh-server including all requiremens onto the microSD card, and placed a call "dpkg -i /*.deb" with logging options in /etc/rc.local. I also configured network by mounting the sd card, editing /etc/network/interfaces, and last changed /etc/shadow to have a valid root account for login. It took my some try-and-error loops, but finally it worked as expected. Call me crazy, but I succeeded without any hardware.
Thank you for the the fire tv guide.
Click to expand...
Click to collapse
So, what's the verdict on this? I want to use my firetv 2 as an emby server. Is it worth it trying to get Ubuntu to run?
Sent from my Mi A1 using Tapatalk
mrchrister said:
So, what's the verdict on this? I want to use my firetv 2 as an emby server. Is it worth it trying to get Ubuntu to run?
Click to expand...
Click to collapse
If it has arm64 packages and headless you can give it a try. If you don't like it you can just revert the ramdisk and go back to Android.
Ok sweet, thanks for the reply
Sent from my Mi A1 using Tapatalk
Just curious if anyone's tried running Plex server on this?
I've been looking for a better solution without shelling out $500+ for a dedicated NAS. AFTV is tiny so I could hardwire it and hide it away.
Thanks
I got the same idea. Right now the firetv is still being used as a media streamer but I'm thinking of doing this soon

Categories

Resources