From 17aec740b0b2112eb1803ca6d5ec8c8161f8dcae Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Fri, 13 Dec 2024 22:31:22 -0600 Subject: [PATCH] devmatch: do nothing if booted in safe mode Safe mode may be enabled because of some problem discovered with a kmod, thus wanting to avoid devmatch. Honor it and let the user deal with the fallout of not autoloading modules. We've at least made it to userland and the user demonstrably has a local console as they selected safe mode in the first place, so this shouldn't be fatal if we don't, e.g., load a necessary NIC driver. --- libexec/rc/rc.d/devmatch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/devmatch b/libexec/rc/rc.d/devmatch index 0999159bb3324b..7a8726de5677a8 100755 --- a/libexec/rc/rc.d/devmatch +++ b/libexec/rc/rc.d/devmatch @@ -41,7 +41,10 @@ one_nomatch="$2" devmatch_start() { - local x m list + local x m list boot_safe + + boot_safe=$(kenv -q boot_safe || echo "NO") + checkyesno boot_safe && return if [ -n "$one_nomatch" ]; then list=$(devmatch -p "${one_nomatch}" | sort -u)