From f3eb11d9b23f5f3e26823165df3f4ccb7bdd971b Mon Sep 17 00:00:00 2001 From: Alexey Sychev Date: Sun, 15 Sep 2024 16:35:27 +0200 Subject: [PATCH 1/5] Test #1 fix --- .github/workflow_config.yml | 4 +- config/armbian/CB1 | 15 +----- src/modules/cb1config/config | 6 --- .../root/etc/udev/rules.d/90-gpio-spi.rules | 2 - src/modules/cb1config/start_chroot_script | 48 ------------------- src/modules/cb1spi/config | 8 ---- src/modules/cb1spi/start_chroot_script | 28 ----------- src/modules/hotspot_cb1/config | 2 - .../filesystem/root/etc/create_ap.conf | 28 ----------- .../filesystem/root/usr/bin/start_hotspot.sh | 11 ----- .../usr/lib/systemd/system/create_ap.service | 14 ------ src/modules/hotspot_cb1/start_chroot_script | 29 ----------- 12 files changed, 4 insertions(+), 191 deletions(-) delete mode 100644 src/modules/cb1config/config delete mode 100644 src/modules/cb1config/filesystem/root/etc/udev/rules.d/90-gpio-spi.rules delete mode 100644 src/modules/cb1config/start_chroot_script delete mode 100644 src/modules/cb1spi/config delete mode 100644 src/modules/cb1spi/start_chroot_script delete mode 100644 src/modules/hotspot_cb1/config delete mode 100644 src/modules/hotspot_cb1/filesystem/root/etc/create_ap.conf delete mode 100644 src/modules/hotspot_cb1/filesystem/root/usr/bin/start_hotspot.sh delete mode 100644 src/modules/hotspot_cb1/filesystem/root/usr/lib/systemd/system/create_ap.service delete mode 100644 src/modules/hotspot_cb1/start_chroot_script diff --git a/.github/workflow_config.yml b/.github/workflow_config.yml index 59a993b0d..96aba5c3f 100644 --- a/.github/workflow_config.yml +++ b/.github/workflow_config.yml @@ -23,9 +23,9 @@ buildtest: # Orange Pi OS based images # - orangepi/orangepi_zero2 # Raspberry Pi OS based images - - raspberry/rpi32 + # - raspberry/rpi32 # - raspberry/rpi64 - - raspberry/opicm4 + # - raspberry/opicm4 # This is used to setup release build chain. # Each entry will be used in setup matrix for releases diff --git a/config/armbian/CB1 b/config/armbian/CB1 index 8c9a1f042..c75e4b13b 100644 --- a/config/armbian/CB1 +++ b/config/armbian/CB1 @@ -2,22 +2,11 @@ # Shebang for better file detection # shellcheck enable=require-variable-braces -BASE_ARCH="arm64" -BASE_IMAGE_ENLARGEROOT=10500 -BASE_IMAGE_RESIZEROOT=600 -BASE_ADD_USER="yes" -BASE_USER="pi" -BASE_USER_PASSWORD="raspberry" - # Image source -DOWNLOAD_URL_CHECKSUM="https://github.com/bigtreetech/CB1/releases/download/V2.3.1/CB1_Debian11_Klipper_kernel5.16_20230215.img.sha256" -DOWNLOAD_URL_IMAGE="https://github.com/bigtreetech/CB1/releases/download/V2.3.1/CB1_Debian11_minimal_kernel5.16_20230215.img.xz" +DOWNLOAD_URL_CHECKSUM="${DOWNLOAD_BASE_URL}/armbian-bigtreetech_cb1_bookworm.img.sha256" +DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/armbian-bigtreetech_cb1_bookworm.img.xz" # export Variables export BASE_ARCH -export BASE_IMAGE_ENLARGEROOT -export BASE_IMAGE_RESIZEROOT export DOWNLOAD_URL_CHECKSUM export DOWNLOAD_URL_IMAGE - -export MODULES="base,deb_namserver,passwordless_sudo,pkgupgrade(network,cb1config,klipper,node,is_req_preinstall,moonraker,cb1spi,ratos(mainsail,crowsnest,linear_movement_analysis,timelapse,klipperscreen,rpi_mcu,disable-services(hotspot_cb1),dfu-util),password-for-sudo),postrename" \ No newline at end of file diff --git a/src/modules/cb1config/config b/src/modules/cb1config/config deleted file mode 100644 index 86965e9f0..000000000 --- a/src/modules/cb1config/config +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -# Shebang for better file detection - -[ -n "$PICONFIG_SWAP_CONF_FILE" ] || PICONFIG_SWAP_CONF_FILE="/etc/dphys-swapfile" -[ -n "$PICONFIG_SWAP_SIZE" ] || PICONFIG_SWAP_SIZE="256" -[ -n "$PICONFIG_SWAP_MAX" ] || PICONFIG_SWAP_MAX="1024" diff --git a/src/modules/cb1config/filesystem/root/etc/udev/rules.d/90-gpio-spi.rules b/src/modules/cb1config/filesystem/root/etc/udev/rules.d/90-gpio-spi.rules deleted file mode 100644 index 8da31277e..000000000 --- a/src/modules/cb1config/filesystem/root/etc/udev/rules.d/90-gpio-spi.rules +++ /dev/null @@ -1,2 +0,0 @@ -KERNEL=="spidev0.0", OWNER="root", GROUP="spi" -KERNEL=="spidev0.1", OWNER="root", GROUP="spi" \ No newline at end of file diff --git a/src/modules/cb1config/start_chroot_script b/src/modules/cb1config/start_chroot_script deleted file mode 100644 index e00bafecb..000000000 --- a/src/modules/cb1config/start_chroot_script +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -# Preinstall customized config.txt -# Written by Stephan Wendel aka KwadFan -# This file may distributed under GPLv3 -# Copyright 2021 -######## - -# shellcheck enable=require-variable-braces - -## Source error handling, leave this in place -set -Eex - -# Set DEBIAN_FRONTEND to noninteractive -if [[ "${DEBIAN_FRONTEND}" != "noninteractive" ]]; then - export DEBIAN_FRONTEND=noninteractive -fi - -## Source CustomPIOS common.sh -# shellcheck disable=SC1091 -source /common.sh -install_cleanup_trap - -# Step 1: Copy 90-gpio-spi.rules -echo_green "Copying 90-gpio-spi.rules..." -unpack /filesystem/root / - -# Step 2: add spi group -groupadd -f --system spi -usermod -a -G spi "${BASE_USER}" - -# Step 3: Disable bluetooth and related services -echo_green "Disabling Bluetooth related services..." -systemctl_if_exists disable hciuart.service -systemctl_if_exists disable bluetooth.service -systemctl_if_exists disable bluealsa.service - -# Step 4: Increase swapfile size -if [[ -f "${PICONFIG_SWAP_CONF_FILE}" ]]; then - echo_green "Increasing swap file size to ${PICONFIG_SWAP_SIZE} Mb. Limit to ${PICONFIG_SWAP_MAX} Mb" - sed -i 's/^CONF_SWAPSIZE.*/'CONF_SWAPSIZE="${PICONFIG_SWAP_SIZE}"'/' "${PICONFIG_SWAP_CONF_FILE}" - sed -i 's/^#CONF_MAXSWAP.*/'CONF_MAXSWAP="${PICONFIG_SWAP_MAX}"'/' "${PICONFIG_SWAP_CONF_FILE}" -fi - -# install avahi so ratos.local works -check_install_pkgs avahi - -#add the same groups as the biqu user -usermod -a -G disk,audio,plugdev,games,users,systemd-journal,input,netdev,ssh "${BASE_USER}" \ No newline at end of file diff --git a/src/modules/cb1spi/config b/src/modules/cb1spi/config deleted file mode 100644 index d0add8f5a..000000000 --- a/src/modules/cb1spi/config +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -#### CB1SPI - CB1 Configuration Module - -# Shebang for better file detection -# shellcheck disable=all - -[ -n "$CB1SPI_CONFIG_TXT_FILE" ] || CB1SPI_CONFIG_TXT_FILE="/boot/BoardEnv.txt" -[ -n "$CB1SPI_CONFIG_BAK_FILE" ] || CB1SPI_CONFIG_BAK_FILE="/boot/BoardEnv.txt.backup" \ No newline at end of file diff --git a/src/modules/cb1spi/start_chroot_script b/src/modules/cb1spi/start_chroot_script deleted file mode 100644 index 662a6d919..000000000 --- a/src/modules/cb1spi/start_chroot_script +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -#### CB1SPI - SB1 Configuration Module -#from https://www.reddit.com/r/BIGTREETECH/comments/xfom6n/comment/it32e6v/ - -# shellcheck enable=require-variable-braces - -## Source error handling, leave this in place -set -Ee - -# Set DEBIAN_FRONTEND to noninteractive -if [[ "${DEBIAN_FRONTEND}" != "noninteractive" ]]; then - export DEBIAN_FRONTEND=noninteractive -fi - -## Source CustomPIOS common.sh -# shellcheck disable=SC1091 -source /common.sh -install_cleanup_trap - -echo_green "Enable SPI interface on CB1 SBC's ..." - -# Step 1: Copy default config to backup file -cp "${CB1SPI_CONFIG_TXT_FILE}" "${CB1SPI_CONFIG_BAK_FILE}" - -# Step 2: Enable SPI -sed -i 's/^#overlays=spidev1_2.*/overlays=spidev1_2/' "${CB1SPI_CONFIG_TXT_FILE}" - -echo_green "Enable SPI interface on CB1 SBC ... DONE!" \ No newline at end of file diff --git a/src/modules/hotspot_cb1/config b/src/modules/hotspot_cb1/config deleted file mode 100644 index 62eb76de9..000000000 --- a/src/modules/hotspot_cb1/config +++ /dev/null @@ -1,2 +0,0 @@ -[ -n "$HOTSPOT_CB1_SHIP" ] || HOTSPOT_CB1_SHIP=https://github.com/oblique/create_ap -[ -n "$HOTSPOT_CB1_BRANCH" ] || HOTSPOT_CB1_BRANCH=master diff --git a/src/modules/hotspot_cb1/filesystem/root/etc/create_ap.conf b/src/modules/hotspot_cb1/filesystem/root/etc/create_ap.conf deleted file mode 100644 index 32c0ee667..000000000 --- a/src/modules/hotspot_cb1/filesystem/root/etc/create_ap.conf +++ /dev/null @@ -1,28 +0,0 @@ -CHANNEL=default -GATEWAY=192.168.50.1 -WPA_VERSION=2 -ETC_HOSTS=0 -DHCP_DNS=gateway -NO_DNS=0 -NO_DNSMASQ=0 -HIDDEN=0 -MAC_FILTER=0 -MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept -ISOLATE_CLIENTS=0 -SHARE_METHOD=nat -IEEE80211N=0 -IEEE80211AC=0 -HT_CAPAB=[HT40+] -VHT_CAPAB= -DRIVER=nl80211 -NO_VIRT=0 -COUNTRY= -FREQ_BAND=2.4 -NEW_MACADDR= -DAEMONIZE=0 -NO_HAVEGED=0 -WIFI_IFACE=wlan0 -INTERNET_IFACE=eth0 -SSID=RatOS -PASSPHRASE=raspberry -USE_PSK=0 \ No newline at end of file diff --git a/src/modules/hotspot_cb1/filesystem/root/usr/bin/start_hotspot.sh b/src/modules/hotspot_cb1/filesystem/root/usr/bin/start_hotspot.sh deleted file mode 100644 index aa6b64d2d..000000000 --- a/src/modules/hotspot_cb1/filesystem/root/usr/bin/start_hotspot.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -#give some time for wifi to connect -sleep 30 -#if wifi is not connected -ip link show dev wlan0 | grep -q "state UP" -check=$? -if [ "$check" -ne 0 ] -then - /usr/bin/create_ap --config /etc/create_ap.conf -fi \ No newline at end of file diff --git a/src/modules/hotspot_cb1/filesystem/root/usr/lib/systemd/system/create_ap.service b/src/modules/hotspot_cb1/filesystem/root/usr/lib/systemd/system/create_ap.service deleted file mode 100644 index 33435ac12..000000000 --- a/src/modules/hotspot_cb1/filesystem/root/usr/lib/systemd/system/create_ap.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Create AP Service -Wants=network-online.target -After=network-online.target - -[Service] -Type=simple -ExecStart=/usr/bin/start_hotspot.sh -KillSignal=SIGINT -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/src/modules/hotspot_cb1/start_chroot_script b/src/modules/hotspot_cb1/start_chroot_script deleted file mode 100644 index b8658576d..000000000 --- a/src/modules/hotspot_cb1/start_chroot_script +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# install ratos wifi hotspot on cb1 -# GPL V3 -######## - -# Error handling -set -xe - -source /common.sh -install_cleanup_trap - -echo_green "Install ratos hotspot tool dependencies..." -check_install_pkgs dnsmasq - -echo_green "Downloading ratos hotspot tool..." -pushd "/home/${BASE_USER}" -gitclone HOTSPOT_CB1 create_ap - -echo_green "Installing ratos hotspot tool..." -pushd "/home/${BASE_USER}/create_ap" -make install - -#edit the config -unpack /filesystem/root / - -chmod +x /usr/bin/start_hotspot.sh - -systemctl enable create_ap -echo_green "Installing ratos hotspot tool ... DONE!" \ No newline at end of file From f2713cb4c8f50b984043431a7b48d96432d6e81c Mon Sep 17 00:00:00 2001 From: Alexey Sychev Date: Sun, 15 Sep 2024 16:56:19 +0200 Subject: [PATCH 2/5] set BASE_ARCH --- config/armbian/CB1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/armbian/CB1 b/config/armbian/CB1 index c75e4b13b..4b19774cc 100644 --- a/config/armbian/CB1 +++ b/config/armbian/CB1 @@ -2,6 +2,8 @@ # Shebang for better file detection # shellcheck enable=require-variable-braces +BASE_ARCH=armv7l + # Image source DOWNLOAD_URL_CHECKSUM="${DOWNLOAD_BASE_URL}/armbian-bigtreetech_cb1_bookworm.img.sha256" DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/armbian-bigtreetech_cb1_bookworm.img.xz" From dd4877d087012bd8abce43e0deb93fef3311fab2 Mon Sep 17 00:00:00 2001 From: Alexey Sychev Date: Sun, 15 Sep 2024 17:00:20 +0200 Subject: [PATCH 3/5] BASE_ARCH arm64 --- config/armbian/CB1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/armbian/CB1 b/config/armbian/CB1 index 4b19774cc..ef4072444 100644 --- a/config/armbian/CB1 +++ b/config/armbian/CB1 @@ -2,7 +2,7 @@ # Shebang for better file detection # shellcheck enable=require-variable-braces -BASE_ARCH=armv7l +BASE_ARCH=armv64 # Image source DOWNLOAD_URL_CHECKSUM="${DOWNLOAD_BASE_URL}/armbian-bigtreetech_cb1_bookworm.img.sha256" From 50ed2d470a5cbac1e11237243c893b5ffcd5e839 Mon Sep 17 00:00:00 2001 From: Alexey Sychev Date: Sun, 15 Sep 2024 18:41:48 +0200 Subject: [PATCH 4/5] debug --- .github/workflows/BuildImages.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/BuildImages.yml b/.github/workflows/BuildImages.yml index ee29103f7..46d9828a4 100644 --- a/.github/workflows/BuildImages.yml +++ b/.github/workflows/BuildImages.yml @@ -81,8 +81,12 @@ jobs: sudo chown -R $USER:$USER $WORKSPACE/repository/src/workspace || true sudo chmod 0775 -R $WORKSPACE/repository/src/workspace || true + ls -la repository/src/workspace/ + mv repository/src/workspace/*.img $IMAGE.img + ls -la + echo "image=${IMAGE}" >> $GITHUB_OUTPUT - name: Upload failed Logfile From 789f79efa14cab8dfd5a52d407568044efcd478d Mon Sep 17 00:00:00 2001 From: Alexey Sychev Date: Sun, 15 Sep 2024 19:08:46 +0200 Subject: [PATCH 5/5] back to bullseye --- config/armbian/CB1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/armbian/CB1 b/config/armbian/CB1 index ef4072444..876a0f33d 100644 --- a/config/armbian/CB1 +++ b/config/armbian/CB1 @@ -5,8 +5,8 @@ BASE_ARCH=armv64 # Image source -DOWNLOAD_URL_CHECKSUM="${DOWNLOAD_BASE_URL}/armbian-bigtreetech_cb1_bookworm.img.sha256" -DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/armbian-bigtreetech_cb1_bookworm.img.xz" +DOWNLOAD_URL_CHECKSUM="${DOWNLOAD_BASE_URL}/armbian-bigtreetech_cb1_bullseye.img.sha256" +DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/armbian-bigtreetech_cb1_bullseye.img.xz" # export Variables export BASE_ARCH