Skip to content

Instantly share code, notes, and snippets.

@happylynx
Last active January 26, 2017 00:37
Show Gist options
  • Save happylynx/d414a7cc7f78353f8d30 to your computer and use it in GitHub Desktop.
Save happylynx/d414a7cc7f78353f8d30 to your computer and use it in GitHub Desktop.

Rikomagic v5

chipset rk3288

Booting linux

Linux can be either stored in internal memory or on sd card

Flash bootloader

Custom bootloader is required to try to load system from microSD before loading internal system.

  1. Download 'create-sdcard' tooling and extract
  2. Download rkflashkit from https://github.com/linuxerwang/rkflashkit
    1. build ./waf configure
    2. run:
      • GUI sudo ./run.py
      • cli sudo ./run.py --help
  3. Backup partition layout an partitions using rkflashkit
  4. Flash 'uboot' partition using rkflashkit with RK3288Loader_uboot_V2.17.02.bin loader distributed with 'create-sdcard'

Create Linuxium sdcard

  1. Download and extract 'create-sdcard'
  2. Download and extract Linuxium
  3. Replace linux-rfs.img in create-sdcard directory by simlink to linuxium-ubuntu1410-rfs.img
  4. If your sdcard is reporting in system as /dev/mmcblk0
    • Then you might need to create simlink ln -s /dev/mmcblk0p1 /dev/mmcblk01 because of bug in sgdisk/create-scdard
  5. Run sudo create-linux-sdcard

Notes on SD card layout

  • based on observations of create-linux-sdcard from create-sdcard

  • it uses GPT

  • the is only one ext4 partition, other sections are located before that partition and not presented as actual GPT partitions

  • parameters partitions start at address 0x2000, it contains addressed of other partitions:

    • boot
    • kernel
    • resources
  • content of 'parameters' partition can be checked out by (first 100 bytes)

      sudo cat /dev/mmcblk0 | dd skip=$((0x2000)) | head -c 100 | hexdump -C
    
  • content of other partitions can be viewed by

      sudo cat /dev/mmcblk0 | dd skip=$((0x2000+<partition_start>)) | head -c 100 | hexdump -C
    

    where is address of beginning of the partition as stated in parameters partitions

  • partitions in parameters format:

    • written in line beginning wiht CMDLINE:
    • format:<partition_length>@<partition_start>(<partition_name>)
    • to get real partition start address 0x2000 has to be added

Tools

Default memory layour as reported by rkflashkit

Reading flash information
Loading partition information
MACHINE_MODEL:rk30sdk
MACHINE_ID:007
MANUFACTURER:RK30SDK
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 3066
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
#KERNEL_IMG: 0x62008000
#FDT_NAME: rk-kernel.dtb
#RECOVER_KEY: 1,1,0,20,0
CMDLINE:console=ttyFIQ0 androidboot.hardware=rk30board androidboot.console=ttyFIQ0 board.ap_has_alsa=0 init=/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00002000@0x00004000(misc),0x00008000@0x00006000(resource),0x00008000@0x0000e000(kernel),0x00010000@0x00016000(boot),0x00010000@0x00026000(recovery),0x0001a000@0x00036000(backup),0x00040000@0x00050000(cache),0x00002000@0x00090000(kpanic),0x00180000@0x00092000(system),0x00002000@0x00212000(metadata),0x00400000@0x00214000(userdata),0x00020000@0x00614000(radical_update),-@0x00634000(user)

Partitions:
uboot        (0x00002000 @ 0x00002000)    4 MiB
misc         (0x00002000 @ 0x00004000)    4 MiB
resource     (0x00008000 @ 0x00006000)   16 MiB
kernel       (0x00008000 @ 0x0000E000)   16 MiB
boot         (0x00010000 @ 0x00016000)   32 MiB
recovery     (0x00010000 @ 0x00026000)   32 MiB
backup       (0x0001A000 @ 0x00036000)   52 MiB
cache        (0x00040000 @ 0x00050000)  128 MiB
kpanic       (0x00002000 @ 0x00090000)    4 MiB
system       (0x00180000 @ 0x00092000)  768 MiB
metadata     (0x00002000 @ 0x00212000)    4 MiB
userdata     (0x00400000 @ 0x00214000) 2048 MiB
radical_update (0x00020000 @ 0x00614000)   64 MiB
user         (0x016EB000 @ 0x00634000) 11734 MiB
Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment