|
@@ -2,141 +2,85 @@ Debian-Sunxi
|
|
|
==========
|
|
|
|
|
|
Bootstrap a minimal debian rootfs with sunxi kernel and boot files. For now
|
|
|
-only 3 olinuxino boards are available. All scripts in this repository are
|
|
|
+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 reviewer for olinuxino lime2 and micro
|
|
|
+create and test a new board. I need reviewers for olinuxino lime2 and micro
|
|
|
olinuxino boards.
|
|
|
|
|
|
Thanks to [lukas2511](https://github.com/lukas2511/olinuxino-a20-micro) for
|
|
|
-quick bootstrap.
|
|
|
+quick bootstrap, and [igorpecovnik](https://github.com/igorpecovnik/lib) for
|
|
|
+some useful scripts.
|
|
|
|
|
|
# Build docker image
|
|
|
|
|
|
```shell
|
|
|
-sudo docker pull debian:stable
|
|
|
git clone https://github.com/bleuchtang/sunxi-debian
|
|
|
cd sunxi-debian && sudo docker build -t debian:olinux .
|
|
|
```
|
|
|
|
|
|
-# Build minimal arm debootstrap
|
|
|
-
|
|
|
-We cannot perform a debootstrap in dockerfile because dockerfile doesn't accept
|
|
|
-privileged mode. For more details see [docker
|
|
|
-issue](https://github.com/docker/docker/issues/1916)
|
|
|
-
|
|
|
-To build the minimal debian rootfs run:
|
|
|
-
|
|
|
-```shell
|
|
|
-sudo docker run --privileged -i -t -v $(pwd)/olinux/:/olinux/ debian:olinux sh ./olinux/create_arm_debootstrap.sh
|
|
|
-```
|
|
|
-
|
|
|
-Optional arguments:
|
|
|
-+ -n <name> hostnane
|
|
|
-+ -a <packages> add additional packages
|
|
|
-+ -d <release> debian release (wheezy, jessie...)
|
|
|
-
|
|
|
# Build sunxi kernel and boot files
|
|
|
|
|
|
To build sunxi kernel and boot files run:
|
|
|
|
|
|
```shell
|
|
|
-sudo docker run --privileged -i -t -v $(pwd)/olinux/:/olinux/ debian:olinux sh ./olinux/create_sunxi_boot_files.sh
|
|
|
+sudo docker run --privileged -i -t -v $(pwd)/olinux/:/olinux/ debian:olinux bash ./olinux/create_sunxi_boot_files.sh
|
|
|
```
|
|
|
|
|
|
Optional arguments:
|
|
|
+ -o offline mode; doesn't pull repositories so you should have run the script once without this option
|
|
|
-+ -t <type> board type (lime,lime2,micro) default is A20 lime
|
|
|
++ -b <type> board type (lime,lime2,micro) default is A20 lime
|
|
|
++ -t <number> number of thread for compilation
|
|
|
++ -l change linux logo on u-boot and kernel
|
|
|
|
|
|
-# Install on a SD card
|
|
|
-
|
|
|
-## Setup SD card device
|
|
|
+# Build minimal arm debootstrap
|
|
|
|
|
|
-Find your device card (with dmesg for instance) and put it in a variable.
|
|
|
+We cannot perform a debootstrap in dockerfile because dockerfile doesn't accept
|
|
|
+privileged mode. For more details see [docker issue](https://github.com/docker/docker/issues/1916)
|
|
|
|
|
|
+To build the minimal debian rootfs with the kernel previously build:
|
|
|
|
|
|
```shell
|
|
|
-mmc=/dev/sdc
|
|
|
+sudo docker run --privileged -i -t -v $(pwd)/olinux/:/olinux/ debian:olinux bash ./olinux/create_arm_debootstrap.sh -i
|
|
|
```
|
|
|
|
|
|
-## Partitioning
|
|
|
-
|
|
|
-Make 2 partitions; one for boot files (kernel, file with custom boot args...),
|
|
|
-and another for root fs.
|
|
|
-
|
|
|
-```shell
|
|
|
-parted -s ${mmc} mklabel msdos
|
|
|
-parted -a optimal ${mmc} mkpart primary fat32 1 16MiB
|
|
|
-parted -a optimal ${mmc} mkpart primary fat32 16MiB 100%
|
|
|
-mkfs.fat -F 32 ${mmc}1
|
|
|
-mkfs.ext4 ${mmc}2
|
|
|
-```
|
|
|
+Optional arguments:
|
|
|
++ -n <name> hostnane
|
|
|
++ -a <packages> add additional packages
|
|
|
++ -d <release> debian release (wheezy, jessie...)
|
|
|
++ -i install kernel previously build
|
|
|
++ -y install yunohost with chroot (testing)
|
|
|
|
|
|
-## Installation
|
|
|
+# Install on a SD card
|
|
|
|
|
|
-### Boot partition
|
|
|
+## Setup SD card device
|
|
|
|
|
|
-Make SD card bootable, add kernel your previously builded and file with
|
|
|
-motherboard paramaters.
|
|
|
+Find your device card (with dmesg for instance). Call create_device script with
|
|
|
+this device in parameter. This script install debootstrap previously build.
|
|
|
|
|
|
```shell
|
|
|
-mkdir -p /media/usb
|
|
|
-dd if=olinux/sunxi/u-boot-sunxi/u-boot-sunxi-with-spl.bin of=${mmc} bs=1024 seek=8
|
|
|
-mount ${mmc}1 /media/usb/
|
|
|
-cp olinux/sunxi/linux-sunxi/arch/arm/boot/uImage /media/usb/
|
|
|
-cp olinux/sunxi/script.bin /media/usb/
|
|
|
+sudo bash olinux/create_device.sh -d /dev/sdc
|
|
|
```
|
|
|
|
|
|
-If you want to do a server without graphical session, you can disable allocated
|
|
|
-ram for the graphical card. To do that copy uEnv.txt file; This file add custom
|
|
|
-kernel parameters to save 32MB of ram. If you want to use the graphical card;
|
|
|
-don't copy uEnv.txt file.
|
|
|
+You can directly create a image file that you can copy after on your sd card or share with others.
|
|
|
|
|
|
```shell
|
|
|
-cp olinux/uEnv.txt /media/usb/
|
|
|
-umount /media/usb
|
|
|
+sudo bash olinux/create_device.sh -d img -s 500
|
|
|
```
|
|
|
|
|
|
-### Root partition
|
|
|
-
|
|
|
-Copy the rootfs you previously builded with debootstrap, and add firmware and
|
|
|
-modules build with sunxi kernel.
|
|
|
-
|
|
|
-```shell
|
|
|
-mount ${mmc}2 /media/usb/
|
|
|
-cp -r olinux/debootstrap/* /media/usb/
|
|
|
-sync
|
|
|
-chmod 1777 /media/usb/tmp/
|
|
|
-rm -rf /media/usb/lib/firmware/
|
|
|
-cp -rf olinux/sunxi/linux-sunxi/out/lib/firmware/ /media/usb/lib/
|
|
|
-sync
|
|
|
-rm -rf /media/usb/lib/modules/
|
|
|
-cp -rf olinux/sunxi/linux-sunxi/out/lib/modules/ /media/usb/lib/
|
|
|
-sync
|
|
|
-umount /media/usb
|
|
|
-```
|
|
|
+# Login to your Olimex
|
|
|
|
|
|
-You can now connect to your box via ssh. Default root password is _olinux_.
|
|
|
-After your first connection on your box you should run depmod to build moddep
|
|
|
-file.
|
|
|
+Find IP and ssh on it! (password: olinux)
|
|
|
|
|
|
```shell
|
|
|
ssh root@mybox
|
|
|
-depmod -a
|
|
|
```
|
|
|
|
|
|
-That's it ! Now you probably doesn't want do more system administration for
|
|
|
-your home server so get an eye on [yunohost](https://yunohost.org/#/) ;)
|
|
|
-
|
|
|
-# TODO
|
|
|
-
|
|
|
-- change _Install on a SD card_ to a script ?
|
|
|
-
|
|
|
# Some links:
|
|
|
|
|
|
## You probably want to Build your own docker image
|
|
|
|
|
|
- Because it's quick and easy; tutorial [here](http://www.aossama.com/build-debian-docker-image-from-scratch/)
|
|
|
-- Because you shoudn't trust regitry images; demonstration [here](https://joeyh.name/blog/entry/docker_run_debian/)
|
|
|
+- Because you shouldn't trust registry images; demonstration [here](https://joeyh.name/blog/entry/docker_run_debian/)
|
|
|
|
|
|
## External links
|
|
|
|