summaryrefslogtreecommitdiffstats
path: root/core/modules/nvidia-libs/module.build
blob: b0599749c54b8e5eda9b8cc5d9a0b03d4ca2e3d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

pre_exec() {
	[ -z "$VERSION" ] && perror "Not run from an @ target"
	local SRC
	SRC="${ROOT_DIR}/tmp/work/nvidia-common/build/$VERSION"
	[ -d "$SRC" ] || perror "nvidia-common did not build $VERSION"
	# XXX Now we override the MODULE_BUILD_DIR, where mltk will then grab alle the required files from
	MODULE_BUILD_DIR="$SRC"
}

post_copy() {
	# generate addon-required for this version
	cat <<-EOF > "${TARGET_BUILD_DIR}/addon-required"
		#!/bin/ash
		[ "\$( cat /sys/module/nvidia/version )" = "$VERSION" ]
	EOF
	chmod +x "${TARGET_BUILD_DIR}/addon-required"
}