Skip to content

bleuchtang/sunxi-debian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Debian-Sunxi

Bootstrap a minimal debian rootfs with sunxi kernel and boot files. For now only 4 olinuxino boards are available. All scripts in this repository are generic so it's easy to add a new boad. Please make a pull request if you create and test a new board. I need reviewers for olinuxino lime2 and micro olinuxino boards.

Thanks to lukas2511 for quick bootstrap, and igorpecovnik for some useful scripts.

Build docker image

git clone https://github.com/bleuchtang/sunxi-debian
cd sunxi-debian && sudo docker build -t debian:olinux .

Build sunxi kernel and boot files

To build sunxi kernel and boot files run:

sudo docker run --privileged -i -t -v $(pwd)/olinux/:/olinux/ debian:olinux bash /olinux/create_sunxi_boot_files.sh -c -s

Optional arguments:

  • -o off-line mode; doesn't pull repositories so you should have run the script once without this option
  • -b board type (a10lime, a20lime, a20lime2, a20micro) default is A20 lime
  • -t target directory for compilation (default /olinux/sunxi)
  • -j number of thread for compilation (default 2)
  • -l change linux logo on u-boot and kernel
  • -c use cross-compilation settings
  • -s use stable tarball (for linux kernel and u-boot) instead of GIT tree

Build minimal arm debootstrap

We cannot perform a debootstrap in dockerfile because dockerfile doesn't accept privileged mode. For more details see docker issue

To build the minimal debian rootfs with the kernel previously build:

sudo docker run --privileged -i -t -v $(pwd)/olinux/:/olinux/ debian:olinux bash /olinux/create_arm_debootstrap.sh -i olinux/sunxi -c

Optional arguments:

  • -d debian release (wheezy, jessie) (default: jessie)
  • -b olinux board (see config_board.sh) (default: a20lime)
  • -a add packages to deboostrap
  • -n hostname (default: olinux)
  • -t target directory for debootstrap (default: /olinux/debootstrap)
  • -y install yunohost (doesn't work with cross debootstrap)
  • -c cross debootstrap
  • -p use aptcacher proxy
  • -i set path for kernel package or install from testing (set '-i testing' to install from debian testing)
  • -e configure for encrypted partition (default: false)

Install on a SD card

Setup SD card device

Find your device card (with dmesg for instance). Call create_device script with this device in parameter. This script install debootstrap previously build.

sudo bash olinux/create_device.sh -d /dev/sdc

You can directly create a image file that you can copy after on your sd card or share with others.

sudo bash olinux/create_device.sh -d img -s 500

/!\ If you install some additional packages you should increase the size of the image (change the -s 500 parameter).

Login to your Olimex

Find IP and ssh on it! (password: olinux)

hint: The IP address is displayed on the login screen, but you must plug a screen.

ssh root@mybox

Build SD with encrypted root

Build debootsrap with additionnal packages and initramfs script:

sudo docker run --privileged -i -t -v $(pwd)/olinux/:/olinux/ debian:olinux bash /olinux/create_arm_debootstrap.sh -i olinux/sunxi -c -i testing -e

Prepare your SD card with root encrypted:

sudo bash olinux/create_device.sh -d /dev/sdc -b olinux/debootstrap/ -u olinux/debootstrap/usr/lib/u-boot/A20-OLinuXino-Lime/u-boot-sunxi-with-spl.bin -e

Now, when the olimex boot, you can connect over https on the ip of the board and unlock the disk.

Some links/tips:

Convert bmp logo to ppm

bmptoppm Labriqueinter.net.bmp > Labriqueinter.net.ppm
ppmquant 224 Labriqueinter.net.ppm > Labriqueinter.net224.ppm
nmnoraw Labriqueinter.net224.ppm > Labriqueinter.net.ppm

You probably want to Build your own docker image

  • Because it's quick and easy; tutorial here
  • Because you shouldn't trust registry images; demonstration here

External links

About

Bootstrap a minimal debian rootfs for sunxi boards

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published