Skip to content
Merged
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
5 changes: 3 additions & 2 deletions .github/scripts/check_target_modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ fi

fail=0

# config-var → expected .ko filename
# config-var → expected .ko path (relative to lib/modules/<version>/)
# Add new pairs here when a kernel-module package is introduced.
check_module() {
var="$1"
ko="$2"
grep -q "^${var}=y" "$CONFIG" || return 0
if find "$TARGET_DIR/lib/modules" -name "$ko" | grep -q .; then
if find "$TARGET_DIR/lib/modules" -path "*/$ko" | grep -q .; then
echo "OK: $ko present (${var}=y)"
else
echo "MISSING: ${var}=y but $ko not found under $TARGET_DIR/lib/modules/" >&2
Expand All @@ -40,6 +40,7 @@ check_module() {
}

check_module BR2_PACKAGE_WIREGUARD_LINUX_COMPAT wireguard.ko
check_module BR2_PACKAGE_XIONGMAI_OSDRV_XM530 xiongmai/sdio0_sd.ko

if [ "$fail" -ne 0 ]; then
echo "check_target_modules: regression detected" >&2
Expand Down
32 changes: 32 additions & 0 deletions general/package/xiongmai-osdrv-xm530/post-build-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh
# xiongmai-osdrv-xm530 post-build hook.
#
# The vendor SD card driver (Arasan SDHC, module name sdio0_sd) ships in the
# image but nothing ever loads it: it is not listed in /etc/modules, so
# S35modules never modprobes it and /dev/mmcblk0 does not appear even with a
# card in the slot. mdev's automount helper and majestic's record path expect
# the card at /dev/mmcblk0p1.
#
# general/overlay/etc/modules is shared by every SoC, so the entry is appended
# here, only for the images that select this package. The hook must run after
# the rootfs overlay is applied, hence late-post-build-hooks.list rather than
# the package's INSTALL_TARGET_CMDS.
#
# Hot-plug is out of scope: the driver loads with detect=0, so sdio0_powerup()
# leaves GPIO49 (sdio0_detect) unmuxed and need_detect/need_poll are both 0.
# A card present at boot enumerates; one inserted afterwards is not detected.
# /etc/modules takes arguments, so "sdio0_sd detect=1" is available if that
# should change.
set -eu

TARGET_DIR="${1:?target dir required}"

MODULES="${TARGET_DIR}/etc/modules"
if [ ! -f "${MODULES}" ]; then
echo "xiongmai-osdrv-xm530: ${MODULES} not found, cannot append sdio0_sd" >&2
exit 1
fi

if ! grep -qx "sdio0_sd" "${MODULES}"; then
printf 'sdio0_sd\n' >> "${MODULES}"
fi
1 change: 1 addition & 0 deletions general/scripts/late-post-build-hooks.list
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# config-symbol:hook-script-relative-path
BR2_PACKAGE_OPENIPC_NFS_ROOT:package/openipc-nfs-root/post-build-hook.sh
BR2_PACKAGE_LIBNL:scripts/prune-libnl.sh
BR2_PACKAGE_XIONGMAI_OSDRV_XM530:package/xiongmai-osdrv-xm530/post-build-hook.sh
Loading