From owner-freebsd-hackers@freebsd.org Mon Dec 25 18:57:13 2017 Return-Path: Delivered-To: freebsd-hackers@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 05637E9FFF9 for ; Mon, 25 Dec 2017 18:57:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id D53076E9E9 for ; Mon, 25 Dec 2017 18:57:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.ysv.freebsd.org (Postfix) id D1C9BE9FFF8; Mon, 25 Dec 2017 18:57:12 +0000 (UTC) Delivered-To: hackers@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 D16FCE9FFF7 for ; Mon, 25 Dec 2017 18:57:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (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 9A1F76E9E7 for ; Mon, 25 Dec 2017 18:57:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x232.google.com with SMTP id n14so7703973iob.4 for ; Mon, 25 Dec 2017 10:57:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:from:date:message-id:subject:to; bh=g8JHg8jtRRgD17BPEiVa1Wv37DriBN9kwCurp35GdIo=; b=vK2rfUgQNEo57oLSjnzHFU7vGK06+t6oLZ4aJzxBA0DCT3JbY//khkmla0oM2fTgsC grmxQ0PP56bJuIEdjp3Osf5/EdoO1nw7caDkoo9oQsIFaTYSW6PL8CYenwcsTrDfB0Y0 TJSj0oF5X5qTmXOKVSgc6FwrOPEWx6I7kvjsUNfmS/Dl0r85Lvi48EO1ffvxvF3uLMHl tEozDpci4WOLf288igR9ukXX7Gkp/EWIuz20U7ojXmu5218CEZjkXQvyk9l4EcmCp01K AEbEFbvd8wixP4UluY/gm9a2jKtBtH69rwGFoXDegcQHRo+SmrjcLnGVEJ8tQXPAJqeu I5og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=g8JHg8jtRRgD17BPEiVa1Wv37DriBN9kwCurp35GdIo=; b=ia97OpFBtL7n53W0/qvjPSx9T31JFHQJAypgSPfBDXPhxlPCWKm+xwkMhYIMEEywUn YO79bVgRDkprxuxlsEA4GHtG1poWnQvcJC4AvC+D9YSFn3SSvq0TkgBBsK2p90FhuJHx T0gOCHeY14aigt0URYeU3F8iiVVsCmfxssvOLHfitmuzv74/1URXPxo8TQd+eWdiDsMs b+tUxMsJePHQNe0i94FgmPGjjX93uDPjLSospJRdsCOOrAzfnKcaIvr+HeGiWpx/fUhZ obGID0cud+/7tkk/jotgR9hsOmZPXU5V8U3RokZmO7syu/ogG4AOadQ5OBfoMY1+jwJ4 QXHw== X-Gm-Message-State: AKGB3mKG+m8rsEmd7fiH9ZwcmSgrV7/DDy2ruUFVcHvKARlCTJ4/FlYb MSZRmztvacOd0+TRAc9axUZ26h7938iirL0SUBLm7rbk X-Google-Smtp-Source: ACJfBovXkzoaxp4xXUPxcwPGDbXsuhVvPdaqCroalwkqqo4nE79uBbgOr52hkIJPpOdSjlzeTv8A/GvNugCHfq4/73M= X-Received: by 10.107.149.5 with SMTP id x5mr25981596iod.136.1514228231567; Mon, 25 Dec 2017 10:57:11 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Mon, 25 Dec 2017 10:57:10 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] From: Warner Losh Date: Mon, 25 Dec 2017 11:57:10 -0700 X-Google-Sender-Auth: _zlStO7SAgTK9D9Ks4RgR9yizYc Message-ID: Subject: devmatch(8) committed .... To: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 18:57:13 -0000 I've committed devmatch(8) to the tree in r327176. It's a building block for automating the loading of modules. While we can load modules today by adding FOO_load=YES to loader.conf, there's no easy way to load only the modules you need based on the hardware you have in the system. devmatch(8) provides the base framework to allow one to do that. It does this my looking at the PNP tables recorded in /boot/kernel/linker.hints. The version I've committed doesn't have the devd nor the rc.d integration. I've committed it for people to play with and give me feedback while those parts are finalized (and while other bugs are fixed). I don't intend to commit them until the kinks are worked out. Some notes: (1) You'll need a newly built kernel. Older kernels have minor bugs that allowed the terminating sentinel to be included in linker hints. All known oens, at least for amd64, have been fixed. (2) Lots and lots of drivers need to have their plug and play tables decorated. This is where I need people's help. I'll be writing up something for those that want to help. ISAPNP, PC Card and USB drivers already have this data. A few PCI drivers have it, and almost no ACPI drivers. The data is generally there, just not properly decorated for devmatch(8) and kldxref(8) to do their thing. (3) There's an issue with the USB pnp data. It's too long for the current devinfo(3) interfaces. I have fixes in the works to correct this. I could just bump the limits, but I want to do something more general and long term. (4) The end game for this is a GENERIC with most of the drivers removed that loads drivers automatically. Bootable storage drivers will have to remain for now until the loader can make use of this code.This is why the warning about hinted ISA devices went into the tree this week. (5) modules will print more than once. also the if_em/if_igb driver is a hard link so both of those will always print. Please send me your feedback. Happy Holidays! Warner