Giter Site home page Giter Site logo

pine64's Introduction

Usage instructions for the image files

Quick start

Extract the image and flash it onto a microSD card (replace sdx with the name of your SD card device file):

# xzcat pine64_linux-xxxxx.img.xz | dd of=/dev/sdx bs=1M
# sync

WARNING: This will overwrite the partition table and a good part of the card itself, so you will loose access to all your data that you had on the card before. WARNING

  • Connect your PC to UART0 on the Pine64 (see Pine64 linux-sunxi Wiki) and connect a terminal program with a 115200n8 setting on your PC to it.
  • Put the microSD card into your Pine64+ and give it some power.
  • If you let the U-Boot prompt time out, it will load a 4.4-rc8+ kernel and will drop you on a shell prompt in a Debian installer based initrd.

Using your own root file system

By default the image will load a kernel and an initrd, but there is also a plain kernel which will try to root mount /dev/mmcblk0p10.

To use that, put your root file system onto /dev/sdx10. This partition is about 1GB in size, feel free to adjust this with a partition editor, but leave the other partitions (in particular the unpartitioned region before 36MB) in place.

Then tell U-Boot to load the other kernel:

sunxi# run load_env
sunxi# run load_dtb
sunxi# run set_cmdline
sunxi# setenv kernel_part mainline
sunxi# run load_kernel
sunxi# run boot_kernel

This is basically the same sequence as the automatic boot, but it selects a different kernel partition to load the kernel image from.

Example: Ubuntu Core 14.04

follows

Booting your own kernel

The default boot sequence will load a kernel and an initrd from the "shell" partition (which is /dev/sdx7 on the SD card). You can put your own kernel into any of the other partitions and load it from there.

The crippled U-Boot can only load kernels which are wrapped as an "Android boot image". So to make your kernel usable, use the mkbootimg tool:

linux# ./mkbootimg --kernel yourkernel --base 0x40000000 --kernel_offset 0x01080000 --board Pine64 --pagesize 2048 -o output.img
linux# dd if=output.img bs=1M of=/dev/sdx9

Then tell U-Boot to use a different kernel partition:

sunxi# run load_env
sunxi# run load_dtb
sunxi# run set_cmdline
sunxi# setenv kernel_part mainline
sunxi# run load_kernel
sunxi# run boot_kernel

U-Boot lists the known partition names when it starts. Starting with the "env" partition they map to the "DOS" partitions starting with /dev/sdx5.

Feel free to adjust the command line with:

sunxi# setenv bootargs "console=ttyS0,115200n8 ...."

Device tree

The installed U-Boot is crippled in a way that it will always pass its own .dtb to the kernel. Replacing that will most likely prevent U-Boot from starting, as it uses the DT for itself and relies on proprietary node and properties.

To fix this you can either use the U-Boot built-in "fdt" commands to change the existing DT in place (possibly tearing down the whole thing and rebuilding it from scratch). While this is nice for hacking, this is as tedious as it is error prone.

As mentioned loading a .dtb from the SD card somewhere into memory and pointing U-Boot to it will not work, but you can clobber U-Boot's in-memory copy with a pristine .dtb. Since the crippled U-Boot can only load whole "partitions", loading 1MB or more somewhere into U-Boot's data segment is obviously a bad idea.

Fortunately the provided DT is rather big (68KB), so there are two 64KB partitions (dtb and altdb), which are meant to hold .dtb files to overwrite U-Boot's copy. To use them, dd your .dtb directly to the microSD card:

$ dd if=your.dtb bs=1M of=/dev/sdx seek=21

"dtb" is at 21 MB, "altdb" at 22 MB.

"dtb" is loaded by default, but setting the U-Boot environment variable "dtb_part" to "altdb" before loading the DT will use the alternative partition.

pine64's People

Contributors

apritzel avatar andre-arm avatar n1tehawk avatar

Watchers

Gregory Briddick avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.