#!/usr/bin/env bash check() { # Tell dracut that this module should only be included if it is required # explicitly. return 255 } depends() { echo drm } installkernel() { instmods acpi_ipmi } install() { # grab what mltk produced, to externalize this part! for dir in "/drm.cfg.d" "/lib/modules/nvidia"; do [ -d "$dir" ] || continue mkdir -p "${initdir}/${dir%/*}" cp -ar "$dir" "${initdir}/${dir%/*}" done # Prepare /lib/modules and depmod for nvidia if applicable slx_service "s3-activate-nvidia-drivers" "Enable loading of nVidia drivers if a suitable GPU is found" \ --wafter "dracut-cmdline.service" \ --wbefore "dracut-pre-udev.service" # Copy nVidia drivers to stage 4 if they're loaded slx_service "s3-copy-nvidia-drivers" "Copy nVidia drivers to stage 4 if in use" \ --wafter "initrd-root-fs.target" \ --wafter "s3-activate-nvidia-drivers.service" }