1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 14:23:11 +00:00

RPI building scripts

This commit is contained in:
Darren Shepherd
2016-02-18 09:58:39 -07:00
parent ba5e4471b7
commit b2db201af9
4 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1 @@
dist

View File

@@ -0,0 +1,15 @@
FROM debian:jessie
ENV DAPPER_RUN_ARGS --device /dev/kvm
ENV DAPPER_OUTPUT dist
RUN apt-get update -y
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libguestfs-tools curl zip linux-image-amd64 unzip
RUN mkdir -p /source/assets
RUN curl -fL http://downloads.hypriot.com/hypriot-rpi-20151115-132854.img.zip > /source/assets/hypriot.img.zip
RUN cd /source/assets && \
unzip hypriot.img.zip
RUN curl -fL https://releases.rancher.com/os/latest/rootfs_arm.tar.gz > /source/assets/rootfs_arm.tar.gz
WORKDIR /source
CMD ["./scripts/build.sh"]

View File

@@ -0,0 +1,9 @@
RaspberryPi 2 Image
===================
Build by running `dapper` in this folder and the build will produce `./dist/rancheros-rpi2.zip`.
KVM
===
This build requires a host capable of KVM. If you don't have KVM then remove `ENV DAPPER_RUN_ARGS --device /dev/kvm` from `Dockerfile.dapper`, but it will run very slow.

View File

@@ -0,0 +1,36 @@
#!/bin/bash
set -e -x
BOOT_DEVICE=/dev/sda1
DEVICE=/dev/sda2
cd $(dirname $0)/..
mkdir -p dist build
cp assets/hypriot*.img build/run.img
guestfish --progress-bars --verbose -a build/run.img run \
: mount $DEVICE / \
: tar-out /lib/modules modules.tar \
: tar-out /lib/firmware firmware.tar \
: umount / \
: zero-device $DEVICE \
: mkfs ext4 $DEVICE \
: mount $DEVICE / \
: mkdir-p /lib/modules \
: mkdir-p /lib/firmware \
: set-verbose false \
: echo tar-in modules.tar /lib/modules \
: tar-in modules.tar /lib/modules \
: echo tar-in firmware.tar /lib/firmware \
: tar-in firmware.tar /lib/firmware \
: echo tgz-in assets/rootfs_arm.tar.gz / \
: tgz-in assets/rootfs_arm.tar.gz / \
: set-verbose true \
: umount / \
: mount $BOOT_DEVICE / \
: write /cmdline.txt "+dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 cgroup-enable=memory swapaccount=1 elevator=deadline rootwait console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty0 rancher.password=rancher rw init=/init
" \
: umount /
zip dist/rancheros-rpi2.zip build/run.img