diff options
| author | Simon Rettberg | 2019-04-26 11:24:14 +0200 |
|---|---|---|
| committer | root | 2019-04-26 11:24:14 +0200 |
| commit | 24fb4ad142f7cb932a5e47ee80c9bbfc10a758c0 (patch) | |
| tree | 5873fcbd617e6ea13f1c1bdc6145211441fbf764 /core/modules/nvidia_kernel | |
| parent | Support multi-target targets with @ syntax (diff) | |
| download | mltk-24fb4ad142f7cb932a5e47ee80c9bbfc10a758c0.tar.gz mltk-24fb4ad142f7cb932a5e47ee80c9bbfc10a758c0.tar.xz mltk-24fb4ad142f7cb932a5e47ee80c9bbfc10a758c0.zip | |
[nvidia*/rfs-s31] Support shipping multiple driver versions
Diffstat (limited to 'core/modules/nvidia_kernel')
| -rw-r--r-- | core/modules/nvidia_kernel/module.build | 97 | ||||
| -rw-r--r-- | core/modules/nvidia_kernel/module.conf | 12 |
2 files changed, 0 insertions, 109 deletions
diff --git a/core/modules/nvidia_kernel/module.build b/core/modules/nvidia_kernel/module.build deleted file mode 100644 index 3c8baa8d..00000000 --- a/core/modules/nvidia_kernel/module.build +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash -fetch_source() { - local url="$REQUIRED_URL_BASE/$REQUIRED_VERSION/$REQUIRED_NVIDIA" - mkdir -p src 2>/dev/null - cd src || perror "Could not change into src directory." - download "$REQUIRED_URL_BASE/$REQUIRED_VERSION/README/supportedchips.html" - download "$url" -} - -build() { - local ROOTUPPERDIR="$MODULE_WORK_DIR/rootupper" - - local NVIDIA="$MODULE_WORK_DIR/src/$REQUIRED_NVIDIA" - local NVIDIAEXTRACTDIR="$ROOTUPPERDIR/NVIDIA" - - [ -d "$NVIDIAEXTRACTDIR" ] && rm -rf "$NVIDIAEXTRACTDIR" - pinfo "Unpacking NVidia archive ($NVIDIA) ..." - sh "$NVIDIA" --extract-only --target "$NVIDIAEXTRACTDIR" || perror "Could not extract $NVIDIA to $NVIDIAEXTRACTDIR." - - pinfo "Ready to chroot - compiling may take some time." - pdebug "--- chroot ---------------------------------------------------------------------" - pdebug "- -" - pdebug "- Notice: This may take a while! -" - pdebug "- -" - pdebug "- Please keep note the Nvidia installer _will_ complain about -" - pdebug "- several warnings and errors. It will do this in any case. -" - pdebug "- -" - pdebug "- This does _not_ mean the kernel module compilation was unsuccessful! -" - pdebug "- -" - pdebug "--------------------------------------------------------------------------------" - - - chroot_run "$ROOTUPPERDIR" <<-EOF - /NVIDIA/nvidia-installer --no-nouveau-check --no-network --no-backup --no-rpms --no-runlevel-check --no-distro-scripts --no-cc-version-check --no-x-check --no-precompiled-interface --silent --kernel-source-path /"$KERNEL_HEADERS_DIR" # Do the work! - # fake success since the installer will exit with an error due to the module not loading properly. - exit 0 - EOF - pinfo "chroot terminated." - - local file - local RESULT - local NVIDIA_MODULES="$MODULE_BUILD_DIR/lib/modules/nvidia/" - mkdir -p "$NVIDIA_MODULES" - pinfo "Copying kernel modules..." - for file in nvidia.ko nvidia-uvm.ko nvidia-modeset.ko nvidia-drm.ko; do - RESULT=$(find "$ROOTUPPERDIR/NVIDIA/kernel" -name "$file" | head -n 1) - [ -z "$RESULT" ] && perror "Could not find built module $file in ./NVIDIA/kernel" - pinfo "Fetching ${file}..." - strip -g "$RESULT" || pwarning "Could not strip $file" - cp "$RESULT" "$NVIDIA_MODULES" || perror "Could not copy $file" - done - - rm -rf "$MODULE_BUILD_DIR/NVIDIA" - - mkdir -p "$MODULE_BUILD_DIR/drm.cfg.d" - local drmfile="$MODULE_BUILD_DIR/drm.cfg.d/00-nvidia" - cat > "$drmfile" <<-BLOFF - @nvidia acpi_ipmi nvidia/nvidia.ko nvidia/nvidia-uvm.ko nvidia/nvidia-modeset.ko nvidia/nvidia-drm.ko - @nvidia_fallback nouveau -BLOFF - if ! [ -s "$MODULE_WORK_DIR/src/supportedchips.html" ]; then - pwarning "No supportedchips.html -- using wildcard drm.cfg" - echo "10de @nvidia" >> "$drmfile" - else - local mode line name dev version - pinfo "Creating drm.cfg" - mode=0 - version= - while read -r line; do - if [[ "$line" =~ '<a name="legacy_' ]]; then - version=$(echo "$line" | sed -r 's/^.*name="legacy_([^"]+)".*$/\1/') - break # For now, we stop here; later on we could support legacy drivers - # By appending $version below and then having different locations for - # the modules, and in stage3.2 load different sqfs containers - elif [[ "$mode" = 0 ]] && [[ "$line" =~ ^'<tr' ]]; then - mode=1 - elif [[ "$mode" = 1 ]] && [[ "$line" =~ ^'<td' ]]; then - mode=2 - name=$(echo "$line" | sed -r 's/^.*<td[^>]*>([^<]+)<.*$/\1/') - elif [[ "$mode" = 2 ]] && [[ "$line" =~ ^'<td'[^'>']*'>'[0-9A-F]{4}'<' ]]; then - mode=0 - dev=$(echo "$line" | sed -r 's/^.*<td[^>]*>([0-9A-Fa-f]{4})<.*$/\1/' | tr 'A-Z' 'a-z') - echo "10de:$dev @nvidia$version" - else - mode=0 - name= - dev= - fi - done < "$MODULE_WORK_DIR/src/supportedchips.html" >> "$drmfile" - fi - -} - -post_copy() { - : -} - diff --git a/core/modules/nvidia_kernel/module.conf b/core/modules/nvidia_kernel/module.conf deleted file mode 100644 index 26d5a160..00000000 --- a/core/modules/nvidia_kernel/module.conf +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -REQUIRED_VERSION="410.93" -REQUIRED_NVIDIA="NVIDIA-Linux-x86_64-$REQUIRED_VERSION.run" -REQUIRED_URL_BASE="http://download.nvidia.com/XFree86/Linux-x86_64" - -REQUIRED_DIRECTORIES=" - /lib/modules/nvidia - /drm.cfg.d -" -REQUIRED_MODULES=" - kernel -" |
