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

Orangepizero3 support #249

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions config/orangepi/default
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ BASE_USER_PASSWORD="armbian"
BASE_DISTRO="armbian"
BASE_IMAGE_RASPBIAN="no"

# partition resizing
BASE_ROOT_PARTITION="2"
BASE_IMAGE_ENLARGEROOT=2500
BASE_IMAGE_RESIZEROOT=600
# Compress not needed due compression done in workflow
BASE_RELEASE_COMPRESS=no
# Modules are valid for 32bit and 64bit images
Expand All @@ -32,8 +28,5 @@ export BASE_USER
export BASE_USER_PASSWORD
export BASE_DISTRO
export BASE_IMAGE_RASPBIAN
export BASE_ROOT_PARTITION
export BASE_IMAGE_ENLARGEROOT
export BASE_IMAGE_RESIZEROOT
export BASE_RELEASE_COMPRESS
export MODULES
8 changes: 8 additions & 0 deletions config/orangepi/orangepi_zero2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ BASE_ARCH="arm64"
DOWNLOAD_URL_CHECKSUM="${DOWNLOAD_BASE_URL}/orangepi-orangepi_zero2_bullseye.img.xz.sha256"
DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/orangepi-orangepi_zero2_bullseye.img.xz"

# partition resizing
BASE_ROOT_PARTITION="2"
BASE_IMAGE_ENLARGEROOT=2500
BASE_IMAGE_RESIZEROOT=600

# export Variables
export BASE_ARCH
export DOWNLOAD_URL_CHECKSUM
export DOWNLOAD_URL_IMAGE
export BASE_ROOT_PARTITION
export BASE_IMAGE_ENLARGEROOT
export BASE_IMAGE_RESIZEROOT
22 changes: 22 additions & 0 deletions config/orangepi/orangepi_zero3_1500mb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/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}/orangepi-orangepi_zero3_1500mb_bullseye.img.xz.sha256"
DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/orangepi-orangepi_zero3_1500mb_bullseye.img.xz"

# partition resizing
BASE_ROOT_PARTITION="2"
BASE_IMAGE_ENLARGEROOT=2500
BASE_IMAGE_RESIZEROOT=600

# export Variables
export BASE_ARCH
export DOWNLOAD_URL_CHECKSUM
export DOWNLOAD_URL_IMAGE
export BASE_ROOT_PARTITION
export BASE_IMAGE_ENLARGEROOT
export BASE_IMAGE_RESIZEROOT
22 changes: 22 additions & 0 deletions config/orangepi/orangepi_zero3_others
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/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}/orangepi-orangepi_zero3_others_bullseye.img.xz.sha256"
DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/orangepi-orangepi_zero3_others_bullseye.img.xz"

# partition resizing
BASE_ROOT_PARTITION="2"
BASE_IMAGE_ENLARGEROOT=2500
BASE_IMAGE_RESIZEROOT=600

# export Variables
export BASE_ARCH
export DOWNLOAD_URL_CHECKSUM
export DOWNLOAD_URL_IMAGE
export BASE_ROOT_PARTITION
export BASE_IMAGE_ENLARGEROOT
export BASE_IMAGE_RESIZEROOT
7 changes: 7 additions & 0 deletions src/modules/orangepi/config
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ bash-completion"
[[ -n "$ORANGEPI_ADD_OVERLAYS_OPIZ2" ]] || ORANGEPI_ADD_OVERLAYS_OPIZ2="i2c3 uart5 spi-spidev"
[[ -n "$ORANGEPI_ADD_OVERLAYS_OPIZ2_PARAMS" ]] || ORANGEPI_ADD_OVERLAYS_OPIZ2_PARAMS="param_spidev_spi_bus=1 param_spidev_spi_cs=1"

## Orange Pi Zero 3 additional configuration
[[ -n "$ORANGEPI_ENABLE_OVERLAYS_OPIZ3" ]] || ORANGEPI_ENABLE_OVERLAYS_OPIZ3="true"
# cs1 is PH9 for SPI1
# cs0 is PH5 for SPI1
[[ -n "$ORANGEPI_ADD_OVERLAYS_OPIZ3" ]] || ORANGEPI_ADD_OVERLAYS_OPIZ3="ph-i2c3 ph-uart5 spi1-cs1-spidev"
[[ -n "$ORANGEPI_ADD_OVERLAYS_OPIZ3_PARAMS" ]] || ORANGEPI_ADD_OVERLAYS_OPIZ3_PARAMS=""

## Disable Autologin on gettys
[[ -n "$ORANGEPI_DISABLE_GETTY_AUTOLOGIN" ]] || ORANGEPI_DISABLE_GETTY_AUTOLOGIN="1"

Expand Down
18 changes: 18 additions & 0 deletions src/modules/orangepi/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,24 @@ if [[ "$(is_board_type)" == "orangepizero2" ]] &&
fi
#### END

#### Orangepi Zero3
if [[ "$(is_board_type)" == "orangepizero3" ]] &&
[[ "${ORANGEPI_ENABLE_OVERLAYS_OPIZ3}" == "true" ]]; then

if [[ -n "${ORANGEPI_ADD_OVERLAYS_OPIZ3}" ]]; then
echo_green "Adding overlays '${ORANGEPI_ADD_OVERLAYS_OPIZ3}' to ${ORANGEPI_CONFIG_TXT_FILE} ..."
echo "overlays=${ORANGEPI_ADD_OVERLAYS_OPIZ3}" >> "${ORANGEPI_CONFIG_TXT_FILE}"
fi

if [[ -n "${ORANGEPI_ADD_OVERLAYS_OPIZ3_PARAMS}" ]]; then
for param in ${ORANGEPI_ADD_OVERLAYS_OPIZ3_PARAMS}; do
echo_green "Add ${param} to ${ORANGEPI_CONFIG_TXT_FILE} ..."
echo "${param}" >> "${ORANGEPI_CONFIG_TXT_FILE}"
done
fi
fi
#### END

### END Substep 2

# Substep 3: add spi-dev module to /etc/modules
Expand Down