From owner-svn-src-head@freebsd.org Sat Sep 30 09:59:33 2017 Return-Path: Delivered-To: svn-src-head@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 37F90E236C7; Sat, 30 Sep 2017 09:59:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0539868A24; Sat, 30 Sep 2017 09:59:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8U9xWWc069217; Sat, 30 Sep 2017 09:59:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8U9xW3V069216; Sat, 30 Sep 2017 09:59:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709300959.v8U9xW3V069216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 30 Sep 2017 09:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324113 - head/usr.sbin/cpucontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.sbin/cpucontrol X-SVN-Commit-Revision: 324113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Sep 2017 09:59:33 -0000 Author: kib Date: Sat Sep 30 09:59:32 2017 New Revision: 324113 URL: https://svnweb.freebsd.org/changeset/base/324113 Log: Allow to disable default microcode updates search path with the new '-n' option. Look for updates in the default locations only after user-supplied locations are tried. If newer microcode files are put into non-standard path, both measures allow to avoid situation where older update loaded from the default path first, and then the second update is applied from non-standard path. Applying intermediate updates might be undesirable. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/usr.sbin/cpucontrol/cpucontrol.c Modified: head/usr.sbin/cpucontrol/cpucontrol.c ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.c Fri Sep 29 23:47:23 2017 (r324112) +++ head/usr.sbin/cpucontrol/cpucontrol.c Sat Sep 30 09:59:32 2017 (r324113) @@ -60,6 +60,7 @@ int verbosity_level = 0; #define FLAG_I 0x01 #define FLAG_M 0x02 #define FLAG_U 0x04 +#define FLAG_N 0x08 #define OP_INVAL 0x00 #define OP_READ 0x01 @@ -427,11 +428,7 @@ main(int argc, char *argv[]) error = 0; cmdarg = ""; /* To keep gcc3 happy. */ - /* - * Add all default data dirs to the list first. - */ - datadir_add(DEFAULT_DATADIR); - while ((c = getopt(argc, argv, "d:hi:m:uv")) != -1) { + while ((c = getopt(argc, argv, "d:hi:m:nuv")) != -1) { switch (c) { case 'd': datadir_add(optarg); @@ -444,6 +441,9 @@ main(int argc, char *argv[]) flags |= FLAG_M; cmdarg = optarg; break; + case 'n': + flags |= FLAG_N; + break; case 'u': flags |= FLAG_U; break; @@ -463,6 +463,8 @@ main(int argc, char *argv[]) usage(); /* NOTREACHED */ } + if ((flags & FLAG_N) == 0) + datadir_add(DEFAULT_DATADIR); dev = argv[0]; c = flags & (FLAG_I | FLAG_M | FLAG_U); switch (c) {