Skip to content

Commit f80dee2

Browse files
authored
Arm images (odroidC2) (#867)
* Add odroidC2 firmware package Signed-off-by: Ettore Di Giacinto <[email protected]> * Add image creation scripts It also adds odroid-c2 examples image. None of them are booting correctly. The openSUSE one fails with #785, and the Ubuntu one has an outdated kernel that doesn't work with our EFI setup, needing a specific kernel compiled with EFI support. Keeping the firmware/packages as samples until we get support for other boards. It also add pipeline as example for building multi-arch examples images Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent b5d965f commit f80dee2

File tree

17 files changed

+830
-0
lines changed

17 files changed

+830
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: 'build multi-arch example files'
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
tags:
9+
- '*'
10+
11+
jobs:
12+
docker:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
include:
17+
- tag: "odroid-c2-"
18+
dockerfile: "examples/odroid-c2"
19+
platforms: "linux/arm64"
20+
- tag: "odroid-c2-ubuntu-3.x"
21+
dockerfile: "examples/odroid-c2-ubuntu"
22+
platforms: "linux/arm64"
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
27+
- name: Prepare
28+
id: prep
29+
run: |
30+
DOCKER_IMAGE=quay.io/costoolkit/examples
31+
VERSION=latest
32+
SHORTREF=${GITHUB_SHA::8}
33+
# If this is git tag, use the tag name as a docker tag
34+
if [[ $GITHUB_REF == refs/tags/* ]]; then
35+
VERSION=${GITHUB_REF#refs/tags/}
36+
fi
37+
TAGS="${DOCKER_IMAGE}:${{ matrix.tag }}${VERSION},${DOCKER_IMAGE}:${{ matrix.tag }}${SHORTREF}"
38+
# If the VERSION looks like a version number, assume that
39+
# this is the most recent version of the image and also
40+
# tag it 'latest'.
41+
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
42+
TAGS="$TAGS,${DOCKER_IMAGE}:${{ matrix.tag }}latest"
43+
fi
44+
# Set output parameters.
45+
echo ::set-output name=tags::${TAGS}
46+
echo ::set-output name=docker_image::${DOCKER_IMAGE}
47+
- name: Set up QEMU
48+
uses: docker/setup-qemu-action@master
49+
with:
50+
platforms: all
51+
52+
- name: Set up Docker Buildx
53+
id: buildx
54+
uses: docker/setup-buildx-action@master
55+
56+
- name: Login to DockerHub
57+
if: github.event_name != 'pull_request'
58+
uses: docker/login-action@v1
59+
with:
60+
registry: quay.io
61+
username: ${{ secrets.QUAY_USERNAME }}
62+
password: ${{ secrets.QUAY_PASSWORD }}
63+
- name: Build
64+
uses: docker/build-push-action@v2
65+
with:
66+
builder: ${{ steps.buildx.outputs.name }}
67+
context: ./${{ matrix.dockerfile }}
68+
file: ./${{ matrix.dockerfile }}/Dockerfile
69+
platforms: ${{ matrix.platforms }}
70+
push: true
71+
tags: ${{ steps.prep.outputs.tags }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
ARG LUET_VERSION=0.20.10
2+
FROM quay.io/luet/base:$LUET_VERSION AS luet
3+
4+
FROM quay.io/costoolkit/examples:odroid-c2-ubuntu-base
5+
6+
ENV COSIGN_EXPERIMENTAL=1
7+
ENV COSIGN_REPOSITORY=raccos/releases-green
8+
9+
RUN apt-get update -y
10+
RUN apt-get install -y dracut-core curl dracut-network rsync
11+
12+
# Copy the luet config file pointing to the upgrade repository
13+
COPY conf/luet.yaml /etc/luet/luet.yaml
14+
15+
RUN curl -L https://github.com/mudler/luet/releases/download/0.20.10/luet-0.20.10-linux-arm64 --output /usr/bin/luet
16+
17+
RUN chmod +x /usr/bin/luet
18+
RUN luet install -y meta/cos-verify
19+
20+
RUN luet install --plugin luet-cosign -y meta/cos-minimal
21+
22+
COPY files/ /
23+
24+
# Handle initrd and vmlinuz symlinks
25+
RUN kernel=$(ls /lib/modules | head -n1) && \
26+
dracut -f "/boot/initrd-${kernel}" "${kernel}" && \
27+
ln -sf "initrd-${kernel}" /boot/initrd
28+
29+
RUN kernel=/boot/Image && \
30+
ln -sf "${kernel#/boot/}" /boot/vmlinuz
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
logging:
2+
color: false
3+
enable_emoji: false
4+
general:
5+
debug: false
6+
spinner_charset: 9
7+
repositories:
8+
- name: "cos"
9+
description: "cOS official"
10+
type: "docker"
11+
enable: true
12+
cached: true
13+
priority: 1
14+
verify: false
15+
urls:
16+
- "quay.io/costoolkit/releases-green-arm64"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# cOS configuration file
2+
# This file allows to tweak cOS configuration such as: default upgrade/recovery image and GRUB menu entry
3+
4+
# Disable/enable image verification during upgrades ( default: true )
5+
VERIFY=false
6+
7+
# Disable/enable upgrades via release channels instead of container images. ( default: true )
8+
CHANNEL_UPGRADES=false
9+
10+
# Default container image used for upgrades. ( defaults to system/cos with channel CHANNEL_UPGRADES enabled )
11+
UPGRADE_IMAGE="quay.io/mudler/cos-test:cos-standard"
12+
13+
# Default recovery image to use when upgrading the recovery partition
14+
# ( defaults to recovery/cos in vanilla cOS images with channel CHANNEL_UPGRADES enabled. Otherwise it defaults to UPGRADE_IMAGE ).
15+
RECOVERY_IMAGE="quay.io/costoolkit/examples:"
16+
17+
# GRUB entry to display on boot. ( defaults: cOS )
18+
GRUB_ENTRY_NAME="example"
19+
20+
# Space separated list of additional paths that are used to
21+
# source cloud-config from. ( defaults paths are: /system/oem /oem/ /usr/local/cloud-config/ )
22+
CLOUD_INIT_PATHS=""
23+
24+
# This is the directory that can be used to store cloud-init files that can be enabled/disabled in runtime
25+
# by cos-features. ( defaults to /system/features )
26+
COS_FEATURESDIR="/system/features"
27+
28+
# This is the repository that hosts the signature files used by cosign and luet-cosign plugin during upgrade/deploy to
29+
# check the artifact signatures
30+
COSIGN_REPOSITORY="raccos/releases-green"
31+
32+
# This sets keyless verify on building packages with luet and the luet-cosign plugin.
33+
# 1 = enabled keyless, 0 = disabled, uses normal public key verification
34+
COSIGN_EXPERIMENTAL=1
35+
36+
# This sets the location of the public key to use to verify the packages installed by luet during upgrade/deploy
37+
# This can be set to file, URL, KMS URI or Kubernetes Secret
38+
# This is only used if COSIGN_EXPERIMENTAL is set to 0
39+
COSIGN_PUBLIC_KEY_LOCATION=""
40+
41+
# Default size (in MB) of disk image files (.img) created during upgrades
42+
DEFAULT_IMAGE_SIZE=3240
43+
44+
# Path to default configuration grub file
45+
GRUBCONF="/etc/cos/grub.cfg"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VERSION="15.3"
2+
PRETTY_NAME="openSUSE"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Default cOS OEM configuration file
2+
#
3+
# This file is part of cOS and will get reset during upgrades.
4+
#
5+
# Before you change this file manually,
6+
# consider copying this file to /usr/local/cloud-config or
7+
# copy the file with a prefix starting by 90, e.g. /oem/91_custom.yaml
8+
name: "Default user"
9+
stages:
10+
initramfs:
11+
- name: "Setup users"
12+
ensure_entities:
13+
- path: /etc/shadow
14+
entity: |
15+
kind: "shadow"
16+
username: "root"
17+
password: "cos"

examples/odroid-c2/Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
ARG LUET_VERSION=0.20.10
2+
FROM quay.io/luet/base:$LUET_VERSION AS luet
3+
4+
FROM opensuse/leap:15.3
5+
6+
ENV COSIGN_EXPERIMENTAL=1
7+
ENV COSIGN_REPOSITORY=raccos/releases-green
8+
9+
RUN zypper in -y \
10+
# Odroid
11+
kernel-default-extra \
12+
systemd-sysvinit \
13+
grub2-arm64-efi \
14+
iproute2 \
15+
squashfs \
16+
conntrack-tools \
17+
findutils \
18+
haveged \
19+
lsscsi \
20+
lvm2 \
21+
mdadm \
22+
multipath-tools \
23+
nfs-utils \
24+
open-iscsi \
25+
open-vm-tools \
26+
python-azure-agent \
27+
qemu-guest-agent \
28+
rng-tools \
29+
systemd \
30+
vim \
31+
parted \
32+
dracut \
33+
e2fsprogs \
34+
dosfstools \
35+
kernel-default \
36+
kernel-firmware-bnx2 \
37+
kernel-firmware-i915 \
38+
kernel-firmware-intel \
39+
kernel-firmware-iwlwifi \
40+
kernel-firmware-mellanox \
41+
kernel-firmware-network \
42+
kernel-firmware-platform \
43+
kernel-firmware-realtek \
44+
coreutils \
45+
less \
46+
device-mapper \
47+
grub2 \
48+
which \
49+
curl \
50+
nano \
51+
gawk \
52+
haveged \
53+
tar \
54+
rsync \
55+
timezone \
56+
jq \
57+
gptfdisk
58+
59+
# Copy the luet config file pointing to the upgrade repository
60+
COPY conf/luet.yaml /etc/luet/luet.yaml
61+
RUN curl -L https://github.com/mudler/luet/releases/download/0.20.10/luet-0.20.10-linux-arm64 --output /usr/bin/luet
62+
63+
RUN chmod +x /usr/bin/luet
64+
RUN luet install -y meta/cos-verify
65+
66+
RUN luet install --plugin luet-cosign -y meta/cos-minimal
67+
68+
COPY files/ /
69+
RUN mkinitrd

examples/odroid-c2/conf/luet.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
logging:
2+
color: false
3+
enable_emoji: false
4+
general:
5+
debug: false
6+
spinner_charset: 9
7+
repositories:
8+
- name: "cos"
9+
description: "cOS official"
10+
type: "docker"
11+
enable: true
12+
cached: true
13+
priority: 1
14+
verify: false
15+
urls:
16+
- "quay.io/costoolkit/releases-green-arm64"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# cOS configuration file
2+
# This file allows to tweak cOS configuration such as: default upgrade/recovery image and GRUB menu entry
3+
4+
# Disable/enable image verification during upgrades ( default: true )
5+
VERIFY=false
6+
7+
# Disable/enable upgrades via release channels instead of container images. ( default: true )
8+
CHANNEL_UPGRADES=false
9+
10+
# Default container image used for upgrades. ( defaults to system/cos with channel CHANNEL_UPGRADES enabled )
11+
UPGRADE_IMAGE="quay.io/mudler/cos-test:cos-standard"
12+
13+
# Default recovery image to use when upgrading the recovery partition
14+
# ( defaults to recovery/cos in vanilla cOS images with channel CHANNEL_UPGRADES enabled. Otherwise it defaults to UPGRADE_IMAGE ).
15+
RECOVERY_IMAGE="quay.io/mudler/cos-test:cos-standard"
16+
17+
# GRUB entry to display on boot. ( defaults: cOS )
18+
GRUB_ENTRY_NAME="example"
19+
20+
# Space separated list of additional paths that are used to
21+
# source cloud-config from. ( defaults paths are: /system/oem /oem/ /usr/local/cloud-config/ )
22+
CLOUD_INIT_PATHS=""
23+
24+
# This is the directory that can be used to store cloud-init files that can be enabled/disabled in runtime
25+
# by cos-features. ( defaults to /system/features )
26+
COS_FEATURESDIR="/system/features"
27+
28+
# This is the repository that hosts the signature files used by cosign and luet-cosign plugin during upgrade/deploy to
29+
# check the artifact signatures
30+
COSIGN_REPOSITORY="raccos/releases-green"
31+
32+
# This sets keyless verify on building packages with luet and the luet-cosign plugin.
33+
# 1 = enabled keyless, 0 = disabled, uses normal public key verification
34+
COSIGN_EXPERIMENTAL=1
35+
36+
# This sets the location of the public key to use to verify the packages installed by luet during upgrade/deploy
37+
# This can be set to file, URL, KMS URI or Kubernetes Secret
38+
# This is only used if COSIGN_EXPERIMENTAL is set to 0
39+
COSIGN_PUBLIC_KEY_LOCATION=""
40+
41+
# Default size (in MB) of disk image files (.img) created during upgrades
42+
DEFAULT_IMAGE_SIZE=3240
43+
44+
# Path to default configuration grub file
45+
GRUBCONF="/etc/cos/grub.cfg"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VERSION="15.3"
2+
PRETTY_NAME="openSUSE"

0 commit comments

Comments
 (0)