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