From owner-freebsd-ports@FreeBSD.ORG Sun Jun 17 06:42:35 2007 Return-Path: X-Original-To: ports@FreeBSD.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B882D16A468 for ; Sun, 17 Jun 2007 06:42:35 +0000 (UTC) (envelope-from LoN_Kamikaze@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 1FA8713C45A for ; Sun, 17 Jun 2007 06:42:34 +0000 (UTC) (envelope-from LoN_Kamikaze@gmx.de) Received: (qmail invoked by alias); 17 Jun 2007 06:42:33 -0000 Received: from nat-wh-1.rz.uni-karlsruhe.de (EHLO mobileKamikaze.norad) [129.13.72.169] by mail.gmx.net (mp004) with SMTP; 17 Jun 2007 08:42:33 +0200 X-Authenticated: #5465401 X-Provags-ID: V01U2FsdGVkX18Zz6NFTCAZKwL44YOVzRi3GeGPMfRAmG3ndKAF8s 0p1l9cGpiLB9Nd Message-ID: <4674D7D8.7040302@gmx.de> Date: Sun, 17 Jun 2007 08:42:32 +0200 From: "[LoN]Kamikaze" User-Agent: Thunderbird 2.0.0.4 (X11/20070616) MIME-Version: 1.0 To: "M. Warner Losh" References: <20070616.213319.-1889956458.imp@bsdimp.com> <4674C9F6.60508@gmx.de> <4674CE41.7000103@gmx.de> <20070617.001516.-1615142562.imp@bsdimp.com> <4674D5B2.4000104@gmx.de> In-Reply-To: <4674D5B2.4000104@gmx.de> X-Enigmail-Version: 0.95.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 Cc: ports@FreeBSD.org Subject: Re: How to get a list of all kernel modules X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2007 06:42:35 -0000 [LoN]Kamikaze wrote: > M. Warner Losh wrote: >> In message: <4674CE41.7000103@gmx.de> >> "[LoN]Kamikaze" writes: >> : [LoN]Kamikaze wrote: >> : > M. Warner Losh wrote: >> : >> Greetings, >> : >> >> : >> is there an easy way to get a list of all the ports that compile >> : >> kernel modules? I'd like to add them to my kernel build. I did this >> : >> once before, but I lost all information on how to do it when I lost my >> : >> laptop's hard disk after the last bsdcan... >> : >> >> : >> Warner >> : > >> : > # find /boot/ -type f -exec pkg_info -W \{} \; >> : >> : Sorry about that, it takes very long. Better is: >> : >> : # sh -c 'for mod in `pkg_info -qaL|grep -E "^/+boot"`; { pkg_info -W "$mod"; } >> >> This sounds great, except for one problem. This will tell me all the >> modules that I've installed that are from ports. Since I've never >> installed any from ports, this will not work for what I want. I want >> a list of all the ports in /usr/ports that install kernel modules. >> I'd even settle for a list of all the ports in /usr/ports that only >> install modules. >> >> Something like >> egrep -l '\.ko$' /usr/ports/*/*/pkg-plist | sed -e s=/pkg-plist// >> might do the trick, but that blows the command line limits out of the >> water. Replacing egrep with 'find' would need to be carefully >> constructed to avoid false positives in any work directories I have >> laying around. I was hoping for something a little easier to do... >> >> Warner > > I see I misunderstood, sorry about that. So how about that one: > > # find /usr/ports/ -type f -name pkg-plist -exec grep -El > '^@cwd[[:space:]]+/boot' \{} \; | sed -E 's|^/usr/ports/||1' | sed -E > 's|/pkg-plist$||1' > > It only works with ports that have a pkg-plist file, though. It's all a bit tricky, now. This only returns a very small number of ports. Changing '^@cwd[[:space:]]+/boot' to '^@cwd[[:space:]]+/' helps, but returns lots of false positives, too: archivers/dpkg audio/mt-daapd comms/hylafax comms/smstools databases/cyrus-imspd databases/firebird-server databases/firebird2-server databases/sqlrelay devel/linux-js emulators/vmware-guestd6 emulators/snespp emulators/its emulators/vmware-guestd4 emulators/vmware-guestd5 games/freebsd-games games/barrage games/childsplay games/lbreakout games/wanderer games/xpat2 german/staroffice5 mail/fetchmail mail/dspam-devel mail/dspam mail/mimedefang mail/py-spambayes mail/zmailer multimedia/linux-gspca-kmod multimedia/linux-ov511-kmod multimedia/pwcbsd net-mgmt/cisco_conf net-mgmt/ng_ipacct net/acx100 net/asterisk-bristuff net/asterisk12 net/ipvs net/ipw-firmware-kmod net/ipw-firmware net/iwi-firmware-kmod net/iwi-firmware net/openldap23-server net/openpbx.org net/asterisk net/ng_netflow net/nvnet net/openldap24-server news/noffle print/bjfilter360 print/bjfilter850 print/bjfilter850ug print/bjfilter860 print/bjfilter870 print/bjfilters600 print/bjfilters630 print/bjfilters6300 print/bjfiltercom russian/tac+ia security/bioapi security/cyrus-sasl security/drweb security/ipsec-tools security/pam-pgsql security/vncrypt sysutils/apt sysutils/devcpu sysutils/fcron sysutils/graphicboot sysutils/heartbeat sysutils/pmap textproc/dixit www/hinventory-client www/interchange www/linux-flashplugin9 www/middleman www/wwwoffle x11/nvidia-driver I suppose these would have to be hand-checked.