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

pre_exec() {
	[ -z "$TARGET_VERSION" ] && perror "Not run from an @ target"
	local SRC SZ
	SRC="${ROOT_DIR}/tmp/work/nvidia-common/build/$TARGET_VERSION"
	[ -d "$SRC" ] || perror "nvidia-common did not build $TARGET_VERSION"
	SZ=$( du -sk "$SRC" | awk '{print $1}' )
	(( SZ < 200000 )) && perror "nvidia-common for $TARGET_VERSION is less than 200MB, fishy"
	# 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 )" = "$TARGET_VERSION" ]
	EOF
	chmod +x "${TARGET_BUILD_DIR}/addon-required"
}