mirror of
https://github.com/rancher/os.git
synced 2025-08-31 22:32:14 +00:00
RPI building scripts
This commit is contained in:
1
scripts/images/rpi-hypriot/.dockerignore
Normal file
1
scripts/images/rpi-hypriot/.dockerignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
dist
|
15
scripts/images/rpi-hypriot/Dockerfile.dapper
Normal file
15
scripts/images/rpi-hypriot/Dockerfile.dapper
Normal 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"]
|
9
scripts/images/rpi-hypriot/README.md
Normal file
9
scripts/images/rpi-hypriot/README.md
Normal 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.
|
36
scripts/images/rpi-hypriot/scripts/build.sh
Executable file
36
scripts/images/rpi-hypriot/scripts/build.sh
Executable 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
|
Reference in New Issue
Block a user