Skip to content

change genimage.cfg, increase rootfs size. #10

change genimage.cfg, increase rootfs size.

change genimage.cfg, increase rootfs size. #10

Workflow file for this run

name: Build image
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
timezone:
type: choice
description: Time zone
options:
- Hawaii
- Alaska
- Pacific Time (US and Canada)
- Mountain Time (US and Canada)
- Central Time (US and Canada)
- Eastern Time (US and Canada)
- Atlantic Time (Canada)
- Newfoundland (Canada)
- UTC
- Western European Time
- Central European Time
- Eastern European Time
- Israel
- Moscow Time
- India
- China
- Japan
- Korea
- New Zealand
default: 'UTC'
fontsize:
type: choice
description: Terminal font size
options:
- small (50 cols x 30 rows)
- larger (50 cols x 15 rows)
hostname:
description: "Hostname (default=buildroot)"
wifi_ssid:
description: Wifi network name (optional)
wifi_password:
description: Wifi network password (optional)
ssh_authorized_key:
description: SSH authorized public key (optional)
max_2_cores:
description: Max 2 cores to limit peak power use
type: boolean
default: false
jobs:
build:
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: True
- name: Note in GHA Summary that this is a vanilla build
run: |
echo "🔨 Creating a vanilla Buildroot OS image with no customization." | tee -a $GITHUB_STEP_SUMMARY
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${{ github.repository_visibility }}" != "private" ]; then
echo "" | tee -a $GITHUB_STEP_SUMMARY
echo 'NOTE: This GitHub Action will only apply customization settings in a *private* GitHub repository.' | tee -a $GITHUB_STEP_SUMMARY
fi
if: github.event_name != 'workflow_dispatch' || github.event.repository.visibility != 'private'
- name: Store inputs as a config file and print customization settings to GHA Summary
run: |
echo '${{ toJSON(inputs) }}' > customization.json
echo '### 🛠️ Customization settings' | tee -a $GITHUB_STEP_SUMMARY
echo '' | tee -a $GITHUB_STEP_SUMMARY
echo '```yaml' >> $GITHUB_STEP_SUMMARY
cat customization.json | tee -a $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
if: github.event_name == 'workflow_dispatch' && github.event.repository.visibility == 'private'
- name: Disable Buildroot compiler cache to reduce disk space usage
run: sed -i '/^BR2_CCACHE=y$/d' br_defconfig
- name: Set up BTRFS file system with compression
run: |
df -h
dd if=/dev/zero of=../virtual_disk.img bs=1M count=12288
sudo mkfs.btrfs ../virtual_disk.img
sudo mkdir /mnt/virtual-btrfs
sudo mount -o loop,compress=zstd ../virtual_disk.img /mnt/virtual-btrfs
df -h
- name: Configure Docker to store containers on BTRFS file system
run: |
# The compression allows us to store more data than the physical disk space,
# which ensures we don't exceed the space provided on GitHub-hosted runners.
# The disk space available is smaller in private repos than in public repos.
sudo systemctl stop docker
if [ -f /etc/docker/daemon.json ]; then
jq '. + { "storage-driver": "btrfs", "data-root": "/mnt/virtual-btrfs" }' /etc/docker/daemon.json | sudo tee /etc/docker/daemon.json.tmp && sudo mv /etc/docker/daemon.json.tmp /etc/docker/daemon.json
else
jq -n '{ "storage-driver": "btrfs", "data-root": "/mnt/virtual-btrfs" }' | sudo tee /etc/docker/daemon.json
fi
sudo systemctl start docker
docker info
- name: Build docker image
run: docker build --platform linux/amd64 --file docker/Dockerfile --tag buildroot-os-builder .
- name: Build Buildroot OS image for SD card using docker
run: |
docker run --platform linux/amd64 --name my-beepy-buildroot buildroot-os-builder ./build-image.sh
docker cp my-beepy-buildroot:/home/builder/beepy-buildroot/buildroot/output/images/sdcard.img ./sdcard.img
- name: Check disk space usage
run: |
df -h
sudo btrfs filesystem usage /mnt/virtual-btrfs
sudo btrfs filesystem df /mnt/virtual-btrfs
if: ${{ !cancelled() }}
- name: Upload SD card image as GitHub Actions artifact
uses: actions/upload-artifact@v4
with:
name: sdcard.img
path: sdcard.img
if: github.event_name == 'workflow_dispatch'
- name: Upload SD card image as a new GitHub Release
run: |
zip sdcard.img.zip sdcard.img && rm sdcard.img
RELEASE_URL=$(gh release create "${{ github.ref_name }}" sdcard.img.zip \
--notes $'The default username is "beepy" and the default password is "beepbeep".\n\n⚠️ You should change the password using `passwd` and disable password-based SSH authentication as soon as possible for security.' \
--generate-notes \
--latest)
echo "" >> $GITHUB_STEP_SUMMARY
echo "📦 Uploaded release: [${{ github.ref_name }}]($RELEASE_URL)" >> $GITHUB_STEP_SUMMARY
echo "📦 Uploaded release ${{ github.ref_name }}:"
echo "$RELEASE_URL"
env:
GH_TOKEN: ${{ github.token }}
if: github.event_name != 'workflow_dispatch'