Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add radxa rockpi4se and cm3 #208

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
14 changes: 14 additions & 0 deletions config/armbian/rockpi4se
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions src/modules/armbian/config
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ 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"
[[ -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"
25 changes: 18 additions & 7 deletions src/modules/armbian/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -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 "Trying to enable SPI interface ..."

### Substep 1: Copy default config to backup file
cp "${ARMBIAN_CONFIG_TXT_FILE}" "${ARMBIAN_CONFIG_BAK_FILE}"
Expand All @@ -113,19 +113,30 @@ 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="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

echo_green "Enable SPI interface on Orange Pi SBC's ... DONE!"
## END
### END Substep 2
if [[ -n "${ARMBIAN_BOARD_TYPE}" ]]; then
echo_green "Enabled SPI interface on ${ARMBIAN_BOARD_TYPE} ... DONE!"
fi
## END Step 7