summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/modules/nvidia-libs@/module.build8
-rw-r--r--core/modules/nvidia-libs@/templates/addon-required.template9
-rwxr-xr-xcore/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version4
3 files changed, 15 insertions, 6 deletions
diff --git a/core/modules/nvidia-libs@/module.build b/core/modules/nvidia-libs@/module.build
index c721cfda..30e7cfea 100644
--- a/core/modules/nvidia-libs@/module.build
+++ b/core/modules/nvidia-libs@/module.build
@@ -13,9 +13,9 @@ pre_exec() {
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
+ sed "s/%TARGET_VERSION%/$TARGET_VERSION/g" \
+ < "${MODULE_DIR}/templates/addon-required.template" \
+ > "${TARGET_BUILD_DIR}/addon-required" \
+ || perror "Could not copy addon-required template to target"
chmod +x "${TARGET_BUILD_DIR}/addon-required"
}
diff --git a/core/modules/nvidia-libs@/templates/addon-required.template b/core/modules/nvidia-libs@/templates/addon-required.template
new file mode 100644
index 00000000..68cb1284
--- /dev/null
+++ b/core/modules/nvidia-libs@/templates/addon-required.template
@@ -0,0 +1,9 @@
+#!/bin/ash
+
+if ! [ -e /sys/module/nvidia/version ]; then
+ echo "No driver loaded, not enabling"
+ exit 1
+fi
+[ "$( cat /sys/module/nvidia/version )" = "%TARGET_VERSION%" ] && exit 0
+echo "Driver version mismatch, not enabling"
+exit 1
diff --git a/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version b/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version
index c8c43666..b32e1187 100755
--- a/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version
+++ b/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version
@@ -14,8 +14,8 @@ if [ -z "$VIRTTYPE" ]; then
exit 0
fi
-[ -e "/dev/cpu/0/msr" ] \
- || modprobe msr \
+[ -e "/dev/cpu/0/msr" ] \
+ || modprobe msr 2> /dev/null \
|| insmod "$NEWROOT/lib/modules/$( uname -r )/kernel/arch/x86/kernel/msr.ko"*
# * because it might be compressed -> msr.ko.zstd ...