This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
forked from gardenlinux/builder_example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build multi-arch images (amd64, arm64), upload images
- Loading branch information
Showing
20 changed files
with
128 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Build the repo | ||
run: ./build ostreeImage-amd64 ostreeImage-arm64 | ||
- name: Upload amd64 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ostree-amd64-trixie-image | ||
path: .build/*amd64-trixie-*raw | ||
- name: Upload arm64 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ostree-arm64-trixie-image | ||
path: .build/*arm64-trixie-*raw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
repo: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Build the repo | ||
run: ./build ostreeRepo-amd64 ostreeRepo-arm64 | ||
- name: Upload amd64 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ostree-amd64-trixie-repo | ||
path: .build/ostreeRepo-amd64-trixie-*.ostreeRepo.tar.gz | ||
- name: Upload arm64 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ostree-arm64-trixie-repo | ||
path: .build/ostreeRepo-arm64-trixie-*.ostreeRepo.tar.gz |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/boot/efi/loader/random-seed |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# <file system> <dir> <type> <options> <makeimg args> | ||
LABEL=EFI /boot/efi vfat umask=0077 type=uefi,size=1G | ||
LABEL=ROOT / ext4 rw,prjquota,discard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
export PATH="/builder/image.d:$PATH" | ||
|
||
rootfs_work="$(mktemp -d)" | ||
mount -t tmpfs tmpfs "$rootfs_work" | ||
|
||
MYROOT="$(mktemp -d)" | ||
mount -t tmpfs tmpfs "$MYROOT" | ||
mkdir -p "$MYROOT"/sysroot | ||
OSTREE_SYSROOT="$MYROOT/sysroot" | ||
OSTREE_REPO=$OSTREE_SYSROOT/ostree/repo | ||
OSTREE_REF="debian/testing/$BUILDER_ARCH" | ||
|
||
rootfs="$1" | ||
output="$2" | ||
|
||
tar xf "$rootfs" -C "$rootfs_work" | ||
|
||
mv "$rootfs_work"/etc "$rootfs_work"/usr/etc | ||
|
||
mkdir -p $OSTREE_REPO | ||
|
||
if curl --head --silent --fail http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH.tar.gz 2> /dev/null; | ||
then | ||
echo "Using http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH.tar.gz" | ||
mkdir -p $OSTREE_REPO | ||
download="$(mktemp -d)" | ||
pushd $download | ||
curl --remote-name http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH.tar.gz | ||
tar xf debian-testing-$BUILDER_ARCH.tar.gz --directory $OSTREE_REPO | ||
popd | ||
rm -rf $download | ||
else | ||
echo "Coud not download http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH.tar.gz, building new repo" | ||
ostree init --mode=archive --repo=$OSTREE_REPO | ||
ostree admin init-fs --modern $OSTREE_SYSROOT | ||
ostree admin os-init --sysroot=$OSTREE_SYSROOT debian | ||
ostree config --repo=$OSTREE_REPO set sysroot.bootloader none | ||
ostree remote --repo=$OSTREE_REPO add --no-gpg-verify --no-sign-verify origin http://ostree.gardenlinux.io/debian-testing-$BUILDER_ARCH $OSTREE_REF | ||
fi | ||
|
||
ostree commit --repo=$OSTREE_REPO --branch $OSTREE_REF --skip-if-unchanged -s "Debian testing build $(date --utc +%Y-%m-%dT%H:%M%Z)" "$rootfs_work" | ||
|
||
tar --directory $OSTREE_REPO --create --mtime="@$BUILDER_TIMESTAMP" --sort name --numeric-owner --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime . | gzip > "$output" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
description: 'image-based system using OSTree' | ||
type: platform |
File renamed without changes.