MILESTONE CM7 RC4 USB Tethering with Linux - Motorola Droid and Milestone General

I've managed to enable USB Tethering between my Milestone with CM7 RC4 and a Linux box. Maybe it is possible also for Mac OS X with same method.
I'm still testing it, with good results, but it is not easy at all for end users. It can become really easy if it gets integrated into a ROM.
CHANGES:
1) set ro.modem_available=1 in build.prop
2) upload tether-nat to /system/xbin
3) Recompile Usb.apk from CM7 RC4 source with patch attached.
I have the already compiled apk, but I don't know if I can attach it here, for legal reasons.
4) Append attached code to /system/etc/rootfs/init.rc
DISCLAIMER: If you don't fully understand what I've written, do not try this. I should have posted this to Development forum, but I don't have enough posts and I'm not a spammer. Use everything AT YOUR OWN RISK.
HOW IT WORKS:
By sending usb_mode_modem to usbd trough its control socket, the Milestone is seen as a standard ACM modem from the PC. The corresponding serial port on Android is /dev/ttyGS0 .
Simply starting pppd on both ends, and correctly setting up ip forwarding, nat and routing tables does the trick.
ON THE LINUX BOX:
Open a terminal and write
sudo pppd nodetach persist defaultroute 172.16.0.2:172.16.0.1 /dev/ttyACM0
(and please set correct DNS servers before trying.)
Notes: every server app on the phone is also accessible from PC, like dropbear. At IP address 172.16.0.1
Motorola Phone Portal is not working, because it doesn't "detect" the usb connection nor wifi connection, so it doesn't even start listening to the TCP port.
Someone knows how to bypass this check?
When using this mode, ADB is not available. Looks like the PC can't detect the phone as a modem, if ADB is enabled. You don't have to manually toggle it.
Dropbear can be used as a replacement.
It asks for root permission in order to use setprop as a signaling mechanism to Android's init to start and stop pppd daemon, in order to not have it always running and wasting resources.
Maybe it is possible to use on device-added and on device-removed triggers with fake device nodes, in order to not require root privileges, but it is more complicated.
If a Moderator could move this thread to Development, this could be a great thing, if I can still post to it.
Massimo M.

tether
hey can u do a easy steps for doing this???

DISCLAIMER: If you don't fully understand what I've written in the first post, do not try this. I should have posted this to Development forum, but I don't have enough posts and I'm not a spammer. Use everything AT YOUR OWN RISK.
Be prepared to reinstall ROM if you have big issues. It means DO BACKUPS!
Only for CyanogenMod 7.0 RC4 (it should work on newer versions, but I haven't tested it.)
Copy Usb-new.apk on root of your sdcard.
Copy setup.txt on root of your sdcard.
Get a shell (ADB, or Terminal emulator).
Become root ( su )
cd /sdcard
sh setup.txt
reboot the phone.
Connect the USB cable, and choose Phone as a modem.
On the pc (Linux, any distro should work)
sudo modprobe cdc-acm
echo nameserver 8.8.8.8 |sudo tee /etc/resolv.conf
sudo pppd nodetach persist defaultroute 172.16.0.2:172.16.0.1 /dev/ttyACM0
and then open the browser!
I haven't tested setup.txt on my phone, only in a android-like directory hierarchy on my pc. I won't be online until Monday.
Try to understand everything!! And be careful.
The most difficult part was compiling Usb.apk, which I've attached now.

maxximino said:
I've managed to enable USB Tethering between my Milestone with CM7 RC4 and a Linux box. Maybe it is possible also for Mac OS X with same method.
I'm still testing it, with good results, but it is not easy at all for end users. It can become really easy if it gets integrated into a ROM.
CHANGES:
1) set ro.modem_available=1 in build.prop
2) upload tether-nat to /system/xbin
3) Recompile Usb.apk from CM7 RC4 source with patch attached.
I have the already compiled apk, but I don't know if I can attach it here, for legal reasons.
4) Append attached code to /system/etc/rootfs/init.rc
DISCLAIMER: If you don't fully understand what I've written, do not try this. I should have posted this to Development forum, but I don't have enough posts and I'm not a spammer. Use everything AT YOUR OWN RISK.
HOW IT WORKS:
By sending usb_mode_modem to usbd trough its control socket, the Milestone is seen as a standard ACM modem from the PC. The corresponding serial port on Android is /dev/ttyGS0 .
Simply starting pppd on both ends, and correctly setting up ip forwarding, nat and routing tables does the trick.
ON THE LINUX BOX:
Open a terminal and write
sudo pppd nodetach persist defaultroute 172.16.0.2:172.16.0.1 /dev/ttyACM0
(and please set correct DNS servers before trying.)
Notes: every server app on the phone is also accessible from PC, like dropbear. At IP address 172.16.0.1
Motorola Phone Portal is not working, because it doesn't "detect" the usb connection nor wifi connection, so it doesn't even start listening to the TCP port.
Someone knows how to bypass this check?
When using this mode, ADB is not available. Looks like the PC can't detect the phone as a modem, if ADB is enabled. You don't have to manually toggle it.
Dropbear can be used as a replacement.
It asks for root permission in order to use setprop as a signaling mechanism to Android's init to start and stop pppd daemon, in order to not have it always running and wasting resources.
Maybe it is possible to use on device-added and on device-removed triggers with fake device nodes, in order to not require root privileges, but it is more complicated.
If a Moderator could move this thread to Development, this could be a great thing, if I can still post to it.
Massimo M.
Click to expand...
Click to collapse
Hi
I am trying to send the AT Command directly from the terminal of the phone:
stop ril-daemon
cat /dev/ttyGS0 &
echo -e 'ATI\r' > /dev/ttyGS0
But the terminal is like not responding. Why?? Did someone try??
Thank you very much for the help.

Related

VPN Connections (Cisco VPN)

Have this working well and thought this info may help others...
First, your phone needs to be rooted and busybox properly installed. If you've rooted in the past few days, you're fine as the current payload-update.zip does install busybox with all of the links, but if you rooted early please confirm this before continuing.
Next, grab the tun.ko module from the OpenVPN thread.
Then follow the instructions for the Motorola Droid at the VPN Connections site, using the tun.ko you downloaded previously. The one caveat here is that you have to copy the module in recovery on the Incredible as we don't yet have rw access to the /system partition when booted normally.
Once you've restarted your phone after installing tun.ko, just install the latest VPN Connections apk and you're ready to go!
One point that confused me (for longer than I care to admit) is that once you create a VPN profile, you have to long-press on it to bring up the menu for connect/disconnect.
Enjoy!
Dave
which vpn connections. I downloaded latest from the store it opened but did not work.
then tried the latest from the site and it forces close. I'll start over tonight and try again.
-------------------------------------
Sent via the XDA Tapatalk App
I was working on this the other day, but I cannot get the phone to connect to my company's VPN - I setup the IPSEC ID/PW correctly as well as my user IP/PW, but I get an ISAKMP_N_AUTHENTICATION_FAILED. The one thing I didn't do was copy tun.ko in recovery mode - I just did a modprove /sdcard/tun.ko...it didn't complain and it seems like VPN Connections can find the device node without a problem.
On my linux box, I can run the same config options in vpnc and connect no problem...
I got it working after a couple days playing with it. My problem was that I had not installed busybox to xbin like their instructions outlined since it was already installed to sbin. once installed to xbin and proper permissions were granted, it worked like a charm.
Please someone post a complete how to. I cannot get this working. Busybox will not "--install" to xbin
Is there a secrete to getting busybox installed? I know this is weak sauce, but I need help.
Did you try installing busybox while in recovery mode?
where do I install busybox? /system/xbin or sbin?
Kulaa said:
where do I install busybox? /system/xbin or sbin?
Click to expand...
Click to collapse
I've got it in both places. It needs to be in xbin for the vpnc-script. I tried modifying the vpnc-script but running in to too many problems.
Those to configured their ASA
I am trying to setup the ASA for this VPN. Numerous vague (to me) unresolved errors. Phase 1 completes (easy).
Phase 2 Failure: Mismatched attribute types for class Encapsulation Mode: Rcv'd: Tunnel Cfg'd" Transport
Group = <group>, Username = <username>, IP = <IP Address>, All IPSec SA proposals found unacceptable!
" " Duplicate Phase 2 packet detected. No last packet to retransmit.
I am not finding the answers to these issues. I have not been working on VPNs for long but have setup A LOT of client (Any Connect & SSL) VPNs. I tried to "match" those configurations and have failed.
Anyone know of a tut they used to set the VPN up on the Firewall side? Im sure one of these guys I work w/ can set it up in mins but learning the hard way is what "they" prefer. < a week later is enough, I concede!
Bump ~ 10 ~
Bump ~ 10 ~
Console output?
It think I followed all the necessary steps but wanted to confirm somehow. Is there any ways to see the log on what VPN Connect is trying to do and why login fails?
supagene said:
It think I followed all the necessary steps but wanted to confirm somehow. Is there any ways to see the log on what VPN Connect is trying to do and why login fails?
Click to expand...
Click to collapse
./vpnc --debug 3 --script <path to script> --gateway <gatewayip> --id <VPN Group ID> --username <username>
johnnybags said:
./vpnc --debug 3 --script <path to script> --gateway <gatewayip> --id <VPN Group ID> --username <username>
Click to expand...
Click to collapse
./vpnc --script ./vpnc-script --gateway gateway.domain.com --id "Default Initial G
roup" --username supagene
Enter IPSec secret for Default Initial [email protected]: *******
Enter password for [email protected]: *******
uname: not found
basename: not found
grep: not found
which: not found
grep: not found
which: not found
grep: not found
which: not found
[: not found
readlink: not found
[: not found
[: not found
hash comparison failed: (ISAKMP_N_AUTHENTICATION_FAILED)(24)
check group password!
I know about the comment to check the group password, but I copy and pasted it so I know it is correct. Any suggestions? Do I copy the busy box from sbin to xbin or do I need to look for another busybox, where do you recommend me getting it form? Sorry for the noob questions.
Ok So I looked and found that the Procudures I followed for Rooting didn't actually copy busybox to xbin so maybe the first post should be updated to mention to check that xbin actually has busybox. I used the same busybox that was included in the rooting guide.
Now I'm at a different error.
Error binding to source port. Try '--local-port 0'
Failed to bind to 0.0.0.0:500: Address already in use
that's fine, it means you probably have another process of vpnc running that didn't terminate. just ad --local-port 0 to the end of your command line.
So how is your ASA configured? Is it the latest software or 8.2? ???
Kulaa said:
So how is your ASA configured? Is it the latest software or 8.2? ???
Click to expand...
Click to collapse
Not sure. I just know that the Admin can connect with his Cyanogen Modded G1 and it works great for him. He has his NAND fully unlocked of coarse.
Thanks for all the help I'll post my next issue tomorrow.
Following this thread that was linked for helping to get this working on the Incredible.
I'm getting a constant "unable to connect" error... Where do I need to enable logging to find out more about where the error is happening at? On my ASA or on the Incredible?
Thanks.
I've never got it working but if you look above you'll see how I ran this thin in adb shell. That will output everything to console and tell you what is wrong.

Change baudrate of ttyMSM0 without stty or busybox?

Hi !
Since I'm a new member I cannot post in Dev but anyway this is my problem :
I'm plugging an Arduino in the Serial port of the phone (/dev/ttyMSM0) that was enabled by modifying the kernel (.config) to disable to FIQ debugger and so on as well documented on the web...
I fix the permission either in init.mahimahi.rc or when building AOSP to 777 to be able to use the Serial with my apk without having to Su them.
I have a problem concerning the speed of the serial port itself. In all the config files I found in the MSM/Kernel or in AOSP source, speed is set to 115200 by default but it is actually 9600 when the phone is operating.
I can change the speed by using busybox and stty -F but I would rather not use that.
I'm looking for a way to set the speed at low-level, when building kernel and/or AOSP. I tried to figure out which file was involved in the creation/definition of /dev/ttyMSM0 but there is just to many of them and it doesnt seem to work.
Any ideas?

Chrooted Linux "Ubuntu Maveric"

Below is a download with a flashable.zip and an ubuntu.img file.
Why is this good?
The new ics updates do not allow webtop with out a dock, kernel problems same problems as the overclocking the new kernel does not support modules at this time, Or the modules are not compiled with the new kernel. This is a suppliment then for those who wish to have a linux distro. If you plug in your phone with a regular hdmi cable you can use the pocket-cloud.apk to view the ubuntu desktop
Working:
Flash plugin 10 full desktop version, (This is a full desktop flash. from ubuntu desktop version of flash 10.1)
synaptic download
apt-get
vncserver
openssh
gdm
python
FIreFox 3.5
Firefox flash plugin working
Mozilla Thunderbird
Working on:
Wine for games, it is currently installed but missing some files if you manually download and install each lib file you should have a working wine, might be able to edit a repository
This is a chrooted enviroment made for android phones, this enviroment was build from scratch using ubuntu to build a chrooted enviroment from scratch for a rootfs file system.
To begin make sure your sdcard-ext has 3.5 gb free or more.
(if you wish to use sdcard instead of your sdcard-ext then you will have to make an edit in the linux.sh file)
To chroot into linux once your have the files in the correct spots you need only to have terminal emulator, and a vncserver connect (pocket-cloud.apk is free from the market.)
You will need to be rooted or the ability to mount a loop file, and chroot into a chrooted enviroment wich usually requires root privleges. Although there may be ways to vnc connect into it with out being rooted using adb, and adb shell, that will not be discussed here.
So if your rooted, and your have 3.5 gb free space on sdcard-ext then run the:
bioniclinux.zip from your recovery
This will push the files to the correct place, except the ubuntu.img
Put the ubuntu.img on sdcard-ext
by typeing:
adb push ubuntu.img /sdcard-ext/ubuntu.img
In your terminal emulator type: linux
(after you used the bioniclinux.zip and pushed the ubuntu.img to sdcard-ext.)
open pocket cloud free
type:
host: localhost or empty or 127.0.0.1 or 127.0.0.0.1 (not sure how many zeros)
username: ubuntu
password: ubuntu
prot 5901
Not Working:
Wine, missing files, wine is still installed if you remove it you could posiible free up some space,
apt-get update
apt-get dist-upgrade This can be fixed if you edit the /etc/acct/source.list
and fix missing packages and delete old sources, The only reason I left it was because upgradeing can breake Flash player 10.1
and dist-upgrade can breake the whole .img If anyone wants to upgrade and fix the source.list let me know
Change log:
Removed uneeded files. Freed up close to 1 gb
installed Chess 3d
upgraded apt-get
Ubuntu.img V2
if you cannot connect with those settings try
username: android
password: android
prot 5901
and if those dont work try
username: android
password: ubuntu
prot 5901
Having troubles make sure you put the ubuntu.img in the correct place, and name is case sensitive, so make sure it says ubuntu.img not Ubuntu.img
check the linux.sh in /system/xbin/linux.sh or /system/bin/linux.sh make sure it is in both places with adb you can do
adb pull /system/xbin/linux.sh
adb push /system/bin/linux.sh
adb pull /system/xbin/linux
adb push /system/bin/linux
That might fix the problem of not seeing the linux comand, if you cant mount your .img make sure inside the linux.sh it is in the correct location
for example one of the linux.sh might say /sdcard/ubuntu.img
the other might say /sdcard/-ext/ubuntu.img
for the location make sure your location of the image is in same place as the linux script
if you have the linux script or the zip you can put it on your sdcard in the same place as your ubuntu.img and type from the terminal
losetup /dev/block/loop0 /sdcard-ext/ubuntu.img
mount -o rw -t ext3 /dev/block/loop0 /data/local/mnt/Linux
Click to expand...
Click to collapse
then try
su
sh /sdcard/linux.sh
or
sh /system/xbin/linux.sh
or
sh /system/bin/linux.sh
Click to expand...
Click to collapse
that should start the chrooted enviroment
Anyone want to upload the .img to a better file sharing site? send me link for download, faster download speed would be nice.
One thing I noticed was the hostname.sh has beenchanged to an upstart service, so in order to get internet you must make an edit to the rc_enter.sh you could use a root explorer or nano editor in terminal
nano /etc/init.android/rc_enter.sh
Chane the /etc/init.d/hostname.sh to:
service start hostname
Also it would be a good idea to add this to the file just before service start hostname put:
echo "localhost 127.0.0.1 192.168.1.1 192.168.157.1 192.168.43.1" > /etc/init/hostname
echo "localhost 127.0.0.1 192.168.1.1 192.168.157.1 192.168.43.1" > /etc/hostname
echo "nameserver localhost" > /etc/resolv.conf
echo "nameserver 127.0.0.1" >> /etc/resolv.conf
echo "nameserver 192.168.1.1" >> /etc/resolv.conf
echo "nameserver 192.168.157.1" >> /etc/resolv.conf
echo "nameserver 192.168.43.1" >> /etc/resolv.conf
(Just to be sure i also added)
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
_
Now you should get internet threw it. If you have wifi you dont need to take those steps but you will not have internet until you are connected to wifi unless you follow those steps to edit the hostname
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Images of desktop and me posting and editing a post on xda forums using the full desktop version of firefox for ubuntu.
I hope we all can start to build on this img and get it to be more flavor full and userfriendly and even get some gaming.
I see that valve works now with linux maybe we can get valve to work with this.
Also this is very productive for developers, I did not install any developing tools for space, but if you wish you could easily install several tools to help you. maybe an android-kitchen or even cynanogen build tools to build kernal and such. pull your kernel config and you could easily all on your phone with this linux create and edit your bionics kernel. Or build a whole rom with cynanogen mod tools.
Another thing that would be good would be cpu overclocking and maybe even unlocking the second cpu for chrooted eviroment. It already runs when using the android, but maybe we can unlock it fully to always run like the first cpu.
Made for sdcart-ext place ubunti.img there. More updates and info will be coming hope you enjoy.
androidifyme said:
Why is this good?
The new ics updates do not allow webtop with out a dock, kernel problems same problems as the overclocking the new kernel does not support modules at this time, Or the modules are not compiled with the new kernel.
Click to expand...
Click to collapse
compatible with leak 232+?
if using stock motoblur, is this retasking the HDMI port to enable ubuntu OVER or in addition to webtop (if we have a lapdock or HD dock for example)?
sounds interesting.
At this time it does not effect webtop, I bet we could get this to work for the webtop2sd or even the regular webtop.
When the usb drive is mounted on your pc there is an action script that allows for usb mass storage, when your bionic is connect to a dock script runs to hijack the hdmi and turns on webtop, that webtop script we already have edited a few post I have seen to add different desktops and such, It would be possible to put our img in webtop if we didnt touch the scripts used to mount it. basically you would have to replace webtop with this but keep the scripts in tact to lauch webtop from your dock, if anyone wants to help I would be willing to look into this.
yes, we would need to hijack the hdmi_hotplug and either insert a mount/remount like webtop2sd, OR ... what the eventual goal of that project was... boot from USB! (was this ever accomplished on Atrix?) for that matter, do we even *need* to hijack HDMI if webtop 3.0 can run the chrooted VNC natively like a phone would? (could be a staging point)
i believe with ICS device drivers, it would be a lot simpler to hot swap linux distros on thumb drives for example, or even more daring.. dual boot into bactrack anyone?
Here is a way we can make the linux distro take over the screen and usb event paths, its originaly for the nook but if anyone wants to take a look.
http://thomaspolasek.blogspot.ca/2012/04/arch-linux-lxde-w-xorg-mouse-keyboard_16.html
Setup our DNS (only have to do this once) echo "nameserver 8.8.8.8" > /etc/resolv.conf echo "nameserver 4.2.2.2" >> /etc/resolv.conf
Update arch pacman -Syu
Install Xorg and LXDE on your Arch Linux Chroot pacman -S xorg-xinit xf86-video-fbdev xf86-input-evdev lxde
Edit your /etc/X11/Xorg.conf file cd /etc/X11 rm Xorg.conf sudo wget http://y.uk.to/files/xorg.conf (or try http://pastebin.com/raw.php?i=8CM7NKhd) You may need to edit the device references for the keyboard and mouse in Xorg.conf! (/dev/input/event5 and /dev/input/event4 might be different) More information is found below
Go on your Nook Tablet and Run the Nook Tweaks app Turn on USB-Settings ---> USB Host Mode Turn on USB-Settings ---> External VBus
Connect your USB devices to your Nook Color Tablet Obtain a female to female usb connector Connect a hub to one side of the female connector Connect a usb keyboard/mouse to the hub Connect a mini-usb to the nook and then to the other side of the female connector
If you need to figure out what devices your keyboard and mouse are on, then cd /dev/input
run the cat command on each input* .... and check if your keyboard/mouse input results in a change on the output from cat for example, when I press a key on my keyboard cat /dev/input/event5 outputs some binary characters.
Now we will setup our linux framebuffer (****UPDATE 1****)
pikpok sent me this suggestion in the comments section.
You can use "setprop ctl.stop media & setprop ctl.stop zygote" in adb shell to kill zygote server and media, if you want to return to android you can replace stop with start and run again, it's much better than chmod
Now we will setup our linux framebuffer (hack)
Try pikpok's suggestion first, if it doesn't work then try out this hack of mine.
Temporary hack to stop the android system from accessing the frame buffer device. I plan on writing a patch that toggles access to this framebuffer from linux. But right now what I do is I change permissions on the framebuffer and then wait for the android system to lose connection to the framebuffer device. Once android loses the connection I run the Xorg server on the framebuffer, it hijacks the graphics output. If anyone has any idea on a better way to this please feel free to post on the comments section. Eventually (again this is a hack) the android system will appear to freeze (the screen stops updating)
cd /dev/graphics chmod 000 /dev/graphics/fb0 chown root:root /dev/graphics/fb0
If the graphics don't freeze right away, then keep running and killing the xorg server over and over until it does.
Start LXDE session (starts Xorg Server) xinit /usr/bin/lxsession &
If everything is configured good, you will get a full LXDE desktop with mouse and keyboard support. For any xorg server problems, have a look at the /var/log/Xorg*.log file
To stop the xorg server you can run (not the safest way but it doesn't really matter for this) killall X
BAM. Fully working linux system using the linux framebuffer with mouse/keyboard support.
In addition to support the USB keyboard and mouse, it is possible for other USB devices that are support ed by linux to be connected. Example of devices such as USB-DVI, USB-SERIAL, Arduino, etc...
Notes about the SD Card and EMMC:
It is possible to chroot into any part of the filesystem of Nook as long as you have rwx access. For my personal usage I chroot into the 8th partition on the EMMC (~4GB) of space and run Arch Linux from there, I find the EMMC runs faster than the SD Card.
that is definately an interesting option, i actually have a nook & xoom i could try this out on. i think that working within the API provided by moto for HDMI cloning might be the most direct and "seamless" display option. if im not mistaken the webtop itself scales and optimizes any application into "webtop" (basically tablet) mode. this is different from a simple cloning, which is preferable the if distro was being run through VNC.
there IS however a dock configuration for webtop (2.0 im sure of, need to test 3) where the display is outputed through HDMI, but the phone display is turned into a simulated mouse and keyboard combo. this would mean it is theoretically possible to run the chrooted OS when HDMI cable is detected, and automatically retask the phone as a HID. bluetooth / usb input is also supported at this point through the dock USB ports.
additionally, HDMI audio routing is only enabled @ 1 resolution output setting (the one for lapdock, need to double check #s). utilizing this feed would probably be the ultimate goal of the linux system (and would give the OS the highest resolution audio possible to work with)
cheers!
Can I get a bump already.
Will this work with any Droid Bionic ROM? I want to install on a custom ROM for use with my LapDock.
Can this allow me to install Ubuntu as WebTop onto the Liquid ROM I am running on the Safe Partition?
Droid Bionic Running:
Unsafe Leaked 6.7.232 Webtop v3.0.0 / LapDock functions perfectly
Safe Strapped Liquid 1.5-ICS-TARGA-MR2.3 is Rooted / No Webtop / my lapdock only charges
I would like to point out that WINE will never work with this as WINE is not a CPU emulator (WINE after all stands for Wine Is Not an Emulator).
Therefore althrough WINE does work on ARM you could only run ARM compiled .exe files which right now there arnt any, this may change once Windows 8 is released for ARM but still it will be pretty useless.
Other than that great to see more device specific guides! the more devices the better
zacthespack said:
I would like to point out that WINE will never work with this as WINE is not a CPU emulator (WINE after all stands for Wine Is Not an Emulator).
Therefore althrough WINE does work on ARM you could only run ARM compiled .exe files which right now there arnt any, this may change once Windows 8 is released for ARM but still it will be pretty useless.
Other than that great to see more device specific guides! the more devices the better
Click to expand...
Click to collapse
I don't know what I am doing here but you're wrong, WINE does work for ARM and apps for x86 works and ARM plus WINE, I tried it myself a long ago with my Atrix, I think I disscused this with you before.
TravisAntonio said:
I don't know what I am doing here but you're wrong, WINE does work for ARM and apps for x86 works and ARM plus WINE, I tried it myself a long ago with my Atrix, I think I disscused this with you before.
Click to expand...
Click to collapse
I was simply repeating whats been said here http://wiki.winehq.org/ARM if you have shown otherwise then great and by all means prove me wrong but you might want to talk with the WINE ARM team to let them know what does work
This is all pretty interesting... im liking the idea of linux on my phone. I cant wait to see how this progresses.
Sent from my Transformer Pad TF300T
Wow! Thank you for this.
I do have an issue though. I would love to get this running.
I entered the information in to PocketCloud as a VNC (is that correct?) and then when I launch "linux" in terminal emulator it says that the linux module isn't found in Busybox.
I followed the instructions (at least I think I did). I flashed the zip in recovery.
What am I missing?
Thank you.
check the linux.sh in /system/xbin/linux.sh or /system/bin/linux.sh make sure it is in both places with adb you can do
adb pull /system/xbin/linux.sh
adb push /system/xbin/linux.sh
adb pull /system/xbin/linux
adb push /system/bin/linux
That might fix the problem of not seeing the linux comand, if you cant mount your .img make sure inside the linux.sh it is in the correct location
for example one of the linux.sh might say /sdcard/ubuntu.img
the other might say /sdcard/-ext/ubuntu.img
for the location make sure your location of the image is in same place as the linux script
if you have the linux script or the zip you can put it on your sdcard in the same place as your ubuntu.img and type from the terminal
su
sh /sdcard/linux.sh
or
sh /system/xbin/linux.sh
that should start the chrooted enviroment
androidifyme said:
One thing I noticed was the hostname.sh has beenchanged to an upstart service, so in order to get internet you must make an edit to the rc_enter.sh you could use a root explorer or nano editor in terminal
nano /etc/init.android/rc_enter.sh
Chane the /etc/init.d/hostname.sh to:
service start hostname
Also it would be a good idea to add this to the file just before service start hostname put:
echo "localhost 127.0.0.1 192.168.1.1 192.168.157.1 192.168.43.1" > /etc/init/hostname
echo "localhost 127.0.0.1 192.168.1.1 192.168.157.1 192.168.43.1" > /etc/hostname
echo "nameserver localhost" > /etc/resolv.conf
echo "nameserver 127.0.0.1" >> /etc/resolv.conf
echo "nameserver 192.168.1.1" >> /etc/resolv.conf
echo "nameserver 192.168.157.1" >> /etc/resolv.conf
echo "nameserver 192.168.43.1" >> /etc/resolv.conf
(Just to be sure i also added)
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
Click to expand...
Click to collapse
Issue With Above Info
Just wanted to mention this is actually off. The nameserver [DNS server] you have listed here. Sorry if this was covered before don't have time to read all replies... 192.168 is reserved only for LAN use [not to be accessible to the Internet only behind a router on a private network]. So those may work for you via WiFi on your home network, but to others they won't be able to talk to those servers [unless a few have those same addresses on their private network setup for the same function].
Then Why does it still work stupid?
It works because the last one you have 8.8.8.8 is a public DNS on the internet so Ubuntu is essentially looking for a website address and 192.168.1.1 FAIL 157.1 FAIL 43.1 FAIL 8.8.8.8 FOUND.
Resolution [verified]
Also, OpenDNS [a very fast and nice FREE DNS nameserver service available worldwide] [http://www.opendns.com/home-solutions ] (scroll down to almost bottom of page there is a dark bar that lists the 2 server addresses if they were to ever change, or you want to check out signing up for an account so you can parental control and/or set custom settings like landing page for not found address (HTTP 404 error) etc.]
Free Worldwide Name [DNS] Servers:
Primary Nameserver [DNS]: 208.67.222.222
Secondary Nameserver [DNS]: 208.67.220.220
[you can use either server as a primary or secondary they just ask you to use 222.222 as primary and 220.220 as Secondary].
So, if you want to edit the OP with those they should work in 99.99% of all cases [can't vouch for people behind the Great Firewall of China or elsewhere if they severely filter the internet [speaking to the majority here]]. Now, usually if using a router [most cable modems are routers] then if you view the below info about opening a command prompt you can open one and type ipconfig [or if not on Windows view your basic network connection info]. Look for an entry labeled Gateway: This in 99% of cases will also have a DNS server [very basic] running and would be the address you could use when on your home network [99% of routers are generally set to 192.168.1.1 or 192.168.10.1 [or some variation on this theme [and yes you could in theory use almost any set of IP addresses on a LAN but I am trying to help the majority of general users]].
Verification [semi as ping helps you know if there is even a computer, but doesn't tell you if that computer runs a DNS server sprcifically]
If you want to see if an address works for you? Then try the following [Windows command listed as that again is the majority Linux users usually know their own ping but replace ping with hping if not sure as there is a good chance hping has been installed by default or by another package already]
Open a command prompt [click Start, run, then type "cmd" [as usual without quotes] in the white box and click OK or hit <ENTER>
When the Black Screen with white text [default yours may be different but should be text only and usually says C:\Blah]
Now type:
Ping 192.168.43.1 [or whatever can even use a website like www.google.com if you would like but we are checking certain addresses here]
Now it should start listing some text on the screen. If you see something like [I stopped it usually default for ping is to try 4x then exit]:
Code:
Pinging 192.168.43.1 with 32 bytes of data:
Request timed out.
Ping statistics for 192.168.43.1:
Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),
You can't talk to anything at that address [whether it is your network or the internet doesn't have that address anywhere, or there is something suchas a firewall blocking the ping command [be sure to enable ECHO ping on your router if not [usually is] and that you check your firewall settings to be sure that it is not filtering the packets].
Sorry this got long, just wanted to explain the issue, how to address it and how to verify things fully.
---------- Post added at 01:22 PM ---------- Previous post was at 01:12 PM ----------
ErisDroid? said:
Wow! Thank you for this.
I do have an issue though. I would love to get this running.
I entered the information in to PocketCloud as a VNC (is that correct?) and then when I launch "linux" in terminal emulator it says that the linux module isn't found in Busybox.
I followed the instructions (at least I think I did). I flashed the zip in recovery.
What am I missing?
Thank you.
Click to expand...
Click to collapse
Search the Play Market for Busybox installer [I prefer the one by Sterricson] and run that, grant it root [be patient on first open it takes it a min to request root usually], then allow it do it's checks [see status bar at top of screen fill as it runs and I suggest you say yes to the backup]. When it finishes tap Install and tap Normal install if prompted. This will ensure your busybox is correctly installed [it should have been your system saying command not found not busybox command not found something is a tiny bit off should have been more like sh: can't find command unless you actually used busybox as the shell itself [not advised is doable but not advised and I don't know any devs on XDA who have set their ROMs to do so [could be wrong I am sure there are devs here I don't know ]].
Ensure you ran his installer zip in recovery so that the linux file is in /system/xbin [or system/bin [some phones go one way others go the other and yes both directories are usually always there as even if it uses xbin usually there are file links to /system/bin for everything that is actually in /system/xbin].
If his installer sets it up in a way that your phone deosn't like follow as the OP states and open the zip find that file named linux [with no extension in Windows should appear as a white blank page icon]. Once you find that file just copy to your SDCard where the ubuntu.img file is.
Once done open terminal
Type in the following
cd /sdcard <ENTER enter key go key whatever your keyboard uses>
now type linux <ENTER> and that starts the server you should see starting vnc server or something verifying it is starting [unless author of the script omitted that which I highly doubt]
NOW try opening androidvnc, pocket cloud, whatever you use [I prefer AndroidVNC, but to each their own].
---------- Post added at 01:29 PM ---------- Previous post was at 01:22 PM ----------
zacthespack said:
I would like to point out that WINE will never work with this as WINE is not a CPU emulator (WINE after all stands for Wine Is Not an Emulator).
Therefore althrough WINE does work on ARM you could only run ARM compiled .exe files which right now there arnt any, this may change once Windows 8 is released for ARM but still it will be pretty useless.
Other than that great to see more device specific guides! the more devices the better
Click to expand...
Click to collapse
Yeah this is right when speaking of Android and WINE, THOUGH THEY ARE APPARENTLY WORKING TO GET WINE ON NATIVE ANDROID YAY, oh and yes they have a proof of concept video, BUT they have yet to release it at all.
As noted by the above quote it is indeed a CPU issue, WINE is coded really only for use with x86 based processors only, you have to basically re-code the whole thing so that it can use ARM instructions AND works with Android [theres a catch because yes there is BASIC support in WINE for ARM as of 2009 [See link below] which is 99.99999% of all Android devices [there are a couple now and more coming from intel with x86 based processors but TRUST me unless they SEVERELY upgraded x86 code ARM code is MUCH better battery use wise so I won't be buying any x86 based mobile devices myself.
http://wiki.winehq.org/ARM
Original poster I am replying to was thinking more along these lines An ANDROID based WINE client that runs is not quite to market yet see:
http://www.engadget.com/2013/02/04/wine-android-windows-apps/
Another Note here folks, I love the Windows, Linux, Unix Emulator [Title as listed on play market Just search Windows Emulator it comes up as first result [as of this writing]] As it does as it says allows the install of one of those systems in Android. I am not sure how well it may run on the Bionic [I use a Tmo Galaxy S2 [T989 1.5GHz Dual Core] and the awesome Nexus 7 [ Grouper 32G] I am here as I saw this while looking at other stuff for another person's phone I am working on
P.S see how easy that was when there is a disagreement or you want to be sure you give fully qualified answers you just do a little internet searching and find reputable [best you can] sources that may settle the question between you
Can someone upload Ubuntu.img
Can someone please upload the Ubuntu.img to somewhere besides 4shared.
Just for clarification:
The first reason I put the 192.168.0.1 and 157, and 43 is because the chrooted enviroment will connect to internet if your phone has a data connection pretty much no matter what because of 8.8.8.8 yes, but if no data, I added those dns for the wifi and virtual wlan0 and lan0, or eth0 on your phone and most of those default to the above addresses,
Second the wine that is installed on here is the wine/arm, but I think there are some broken dependencies, I was only trying to get wine to run for windows programs not an os, like the qemu emulator i think there is an apk in the market or online for it.
Yes I forgot to say you would need busybox to install and run this, so first make sure you have busybx installed, rooted, /system/xbin/linux, /system/xbin/linux.sh, /sdcard/ubuntu.img
open terminal type :
linux
[email protected]:vncserver
then connect to your localhost:ubuntu:ubuntu:5901
if you have any question or errors dont be affraid to message me or post here.
RealPariah said:
Issue With Above Info
Just wanted to mention this is actually off. The nameserver [DNS server] you have listed here. Sorry if this was covered before don't have time to read all replies... 192.168 is reserved only for LAN use [not to be accessible to the Internet only behind a router on a private network]. So those may work for you via WiFi on your home network, but to others they won't be able to talk to those servers [unless a few have those same addresses on their private network setup for the same function].
Then Why does it still work stupid?
It works because the last one you have 8.8.8.8 is a public DNS on the internet so Ubuntu is essentially looking for a website address and 192.168.1.1 FAIL 157.1 FAIL 43.1 FAIL 8.8.8.8 FOUND.
Resolution [verified]
Also, OpenDNS [a very fast and nice FREE DNS nameserver service available worldwide] [http://www.opendns.com/home-solutions ] (scroll down to almost bottom of page there is a dark bar that lists the 2 server addresses if they were to ever change, or you want to check out signing up for an account so you can parental control and/or set custom settings like landing page for not found address (HTTP 404 error) etc.]
Free Worldwide Name [DNS] Servers:
Primary Nameserver [DNS]: 208.67.222.222
Secondary Nameserver [DNS]: 208.67.220.220
[you can use either server as a primary or secondary they just ask you to use 222.222 as primary and 220.220 as Secondary].
So, if you want to edit the OP with those they should work in 99.99% of all cases [can't vouch for people behind the Great Firewall of China or elsewhere if they severely filter the internet [speaking to the majority here]]. Now, usually if using a router [most cable modems are routers] then if you view the below info about opening a command prompt you can open one and type ipconfig [or if not on Windows view your basic network connection info]. Look for an entry labeled Gateway: This in 99% of cases will also have a DNS server [very basic] running and would be the address you could use when on your home network [99% of routers are generally set to 192.168.1.1 or 192.168.10.1 [or some variation on this theme [and yes you could in theory use almost any set of IP addresses on a LAN but I am trying to help the majority of general users]].
Verification [semi as ping helps you know if there is even a computer, but doesn't tell you if that computer runs a DNS server sprcifically]
If you want to see if an address works for you? Then try the following [Windows command listed as that again is the majority Linux users usually know their own ping but replace ping with hping if not sure as there is a good chance hping has been installed by default or by another package already]
Open a command prompt [click Start, run, then type "cmd" [as usual without quotes] in the white box and click OK or hit <ENTER>
When the Black Screen with white text [default yours may be different but should be text only and usually says C:\Blah]
Now type:
Ping 192.168.43.1 [or whatever can even use a website like www.google.com if you would like but we are checking certain addresses here]
Now it should start listing some text on the screen. If you see something like [I stopped it usually default for ping is to try 4x then exit]:
Code:
Pinging 192.168.43.1 with 32 bytes of data:
Request timed out.
Ping statistics for 192.168.43.1:
Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),
You can't talk to anything at that address [whether it is your network or the internet doesn't have that address anywhere, or there is something suchas a firewall blocking the ping command [be sure to enable ECHO ping on your router if not [usually is] and that you check your firewall settings to be sure that it is not filtering the packets].
Sorry this got long, just wanted to explain the issue, how to address it and how to verify things fully.
---------- Post added at 01:22 PM ---------- Previous post was at 01:12 PM ----------
Search the Play Market for Busybox installer [I prefer the one by Sterricson] and run that, grant it root [be patient on first open it takes it a min to request root usually], then allow it do it's checks [see status bar at top of screen fill as it runs and I suggest you say yes to the backup]. When it finishes tap Install and tap Normal install if prompted. This will ensure your busybox is correctly installed [it should have been your system saying command not found not busybox command not found something is a tiny bit off should have been more like sh: can't find command unless you actually used busybox as the shell itself [not advised is doable but not advised and I don't know any devs on XDA who have set their ROMs to do so [could be wrong I am sure there are devs here I don't know ]].
Ensure you ran his installer zip in recovery so that the linux file is in /system/xbin [or system/bin [some phones go one way others go the other and yes both directories are usually always there as even if it uses xbin usually there are file links to /system/bin for everything that is actually in /system/xbin].
If his installer sets it up in a way that your phone deosn't like follow as the OP states and open the zip find that file named linux [with no extension in Windows should appear as a white blank page icon]. Once you find that file just copy to your SDCard where the ubuntu.img file is.
Once done open terminal
Type in the following
cd /sdcard <ENTER enter key go key whatever your keyboard uses>
now type linux <ENTER> and that starts the server you should see starting vnc server or something verifying it is starting [unless author of the script omitted that which I highly doubt]
NOW try opening androidvnc, pocket cloud, whatever you use [I prefer AndroidVNC, but to each their own].
---------- Post added at 01:29 PM ---------- Previous post was at 01:22 PM ----------
Yeah this is right when speaking of Android and WINE, THOUGH THEY ARE APPARENTLY WORKING TO GET WINE ON NATIVE ANDROID YAY, oh and yes they have a proof of concept video, BUT they have yet to release it at all.
As noted by the above quote it is indeed a CPU issue, WINE is coded really only for use with x86 based processors only, you have to basically re-code the whole thing so that it can use ARM instructions AND works with Android [theres a catch because yes there is BASIC support in WINE for ARM as of 2009 [See link below] which is 99.99999% of all Android devices [there are a couple now and more coming from intel with x86 based processors but TRUST me unless they SEVERELY upgraded x86 code ARM code is MUCH better battery use wise so I won't be buying any x86 based mobile devices myself.
http://wiki.winehq.org/ARM
Original poster I am replying to was thinking more along these lines An ANDROID based WINE client that runs is not quite to market yet see:
http://www.engadget.com/2013/02/04/wine-android-windows-apps/
Another Note here folks, I love the Windows, Linux, Unix Emulator [Title as listed on play market Just search Windows Emulator it comes up as first result [as of this writing]] As it does as it says allows the install of one of those systems in Android. I am not sure how well it may run on the Bionic [I use a Tmo Galaxy S2 [T989 1.5GHz Dual Core] and the awesome Nexus 7 [ Grouper 32G] I am here as I saw this while looking at other stuff for another person's phone I am working on
P.S see how easy that was when there is a disagreement or you want to be sure you give fully qualified answers you just do a little internet searching and find reputable [best you can] sources that may settle the question between you
Click to expand...
Click to collapse
Thanks for the post, This is great help
Also if you wanted to try to highjack the hdmi instead of the phones frame buffer we might be able to do that.
by taking over /dev/graphics/fb1 ,I have not personaly tested this, or someone who worked on the webtop2sd might be able to use this instead of the webtop2sd linux versoin used.
You can use "setprop ctl.stop media & setprop ctl.stop zygote" in adb shell to kill zygote server and media, if you want to return to android you can replace stop with start and run again, it's much better than chmod
Now we will setup our linux framebuffer (hack)
Try pikpok's suggestion first, if it doesn't work then try out this hack of mine.
Temporary hack to stop the android system from accessing the frame buffer device. I plan on writing a patch that toggles access to this framebuffer from linux. But right now what I do is I change permissions on the framebuffer and then wait for the android system to lose connection to the framebuffer device. Once android loses the connection I run the Xorg server on the framebuffer, it hijacks the graphics output. If anyone has any idea on a better way to this please feel free to post on the comments section. Eventually (again this is a hack) the android system will appear to freeze (the screen stops updating)
cd /dev/graphics chmod 000 /dev/graphics/fb1 chown root:root dev/graphics/fb1
If the graphics don't freeze right away, then keep running and killing the xorg server over and over until it does.
Start LXDE session (starts Xorg Server) xinit /usr/bin/lxsession &
If everything is configured good, you will get a full LXDE desktop with mouse and keyboard support. For any xorg server problems, have a look at the /var/log/Xorg*.log file
To stop the xorg server you can run (not the safest way but it doesn't really matter for this) killall X
BAM. Fully working linux system using the linux framebuffer with mouse/keyboard support.
androidifyme said:
Just for clarification:
The first reason I put the 192.168.0.1 and 157, and 43 is because the chrooted enviroment will connect to internet if your phone has a data connection pretty much no matter what because of 8.8.8.8 yes, but if no data, I added those dns for the wifi and virtual wlan0 and lan0, or eth0 on your phone and most of those default to the above addresses,
Second the wine that is installed on here is the wine/arm, but I think there are some broken dependencies, I was only trying to get wine to run for windows programs not an os, like the qemu emulator i think there is an apk in the market or online for it.
Yes I forgot to say you would need busybox to install and run this, so first make sure you have busybx installed, rooted, /system/xbin/linux, /system/xbin/linux.sh, /sdcard/ubuntu.img
open terminal type :
linux
[email protected]:vncserver
then connect to your localhost:ubuntu:ubuntu:5901
if you have any question or errors dont be affraid to message me or post here.
Thanks for the post, This is great help
Also if you wanted to try to highjack the hdmi instead of the phones frame buffer we might be able to do that.
by taking over /dev/graphics/fb1 ,I have not personaly tested this, or someone who worked on the webtop2sd might be able to use this instead of the webtop2sd linux versoin used.
You can use "setprop ctl.stop media & setprop ctl.stop zygote" in adb shell to kill zygote server and media, if you want to return to android you can replace stop with start and run again, it's much better than chmod
Now we will setup our linux framebuffer (hack)
Try pikpok's suggestion first, if it doesn't work then try out this hack of mine.
Temporary hack to stop the android system from accessing the frame buffer device. I plan on writing a patch that toggles access to this framebuffer from linux. But right now what I do is I change permissions on the framebuffer and then wait for the android system to lose connection to the framebuffer device. Once android loses the connection I run the Xorg server on the framebuffer, it hijacks the graphics output. If anyone has any idea on a better way to this please feel free to post on the comments section. Eventually (again this is a hack) the android system will appear to freeze (the screen stops updating)
cd /dev/graphics chmod 000 /dev/graphics/fb1 chown root:root dev/graphics/fb1
If the graphics don't freeze right away, then keep running and killing the xorg server over and over until it does.
Start LXDE session (starts Xorg Server) xinit /usr/bin/lxsession &
If everything is configured good, you will get a full LXDE desktop with mouse and keyboard support. For any xorg server problems, have a look at the /var/log/Xorg*.log file
To stop the xorg server you can run (not the safest way but it doesn't really matter for this) killall X
BAM. Fully working linux system using the linux framebuffer with mouse/keyboard support.
Click to expand...
Click to collapse
That's interesting I would have thought you could run a script and grep the interface IP if you are tying the Cell in for data. I know this takes time and all, but what I would suggest is you could prolly throw it in the linux wrapper script you have or if that is too early in the process maybe throw a script that loads on login to the image to do so and re-build. Again I know you just started this and that takes time just throwing it out there..
Also, if it is for LAN WiFi doesn't DHCP run and able to grab an IP?
I understand the ARM deal, I just threw in the emulator name for those who don't understand what WINE truly is and are trying to find something to run a more robust Windows environment [why, I am not sure, but hey there it is LoL].

USB Ethernet for N7100

I'm trying to get USB Ethernet support enabled on the Omni ROM for N7100 (specifically the AX8817X one). I'll explain the steps I went through
cd kernel/samsung/smdk4412/
make custom_n7100_defconfig
make menuconfig
This bring up the GUI module thing (ncurses required).
Then I navigate to:
Device Driver -> Network Device Support -> USB Network Adapters -> Multipurpose USB Networking Framework
In here I then enabled the AX8817X support with 'M' to make a dynamic module. I am only doing this so I can see if it appears as a .ko afterwards.
After this I try to build using both 'brunch n7100' and 'lunch aosp_arm-eng'.
However the build always falls over. For brunch it tells me to recompile using make mrproper, which also falls over. Lunch says something about no target. Got any ideas how to get this working, if its possible at all?
Thanks a lot.
If you wanna lunch a device, you do something like lunch omni_n7100-userdebug
Build log please.
Sent from my GT-N7100 using Tapatalk
kaleb500 said:
I'm trying to get USB Ethernet support enabled on the Omni ROM for N7100 (specifically the AX8817X one). I'll explain the steps I went through
cd kernel/samsung/smdk4412/
make custom_n7100_defconfig
make menuconfig
This bring up the GUI module thing (ncurses required).
Then I navigate to:
Device Driver -> Network Device Support -> USB Network Adapters -> Multipurpose USB Networking Framework
In here I then enabled the AX8817X support with 'M' to make a dynamic module. I am only doing this so I can see if it appears as a .ko afterwards.
After this I try to build using both 'brunch n7100' and 'lunch aosp_arm-eng'.
However the build always falls over. For brunch it tells me to recompile using make mrproper, which also falls over. Lunch says something about no target. Got any ideas how to get this working, if its possible at all?
Thanks a lot.
Click to expand...
Click to collapse
You need to:
Copy the .config from menuconfig over to arch/arm/configs/custom_n7000_defconfig
export ARCH=arm
make mrproper (might need to set the toolchain path to the Android toolchain by setting CROSS_COMPILE properly)
Then go to the top level and brunch
Entropy512 said:
You need to:
Copy the .config from menuconfig over to arch/arm/configs/custom_n7000_defconfig
export ARCH=arm
make mrproper (might need to set the toolchain path to the Android toolchain by setting CROSS_COMPILE properly)
Then go to the top level and brunch
Click to expand...
Click to collapse
Thanks for the responses. Based on your advice I performed the following steps:
1. Copy .config to arch/arm/configs/custom_n7100_defconfig (replacing the one that was already there).
2. Delete .config, no longer needed after copy.
3. Went to top level then:
. build/envsetup
brunch n7100
This built OK and 'asix.ko' has appeared in the modules area. So its looking pretty good.
I can't test it on the phone until tomorrow. I will report back
OK the dynamic module didn't work properly. So we tried compiling as a static module instead. This does require the make mrproper step, otherwise it falls over. Process as follows:
make clean
cd kernel/samsung/smdk4412/
make custom_n7100_defconfig
make menuconfig
This bring up the GUI module thing (ncurses required).
Then I navigate to:
Device Driver -> Network Device Support -> USB Network Adapters -> Multipurpose USB Networking Framework
In here I then enabled the AX8817X support with 'Y' to make a static module. Save the config then copy to the correct area:
cp .config arch/arm/configs/custom_n7100_defconfig
sudo rm .config*
The default CROSS_COMPILE value in the makefile is wrong so I change it from:
CROSS_COMPILE ?= ../../../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
to:
CROSS_COMPILE ?= ../../../prebuilts/gcc/linux-x86/arm/arm-eabi-4.4.3/bin/arm-eabi-
After this run mrporper:
make mrproper
Then navigate to the top and run brunch:
cd ../../../
. build/envsetup,sh
brunch n7100
This builds OK. When installed on the phone I then plug a USB device in and run a terminal application called 'Terminal IDE' and issue:
su
ifup eth0
This actually brings the interface up, and it is visible when I do an ifconfig (I tried this without the device plugged in as a sanity check and it didn't work). It then complains that the following file is missing:
/etc/network/interfaces
In the terminal app i remount the drive to make it writable using the steps shown here:
http://ckirbach.wordpress.com/2012/11/27/how-to-remount-system-as-read-write-in-android/
I then manually create the file and populate as follows:
auto eth0
iface eth0 inet dhcp
This prevent the same error occurring. How now it complains it can't find the following:
/etc/network/if-up.d
/var/run/ifstate
I could continue with the process of adding these files manually. But perhaps there is another kernel module I need to add? Its kind of looks like the device driver and the device itself are working fine, but the kernel is missing the files it needs? Any ideas appreciated.
Thanks
p.s. Deleted the interfaces file for the moment
OK I got it working eventually. Tried a different USB device then in terminal:
su
netcfg eth0 up
netcfg eth0 dhcp
It then enumerated correctly
The device was a Mb rather than a Gb that I tried previously. Perhaps that is why it didn't work. Perhaps there is a Gb option the kernel config somewhere?
Thanks for the help anyway. Learnt alot.

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