Skip to content

Commit 60d1e23

Browse files
committed
armbian: replace prebuilt deb downloads with Seeed APT repo installs
Replace manual prebuilt deb downloads and source compilation with apt-get install from the Seeed APT repository hosted on GitHub Pages. This applies to all Seeed packages across RK3576 and RK3588 boards: - fcs960k-aic-bluez, usbdevice-gadget, morse tools (common) - camera-engine-rkaiq-rk3576 (RK3576) - libmali-g610, camera-engine-rkaiq-rk3588, realtek-r8125-dkms (RK3588) Use chroot_sdcard instead of chroot_sdcard_apt_get_install to avoid the framework's bind-mounted apt lists cache overwriting the Seeed repo index. Extract seeed_recomputer_install_from_apt() helper to centralize the add-repo/install/remove cycle.
1 parent 12ea62a commit 60d1e23

3 files changed

Lines changed: 69 additions & 123 deletions

File tree

config/boards/recomputer-rk3576-devkit.conf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ function post_family_config__recomputer_rk3576_devkit_use_seeed_bootscript() {
3030

3131
# Install camera engine rkaiq for Rockchip ISP
3232
function pre_install_distribution_specific__recomputer_rk3576_install_camera_engine() {
33-
seeed_recomputer_download_and_install_deb \
34-
"https://github.com/Seeed-Studio/seeed_armbian_extension/releases/download/v1.0/rk3576-camera-engine-rkaiq.deb" \
35-
"rk3576-camera-engine-rkaiq.deb" \
36-
"camera-engine-rkaiq"
33+
display_alert "Installing camera engine from APT repo" "camera-engine-rkaiq" "info"
34+
35+
seeed_recomputer_install_from_apt camera-engine-rkaiq-rk3576
36+
37+
display_alert "Camera engine installed successfully" "camera-engine-rkaiq" "info"
3738
}
3839

3940
# Kernel config customizations for RK3576

config/boards/recomputer-rk3588-devkit.conf

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,34 @@ function post_family_config__recomputer_rk3588_devkit_use_seeed_bootscript() {
3030

3131
# Install libmali package for RK3588 GPU userspace
3232
function pre_install_distribution_specific__recomputer_rk3588_install_libmali() {
33-
seeed_recomputer_download_and_install_deb \
34-
"https://github.com/Seeed-Studio/seeed_armbian_extension/releases/download/v1.0/libmali-valhall-g610-g13p0-x11-wayland-gbm_1.9-1_arm64.deb" \
35-
"libmali-valhall-g610-g13p0-x11-wayland-gbm_1.9-1_arm64.deb" \
36-
"libmali-g610"
33+
display_alert "Installing Mali GPU libraries from APT repo" "libmali-g610" "info"
34+
35+
seeed_recomputer_install_from_apt libmali-valhall-g610-g13p0-x11-wayland-gbm
36+
chroot_sdcard ldconfig
37+
38+
display_alert "Mali GPU libraries installed successfully" "libmali-g610" "info"
3739
}
3840

3941
# Install Realtek r8125 DKMS package
4042
function pre_install_distribution_specific__recomputer_rk3588_install_r8125_dkms() {
41-
seeed_recomputer_download_and_install_deb \
42-
"https://github.com/Seeed-Studio/seeed_armbian_extension/releases/download/v1.0/realtek-r8125-kmod_9.016.01-1_arm64.deb" \
43-
"realtek-r8125-kmod_9.016.01-1_arm64.deb" \
44-
"realtek-r8125-dkms"
43+
display_alert "Installing r8125 DKMS from APT repo" "realtek-r8125" "info"
44+
45+
seeed_recomputer_install_from_apt realtek-r8125-dkms
46+
47+
cat > "${SDCARD}/etc/modules-load.d/r8125.conf" <<- EOT
48+
r8125
49+
EOT
50+
51+
display_alert "r8125 DKMS installed successfully" "realtek-r8125" "info"
4552
}
4653

4754
# Install RK camera engine package for RK3588
4855
function pre_install_distribution_specific__recomputer_rk3588_install_camera_engine() {
49-
seeed_recomputer_download_and_install_deb \
50-
"https://github.com/Seeed-Studio/seeed_armbian_extension/releases/download/v1.0/camera_engine_rkaiq_rk3588_arm64_with_service.deb" \
51-
"camera_engine_rkaiq_rk3588_arm64_with_service.deb" \
52-
"camera-engine-rkaiq-rk3588"
56+
display_alert "Installing camera engine from APT repo" "camera-engine-rkaiq" "info"
57+
58+
seeed_recomputer_install_from_apt camera-engine-rkaiq-rk3588
59+
60+
display_alert "Camera engine installed successfully" "camera-engine-rkaiq" "info"
5361
}
5462

5563
# Kernel config customizations for RK3588

config/sources/vendors/seeed-studio/recomputer-rk35xx-common.inc

Lines changed: 44 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,38 @@
11
# Common configuration for reComputer RK3576/RK3588 DevKit
22
# Source this file from individual board configs.
33

4-
# Helper: download a deb if not cached, then install into chroot
5-
# Usage: seeed_recomputer_download_and_install_deb <url> <cache_filename> <display_name> [expected_sha256]
6-
function seeed_recomputer_download_and_install_deb() {
7-
local url="$1"
8-
local cache_filename="$2"
9-
local display_name="$3"
10-
local expected_sha256="${4:-}"
11-
12-
local deb_file="${SRC}/cache/download/${cache_filename}"
13-
mkdir -p "${SRC}/cache/download"
14-
15-
if [[ ! -f "${deb_file}" ]]; then
16-
display_alert "Downloading ${display_name}" "${url}" "info"
17-
local tmp_file="${deb_file}.tmp"
18-
if ! curl --connect-timeout 30 --retry 3 --retry-delay 5 -fsSL -o "${tmp_file}" "${url}"; then
19-
rm -f "${tmp_file}"
20-
display_alert "Failed to download ${display_name}" "${display_name}" "err"
21-
return 1
22-
fi
23-
if [[ -n "${expected_sha256}" ]]; then
24-
if ! echo "${expected_sha256} ${tmp_file}" | sha256sum -c -; then
25-
rm -f "${tmp_file}"
26-
display_alert "Checksum mismatch for ${display_name}" "${display_name}" "err"
27-
return 1
28-
fi
29-
fi
30-
mv "${tmp_file}" "${deb_file}"
31-
fi
32-
33-
install_deb_chroot "${deb_file}" "" "" ""
34-
display_alert "${display_name} installed successfully" "${display_name}" "info"
35-
}
36-
37-
# Install custom bluez package for FCS960K support
38-
function pre_install_distribution_specific__recomputer_install_custom_bluez() {
39-
seeed_recomputer_download_and_install_deb \
40-
"https://github.com/Seeed-Studio/seeed_armbian_extension/releases/download/v1.0/fcs960k-aic-bluez_5.66-1_arm64.deb" \
41-
"fcs960k-aic-bluez_5.66-1_arm64.deb" \
42-
"fcs960k-aic-bluez"
4+
# Seeed APT repository configuration
5+
SEEED_APT_REPO_URL="https://seeed-studio.github.io/seeed_armbian_extension"
6+
7+
# Helper: install packages from Seeed APT repo.
8+
# Armbian's chroot_sdcard_apt_get_install bind-mounts cached apt lists,
9+
# which overwrites the Seeed repo index. Use chroot_sdcard directly instead.
10+
# Usage: seeed_recomputer_install_from_apt <package> [<package> ...]
11+
function seeed_recomputer_install_from_apt() {
12+
(($#)) || return 0
13+
14+
cat > "${SDCARD}/etc/apt/sources.list.d/seeed.list" <<- EOF
15+
deb [trusted=yes] ${SEEED_APT_REPO_URL} stable main
16+
EOF
17+
chroot_sdcard apt-get -y -qq -o Dpkg::Use-Pty=0 update
18+
chroot_sdcard DEBIAN_FRONTEND=noninteractive apt-get -y -qq -o Dpkg::Use-Pty=0 \
19+
--no-install-recommends install "$@"
20+
rm -f "${SDCARD}/etc/apt/sources.list.d/seeed.list"
21+
chroot_sdcard apt-get -y -qq -o Dpkg::Use-Pty=0 update
4322
}
4423

45-
# Install USB gadget package
46-
function pre_install_distribution_specific__recomputer_install_usbdevice_gadget() {
47-
seeed_recomputer_download_and_install_deb \
48-
"https://github.com/Seeed-Studio/seeed_armbian_extension/releases/download/v1.0/usbdevice-gadget-rk3588_1.0.1_arm64.deb" \
49-
"usbdevice-gadget-rk3588_1.0.1_arm64.deb" \
50-
"usbdevice-gadget"
51-
}
24+
# Install Seeed common packages (bluez, USB gadget, Morse tools)
25+
function pre_install_distribution_specific__recomputer_install_seeed_packages() {
26+
display_alert "Installing Seeed packages from APT repo" "seeed-apt" "info"
5227

53-
# Install Morse Wireless tools (FGH100M support)
54-
# Uses dpkg --force-depends because hostapd/wpa-supplicant tools depend on
55-
# libssl1.1 which is not available in Noble (ships libssl3).
56-
# The tools still work at runtime against libssl3.
57-
function pre_install_distribution_specific__recomputer_install_morse_tools() {
58-
display_alert "Installing Morse wireless tools for FGH100M" "morse-tools" "info"
59-
60-
local cache_dir="${SRC}/cache/download"
61-
mkdir -p "${cache_dir}"
62-
63-
declare -A packages=(
64-
["wpa-supplicant-morse-tools"]="https://github.com/Seeed-Studio/seeed_armbian_extension/releases/download/v1.0/wpa-supplicant-morse-tools_1.0-1_arm64.deb"
65-
["morsectrl-tools"]="https://github.com/Seeed-Studio/seeed_armbian_extension/releases/download/v1.0/morsectrl-tools_1.0-1_arm64.deb"
66-
["hostapd-morse-tools"]="https://github.com/Seeed-Studio/seeed_armbian_extension/releases/download/v1.0/hostapd-morse-tools_1.0-1_arm64.deb"
67-
)
68-
69-
for pkg_name in "${!packages[@]}"; do
70-
local pkg_url="${packages[$pkg_name]}"
71-
local pkg_file="${cache_dir}/${pkg_name}_1.0-1_arm64.deb"
72-
73-
if [[ ! -f "${pkg_file}" ]]; then
74-
display_alert "Downloading ${pkg_name}" "${pkg_url}" "info"
75-
local tmp_file="${pkg_file}.tmp"
76-
if ! curl --connect-timeout 30 --retry 3 --retry-delay 5 -fsSL -o "${tmp_file}" "${pkg_url}"; then
77-
rm -f "${tmp_file}"
78-
display_alert "Failed to download ${pkg_name}" "${pkg_name}" "err"
79-
continue
80-
fi
81-
mv "${tmp_file}" "${pkg_file}"
82-
fi
83-
84-
display_alert "Installing ${pkg_name} via dpkg" "morse-tools" "info"
85-
local chroot_deb="/root/${pkg_name}_1.0-1_arm64.deb"
86-
run_host_command_logged cp -pv "${pkg_file}" "${SDCARD}${chroot_deb}"
87-
chroot_sdcard dpkg --force-depends -i "${chroot_deb}" || {
88-
display_alert "Failed to install ${pkg_name}" "morse-tools" "err"
89-
}
90-
run_host_command_logged rm -f "${SDCARD}${chroot_deb}"
91-
done
28+
seeed_recomputer_install_from_apt \
29+
fcs960k-aic-bluez \
30+
usbdevice-gadget-rk3588 \
31+
wpa-supplicant-morse-tools \
32+
morsectrl-tools \
33+
hostapd-morse-tools
9234

93-
# Fix apt state after --force-depends broke dependency tracking
94-
chroot_sdcard apt-get -y -qq -o Dpkg::Use-Pty=0 --fix-broken install || {
95-
display_alert "apt --fix-broken install failed" "morse-tools" "warn"
96-
}
97-
98-
display_alert "Morse wireless tools installed successfully" "morse-tools" "info"
35+
display_alert "Seeed packages installed successfully" "seeed-apt" "info"
9936
}
10037

10138
# AIC8800 wireless tweaks (BSP-level)
@@ -105,15 +42,15 @@ function post_family_tweaks_bsp__recomputer_aic8800_wireless() {
10542
mkdir -p "${destination}"/etc/modules-load.d
10643

10744
cat > "${destination}"/etc/modprobe.d/aic8800-wireless.conf <<- EOT
108-
options aic8800_fdrv_sdio aicwf_dbg_level=0 custregd=0 ps_on=0
109-
EOT
45+
options aic8800_fdrv_sdio aicwf_dbg_level=0 custregd=0 ps_on=0
46+
EOT
11047

11148
cat > "${destination}"/etc/modules-load.d/aic8800-btlpm.conf <<- EOT
112-
hidp
113-
rfcomm
114-
bnep
115-
aic8800_btlpm_sdio
116-
EOT
49+
hidp
50+
rfcomm
51+
bnep
52+
aic8800_btlpm_sdio
53+
EOT
11754

11855
if [[ -d "$SRC/packages/bsp/aic8800" ]]; then
11956
install -d -m 0755 "${destination}/usr/bin"
@@ -292,15 +229,15 @@ function post_family_tweaks__recomputer_add_sbin_to_path() {
292229

293230
mkdir -p $SDCARD/etc/profile.d
294231
cat > $SDCARD/etc/profile.d/custom-path.sh <<-'EOF'
295-
# Add sbin directories to PATH for ifconfig and other admin tools
296-
if [ -d /usr/sbin ] && [[ ":$PATH:" != *":/usr/sbin:"* ]]; then
297-
PATH="/usr/sbin:$PATH"
298-
fi
299-
if [ -d /sbin ] && [[ ":$PATH:" != *":/sbin:"* ]]; then
300-
PATH="/sbin:$PATH"
301-
fi
302-
export PATH
303-
EOF
232+
# Add sbin directories to PATH for ifconfig and other admin tools
233+
if [ -d /usr/sbin ] && [[ ":$PATH:" != *":/usr/sbin:"* ]]; then
234+
PATH="/usr/sbin:$PATH"
235+
fi
236+
if [ -d /sbin ] && [[ ":$PATH:" != *":/sbin:"* ]]; then
237+
PATH="/sbin:$PATH"
238+
fi
239+
export PATH
240+
EOF
304241

305242
chmod +x $SDCARD/etc/profile.d/custom-path.sh
306243
}

0 commit comments

Comments
 (0)