FORUMS

Running Android or Linux from an SD card on a RK3288 device - An easy way to dual boo

17 posts
Thanks Meter: 7
 
Post Reply Email Thread
If you are interested in dual booting Android and Linux on your RK3288 device or you simply want to try a different Android ROM or Linux distro without flashing the device, then use this method of booting from an SD card.

You will need a PC running Linux and an SD card of 8 GB or more, at least class 10 speed.

Download the tools from 'https://drive.google.com/file/d/0B99...GVqWkZMRGFCSjg'. After unzipping you will see two shell scripts called 'create-android-sdcard' and 'create-linux-sdcard', a directory called 'Tools', a file called 'RK3288Loader_uboot_V2.17.02.bin' and some '.img' files together with a 'parameter' file.

To be able to dual boot (i.e. boot directly from the device or from an SD card), you will first need to update the bootloader on your device. Either use 'AndroidTool v2.3' on Windows or 'upgrade_tool' on Linux to flash just the 'Loader' with the 'RK3288Loader_uboot_V2.17.02.bin' file.

To create a bootable SD card first put it into your PC and use a command like 'blkid' or 'lsblk' to identify its device name (e.g. /dev/sdc).

For Android, run the script 'create-android-sdcard' and pass the name and location of the Android ROM you want to install onto the SD card, e.g.:

./create-android-sdcard radxa_rock_android_kitkat_140909_update.img

The program will prompt you to confirm the name of the device for the SD card. Once confirmed it will then unpack the Android ROM, create partitions on the SD card that mimic the ROM including a 'user' partition that will use the remaining space of the SD card. It will then install the Android ROM to the SD card and notify you when complete.

For Linux, as currently no standard approach to creating a Linux distro exists, to allow flexibility you will have to perform some initial set up steps. I've included example kernel and resource images which work fine on the Firefly, MK802V (et al) and Orion R28 (et al). I've also included download links for example root file systems (RFSs). Download either the Ubuntu 12.04 or Xubuntu/Lubuntu 14.10 RFS and unzip and rename as 'linux-rfs.img'. If you want to try a different kernel/resource combo simply rename them as 'kernel-linux.img' and 'resource-linux.img'. You can also use the tools in the 'Tools' directory to unpack Linux distros for those who want to experiment. Just don't modify the 'boot-linux.img' or 'parameter-linux' files as these must be used rather than any supplied as part of a Linux distro for Linux to boot from SD card.

Once set up, simply run:

./create-linux-sdcard

The program will initially prompt you to confirm the name the device for the SD card and then it will create a bootable Linux SD card from the images defined in the'*.img' files.

Now just take the SD card and insert into your RK3288 device and power on to enjoy booting either Android or Linux.

The Android script will work with any Android ROM packed as an image with a separate 'data' and 'user' partition. I recently saw a ROM with the 'user' partition effectively combined with the 'data' partition. My sketchy knowledge of Android includes the memory of some requirement to have the 'user' partition as type 'vfat' as some programs expected or required that format. So until I can confirm this, or identify which Android version release it pertains to, I've not included it yet within the script.

Both scripts work for RK3288 and RK3188 devices. They utilize the excellent work from Fukaumi-san (naobsd) who provided the binary headers required to boot from SD card (see the 'README.txt' in the 'Tools' directory for further details and the required copyright notice, conditions and disclaimer).

The other key advantage of these scripts is that they allow you to boot a 'bricked' device. Some time ago I managed to break my Orion R28 Meta such that it would not boot and could not be flashed. I've included the required functionality in the scripts to boot even if no memory can be found on the device. So now I have a working Orion R28 again, albeit just from SD card.

Enjoy!
The Following 3 Users Say Thank You to Linuxium For This Useful Post: [ View ] Gift Linuxium Ad-Free
6th December 2014, 03:40 PM |#2  
Linuxium's Avatar
OP Junior Member
Thanks Meter: 7
 
Donate to Me
More
Alternatively use https://drive.google.com/file/d/0B99...FRucUM0bS1CWUE for undefined 'user' partition Android ROMs.
13th January 2015, 03:17 PM |#3  
Junior Member
Thanks Meter: 0
 
More
can´t creat sd card ubuntu image
first of all let me give congratulations for the excelent work for the community including the creation of tuturiais.
I have a firefly rk3288 and tried to install ubuntu 14.04 through this method in sd card. But doesn´t work for me. it gives an error at line 116 of rkcrc file and does not create the desired image.
the steps I took were these:
[email protected]:/media/sda2/xxx$ ls
boot-linux.img linux-rfs.img rkcrc
create-android-sdcard mkkrnlimg rkunpack
create-linux-sdcard parameter-linux sdboot_rk3188.img
create-sdcard.7z README.txt sdboot_rk3288.img
downloadable-rfs-examples resource-linux.img split_bootimg_pl
kernel-linux.img RK3288Loader_uboot_V2.17.02.bin Tools
[email protected]:/media/sda2/xxx$./create-linux-sdcard
./create-linux-sdcard: Is your SD card loaded as '/dev/sdc' (y/n)? n
./create-linux-sdcard: Do you want to use a different device? y
./create-linux-sdcard: Enter new device name? /dev/sdb
./create-linux-sdcard: Is your SD card loaded as '/dev/sdb' (y/n)? y
./create-linux-sdcard: Unmounting partitions on '/dev/sdb' ... done.
./create-linux-sdcard: Formatting SD card '/dev/sdb' ... done.
./create-linux-sdcard: Flashing bootloader 'sdboot_rk3288.img' to '/dev/sdb' ... done.
./create-linux-sdcard: Updating partition table on '/dev/sdb' ... done.
./create-linux-sdcard: Calculating partition size for '/dev/sdb' ... done.
./create-linux-sdcard: Creating 'linux' partition as '/dev/sdb1' on /dev/sdb ...done.
./create-linux-sdcard: Making 'ext4' file system for 'linux' partition on '/dev/sdb1' ... done.
./create-linux-sdcard: Creating 'parameter-linux.img' from 'parameter-linux' ... ./create-linux-sdcard: line 116: /media/sda2/xxx/Tools/rkcrc: cannot execute binary file
done.

./create-linux-sdcard: Cannot create 'parameter-linux.img' ... exiting.


Can you help me? Is there any thing wrong in my steps?
Thanks
João Xavier
21st March 2015, 07:55 PM |#4  
Junior Member
Thanks Meter: 2
 
More
Building a kernel to work with this...
Hi Ian,
Thanks for your work on this. I've managed to get my Q8 RK3288(Board xt-q8l-v10) box booting into Linux from the SD card using your installation scripts.

However what I would really like to do is experiment with OpenCL on the GPU. Do do this I need compile a new kernel with the kernel source from ARM that matches the user space binary ARM posted.

The problem is that I can't get any of the kernels I compile to boot. Like the HDMI doesn't even initialise, so no logging. I've included my .config file that I'm using with the code from here:
https://github.com/linux-rockchip/li...rk3288-rbox-kk

It's the 3.10.37 kernel.

Is there some unusual config to get the kernel to boot with the RK bootloader? I assume I can replace the kernel-linux.img without replacing the resource-linux.img given that the kernels are both 3.10.*

To flash the zImage I use the provided mkkrnlimg to create kernel-linux.img, and then do:

dd if=kernel-linux.img of=/dev/sdb conv=sync,fsync seek=$((0xC000))

replacing the kernel-linux.img with the one you provide makes the sdcard boot successfully again.

Any help would be great!
Tim.

UPDATE 22nd March

I managed to get access to the serial console. See here http://www.freaktab.com/showthread.p...-on-XT-Q8L-V10

The kernel I compiled reboots before flushing all data to the port. It's in a boot-loop logging
Code:
U-Boot 2014.10-RK3288-02 (Nov 10 2014 - 03:41:49)

CPU: rk3288
CPU's clock information:
    arm pll = 600000000HZ
    periph pll = 300000000HZ
    ddr pll = 200000000HZ
    codec pll = 594000000HZ
Board:	Rockchip platform Board
DRAM:  Found dram banks:1
Adding bank:0000000000000000(0000000080000000)
128 MiB
SDCard Boot.
storage init OK!
Using default environment

GetParam
check parameter success
Unknow param: MACHINE_MODEL:linuxium-sdcard-parameter!
Unknow param: MACHINE_ID:007!
Unknow param: MANUFACTURER:RK30SDK!
Unknow param: PWR_HLD: 0,0,A,0,1!
failed to prepare fdt from boot!
power key: bank-0 pin-5
Enter power_led_init
can't find dts node for ricoh619
pmic:act8846
Can't find dts node for fuel guage cw201x
SecureBootEn = 0, SecureBootLock = 0

#Boot ver: 0000-00-00#0.00
empty serial no.
no fuel gauge found
no fuel gauge found
read logo_on switch from dts [0]
checkKey
vbus = 1
no fuel gauge found
failed to find part:misc
misc partition not found!
Hit any key to stop autoboot:  0 
failed to load fdt from boot!
kernel   @ 0x02000000 (0x005f4e38)
ramdisk  @ 0x059fc000 (0x0015b520)
Secure Boot state: 0
bootrk: do_bootm_linux...
   Loading Device Tree to 0561c000, end 05636f1c ... OK
Add bank:0000000000000000, 0000000080000000

Starting kernel ...

<hit enter to activate fiq debugger>
[    0.000000] Booting Linux on physical CPU 0x500
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.10.0 ([email protected]) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #8 SMP PREEMPT Sat Mar 21 18:24:56 CET 2015
[    0.000000] CPU: ARMv7 Processor [410fc0d1] revision 1 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: Rockchip RK3288 (Flattened Device Tree), model: rockchip,rk3288
[    0.000000] rockchip_ion_reserve
[    0.000000] cma: CMA: reserved 16 MiB at 2e800000
[    0.000000] Memory policy: ECC disabled, Data cache writealloc
[    0.000000] Boot mode: PANIC (7) flag: NORMAL (0xc3524200)
[    0.000000] PERCPU: Embedded 9 pages/cpu @c1ce0000 s14016 r8192 d14656 u36864
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 522768
[    0.000000] Kernel command line: console=tty0 init=/sbin/init  mtdparts=rk29xxnand:[email protected](resource),[email protected](kernel),[email protected](boot) storagemedia=sd loader.timestamp=2014-11-10_03:41:49
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 2048MB = 2048MB total
[    0.000000] Memory: 2048728k/2048728k available, 48424k reserved, 1318912K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0a95bcc   (10807 kB)
[    0.000000]       .init : 0xc0a96000 - 0xc0aeb6c0   ( 342 kB)
[    0.000000]       .data : 0xc0aec000 - 0xc0b8bb08   ( 639 kB)
[    0.000000]        .bss : 0xc0b8bb08 - 0xc0ca8a44   (1140 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] 	RCU dyntick-idle
The bits about device trees and fdt? in the boot-loader's output look suspicious... How does the kernel get the device tree in this setup? Device trees are new to me as this is my first time building ARM kernels.

UPDATE 26nd March

Turns out the hang kernel startup is due to having 'Framebuffer Console support' enabled. Compiling it as a module and loading once the systems up gives a SEGV. I've now got the Q8 booting into a basic Debian install but without Wifi or HDMI output.
UPDATE 5th April

I've got ARM's OpenCL working with the firefly kernel. I've started a project with wiki on BitBucket
https://bitbucket.org/DengueTim/q8-r...rnel/wiki/Home
Attached Files
File Type: txt dotConfigNoBoot.txt - [Click for QR Code] (95.3 KB, 110 views)
The Following User Says Thank You to Timp74 For This Useful Post: [ View ] Gift Timp74 Ad-Free
15th April 2015, 01:37 PM |#5  
Senior Member
Thanks Meter: 49
 
More
Thumbs up
Quote:
Originally Posted by Timp74

Hi Ian,
Thanks for your work on this. I've managed to get my Q8 RK3288(Board xt-q8l-v10) box booting into Linux from the SD card using your installation scripts.

.........------...........

UPDATE 5th April

I've got ARM's OpenCL working with the firefly kernel. I've started a project with wiki on BitBucket
https://bitbucket.org/DengueTim/q8-r...rnel/wiki/Home

I am damn happy to read your post and see your work on that rockchip based low-budged device.
I also own XT-Q8L-V10 pcb, another label but same board.

Sorry for my question, but when you can run ARM's OpenCL working on that device, does that mean that I can:
-Kind of unlock the bootloader to run wasser-rom or other rk-based rom's?
-Running standalone kodi (in the past openELEC or xbmc) as system?
-Get more system speed by using the a good-class external sd-card for os instead of low-budget nand (foresee) on-board?
-In anyway to run hdmi-cec?

I would be so happy to hear from you!

Greetings by I_did_it_just_tmrrow
26th October 2015, 10:56 AM |#6  
Senior Member
Thanks Meter: 25
 
More
Right now I am using UGOOS UT3S Tv box based on RK3288 chipset using dualboot. Android 4.4 and xubuntu 15.04 firmware released in july or august. As for me a rather stable decision for RK3288 devices
20th November 2018, 09:08 AM |#7  
KevMetal's Avatar
Senior Member
Thanks Meter: 488
 
More
Quote:
Originally Posted by Linuxium

Alternatively use https://drive.google.com/file/d/0B99...FRucUM0bS1CWUE for undefined 'user' partition Android ROMs.

Hi friend . I wish my box was RK3288 but I have RK3229 . I would like to use your tutorial to boot any Ubuntu distro on my MXQ mini ( fake copy) box to get chrome desktop + netflix+amazon video through browser working ...

Where could I find .bin file to modify my bootloader ....I guess that's the big question ...Any suggestions..if I have to make it _ could you send me in the right direction.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes