Skip to content
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Repository for ready-to-use Debian-based [evcc](https://evcc.io) images for popu
| [Raspberry Pi 4](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/) | ✅ | Built-in | SD only | [`rpi4b`](https://github.com/evcc-io/images/releases) | see above |
| [Raspberry Pi 3b](https://www.raspberrypi.com/products/raspberry-pi-3-model-b/) | ✅ | Built-in | SD only | [`rpi4b`](https://github.com/evcc-io/images/releases) | see above |
| [Raspberry Pi Zero 2 W](https://www.raspberrypi.com/products/raspberry-pi-zero-2-w/) | ✅ | Built-in | SD only | [`rpi4b`](https://github.com/evcc-io/images/releases) | see above |
| [OpenWB series2 standard/Duo](https://openwb.de/main/?page_id=161) | ✅ | Built-in | SD only | [`openwb`](https://github.com/evcc-io/images/releases) | see above |
| [OpenWB series2 standard/Duo+](https://openwb.de/main/?page_id=161) | ✅ | Built-in | SD only | [`openwb-display`](https://github.com/evcc-io/images/releases) | see above |
| [NanoPi R3S](https://www.friendlyelec.com/index.php?route=product/product&product_id=311) | ✅ | via USB | eMMC & SD | [`nanopi-r3s`](https://github.com/evcc-io/images/releases) | see above, [then copy to eMMC](https://docs.armbian.com/User-Guide_Getting-Started/#installation) |

✅ tested<br/>
Expand Down
10 changes: 6 additions & 4 deletions build-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ Examples:
./build-local.sh --board nanopi-r3s

Supported boards:
- rpi4b Raspberry Pi 4B
- nanopi-r3s NanoPi R3S
- rpi4b Raspberry Pi 4B
- nanopi-r3s NanoPi R3S
- openwb OpenWB without display
- openwb-display OpenWB with display

EOF
}
Expand Down Expand Up @@ -57,12 +59,12 @@ check_requirements() {

validate_board() {
case "$BOARD" in
rpi4b|nanopi-r3s)
rpi4b|nanopi-r3s|openwb|openwb-display)
echo "✅ Board '$BOARD' is supported"
;;
*)
echo "❌ Unsupported board: '$BOARD'"
echo "Supported boards: rpi4b, nanopi-r3s"
echo "Supported boards: rpi4b, nanopi-r3s, openwb, openwb-display"
exit 1
;;
esac
Expand Down
39 changes: 17 additions & 22 deletions scripts/build-armbian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ REPO_ROOT=$(cd -- "${SCRIPT_DIR}/.." && pwd)
BOARD=""
HOSTNAME="evcc"
RELEASE_NAME="local"
OPENWB_DISPLAY="false"

usage() {
cat <<EOF
Expand All @@ -20,7 +21,7 @@ Examples:
$0 --board rpi4b
$0 --board nanopi-r3s --release-name 2025-01

Supported boards are those supported by Armbian mainline (e.g. rpi4b, nanopi-r3s).
Supported boards are those supported by Armbian mainline (e.g. rpi4b, nanopi-r3s, openwb, openwb-display).
EOF
}

Expand Down Expand Up @@ -52,12 +53,21 @@ cleanup() {
fi
}
trap cleanup EXIT
mkdir -p "$BUILDTMP/userpatches/overlay/etc"
mkdir -p "$BUILDTMP/userpatches/overlay/"

if [[ "$BOARD" =~ ^openwb.* ]]; then
OPENWB="true"
fi

if [[ "$BOARD" == "openwb-display" ]]; then
OPENWB_DISPLAY="true"
fi

# Exported to the chroot via /etc/evcc-image.env
cat >"$BUILDTMP/userpatches/overlay/etc/evcc-image.env" <<ENV
# Exported to the chroot via /tmp/overlay/evcc-image.env
cat >"$BUILDTMP/userpatches/overlay/evcc-image.env" <<ENV
EVCC_HOSTNAME=${HOSTNAME}
OPENWB=${OPENWB}
OPENWB_DISPLAY=${OPENWB_DISPLAY}
ENV

# Copy our customize script and auxiliary files
Expand All @@ -74,7 +84,7 @@ if [[ "$(uname)" == "Darwin" ]]; then
else
BUILD_DIR="$BUILDTMP/build"
fi
git clone --depth=1 --branch v25.8.1 https://github.com/armbian/build.git "$BUILD_DIR"
git clone --depth=1 --branch v25.8.2 https://github.com/armbian/build.git "$BUILD_DIR"

# Place our userpatches into the build tree
rm -rf "$BUILD_DIR/userpatches"
Expand All @@ -87,22 +97,7 @@ echo "Removing problematic rkvdec patches..."
find "$BUILD_DIR/patch" -name "*general-v4l2-rkvdec*" -type f -exec rm -v {} \; 2>/dev/null || true

pushd "$BUILD_DIR" >/dev/null
EXPERT=yes \
SKIP_LOG_ARCHIVE=yes \
SHARE_LOG=yes \
USE_TORRENT=no \
OFFLINE_WORK=no \
VENDOR="evcc" \
VENDORURL="https://evcc.io" \
IMAGE_SUFFIX="evcc-${RELEASE_NAME}" \
./compile.sh \
BOARD="$BOARD" \
BRANCH=current \
RELEASE="bookworm" \
BUILD_MINIMAL=no \
BUILD_DESKTOP=no \
KERNEL_CONFIGURE=no \
COMPRESS_OUTPUTIMAGE=sha,zip
./compile.sh $BOARD
popd >/dev/null

# Copy results to output directory
Expand All @@ -114,7 +109,7 @@ fi

# Rename outputs to armbian_evcc-[release-name]_[board].img[...]
shopt -s nullglob
for f in "$IMAGE_OUT_DIR"/Armbian-*; do
for f in "$IMAGE_OUT_DIR"/evcc_*; do
base_ext="${f##*.}"
if [[ "$f" == *.img ]]; then
mv -f "$f" "$IMAGE_OUT_DIR/armbian_evcc-${RELEASE_NAME}_${BOARD}.img"
Expand Down
21 changes: 21 additions & 0 deletions userpatches/common-evcc.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export EXPERT=yes
export SKIP_LOG_ARCHIVE=yes
export SHARE_LOG=no
export USE_TORRENT=no
export OFFLINE_WORK=no
export VENDOR="evcc"
export VENDORURL="https://evcc.io"
export VENDORSUPPORT="https://github.com/evcc-io/evcc/discussions"
export BRANCH=current
export RELEASE="trixie"
export BUILD_MINIMAL=no
export BUILD_DESKTOP=no
export KERNEL_CONFIGURE=no
export COMPRESS_OUTPUTIMAGE=sha,zip
export INCLUDE_HOME_DIR=yes
export CONSOLE_AUTOLOGIN=no
export MAINTAINER="Michael Geers"
export MAINTAINERMAIL="[email protected]"

# Use build host DNS server inside chroot instead of default 1.0.0.1
NAMESERVER=$(grep nameserver /etc/resolv.conf|awk '{ print $2 }'| head -n 1)
3 changes: 3 additions & 0 deletions userpatches/config-nanopi-r3s.conf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source common-evcc.conf

export BOARD=nanopi-r3s
3 changes: 3 additions & 0 deletions userpatches/config-openwb-display.conf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source config-openwb.conf.sh

export EXTRA_IMAGE_SUFFIXES+=("-display")
11 changes: 11 additions & 0 deletions userpatches/config-openwb.conf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source config-rpi4b.conf.sh

export EXTRA_IMAGE_SUFFIXES+=("-openwb")

function pre_umount_final_image__900_append_to_raspi_config() {
cat <<- EOD >> "${MOUNT}"/boot/firmware/config.txt
[all]
gpio=4,5,7,11,17,22,23,24,25,26,27=op,dl
gpio=6,8,9,10,12,13,16,21=ip,pu
EOD
}
3 changes: 3 additions & 0 deletions userpatches/config-rpi4b.conf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source common-evcc.conf

export BOARD=rpi4b
Loading