Skip to content

Commit

Permalink
Orangepi Zero3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
meganukebmp committed Oct 28, 2023
1 parent 544b9c6 commit 9644890
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
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="1"
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="1"
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

0 comments on commit 9644890

Please sign in to comment.