From owner-freebsd-arch@freebsd.org Mon Apr 17 19:10:12 2017 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DE3ED415B0 for ; Mon, 17 Apr 2017 19:10:12 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5EA1FB0 for ; Mon, 17 Apr 2017 19:10:12 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 4AB02D415AF; Mon, 17 Apr 2017 19:10:12 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A4DBD415AE for ; Mon, 17 Apr 2017 19:10:12 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03D2E1FAF; Mon, 17 Apr 2017 19:10:12 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x241.google.com with SMTP id p68so20712879qke.1; Mon, 17 Apr 2017 12:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qGmKpq2VwDn628E4cgL2RNIWfD70iE86HLBUDc6muXQ=; b=QDvf0aZ2ef7P9qijvFREhbXB/J2BnSrbZXkrRsg4cWHGTe+QbG/7ONsbq4kfFy0Hyf 8PaHQs3hJt63AqBLjt7q31uOFVdv0DbpIhrX66WKCLNGSkxqsG4VhzA5gtRh7E1VIO24 JF3+VNz6U0AG/obXRsvAh1ktYt4VyAiE//TM/QBIPd76MWPJFHO9EfnjIob9W5+K2Lel +yVpcDCkom86KZpC1syxu+yNdRqHv72/et92iAtGbAQOA5f5TOECRsflHy5Rp3RhLDi6 IqRB7sM/sgvlTInNYekXVJ5XrZl0Y7wMMuQwiZ12HtsNDv07GIjQCiEhe1McTsyaaZc6 kuig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=qGmKpq2VwDn628E4cgL2RNIWfD70iE86HLBUDc6muXQ=; b=DKT2csnqrQW7+qWZSBOHgLVq8hrMnOuVKwlTf74CMmX8pZRpVEBgmIvVAWErN1fL17 GVPHIjMM7pxRgbrdp0reGo/8+IbG2aoEq7KfbTj6pWPT0OYUO/lnN/mkiehNisOY44U+ MfXWm+5MFp0lRlnwzx4IkAzL6Oo+GUC3pMIZQGMg5huOUyX51Nv8twwnGh+CPihD2u5e QtTFDtgB++ksPbx1Wdfx7YI9bAqoba+RPxAcKLu2MGJ6DdICQjfGHF+ajs8t08FUt3xI sRJDAhu8CDbe6o9+2p3UywMnJohW014swtfywiHNqGzH33xDy1EzSrc2Fi+i7ub5ntIb eELg== X-Gm-Message-State: AN3rC/70gL+KxRTbfQ/aTPB4Ff6YknuC5yNS+h6v84uFyohLfrqVCE0Q AKqCrjnzTO8S8twb X-Received: by 10.55.192.143 with SMTP id v15mr9642136qkv.88.1492456211195; Mon, 17 Apr 2017 12:10:11 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id t71sm7920992qki.8.2017.04.17.12.10.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Apr 2017 12:10:10 -0700 (PDT) Sender: Mark Johnston Date: Mon, 17 Apr 2017 12:09:40 -0700 From: Mark Johnston To: Gary Jennejohn Cc: Baptiste Daroussin , arch@FreeBSD.org Subject: Re: modules finding order Message-ID: <20170417190940.GC18960@wkstn-mjohnston.west.isilon.com> References: <20170416202137.5x4vegfnm2pvkn6t@ivaldir.net> <20170416221249.GA11628@raichu> <20170417085822.0af03ceb@ernst.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170417085822.0af03ceb@ernst.home> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Apr 2017 19:10:12 -0000 On Mon, Apr 17, 2017 at 08:58:22AM +0200, Gary Jennejohn wrote: > On Sun, 16 Apr 2017 15:12:49 -0700 > Mark Johnston wrote: > > On Sun, Apr 16, 2017 at 10:21:37PM +0200, Baptiste Daroussin wrote: > > > Hi all, > > > > > > I would like to change in FreeBSD 12 at least the default order the modules are > > > found/look up. > > > > > > For now the modules are loaded from /boot/kernel first then if not found, > > > checked from /boot/modules. > > > > > > I think we should revert that to /boot/modules first then /boot/kernel. > > > > The problem I see with this is that the module under > /boot/modules may have been generated against a /usr/src which is > newer than what was used to generate the running kernel. In this > case kldload should (I hope) fail. It may or may not; the load will fail if the running kernel's __FreeBSD_version does not match the value that the module was compiled with. If the __FreeBSD_version values match, then the module is in theory compatible with the running kernel and should just work. > I regularly update /usr/src without making a new world or kernel. > > If kldload automatically falls back to trying /boot/kernel in > this case then everything would be OK. If kldload does not or > cannot retry then I would not consider this change a good idea. I don't think there's any mechanism to fall back. A "kldload foo" from the command line will cause the kernel to try and load the first "foo.ko" found in the paths given by the kern.module_path sysctl value. If that fails, the kldload fails. I'm not sure how it works for modules loaded by loader(8). > > There's also the possibility that the module is loaded > successfully, but at run time it fails due to missing > functionality in the old kernel. I'm not sure that this could > happen.