From be633f2a15b1353142f1340ad09a6323d0c6b2b2 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 15 Mar 2023 18:16:38 +0100 Subject: [PATCH 1/9] feat: add radxa rockpi4se and cm3 Signed-off-by: Stephan Wendel --- config/armbian/rock_cm3 | 14 +++++++++ config/armbian/rockpi4se | 14 +++++++++ .../armbian_pkgupgrade/start_chroot_script | 29 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 config/armbian/rock_cm3 create mode 100644 config/armbian/rockpi4se diff --git a/config/armbian/rock_cm3 b/config/armbian/rock_cm3 new file mode 100644 index 000000000..843ddfd99 --- /dev/null +++ b/config/armbian/rock_cm3 @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Shebang for better file detection +# shellcheck enable=require-variable-braces + +BASE_ARCH="arm64" + +# Image source +DOWNLOAD_URL_CHECKSUM="${DOWNLOAD_BASE_URL}/armbian-rock_cm3.img.xz.sha256" +DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/armbian-rock_cm3.img.xz" + +# export Variables +export BASE_ARCH +export DOWNLOAD_URL_CHECKSUM +export DOWNLOAD_URL_IMAGE diff --git a/config/armbian/rockpi4se b/config/armbian/rockpi4se new file mode 100644 index 000000000..cccc17fee --- /dev/null +++ b/config/armbian/rockpi4se @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Shebang for better file detection +# shellcheck enable=require-variable-braces + +BASE_ARCH="arm64" + +# Image source +DOWNLOAD_URL_CHECKSUM="${DOWNLOAD_BASE_URL}/armbian-rock_pi_4se.img.xz.sha256" +DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/armbian-rock_pi_4se.img.xz" + +# export Variables +export BASE_ARCH +export DOWNLOAD_URL_CHECKSUM +export DOWNLOAD_URL_IMAGE diff --git a/src/modules/armbian_pkgupgrade/start_chroot_script b/src/modules/armbian_pkgupgrade/start_chroot_script index 7090d0e5d..54c711f2d 100644 --- a/src/modules/armbian_pkgupgrade/start_chroot_script +++ b/src/modules/armbian_pkgupgrade/start_chroot_script @@ -57,6 +57,21 @@ if [[ "$(is_board_type)" == "orangepi4-lts" ]]; then echo "linux-dtb-current-rockchip64 hold" | dpkg --set-selections fi + +### Rock Pi 4 SE +if [[ "$(is_board_type)" == "rockpi-4b" ]]; then + echo "armbian-firmware hold" | dpkg --set-selections + echo "linux-image-current-rockchip64 hold" | dpkg --set-selections + echo "linux-dtb-current-rockchip64 hold" | dpkg --set-selections +fi + +### Rock CM3 +if [[ "$(is_board_type)" == "rock-3a" ]]; then + echo "armbian-firmware hold" | dpkg --set-selections + echo "linux-image-edge-rk35xx hold" | dpkg --set-selections + echo "linux-dtb-edge-rk35xx hold" | dpkg --set-selections +fi + ## Run full upgrade apt-get upgrade --yes --assume-yes @@ -75,4 +90,18 @@ if [[ "$(is_board_type)" == "orangepi4-lts" ]]; then echo "linux-dtb-current-rockchip64 install" | dpkg --set-selections fi +### Rock Pi 4 SE +if [[ "$(is_board_type)" == "rockpi-4b" ]]; then + echo "armbian-firmware install" | dpkg --set-selections + echo "linux-image-current-rockchip64 install" | dpkg --set-selections + echo "linux-dtb-current-rockchip64 install" | dpkg --set-selections +fi + +### Rock CM3 +if [[ "$(is_board_type)" == "rock-3a" ]]; then + echo "armbian-firmware install" | dpkg --set-selections + echo "linux-image-edge-rk35xx install" | dpkg --set-selections + echo "linux-dtb-edge-rk35xx install" | dpkg --set-selections +fi + unset DEBIAN_FRONTEND From 50284f17315dbcafa2ddbbc5768fbea4e53a4b23 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 15 Mar 2023 19:38:37 +0100 Subject: [PATCH 2/9] feat: enable SPI1 bus on RockPi4 Signed-off-by: Stephan Wendel --- src/modules/armbian/start_chroot_script | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/modules/armbian/start_chroot_script b/src/modules/armbian/start_chroot_script index fa4744f51..86a8b5eb4 100644 --- a/src/modules/armbian/start_chroot_script +++ b/src/modules/armbian/start_chroot_script @@ -104,7 +104,7 @@ fi ## END ## Step 7: Enable SPI interface by default -echo_green "Enable SPI interface on Orange Pi SBC's ..." +echo_green "Enable SPI interface on ..." ### Substep 1: Copy default config to backup file cp "${ARMBIAN_CONFIG_TXT_FILE}" "${ARMBIAN_CONFIG_BAK_FILE}" @@ -113,19 +113,28 @@ cp "${ARMBIAN_CONFIG_TXT_FILE}" "${ARMBIAN_CONFIG_BAK_FILE}" ### Substep 2: Enable SPI in armbianEnv.txt depending on device #### OrangePi 3 LTS if [[ "$(is_board_type)" == "orangepi3-lts" ]]; then + ARMBIAN_BOARD_TYPE="Orange Pi 3 LTS" echo "overlays=spi-spidev1" >> "${ARMBIAN_CONFIG_TXT_FILE}" + echo "spi-dev" >> "${ARMBIAN_MODULES_FILE}" fi #### OrangePi 4 LTS if [[ "$(is_board_type)" == "orangepi4-lts" ]]; then + ARMBIAN_BOARD_TYPE="Orange Pi 4 LTS" echo "overlays=spi-spidev" >> "${ARMBIAN_CONFIG_TXT_FILE}" echo "param_spidev_spi_bus=1" >> "${ARMBIAN_CONFIG_TXT_FILE}" + echo "spi-dev" >> "${ARMBIAN_MODULES_FILE}" fi -### END Substep 2: -### Substep 3: add spi-dev module to /etc/modules -echo "spi-dev" >> "${ARMBIAN_MODULES_FILE}" -### END Substep 3 +#### Radxa Rock Pi 4 SE (probably other Rock Pi 4 models does work also) +#### "NOTE: Will not work with soldered on SPI Flash !!!" +if [[ "$(is_board_type)" == "rockpi-4b" ]]; then + ARMBIAN_BOARD_TYPE="Orange Pi 4 LTS" + echo "overlays=spi-spidev" >> "${ARMBIAN_CONFIG_TXT_FILE}" + echo "param_spidev_spi_bus=1" >> "${ARMBIAN_CONFIG_TXT_FILE}" + echo "spi-dev" >> "${ARMBIAN_MODULES_FILE}" +fi -echo_green "Enable SPI interface on Orange Pi SBC's ... DONE!" +### END Substep 2 +echo_green "Enabled SPI interface on ${ARMBIAN_BOARD_TYPE} ... DONE!" ## END From 337101785ab6a3d9337f75174af237ccd22fea04 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 15 Mar 2023 20:15:13 +0100 Subject: [PATCH 3/9] feat: install rsetup on rock pi's Signed-off-by: Stephan Wendel --- src/modules/armbian/config | 4 ++++ src/modules/armbian/start_chroot_script | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/modules/armbian/config b/src/modules/armbian/config index c36fa8a01..65cdc14a2 100644 --- a/src/modules/armbian/config +++ b/src/modules/armbian/config @@ -16,3 +16,7 @@ bash-completion" [[ -n "$ARMBIAN_CONFIG_TXT_FILE" ]] || ARMBIAN_CONFIG_TXT_FILE="/boot/armbianEnv.txt" [[ -n "$ARMBIAN_CONFIG_BAK_FILE" ]] || ARMBIAN_CONFIG_BAK_FILE="/boot/armbianEnv.txt.backup" [[ -n "$ARMBIAN_MODULES_FILE" ]] || ARMBIAN_MODULES_FILE="/etc/modules" + + +## Radxa rsetup deb package +[[ -n "$ARMBIAN_RADXA_RSETUP_PKG" ]] || ARMBIAN_RADXA_RSETUP_PKG="https://github.com/radxa-pkg/rsetup/releases/download/0.3.12/rsetup_0.3.12_all.deb" diff --git a/src/modules/armbian/start_chroot_script b/src/modules/armbian/start_chroot_script index 86a8b5eb4..57e141049 100644 --- a/src/modules/armbian/start_chroot_script +++ b/src/modules/armbian/start_chroot_script @@ -138,3 +138,16 @@ fi ### END Substep 2 echo_green "Enabled SPI interface on ${ARMBIAN_BOARD_TYPE} ... DONE!" ## END + + +## Step 8: Install rsetup on Rock Pis/CM +if [[ "$(is_board_type)" =~ "rock" ]]; then + pushd "/home/${BASE_USER}" &> /dev/null || exit 1 + mkdir rsetup-tmp + pushd "/home/${BASE_USER}/rsetup-tmp" &> /dev/null || exit 1 + wget -q --show-progress "${ARMBIAN_RADXA_RSETUP_PKG}" + sudo dpkg -i rsetup_*_all.deb + popd &> /dev/null || exit 1 + rm -rf rsetup-tmp + popd &> /dev/null || exit 1 +fi From f604f7bf1b0014714dbf5280f74cb2450e03995d Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 15 Mar 2023 20:33:29 +0100 Subject: [PATCH 4/9] fix: fix install rsetup Signed-off-by: Stephan Wendel --- src/modules/armbian/config | 1 + src/modules/armbian/start_chroot_script | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/modules/armbian/config b/src/modules/armbian/config index 65cdc14a2..0df5bcffb 100644 --- a/src/modules/armbian/config +++ b/src/modules/armbian/config @@ -20,3 +20,4 @@ bash-completion" ## Radxa rsetup deb package [[ -n "$ARMBIAN_RADXA_RSETUP_PKG" ]] || ARMBIAN_RADXA_RSETUP_PKG="https://github.com/radxa-pkg/rsetup/releases/download/0.3.12/rsetup_0.3.12_all.deb" +[[ -n "$ARMBIAN_RADXA_RSETUP_PKG_DEPS" ]] || ARMBIAN_RADXA_RSETUP_PKG_DEPS="gdisk yq" diff --git a/src/modules/armbian/start_chroot_script b/src/modules/armbian/start_chroot_script index 57e141049..4c2af788e 100644 --- a/src/modules/armbian/start_chroot_script +++ b/src/modules/armbian/start_chroot_script @@ -142,12 +142,17 @@ echo_green "Enabled SPI interface on ${ARMBIAN_BOARD_TYPE} ... DONE!" ## Step 8: Install rsetup on Rock Pis/CM if [[ "$(is_board_type)" =~ "rock" ]]; then + echo_green "Installing Radxa 'rsetup' ..." pushd "/home/${BASE_USER}" &> /dev/null || exit 1 mkdir rsetup-tmp pushd "/home/${BASE_USER}/rsetup-tmp" &> /dev/null || exit 1 wget -q --show-progress "${ARMBIAN_RADXA_RSETUP_PKG}" + # shellcheck disable=SC2086 + # We need word spliiting here + apt-get install ${ARMBIAN_RADXA_RSETUP_PKG_DEPS} sudo dpkg -i rsetup_*_all.deb popd &> /dev/null || exit 1 rm -rf rsetup-tmp popd &> /dev/null || exit 1 fi +## END Step 8 From e9df364c7d60d6fb092edcddc730395ec627b447 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 15 Mar 2023 21:06:48 +0100 Subject: [PATCH 5/9] chore: wip Signed-off-by: Stephan Wendel --- src/modules/armbian/start_chroot_script | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/armbian/start_chroot_script b/src/modules/armbian/start_chroot_script index 4c2af788e..0e6b7a203 100644 --- a/src/modules/armbian/start_chroot_script +++ b/src/modules/armbian/start_chroot_script @@ -104,7 +104,7 @@ fi ## END ## Step 7: Enable SPI interface by default -echo_green "Enable SPI interface on ..." +echo_green "Trying to enable SPI interface ..." ### Substep 1: Copy default config to backup file cp "${ARMBIAN_CONFIG_TXT_FILE}" "${ARMBIAN_CONFIG_BAK_FILE}" @@ -129,14 +129,16 @@ fi #### Radxa Rock Pi 4 SE (probably other Rock Pi 4 models does work also) #### "NOTE: Will not work with soldered on SPI Flash !!!" if [[ "$(is_board_type)" == "rockpi-4b" ]]; then - ARMBIAN_BOARD_TYPE="Orange Pi 4 LTS" + ARMBIAN_BOARD_TYPE="Radxa RockPi 4" echo "overlays=spi-spidev" >> "${ARMBIAN_CONFIG_TXT_FILE}" echo "param_spidev_spi_bus=1" >> "${ARMBIAN_CONFIG_TXT_FILE}" echo "spi-dev" >> "${ARMBIAN_MODULES_FILE}" fi ### END Substep 2 -echo_green "Enabled SPI interface on ${ARMBIAN_BOARD_TYPE} ... DONE!" +if [[ -n "${ARMBIAN_BOARD_TYPE}" ]]; then + echo_green "Enabled SPI interface on ${ARMBIAN_BOARD_TYPE} ... DONE!" +fi ## END From 884ba04f31d86f9ccf0aa204f3b348d226b956ba Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 15 Mar 2023 21:28:27 +0100 Subject: [PATCH 6/9] fix: fix build error due missing yq package Signed-off-by: Stephan Wendel --- src/modules/armbian/config | 2 ++ src/modules/armbian/start_chroot_script | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/modules/armbian/config b/src/modules/armbian/config index 0df5bcffb..7ea551f28 100644 --- a/src/modules/armbian/config +++ b/src/modules/armbian/config @@ -21,3 +21,5 @@ bash-completion" ## Radxa rsetup deb package [[ -n "$ARMBIAN_RADXA_RSETUP_PKG" ]] || ARMBIAN_RADXA_RSETUP_PKG="https://github.com/radxa-pkg/rsetup/releases/download/0.3.12/rsetup_0.3.12_all.deb" [[ -n "$ARMBIAN_RADXA_RSETUP_PKG_DEPS" ]] || ARMBIAN_RADXA_RSETUP_PKG_DEPS="gdisk yq" +#### https://github.com/radxa-pkg/yq needed for rsetup (yaml parser) +[[ -n "$ARMBIAN_RADXA_DEP_YQ" ]] || ARMBIAN_RADXA_DEP_YQ="https://github.com/radxa-pkg/yq/releases/download/4.30.5/yq_4.30.5_arm64.deb" diff --git a/src/modules/armbian/start_chroot_script b/src/modules/armbian/start_chroot_script index 0e6b7a203..4d93547b4 100644 --- a/src/modules/armbian/start_chroot_script +++ b/src/modules/armbian/start_chroot_script @@ -149,6 +149,8 @@ if [[ "$(is_board_type)" =~ "rock" ]]; then mkdir rsetup-tmp pushd "/home/${BASE_USER}/rsetup-tmp" &> /dev/null || exit 1 wget -q --show-progress "${ARMBIAN_RADXA_RSETUP_PKG}" + wget -q --show-progress "${ARMBIAN_RADXA_DEP_YQ}" + sudo dpkg -i "yq_4.30.5_arm64.deb" # shellcheck disable=SC2086 # We need word spliiting here apt-get install ${ARMBIAN_RADXA_RSETUP_PKG_DEPS} From a50a6784f77877eec81e5c812e23beab91f2d791 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 15 Mar 2023 21:46:47 +0100 Subject: [PATCH 7/9] fix: fix syntax error in apt-get command Signed-off-by: Stephan Wendel --- src/modules/armbian/start_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/armbian/start_chroot_script b/src/modules/armbian/start_chroot_script index 4d93547b4..a953806b4 100644 --- a/src/modules/armbian/start_chroot_script +++ b/src/modules/armbian/start_chroot_script @@ -153,7 +153,7 @@ if [[ "$(is_board_type)" =~ "rock" ]]; then sudo dpkg -i "yq_4.30.5_arm64.deb" # shellcheck disable=SC2086 # We need word spliiting here - apt-get install ${ARMBIAN_RADXA_RSETUP_PKG_DEPS} + apt-get install --yes --no-install-recommends ${ARMBIAN_RADXA_RSETUP_PKG_DEPS} sudo dpkg -i rsetup_*_all.deb popd &> /dev/null || exit 1 rm -rf rsetup-tmp From 3b61a1f1b241f7bcb17290f627355c9731f5a5f1 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Thu, 16 Mar 2023 18:41:23 +0100 Subject: [PATCH 8/9] refactor!: remove rsetup from rock images In current state unusable in armbian BREAKING CHANGE: rsetup no longer available Signed-off-by: Stephan Wendel --- src/modules/armbian/start_chroot_script | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/modules/armbian/start_chroot_script b/src/modules/armbian/start_chroot_script index a953806b4..e9cc9d091 100644 --- a/src/modules/armbian/start_chroot_script +++ b/src/modules/armbian/start_chroot_script @@ -139,24 +139,4 @@ fi if [[ -n "${ARMBIAN_BOARD_TYPE}" ]]; then echo_green "Enabled SPI interface on ${ARMBIAN_BOARD_TYPE} ... DONE!" fi -## END - - -## Step 8: Install rsetup on Rock Pis/CM -if [[ "$(is_board_type)" =~ "rock" ]]; then - echo_green "Installing Radxa 'rsetup' ..." - pushd "/home/${BASE_USER}" &> /dev/null || exit 1 - mkdir rsetup-tmp - pushd "/home/${BASE_USER}/rsetup-tmp" &> /dev/null || exit 1 - wget -q --show-progress "${ARMBIAN_RADXA_RSETUP_PKG}" - wget -q --show-progress "${ARMBIAN_RADXA_DEP_YQ}" - sudo dpkg -i "yq_4.30.5_arm64.deb" - # shellcheck disable=SC2086 - # We need word spliiting here - apt-get install --yes --no-install-recommends ${ARMBIAN_RADXA_RSETUP_PKG_DEPS} - sudo dpkg -i rsetup_*_all.deb - popd &> /dev/null || exit 1 - rm -rf rsetup-tmp - popd &> /dev/null || exit 1 -fi -## END Step 8 +## END Step 7 From 00c514644ba45001f3c6759e34138c16ba9dbcc0 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Thu, 23 Mar 2023 18:34:59 +0100 Subject: [PATCH 9/9] refactor!: remove radxa cm3 config BREAKING CHANGE: Removes Radxa CM3 configuration Will be added seperatly. Need a bunch mor testing then expected. Signed-off-by: Stephan Wendel --- config/armbian/rock_cm3 | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 config/armbian/rock_cm3 diff --git a/config/armbian/rock_cm3 b/config/armbian/rock_cm3 deleted file mode 100644 index 843ddfd99..000000000 --- a/config/armbian/rock_cm3 +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -# Shebang for better file detection -# shellcheck enable=require-variable-braces - -BASE_ARCH="arm64" - -# Image source -DOWNLOAD_URL_CHECKSUM="${DOWNLOAD_BASE_URL}/armbian-rock_cm3.img.xz.sha256" -DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/armbian-rock_cm3.img.xz" - -# export Variables -export BASE_ARCH -export DOWNLOAD_URL_CHECKSUM -export DOWNLOAD_URL_IMAGE