Skip to content

Commit 79fd84f

Browse files
twwnleggewie
authored andcommitted
Radxa Cubie A5E & Kickpi K2B: Pull CodeRabbit nitpicks
Same as for Radxa Zero 3
1 parent f3a21c7 commit 79fd84f

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

config/boards/kickpik2b.csc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,21 @@ function post_family_tweaks_bsp__aic8800_wireless() {
3636
EOT
3737
# Add AIC8800 Bluetooth Service and Script
3838
if [[ -d "$SRC/packages/bsp/aic8800" ]]; then
39-
mkdir -p "${destination}"/etc/systemd/system
40-
mkdir -p "${destination}"/usr/bin
41-
cp -f "$SRC/packages/bsp/aic8800/aic-bluetooth" "${destination}"/usr/bin
42-
chmod +x "${destination}"/usr/bin/aic-bluetooth
43-
cp -f "$SRC/packages/bsp/aic8800/aic-bluetooth.service" "${destination}"/etc/systemd/system
39+
install -d -m 0755 "${destination}/usr/bin"
40+
install -m 0755 "$SRC/packages/bsp/aic8800/aic-bluetooth" "${destination}/usr/bin/aic-bluetooth"
41+
install -d -m 0755 "${destination}/usr/lib/systemd/system"
42+
install -m 0644 "$SRC/packages/bsp/aic8800/aic-bluetooth.service" "${destination}/usr/lib/systemd/system/aic-bluetooth.service"
43+
else
44+
display_alert "$BOARD" "Skipping AIC8800 BT assets (packages/bsp/aic8800 not found)" "warn"
4445
fi
4546
}
4647

4748
# Enable AIC8800 Bluetooth Service
4849
function post_family_tweaks__enable_aic8800_bluetooth_service() {
4950
display_alert "$BOARD" "Enabling AIC8800 Bluetooth Service" "info"
50-
chroot_sdcard systemctl --no-reload enable aic-bluetooth.service
51+
if chroot_sdcard test -f /lib/systemd/system/aic-bluetooth.service || chroot_sdcard test -f /etc/systemd/system/aic-bluetooth.service; then
52+
chroot_sdcard systemctl --no-reload enable aic-bluetooth.service
53+
else
54+
display_alert "$BOARD" "aic-bluetooth.service not found in image; skipping enable" "warn"
55+
fi
5156
}

config/boards/radxa-cubie-a5e.csc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,22 @@ function post_family_tweaks_bsp__aic8800_wireless() {
3939
EOT
4040
# Add AIC8800 Bluetooth Service and Script
4141
if [[ -d "$SRC/packages/bsp/aic8800" ]]; then
42-
mkdir -p "${destination}"/etc/systemd/system
43-
mkdir -p "${destination}"/usr/bin
44-
cp -f "$SRC/packages/bsp/aic8800/aic-bluetooth" "${destination}"/usr/bin
45-
chmod +x "${destination}"/usr/bin/aic-bluetooth
46-
cp -f "$SRC/packages/bsp/aic8800/aic-bluetooth.service" "${destination}"/etc/systemd/system
42+
install -d -m 0755 "${destination}/usr/bin"
43+
install -m 0755 "$SRC/packages/bsp/aic8800/aic-bluetooth" "${destination}/usr/bin/aic-bluetooth"
44+
install -d -m 0755 "${destination}/usr/lib/systemd/system"
45+
install -m 0644 "$SRC/packages/bsp/aic8800/aic-bluetooth.service" "${destination}/usr/lib/systemd/system/aic-bluetooth.service"
46+
else
47+
display_alert "$BOARD" "Skipping AIC8800 BT assets (packages/bsp/aic8800 not found)" "warn"
4748
fi
4849
}
4950

5051
# Enable AIC8800 Bluetooth Service
5152
function post_family_tweaks__enable_aic8800_bluetooth_service() {
5253
display_alert "$BOARD" "Enabling AIC8800 Bluetooth Service" "info"
53-
chroot_sdcard systemctl --no-reload enable aic-bluetooth.service
54+
if chroot_sdcard test -f /lib/systemd/system/aic-bluetooth.service || chroot_sdcard test -f /etc/systemd/system/aic-bluetooth.service; then
55+
chroot_sdcard systemctl --no-reload enable aic-bluetooth.service
56+
else
57+
display_alert "$BOARD" "aic-bluetooth.service not found in image; skipping enable" "warn"
58+
fi
5459
}
5560

0 commit comments

Comments
 (0)