diff --git a/.github/workflows/push_pr_release.yml b/.github/workflows/push_pr_release.yml index 6846269..26fd494 100644 --- a/.github/workflows/push_pr_release.yml +++ b/.github/workflows/push_pr_release.yml @@ -18,7 +18,7 @@ on: types: [ hyperion_push ] env: - PLATFORM: bookworm + PLATFORM: trixie jobs: image-builder: @@ -28,8 +28,8 @@ jobs: fail-fast: false matrix: pi-gen: [ - { branch: bookworm, architecture: armhf }, - { branch: bookworm-arm64, architecture: arm64 } + { branch: master, architecture: armhf }, + { branch: arm64, architecture: arm64 } ] steps: @@ -51,12 +51,13 @@ jobs: - name: 👷 Build run: | touch pi-gen/stage3/SKIP pi-gen/stage4/SKIP pi-gen/stage4/SKIP_IMAGES pi-gen/stage5/SKIP pi-gen/stage5/SKIP_IMAGES + cp -R stage2 pi-gen/ cp -R stage-hyperbian pi-gen/ touch pi-gen/stage-hyperbian/EXPORT_IMAGE cp config pi-gen/ && cd pi-gen echo "Suites: ${{ env.PLATFORM }}" >> "./stage-hyperbian/00-install-hyperion/files/hyperion.sources" echo "Architectures: ${{ matrix.pi-gen.architecture }}" >> "./stage-hyperbian/00-install-hyperion/files/hyperion.sources" - echo "RELEASE='${{ env.PLATFORM }}'" >> "./config" + echo -e "\nRELEASE='${{ env.PLATFORM }}'" >> "./config" sudo IMG_FILENAME=${{ env.HYPERBIAN }} ARCHIVE_FILENAME=${{ env.HYPERBIAN }} ./build.sh - name: 📦 Upload diff --git a/config b/config index 4955e77..e8bdacb 100644 --- a/config +++ b/config @@ -1,7 +1,2 @@ IMG_NAME='HyperBian' STAGE_LIST='stage0 stage1 stage2 stage-hyperbian' -TARGET_HOSTNAME='HyperBian' -DISABLE_FIRST_BOOT_USER_RENAME=1 -SUDO_USER='hyperion' -FIRST_USER_NAME='hyperion' -FIRST_USER_PASS='ambientlight' diff --git a/stage-hyperbian/00-install-hyperion/00-run.sh b/stage-hyperbian/00-install-hyperion/00-run.sh index b2667ef..e4d37fe 100755 --- a/stage-hyperbian/00-install-hyperion/00-run.sh +++ b/stage-hyperbian/00-install-hyperion/00-run.sh @@ -1,8 +1,7 @@ #!/bin/bash -e -# Enable SPI and force HDMI output -echo '---> Enable SPI and force HDMI output' -sed -i "s/^#dtparam=spi=on.*/dtparam=spi=on/" ${ROOTFS_DIR}/boot/firmware/config.txt +# Force HDMI output +echo '---> Force HDMI output' sed -i "s/^#hdmi_force_hotplug=1.*/hdmi_force_hotplug=1/" ${ROOTFS_DIR}/boot/firmware/config.txt # Modify /usr/lib/os-release diff --git a/stage-hyperbian/00-install-hyperion/files/motd-hyperbian b/stage-hyperbian/00-install-hyperion/files/motd-hyperbian index 0ad8370..4c1fd46 100644 --- a/stage-hyperbian/00-install-hyperion/files/motd-hyperbian +++ b/stage-hyperbian/00-install-hyperion/files/motd-hyperbian @@ -15,7 +15,7 @@ printf "| __ | \ / | ___/ | __| | _ / | _ < | | / /\ \ | . printf "| | | | | | | | | |____ | | \ \ | |_) | | | / ____ \ | |\ |\n" printf "|_| |_| |_| |_| |______| |_| \_\ |____/ |_| /_/ \_\ |_| \_|\n" -printf "\nTo configure Hyperion browse to ${BLUE}http://${IP}:8090${NC} from another device on your network." +printf "\nTo configure Hyperion browse to ${BOLD}http://${IP}:8090${NC} from another device on your network." printf "\nAll Hyperion configuration can be completed via the Hyperion Web UI.\n\n" systemctl is-active hyperion@*.service >/dev/null 2>&1 && printf "Hyperion status: ${GREEN}⬤ Running${NC}\n" || printf "Hyperion status: ${RED}⬤ Stopped${NC}\n" diff --git a/stage2/04-cloud-init/files/meta-data b/stage2/04-cloud-init/files/meta-data new file mode 100644 index 0000000..ac36efd --- /dev/null +++ b/stage2/04-cloud-init/files/meta-data @@ -0,0 +1,18 @@ +# This is the meta-data configuration file for cloud-init. Please refer to the +# cloud-init documentation for more information: +# +# https://cloudinit.readthedocs.io/ + +# Set the datasource mode to "local". This ensures that user-data is acted upon +# prior to bringing up the network (because everything about the datasource is +# assumed to be local). If you wish to use an HTTP datasource instead, you can +# change this to "net" or override it on the kernel cmdline (see README). +dsmode: local + +# Specifies the "unique" identifier of the instance. Typically in cloud-init +# this is generated by the owning cloud and is actually unique (to some +# degree). Here our data-source is local, so this is just a fixed string. +# Warning: changing this will cause cloud-init to assume it is running on a +# "new" instance, and to go through first time setup again (the value is +# compared to a cached copy). +instance_id: rpios-image diff --git a/stage2/04-cloud-init/files/network-config b/stage2/04-cloud-init/files/network-config new file mode 100644 index 0000000..3fdc175 --- /dev/null +++ b/stage2/04-cloud-init/files/network-config @@ -0,0 +1,25 @@ +#################################################################################### +## Configure your initial HyperBian Wifi connectivity to your needs below. +## Uncomment and edit the relevant sections as needed. +## +## If you have additional needs refer to the cloud-init documentation +## and the netplan reference for full details: +## +## https://netplan.io/reference +## https://cloudinit.readthedocs.io/en/latest/topics/network-config.html +## https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v2.html +#################################################################################### + +## Uncomment the below to enable the configuration +#network: +# version: 2 +# wifis: +# wlan0: +# dhcp4: true +# optional: true +# access-points: +## Replace the elements below with your Wifi SSID and Password +# "YOUR_SSID": +# password: "YOUR_PASSWORD" +## Replace YOUR_COUNTRY_CODE with your 2-letter country code +# regulatory-domain: YOUR_COUNTRY_CODE diff --git a/stage2/04-cloud-init/files/user-data b/stage2/04-cloud-init/files/user-data new file mode 100644 index 0000000..ad61152 --- /dev/null +++ b/stage2/04-cloud-init/files/user-data @@ -0,0 +1,86 @@ +## template: jinja +#cloud-config + +# This is the user-data configuration file for cloud-init. By default this sets +# up an initial user called "ubuntu" with password "ubuntu", which must be +# changed at first login. However, many additional actions can be initiated on +# first boot from this file. The cloud-init documentation has more details: +# +# https://cloudinit.readthedocs.io/ +# +# Please note that the YAML format employed by this file is sensitive to +# differences in whitespace; if you are editing this file in an editor (like +# Notepad) which uses literal tabs, take care to only use spaces for +# indentation. See the following link for more details: +# +# https://en.wikipedia.org/wiki/YAML +# + +################################################################## +## Configure your initial HyperBian system to your needs below ### +## Uncomment and edit the relevant sections as needed. ### +################################################################## + +# 1. Define the Hyperion user name (optional) +{% set HYPERION_USER = "hyperion" %} + +# 2. Define, if ssh access should be enabled (optional) +{% set ENABLE_SSH = false %} + +# 3. Set the system's hostname (optional) +hostname: hyperbian + +# 4. Set the timezone for this instance (optional) +# the value of 'timezone' must exist in /usr/share/zoneinfo +# Run: timedatectl list-timezones + +## Sample for Berlin timezone +#timezone: Europe/Berlin + +# 5. Set the locale to a given locale; default: en_GB.UTF-8 (optional) +# Run: locale -a + +## Sample for German locale +#locale: de_DE.UTF-8 + +# 6. Set up the keyboard layout (optional) +# See localectl(1), in particular the various list-x11-* sub-commands, +# to determine the available models, layouts, variants, and options +# Run: localectl list-x11-keymap-layouts + +## Sample for German keyboard layout +#keyboard: +# layout: de + +# 7. Enable the SPI interface (optional) +rpi: + interfaces: + spi: true + +############################### +### DO NOT CHANGE THE BELOW ### +############################### + +users: +- name: {{ HYPERION_USER }} + gecos: Hyperion user + groups: users, dialout, sudo, video, audio, gpio, spi, i2c + sudo: ["ALL=(ALL) NOPASSWD:ALL"] + lock_passwd: false + passwd: $1$5RPVAd$vJeLqLb5KjHn0aqw69Oxq1 + shell: /bin/bash + +ssh_pwauth: {{ ENABLE_SSH }} + +runcmd: + - | + echo "Running setup for Hyperion user: {{ HYPERION_USER }}" + /usr/share/hyperion/scripts/updateHyperionUser.sh -u "{{ HYPERION_USER }}" + +{% if ENABLE_SSH %} + - systemctl unmask ssh + - systemctl enable ssh + - systemctl start ssh +{% else %} + - echo "SSH is disabled in config" +{% endif %}