Jump to content


Photo

Pre-Alpha 0.3 Ubuntu Linux for MK802 III / UG802 / MK808 / UG007 / iMito MX1


  • Please log in to reply
505 replies to this topic

#1 AndrewDB

AndrewDB

    Developer

  • FW Developer
  • PipPipPip
  • 427 posts
  • LocationThe Hague, Netherlands

Posted 04 December 2012 - 11:07 AM

Title says it all. No hand holding at this stage as this is really for people who know what they are doing.
Note that this is the last of the pre-Alpha releases, intended for developers only. In around ten days I'll post an Alpha 0.4 release with more/some support and simplified installation steps!
Folks, I can't stress this enough: these pre-Alpha releases are only for people who have already cross-compiled the Linux kernel for an ARM device and are used to having things not working out-of-the-box.
And no, it won't play movies nor will it run XBMC at this stage, and you can't play any games with it yet (no OpenGL support).
Also, please at least read this first post COMPLETELY before asking any questions in this thread!

Present version is pre-Alpha 0.3
It has been tested on the UG802, Rikomagic MK802 III, MK808, UG007 and iMito MX1.

These are the features for the pre-Alpha 0.3 release:
  • Ubuntu 12.10 Quantal armhf based.
  • Easy to install and dual-boot (does not erase your Android installation).
  • HDMI 1920x1080 60Hz aka 1080p.
  • XFCE desktop.
  • Linux framebuffer consoles.
  • HDMI sound support. USB sound support.
  • Full array of cpufreq governors (I suggest the interactive governor).
  • USB mouse, keyboard and USB storage tested. Webcam tested by Alok.
  • nbench benchmark included (source code and binary) so you can check the real clock speed / performance of your Android stick.
  • OpenSSH server included and installed so you can use the Android stick headless.
  • Internal WiFi is not functional yet. You'll need a $4 Realtek or Ralink USB Wifi dongle or a $5 USB 2.0 10/100 ASIX or SR9700 Ethernet dongle to connect to your network. A list of tested, known to be working adapters is available in the second post in this thread.

Download links:

The kernel kernel-0.3.img (<10MB) https://docs.google....QS1vTVgwbmNTWXc
The Ubuntu 12.10 filesystem linuxroot-0.3.tar.gz (700MB) https://docs.google....SU9hOWN4Z0JEVEE

IMPORTANT: kernel-0.3 can only be used with linuxroot-0.3, do not mix kernel and root fs versions.

Requirements:

To install:
- Rooted Android stick and SuperUser.apk installed.
- Terminal emulator in Android.
- microSD card (4GB, 8GB or 16GB) or USB key (4GB, 8GB, 16GB, 32GB).
- A Windows/Linux PC.
- RKAndroidTool v1.35 (Windows program to flash RK3066 devices). This is the program you need to flash the kernel!

If you have installed a Finless Android ROM on your Android stick using the Flash method then you already have everything you need to proceed with the installation.
The zip file that includes Bob's ROM also has the RKAndroidTools v1.35 and full, detailed installation instructions, so please get it!

To use Linux you'll probably need:
- USB 2.0 hub
- USB keyboard and mouse.
- HDMI monitor (Full HD capable i.e. 1920x1080@60Hz - 1080p).
- An inexpensive USB WiFi b/g/n or Ethernet 10/100 adapter dongle.

Changelog

- pre-Alpha 0.1: Initial release, requires microSD card.
- pre-Alpha 0.2: Simplified boot requirements. Can now boot from a root partition labeled linuxroot on any mass storage device accessible at boot time e.g. a 4GB USB key, a 8GB SD card in USB card reader plugged into the USB hub, or a microSD card in the microSD card slot of your Android stick. Also can boot from a USB hard disk (tested by Alok).
- pre-Alpha 0.3: Tested on a wider range of RK3066 devices, kernel source removed to save space (if you need the kernel source you can still copy it over from the pre-Alpha 0.2 rootfs file). Added cifs-utils package (SMB). Recompiled kernel with different settings, supports NFS V3 and V4 client, NTFS read/write. Cleaned apt archive cache. Some extra artwork (wallpapers, icon themes) and various chess engines.

Sponsors

- Thank you Slatedroid user gsandiego for sponsoring a nifty Infrared Digital Thermometer that will allow me to take precise temperature measurements on the RK3066 running different loads at different clock frequencies!

Edited by AndrewDB, 04 December 2012 - 05:00 PM.

  • kozmo2k4 and saahilj like this

#2 AndrewDB

AndrewDB

    Developer

  • FW Developer
  • PipPipPip
  • 427 posts
  • LocationThe Hague, Netherlands

Posted 04 December 2012 - 11:08 AM

Installation and troubleshooting

There are two separate steps to install Ubuntu Linux on an RK3066 Android stick:

  • Flash the kernel in the recovery NAND partition.
  • Extract the Ubuntu root filesystem with the proper permissions on to a partition on some kind of USB mass storage.

1. Flashing the kernel
(there are many ways to do this, here is a simple one that should take less than a minute)
- Install RKAndroidTools v1.35 on your Windows PC following exactly the instructions provided by Bob Finless.
- Download the kernel-0.3.img file to your Windows PC. Rename it recovery.img (overwrite any other recovery.img file already present).
- Connect Android stick to your PC and start the RKAndroidTool v1.35 app in Windows.
- On the Android stick, open the terminal emulator and type "su", then "reboot bootloader"
- RKAndroidTool will emit a sound and should now detect the Android stick.
- Flash only the new recovery.img to the recovery partition in the NAND. This takes 5 or 6 seconds, and your Android stick will immediately reboot into Android. THIS IS NORMAL.

If you get the "dead Android bot" with red triangle when rebooting into recovery, it means the Linux kernel image was not flashed correctly to the recovery partition. :nea:
Power off, power on, and repeat the procedure above paying attention to all details, and it should work. You'll know when it works because when the Linux kernel boots correctly, you can see kernel messages scrolling on the screen.

2. Rootfs Installation
(again there are many ways to do this, here is a simple one)
Requires a Linux PC.
If you don't have a Linux PC, you can use the GParted LiveCD: http://gparted.sourc....net/livecd.php

1. Use GParted to create an ext4 partition of at least 4GB on a USB key or a microSD card. Label the partition linuxroot.

2. As root, extract the tarball, and copy (using cp -a) all the files in the extracted directory to the partition labeled linuxroot. This will create a Ubuntu root filesystem on the USB key or microSD card with all the proper permissions.

If when you boot Linux, you don't get the LightDM login screen, it means you didn't copy the rootfs files properly (probably you weren't root) and a certain number of files don't have the correct permissions. :nea: Repeat the two steps above paying attention to the instructions!

Booting Linux

Now that you have installed the Linux kernel in the recovery partition of your Android stick, and extracted the Ubuntu filesystem to a partition on USB storage, you can dual boot, choosing between Android or Linux.

To boot Android, power up your Android TV stick as usual.

To boot Linux: first boot into Android, open the terminal emulator and type "su", then "reboot recovery". Your Android TV stick will reboot into Linux and after a couple of seconds, you should see some kernel messages scrolling on your TV display or monitor, then a few seconds later the LightDM graphical login screen.

After using Linux, shutdown and power off the RK3066 TV stick. When powered on again it will reboot into Android as usual.

Notes:
* There is only one user defined: user ubuntu password ubuntu. Needless to say, change the password ASAP! To become root: type "sudo su".
* The kernel config is available in /proc/config.gz.
* The nbench benchmark is in /root.

Edited by AndrewDB, 04 December 2012 - 01:27 PM.


#3 AndrewDB

AndrewDB

    Developer

  • FW Developer
  • PipPipPip
  • 427 posts
  • LocationThe Hague, Netherlands

Posted 04 December 2012 - 11:08 AM

Recommended USB network adapters, FAQ and Tips


Recommended USB Ethernet adapters
The preliminary information I have is that people who have bought inexpensive adapters based on the ASIX chipset have not had any problems with them.

Recommended USB WiFi adapters
Again here there are preliminary reports that indicate that the various Ralink based adapters work fine. I myself am using a $7 Ralink 5370 noname adapter and it has an external antenna, works flawlessly as far as I can tell.


FAQ

Q1. I want to boot into Linux directly without going through Android. Is it possible?
A1. Yes, it is possible. You can simply flash the Linux kernel on the "kernel" partition in NAND, instead of the "recovery" partition. However, since we are still in the Alpha or pre-Alpha development stage, this is not recommended.

Q2. I accidentally / voluntarily installed the Linux kernel on the kernel partition, and now my Android TV stick boots into Linux directly; I can't boot into Android anymore. How do I revert to the previous state?
A2. The simplest way is to follow the "unbricking" procedure, which varies slightly depending on which Android TV stick you have. On the UG802, it means you have to open the case and short two pads (with e.g. a screwdriver) on the printed circuit board while powering on the UG802, and then flash the original firmware of your device.

Q2a. I accidentally / voluntarily configured the misc partition to boot into recovery, and now my Android TV stick boots into Linux directly; I can't boot into Android anymore. How do I revert to the previous state?
A2a. The simplest way is to follow the "unbricking" procedure, which varies slightly depending on which Android TV stick you have. On the UG802, it means you have to open the case and short two pads (with e.g. a screwdriver) on the printed circuit board while powering on the UG802, and then flash the original firmware of your device.

Q3. I can't find RKAndroidTools v1.35 anywhere! Please help!
A3. Two words: Bob. Finless.

Q4. I keep asking questions and not getting answers. Why is that?
A4. First check that your question has not already been asked here on SlateDroid: the Search tool is there in the upper right corner of every page, for exactly that purpose. Also note that this project is still in the Pre-Alpha or Alpha stage, and as such developers have little time to deal with generic issues that may prove difficult to overcome by less experienced users, they have to spend what precious time they have on - guess what? - developing! User support will improve as we move on to the Beta stage.

Q5. Can I use my RK3066 Android TV stick as a headless Linux server if I install Ubuntu Linux on it?
A5. Indeed you can. Check out this awesome website setup by Alok that runs entirely on a UG802: http://ubuntu.g8.net

Q6. Will you develop a version of Ubuntu Linux for RK3066 tablets?
A6. Yes, it's in the roadmap. Alpha 0.4 will support the Pipo S1, more RK3066 tablets will be supported in subsequent releases.

Q7. Is there a way to flash the NAND from Linux?
A7. There is still work to be done on the NAND Linux kernel driver, but eventually yes, it will be possible to flash the NAND from Linux. At that point one should be able to install UBIFS on the NAND and use it as a reliable, fast storage device.


Tips

Edited by AndrewDB, 08 December 2012 - 04:24 AM.


#4 tengbretson

tengbretson

    Newbie

  • Jr. Member
  • Pip
  • 1 posts

Posted 04 December 2012 - 11:41 AM

AndrewDB, your work on this project is really impressive and I cannot thank you enough for all your work.
I will be receiving my own UG007 in the mail soon and would like to test Ubuntu on it if I can. Unfortunately, right now my only option for a display is a 800x600 projector. Is it possible to adjust the hdmi output resolution to 800x600?

#5 Asure

Asure

    Advanced Member

  • Hero Member
  • PipPipPip
  • 784 posts

Posted 04 December 2012 - 12:50 PM

Flashing to the kernel partition will boot straight to Linux, right?
(I've a wierd device that i don't have the original flash for, and it's in a non-booting state right now.)

#6 linuxerwang

linuxerwang

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 44 posts

Posted 04 December 2012 - 01:09 PM

Flashing to the kernel partition will boot straight to Linux, right?
(I've a wierd device that i don't have the original flash for, and it's in a non-booting state right now.)



No, this pre-alpha version has dual boot: to boot into ubuntu you have to boot into android first, in terminal emulator you need to type "su; boot recovery". You can also set a startup script in android so it does this automatically. You can find the details in previous post threads.

According to the roadmap Adrew will release a real boot directly to ubuntu in future releases.

#7 AndrewDB

AndrewDB

    Developer

  • FW Developer
  • PipPipPip
  • 427 posts
  • LocationThe Hague, Netherlands

Posted 04 December 2012 - 01:18 PM

Flashing to the kernel partition will boot straight to Linux, right?
(I've a wierd device that i don't have the original flash for, and it's in a non-booting state right now.)

Sorry but quite honestly I suggest you return your non-functional device. Trying to make it work by flashing an experimental kernel is something I just can't recommend. :nea:

Edited by AndrewDB, 04 December 2012 - 01:24 PM.


#8 aloksinha2001

aloksinha2001

    Developer

  • FW Developer
  • PipPipPip
  • 247 posts

Posted 04 December 2012 - 08:25 PM

Team,

World's first website running on Ubuntu on MKxx/UG8xx

A website for Ubuntu on UG/MK8XX devices, by Ubuntu on UG8xx/MK8xx and of Ubuntu on UG8xx/MK8xx devices

Please find link to a website -dedicated to the development of Ubuntu on UG8xx/MK8xx devices

This site is in development stage and will remain so for a long time...additionally it is running over my DSL link... so please be gentle...

What is super cool about this site is that it is running on 0.2 Pre-alpha version of Ubuntu ... on an MK808... with PHP, Mysql, Apache2, Sendmail, spamguard, bind9, Joomla,ntp, sshd, smbd and a host of other servers on the same. :yahoo:

Let me know, if you find any broken links... or have any more suggestions to add content...

http://ubuntu.g8.net

Attached Files


Edited by aloksinha2001, 05 December 2012 - 09:25 AM.

  • joetmax23 likes this

#9 aruangra

aruangra

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 73 posts

Posted 04 December 2012 - 11:09 PM

If I replace Android's kernel.img in MK808 with this kernel file using RKAndroidTool 1.35. Will I be able to boot directly to Linux in my SD card. Is it possible to flash back to Android.

#10 AndrewDB

AndrewDB

    Developer

  • FW Developer
  • PipPipPip
  • 427 posts
  • LocationThe Hague, Netherlands

Posted 04 December 2012 - 11:49 PM

If I replace Android's kernel.img in MK808 with this kernel file using RKAndroidTool 1.35. Will I be able to boot directly to Linux in my SD card. Is it possible to flash back to Android.

Yes, and yes (by following unbricking procedure that requires opening the MK808 and shorting two pins on the NAND Flash chip - do not attempt if you haven't done this before).
I really believe that at this stage it's better to follow my instructions and flash the kernel to the recovery partition. :huh:

Edited by AndrewDB, 04 December 2012 - 11:51 PM.


#11 AndrewDB

AndrewDB

    Developer

  • FW Developer
  • PipPipPip
  • 427 posts
  • LocationThe Hague, Netherlands

Posted 04 December 2012 - 11:54 PM

Team,
A website for Ubuntu on UG/MK8XX devices, by Ubuntu on UG8xx/MK8xx and of Ubuntu on UG8xx/MK8xx devices
...
http://ubuntu.g8.net


This is so cool! 8)

Awesome to see an RK3066 Android TV stick running a full-fledged website! :clapping: :clapping: :clapping:

#12 aruangra

aruangra

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 73 posts

Posted 04 December 2012 - 11:59 PM

Hi AndrewDB,

MK808 has a reset button to get into the flash mode manually. Is it the same as what you mentioned (shorting NAND flash chip) without the need to open the case?



Yes, and yes (by following unbricking procedure that requires opening the MK808 and shorting two pins on the NAND Flash chip - do not attempt if you haven't done this before).
I really believe that at this stage it's better to follow my instructions and flash the kernel to the recovery partition. :huh:


Edited by aruangra, 05 December 2012 - 12:01 AM.


#13 AndrewDB

AndrewDB

    Developer

  • FW Developer
  • PipPipPip
  • 427 posts
  • LocationThe Hague, Netherlands

Posted 05 December 2012 - 12:08 AM

AndrewDB, your work on this project is really impressive and I cannot thank you enough for all your work.
I will be receiving my own UG007 in the mail soon and would like to test Ubuntu on it if I can. Unfortunately, right now my only option for a display is a 800x600 projector. Is it possible to adjust the hdmi output resolution to 800x600?

If your 800x600 projector has an HDMI input then it can certainly rescale the output from 1920x1080 to 800x600, but things just won't look good.
:nea:

#14 aloksinha2001

aloksinha2001

    Developer

  • FW Developer
  • PipPipPip
  • 247 posts

Posted 05 December 2012 - 12:45 AM

Hi AndrewDB,

MK808 has a reset button to get into the flash mode manually. Is it the same as what you mentioned (shorting NAND flash chip) without the need to open the case?

True - go ahead and install on main kernel file.... but as Andrew said, if you break anything, you will atleast get to keep the broken pieces :)

Alok

#15 aloksinha2001

aloksinha2001

    Developer

  • FW Developer
  • PipPipPip
  • 247 posts

Posted 05 December 2012 - 12:55 AM

Andrew,

1. Is there any way in which, we can use the internal SDCard RAM as internal RAM ?

2. Or is there anyway to increase the available RAM ?

3. What storage does the /tmp/fs use ? 1GB internal ram or SD card ?

Alok

#16 AndrewDB

AndrewDB

    Developer

  • FW Developer
  • PipPipPip
  • 427 posts
  • LocationThe Hague, Netherlands

Posted 05 December 2012 - 01:24 AM

Hi AndrewDB,

MK808 has a reset button to get into the flash mode manually. Is it the same as what you mentioned (shorting NAND flash chip) without the need to open the case?


Hi,
Unfortunately the reset button has a slightly different function: it allows you to enter "bootloader mode" i.e. it is equivalent to typing the command "reboot bootloader".
That should be enough to recover the MK808 in most cases - but not all. If you really mess up the NAND you will still need to follow the unbricking procedure that requires shorting two pins on the NAND flash chip.
This is why I still recommend that most people install the Linux kernel in the recovery partition, and not on top of the Android kernel. Opening the MK808 or the UG802 is still an extra headache and we already have enough to worry about. Worrying about unbricking these devices is just a waste of time, imho.
In a later stage when we can get the NAND driver working reliably in Linux, then we can think about installing Linux on top of Android in the NAND flash chip.
That's just my $0.02 opinion, though. Obviously we are all free to do as we wish with our own hardware. 8)

#17 AndrewDB

AndrewDB

    Developer

  • FW Developer
  • PipPipPip
  • 427 posts
  • LocationThe Hague, Netherlands

Posted 05 December 2012 - 01:30 AM

Andrew,
1. Is there any way in which, we can use the internal SDCard RAM as internal RAM ?
...

PM sent! ;)

#18 Raymond Day

Raymond Day

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 185 posts

Posted 05 December 2012 - 06:24 AM

This is what I am setting mine up for. To be a web server. But though a open port on my comcast. It's neat to see this working all ready on your link.

When I 1ST went to phpsysinfo the "Processors" 0 and 1 click the + by them and they both said 2.40! When I checked again it was down to 1.63. Did you do something to over clock it?

Looks like your running it on a 32GB card with only about 12% used.

Attached File  His UG802 at 2.40 GHz.jpg   134.67KB   119 downloads

Your GHz looks like it goes up and down, and can with in a min.

You should put a robots.txt file in the web root folder so Google don't link it because your running it on your DSL.

Thank you for posting this. Mine will be running like this soon. I think it will work good.

-Raymond Day

Edited by Raymond Day, 05 December 2012 - 06:27 AM.


#19 aloksinha2001

aloksinha2001

    Developer

  • FW Developer
  • PipPipPip
  • 247 posts

Posted 05 December 2012 - 08:51 AM

This is what I am setting mine up for. To be a web server. But though a open port on my comcast. It's neat to see this working all ready on your link.

When I 1ST went to phpsysinfo the "Processors" 0 and 1 click the + by them and they both said 2.40! When I checked again it was down to 1.63. Did you do something to over clock it?

Looks like your running it on a 32GB card with only about 12% used.

Attached File  His UG802 at 2.40 GHz.jpg   134.67KB   119 downloads

Your GHz looks like it goes up and down, and can with in a min.

You should put a robots.txt file in the web root folder so Google don't link it because your running it on your DSL.

Thank you for posting this. Mine will be running like this soon. I think it will work good.

-Raymond Day


Raymond,

I have not overclocked the system... the issue seems to be in what is being reported by phpsysinfo.... am trying to figure out what is wrong with it.... Try this information link -this is more reliable in CPU speed. And yes the CPU is managed on an interactive basis by the system on its own.

Yes, the usb stick is 32GB - needed to make sure, there are no space concerns :)

robots.txt file - i thought of it and then left it out, since the objective of the website is to determine load bearing capacity as well... wanted to see if some day full fledged servers can be hosted.

Hope you get your system working -if you get stuck anywhere - do let me know.

Alok

#20 linuxium

linuxium

    Newbie

  • Jr. Member
  • Pip
  • 8 posts

Posted 05 December 2012 - 10:36 AM

True - go ahead and install on main kernel file.... but as Andrew said, if you break anything, you will atleast get to keep the broken pieces :)

Alok


I installed the recovery image as the kernel image and it works fine on a UG802. Of course you'll then need to work out your "unbricking" strategy as if you screw up your remote access or access direct as a Linux UG802 device you can't then access the device directly from another Linux or Windose :o