summaryrefslogtreecommitdiff
path: root/sys-freebsd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-08-25 07:36:27 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-08-25 07:36:27 +0100
commit43793fab84041cfc5c60c0151d1591b8a69fb24a (patch)
tree6208a7f4fc744684fce0f55acbb47511acace498 /sys-freebsd
parent28e3d252dc8ac8a5635206dfefe1cfe05058d1db (diff)
gentoo resync : 25.08.2018
Diffstat (limited to 'sys-freebsd')
-rw-r--r--sys-freebsd/Manifest.gzbin2711 -> 2713 bytes
-rw-r--r--sys-freebsd/freebsd-share/Manifest3
-rw-r--r--sys-freebsd/freebsd-share/files/freebsd-share-SA-1808-tcp-11.patch23
-rw-r--r--sys-freebsd/freebsd-share/files/freebsd-share-SA-1810-ip.patch113
-rw-r--r--sys-freebsd/freebsd-share/freebsd-share-11.1_p1.ebuild122
-rw-r--r--sys-freebsd/freebsd-sources/Manifest11
-rw-r--r--sys-freebsd/freebsd-sources/freebsd-sources-11.1_p3.ebuild188
-rw-r--r--sys-freebsd/freebsd-usbin/Manifest2
-rw-r--r--sys-freebsd/freebsd-usbin/files/freebsd-usbin-SA-1803-speculative_execution-amd64-11.patch189
-rw-r--r--sys-freebsd/freebsd-usbin/freebsd-usbin-11.1_p1.ebuild191
10 files changed, 842 insertions, 0 deletions
diff --git a/sys-freebsd/Manifest.gz b/sys-freebsd/Manifest.gz
index e39ac0e312b1..19f270f69845 100644
--- a/sys-freebsd/Manifest.gz
+++ b/sys-freebsd/Manifest.gz
Binary files differ
diff --git a/sys-freebsd/freebsd-share/Manifest b/sys-freebsd/freebsd-share/Manifest
index a76d9a8a5b87..3e48e89a38f2 100644
--- a/sys-freebsd/freebsd-share/Manifest
+++ b/sys-freebsd/freebsd-share/Manifest
@@ -1,6 +1,9 @@
AUX freebsd-share-10.0-gentoo-eapi3.patch 475 BLAKE2B 2003dbeb08815d0b71450301bbb91cf387525ae67b876260eec625d087f0df84b2ba08bc080b99606cc960b938a4203b52cc670668a6da6656202d0f61acf970 SHA512 b7fe870aafe1cf9029c1d1d9de16413b5be8354b1c2ba0d0eab6f0fe3076ab03da08ff764c923c087e246b90355a48d55acef9b9b5a29238ddf8c92bdb3ca0f8
AUX freebsd-share-10.2-gnu-miscfiles.patch 913 BLAKE2B 2c264e3f7422f8f8f0994d2e888221e1f5223865596e5cfd4ab41cf6c4f6bb640cde891f7a32fe09d91115cb9bb934e5fc4bade310407205ec454cb3b0904c9b SHA512 fa792f15e325117e4448b344ab3dbf64d3880719698d88d8dda60c8cc4afea8c11cb845f44fa3b78ddc98fc6b021ef9edac639f649e8d166d79bf2c0e4f654f5
AUX freebsd-share-10.3-gentoo-skel.patch 600 BLAKE2B b04b8653aef9add52fe180b587635809cdbfc644d0df59eef1f471449228689a19adc1f19613ba7265c30f200e52ecd6e5f95fbd7312c488d1565e629baaeb67 SHA512 338eb369c50b11835f00474be5363bf6af43d8391a28a6e78e1517afc686b168fd0bfc32d45a78e79515c3d89a35b097548117cb2838b751d3d41330939c7dc2
+AUX freebsd-share-SA-1808-tcp-11.patch 896 BLAKE2B 6f459795078217835f6accbe4ed27bd82f639a103f89e45bd78429d0de9ef8ee2f63be3afac63780f5cf663e2f3e1327bf15e655b612e2a0f6416f272ddd75c9 SHA512 f2bb1085b680eaad997d79940a33d8dfd56e0e4ec6d2df628f58f208d2a37cb7f60ed94b4738afcd25112ea55268c06a1bc6534128802fd522771537fa7f4164
+AUX freebsd-share-SA-1810-ip.patch 4563 BLAKE2B efbe805bccbff5e49c3e1f0d5fd6a95ebd077cdc026a296f314815a3918eaffb694a1f9fb4beffcd609ca5d57da37762e28c9c2ee450d681d22f0f280c8b164f SHA512 55404a2ed446b0aa3bcd4bc6f82f5c253644d448645da82233865e0fadb3875501810fd0eeda1caab2489445dc759e52b2cccfcad99f65678640692fb5abf404
DIST freebsd-src-11.1.tar.xz 147661560 BLAKE2B a9e6ba9d0e12c8b56ac58575d5f02931edbb6a3545d9dccae78810d2d0470a29b29dd7f724b03b8afafbca23717a71346e4cfbd3530e0f40118a23609c3f414e SHA512 b97707ec7a601ca6bcb682c45f6d94a38484301ac24630d7285eff6f88b027ce6900c93fc62f8ce36e0cf32c91f73a9d1c999db397b7f8782fd74a8551a03aca
EBUILD freebsd-share-11.1.ebuild 3324 BLAKE2B a4a35392bc6e32b2e7c8922e887260717b30df97d4c18b9d6b068338ed536e5cc4dafdbca59391345d1c2af93798b28417d660aa2cb86778b53d5097a904f3ce SHA512 6e91be861b588dc5e91ac6b6e71fd242c5b7d86f9aabc8077bc2084326b65d71c1da6a6c4bb1b61e71e991c501eb7ebd13bd2bb46352bdcd8b37815bd5ae1ea9
+EBUILD freebsd-share-11.1_p1.ebuild 3405 BLAKE2B b0d7ec19e8b9c2adf20a377d9f1a096d3e02e51bff41d1e969ee57b51c38f81049b1ee83906770cab466e2c7e17119354c92fc5e54b9714f9ca1ebc896cb79e5 SHA512 004f0e831b08895cb162117d4d4eab291a58581e655177997ae823f4825af8bb31067c1fcf0c58d0c50757027c7feee5ab051d7a9702d983469a57e6bd81fde5
MISC metadata.xml 303 BLAKE2B 32a957edfc2dcb1fd1076d208b253fbe2408a65f44585ebd3863a9f6d95f4e25d8e3fc5ada378074e0d7e1ebd47793c4e8241656087da905100f68375c70df9e SHA512 4483a50bd02a3644bd12148d0a54ff78686d974337b5c22a267bdae228eefec85bf1a8b74a1c04a7759645e451e59c75734318d07376692d26c97261eaf2fbf3
diff --git a/sys-freebsd/freebsd-share/files/freebsd-share-SA-1808-tcp-11.patch b/sys-freebsd/freebsd-share/files/freebsd-share-SA-1808-tcp-11.patch
new file mode 100644
index 000000000000..b7d2a750c789
--- /dev/null
+++ b/sys-freebsd/freebsd-share/files/freebsd-share-SA-1808-tcp-11.patch
@@ -0,0 +1,23 @@
+--- share/man/man4/tcp.4.orig
++++ share/man/man4/tcp.4
+@@ -445,6 +445,20 @@
+ Reseeding should not be necessary, and will break
+ .Dv TIME_WAIT
+ recycling for a few minutes.
++.It Va reass.cursegments
++The current total number of segments present in all reassembly queues.
++.It Va reass.maxsegments
++The maximum limit on the total number of segments across all reassembly
++queues.
++The limit can be adjusted as a tunable.
++.It Va reass.maxqueuelen
++The maximum number of segments allowed in each reassembly queue.
++By default, the system chooses a limit based on each TCP connection's
++receive buffer size and maximum segment size (MSS).
++The actual limit applied to a session's reassembly queue will be the lower of
++the system-calculated automatic limit and the user-specified
++.Va reass.maxqueuelen
++limit.
+ .It Va rexmit_min , rexmit_slop
+ Adjust the retransmit timer calculation for
+ .Tn TCP .
diff --git a/sys-freebsd/freebsd-share/files/freebsd-share-SA-1810-ip.patch b/sys-freebsd/freebsd-share/files/freebsd-share-SA-1810-ip.patch
new file mode 100644
index 000000000000..1fee32f348b6
--- /dev/null
+++ b/sys-freebsd/freebsd-share/files/freebsd-share-SA-1810-ip.patch
@@ -0,0 +1,113 @@
+--- share/man/man4/inet.4.orig
++++ share/man/man4/inet.4
+@@ -28,7 +28,7 @@
+ .\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93
+ .\" $FreeBSD$
+ .\"
+-.Dd Feb 4, 2016
++.Dd August 14, 2018
+ .Dt INET 4
+ .Os
+ .Sh NAME
+@@ -229,15 +229,38 @@
+ cycle greatly.
+ Default is 0 (sequential IP IDs).
+ IPv6 flow IDs and fragment IDs are always random.
++.It Va ip.maxfrags
++Integer: maximum number of fragments the host will accept and simultaneously
++hold across all reassembly queues in all VNETs.
++If set to 0, reassembly is disabled.
++If set to -1, this limit is not applied.
++This limit is recalculated when the number of mbuf clusters is changed.
++This is a global limit.
+ .It Va ip.maxfragpackets
+-Integer: maximum number of fragmented packets the host will accept and hold
+-in the reassembling queue simultaneously.
+-0 means that the host will not accept any fragmented packets.
+-\-1 means that the host will accept as many fragmented packets as it receives.
++Integer: maximum number of fragmented packets the host will accept and
++simultaneously hold in the reassembly queue for a particular VNET.
++0 means that the host will not accept any fragmented packets for that VNET.
++\-1 means that the host will not apply this limit for that VNET.
++This limit is recalculated when the number of mbuf clusters is changed.
++This is a per-VNET limit.
++.It Va ip.maxfragbucketsize
++Integer: maximum number of reassembly queues per bucket.
++Fragmented packets are hashed to buckets.
++Each bucket has a list of reassembly queues.
++The system must compare the incoming packets to the existing reassembly queues
++in the bucket to find a matching reassembly queue.
++To preserve system resources, the system limits the number of reassembly
++queues allowed in each bucket.
++This limit is recalculated when the number of mbuf clusters is changed or
++when the value of
++.Va ip.maxfragpackets
++changes.
++This is a per-VNET limit.
+ .It Va ip.maxfragsperpacket
+ Integer: maximum number of fragments the host will accept and hold
+-in the reassembling queue for a packet.
+-0 means that the host will not accept any fragmented packets.
++in the reassembly queue for a packet.
++0 means that the host will not accept any fragmented packets for the VNET.
++This is a per-VNET limit.
+ .El
+ .Sh SEE ALSO
+ .Xr ioctl 2 ,
+--- share/man/man4/inet6.4.orig
++++ share/man/man4/inet6.4
+@@ -29,7 +29,7 @@
+ .\"
+ .\" $FreeBSD$
+ .\"
+-.Dd September 2, 2009
++.Dd August 14, 2018
+ .Dt INET6 4
+ .Os
+ .Sh NAME
+@@ -219,12 +219,41 @@
+ This value applies to all the transport protocols on top of
+ .Tn IPv6 .
+ There are APIs to override the value.
++.It Dv IPV6CTL_MAXFRAGS
++.Pq ip6.maxfrags
++Integer: maximum number of fragments the host will accept and simultaneously
++hold across all reassembly queues in all VNETs.
++If set to 0, fragment reassembly is disabled.
++If set to -1, this limit is not applied.
++This limit is recalculated when the number of mbuf clusters is changed.
++This is a global limit.
+ .It Dv IPV6CTL_MAXFRAGPACKETS
+ .Pq ip6.maxfragpackets
+-Integer: default maximum number of fragmented packets the node will accept.
+-0 means that the node will not accept any fragmented packets.
+--1 means that the node will accept as many fragmented packets as it receives.
+-The flag is provided basically for avoiding possible DoS attacks.
++Integer: maximum number of fragmented packets the node will accept and
++simultaneously hold in the reassembly queue for a particular VNET.
++0 means that the node will not accept any fragmented packets for that VNET.
++-1 means that the node will not apply this limit for that VNET.
++This limit is recalculated when the number of mbuf clusters is changed.
++This is a per-VNET limit.
++.It Dv IPV6CTL_MAXFRAGBUCKETSIZE
++.Pq ip6.maxfragbucketsize
++Integer: maximum number of reassembly queues per bucket.
++Fragmented packets are hashed to buckets.
++Each bucket has a list of reassembly queues.
++The system must compare the incoming packets to the existing reassembly queues
++in the bucket to find a matching reassembly queue.
++To preserve system resources, the system limits the number of reassembly
++queues allowed in each bucket.
++This limit is recalculated when the number of mbuf clusters is changed or
++when the value of
++.Va ip6.maxfragpackets
++changes.
++This is a per-VNET limit.
++.It Dv IPV6CTL_MAXFRAGSPERPACKET
++.Pq ip6.maxfragsperpacket
++Integer: maximum number of fragments the host will accept and hold in the
++ressembly queue for a packet.
++This is a per-VNET limit.
+ .It Dv IPV6CTL_ACCEPT_RTADV
+ .Pq ip6.accept_rtadv
+ Boolean: the default value of a per-interface flag to
diff --git a/sys-freebsd/freebsd-share/freebsd-share-11.1_p1.ebuild b/sys-freebsd/freebsd-share/freebsd-share-11.1_p1.ebuild
new file mode 100644
index 000000000000..a8b673e53ec3
--- /dev/null
+++ b/sys-freebsd/freebsd-share/freebsd-share-11.1_p1.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit bsdmk freebsd
+
+DESCRIPTION="FreeBSD shared tools/files"
+SLOT="0"
+LICENSE="BSD zfs? ( CDDL )"
+
+IUSE="doc usb zfs"
+
+if [[ ${PV} != *9999* ]]; then
+ KEYWORDS="~amd64-fbsd ~x86-fbsd"
+fi
+
+EXTRACTONLY="
+ share/
+ contrib/
+ gnu/
+ usr.bin/
+ usr.sbin/
+ sbin/
+ bin/
+ lib/
+ etc/
+ tools/tools/locale/
+"
+
+DEPEND="=sys-freebsd/freebsd-mk-defs-${RV}*
+ =sys-freebsd/freebsd-sources-${RV}*"
+RDEPEND="sys-apps/miscfiles"
+
+RESTRICT="strip"
+
+S="${WORKDIR}/share"
+
+pkg_setup() {
+ # Add the required source files.
+ use zfs && EXTRACTONLY+="cddl/ "
+
+ use doc || mymakeopts="${mymakeopts} WITHOUT_SHAREDOCS= "
+ use usb || mymakeopts="${mymakeopts} WITHOUT_USB= "
+ use zfs || mymakeopts="${mymakeopts} WITHOUT_CDDL= "
+
+ has_version "<sys-freebsd/freebsd-ubin-10.1" && mymakeopts="${mymakeopts} WITHOUT_VT= "
+ has_version "<sys-freebsd/freebsd-ubin-11.0" && mymakeopts="${mymakeopts} WITHOUT_LOCALES= "
+ has_version "<sys-freebsd/freebsd-lib-9.1-r11" && mymakeopts="${mymakeopts} WITHOUT_ICONV= "
+
+ mymakeopts="${mymakeopts} WITHOUT_SENDMAIL= WITHOUT_CLANG= "
+}
+
+REMOVE_SUBDIRS="mk termcap zoneinfo tabset"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-10.3-gentoo-skel.patch"
+ "${FILESDIR}/${PN}-10.0-gentoo-eapi3.patch"
+ "${FILESDIR}/${PN}-10.2-gnu-miscfiles.patch"
+ "${FILESDIR}/${PN}-SA-1808-tcp-11.patch"
+ "${FILESDIR}/${PN}-SA-1810-ip.patch"
+)
+
+src_prepare() {
+ # Remove make.conf manpage as it describes bsdmk's make.conf.
+ sed -i -e 's:make.conf.5::' "${S}/man/man5/Makefile"
+ # Remove rc.conf manpage as it describes bsd's rc.conf.
+ sed -i -e 's:\brc.conf.5::' "${S}/man/man5/Makefile"
+ sed -i -e 's:\brc.conf.local.5::' "${S}/man/man5/Makefile"
+ # Remove mailer.conf manpage
+ sed -i -e 's:mailer.conf.5::' "${S}/man/man5/Makefile"
+ # Remove pbm and moduli(ssh) manpages
+ sed -i -e 's:pbm.5::' -e 's:moduli.5::' "${S}/man/man5/Makefile"
+ # Remove builtins manpage
+ sed -i -e '/builtins\.1/d' "${S}/man/man1/Makefile"
+ # Remove rc manpages
+ sed -i -e '/rc.8/d' "${S}/man/man8/Makefile"
+ # Remove hv_kvp_daemon.8 manpage. It's provided by freebsd-usbin.
+ sed -i -e '/hv_kvp_daemon.8/d' "${S}/man/man8/Makefile"
+
+ # Don't install the arch-specific directories in subdirectories
+ sed -i -e '/MANSUBDIR/d' "${S}"/man/man4/man4.{i386,sparc64}/Makefile
+
+ # Remove them so that they can't be included by error
+ rm -rf "${S}"/mk/*.mk
+
+ # Make proper symlinks by defining the full target.
+ local sdir
+ for sdir in colldef monetdef msgdef numericdef timedef
+ do
+ sed -e 's:\${enc2}$:\${enc2}/\${FILESNAME}:g' -i \
+ "${S}/${sdir}/Makefile" || \
+ die "Error fixing ${sdir}/Makefile"
+ done
+ if [[ ! -e "${WORKDIR}/sys" ]]; then
+ ln -s "/usr/src/sys" "${WORKDIR}/sys" || die "failed to set sys symlink"
+ fi
+}
+
+src_compile() {
+ export ESED="/usr/bin/sed"
+
+ # libiconv support.
+ if ! has_version "<sys-freebsd/freebsd-lib-9.1-r11" ; then
+ # i18n/csmapper/APPLE requires mkcsmapper_static
+ # i18n/esdb/APPLE requires mkesdb_static
+ for pkg in mkcsmapper_static mkesdb_static
+ do
+ cd "${WORKDIR}"/usr.bin/${pkg} || die
+ freebsd_src_compile
+ done
+ fi
+
+ # This is a groff problem and not a -shared problem.
+ cd "${S}" || die
+ export GROFF_TMAC_PATH="/usr/share/tmac/:/usr/share/groff/1.22.2/tmac/"
+ freebsd_src_compile -j1 || die "emake failed"
+}
+
+src_install() {
+ freebsd_src_install -j1 DOCDIR=/usr/share/doc/${PF}
+}
diff --git a/sys-freebsd/freebsd-sources/Manifest b/sys-freebsd/freebsd-sources/Manifest
index a278f0e37493..31cdb3a0f260 100644
--- a/sys-freebsd/freebsd-sources/Manifest
+++ b/sys-freebsd/freebsd-sources/Manifest
@@ -7,10 +7,21 @@ AUX freebsd-sources-7.1-includes.patch 318 BLAKE2B e95da1360824b9a5037bf55deda2d
AUX freebsd-sources-8.0-subnet-route-pr40133.patch 548 BLAKE2B 2c783822d71de3633c5b914a38d1a80b9afd4a5e4335ac9a01da605306c8d0f5605970f808d9b7c93e9853a7b741eaec8f0b1701602160761404558eaf93f680 SHA512 9ae65e2775302b664dd4e5f5cbc58fe1ca7db61b6182db10971660207c72ec74e542181f1c2aefcacd2fd4b54e10d371efc619c3c03a977c35d3cf67b99b7de5
AUX freebsd-sources-9.0-disable-optimization.patch 927 BLAKE2B 42fff42c4d1bc57aed5c4b4dc30328f8ac3317f36cb3b4df60690e5ce9e3ef19d2a1b6a8e35082aad6c43283b47af8df6c94912710d55fc925e2eae08d275459 SHA512 0b74874d42eab95994309b922f37ebbf3706d01db6c447c9f062b03e64b77c7f793bc297150b539acdf39530a8afd91f4bf824a87c674dd625a59056656c614b
AUX freebsd-sources-9.0-sysctluint.patch 403 BLAKE2B 3860821b308a75dcad8fa5910cb6c287ca2013269d21b588d0abbb1a79197366eac7eb733c87136f77ba2556913f36784842ac5f089d5c9bdb59bdb836748049 SHA512 f3a87cb187858bc6fd1bafda3c3bd7bbda52b07239a50a7c1aa201df2c52a58d4809e196b8799b1949c8ca1a556519d454ad1789358540e3a96cd480fc0a504c
+DIST freebsd-sources-11.1_p3-patchset.tar.xz 36348 BLAKE2B b88f8a0f0bfde97a0416967c76ffb1d8fcb3f9050d69caa83941ab38e289622a9a5d25887e895d364f333980f7ab21af454d6fbe48157119279b4a0b600856ff SHA512 c981eee806ad93ebc720434789da1ae38f21a131ec8f92c3e55dab4e5fbc61e225c615132bb971e2b9bf4bc6922b2c7bdd9117644e8ba6547c20857deea0bbc1
DIST freebsd-sources-EN-1707-vnet.patch 356 BLAKE2B 6e586e8cc767c0f177b6f1175512c4d5bd4fdf9abb94b644348dbe8b681d4838bdba8c83496ae351fb075329fed4e270bdd8768ce63e8c99fc69ba36d3040d8c SHA512 2fdb58388acb98811588beeabaf8a533926f96ac3f594f53dd80dcdb38ede4fe0dd66f0dd7bb32b40a27f756e2b03fed91c4416cbdcd4c16dd8143f5438885d7
DIST freebsd-sources-EN-1708-pf.patch 706 BLAKE2B 7b812c1d696f2a1ab6e648228fe4fce8b8e32f57ed8dc713b24db5dacca70e693ee24001f0db168d79c528e2c20c6011ac423629a807949757e9f468969c3127 SHA512 e9dc61ff10aafb9b92721c599577ce995458b8a1a93b31fc6cc39b910db2b8f965ff0354a45bf82d2d57abba7aa0bf6d2f002044d242e19121d5ee4cd7a1dc15
+DIST freebsd-sources-EN-1804-mem.11.patch 2932 BLAKE2B 41eb2445cbc9a339f21b64ae0aa64b477c6691540236b8b3c378475fa3f451b35f3e9793eae240f15364b39b0a9fda0971c92f4dadb0933c103a933db154a718 SHA512 feb22d2cc614c0fc80eea5410894a9f0c091ec77e01810fe1476a8702624331e3a45d44e1de15945586dfa0a334a12442f46e61ad148fa555e4900d486f79185
+DIST freebsd-sources-EN-1805-mem.11.1.patch 4106 BLAKE2B 598b12547f66e1cb3b915878bb37f73c6a028655f78cb50f8fb113af4c0a31f6ba82f884de4b79151b6512bc67aa8a2cc404c5bce6ffcf07dada37426eb5082c SHA512 ec80584da7ba7f6d0b6039b9a4acb151b18fcf5671a805c52911a97fc53cc5bcc5cfe427d37f91fcb130f437a134eed7d746b652131591fc28986d18d5b3a48c
+DIST freebsd-sources-EN-1807-pmap.patch 1639 BLAKE2B 437379a0471f1c36dcebfcce471d1e65426773c96a18ad4f4272c3617cecedce45b6a09a518a45947b36d1e1d47aa485839f24fa24d4b8dea14fd9f7fb5b480f SHA512 f3a482fc573ccee1ed779a3fc4bbd5c54a0a93395ca83e4e5b36293ce3b298545b4f9e1bb91c557d00d89890a2ef3c425e966077de4fccdb670059519bb75b44
DIST freebsd-sources-SA-1708-ptrace.patch 696 BLAKE2B d040de29c3aca8fbc5d837c574e5ee81196ba41f1a90720579e854ba4e9786e23545547892d4e6d90c850161a53aaef7de014cbb918c45a261aea56b02cd2d7b SHA512 973bfe4e594fe34340ae723b3451a1b84a9877b51e1e14e8cd0a9944bec5bc4efec6ff39ba61998c1da1f2c2df0fe17272b3dad2e2cc3880cfa0ff6017d2730e
DIST freebsd-sources-SA-1710-kldstat.patch 2155 BLAKE2B e2c47d72a4a497283d7def916cdf0991b5ec791f545736474db18301866362b3c96f0a4ac5e7c1c2a91535961ac048e5e1c1e7ad10d10ced3dba954453a04ef5 SHA512 a5cc0acfcac8401fb4066fd5bfbaa1c5718a38f05877b8fb1c5a9cce1df9af4a82bd1c263c80c2b58ad058349753dcec9c4aa13bdb178f3b80493785badc65a4
+DIST freebsd-sources-SA-1801-ipsec-11.patch 1153 BLAKE2B bc7b0fb85a5d03873cf8dc61c2478b450167f8d0d5f9094c14cf9a3647a9d1ecdee8245ba45e70270aa95e21f112a0c10978a57b41ecbafa0a5392c101bef4b0 SHA512 034777a8f5bacd73ae989747bdb1669747d7af0e1655cb033e95068a2318063301b05a2ddbb3debbfd32f938c77bef1614535b6a667a511bf3f0287fb6e1667c
+DIST freebsd-sources-SA-1804-vt.patch 640 BLAKE2B 2cf3dcecfac7b33136c47c5fad23840c98c19ae7690fdd6520eacb4779d3101a615a1416c5337a0fe740cc56d7ea19ed4de9481ccced73a5322610950637fecb SHA512 461ca668363f1b334b626b7256830d1abe249d8c76417e524a366a2643676c8681127cd8c326dfe7cd1b1ee3ad67fb4819f08fd2a2db9b5b7a108171e8777a5b
+DIST freebsd-sources-SA-1805-ipsec.patch 3182 BLAKE2B 43c7e5b80a4b552c167efcca392fc1ec5d6aed3c425d081a63b9e221aed92f891674fc6f9b17805e449c806422d4b8624e773e4b463d50b51ec629197a014004 SHA512 116d9a6d67452863e5dc12124ad3bad4a29c472755235e65f97f474e048ba7f9a4711d0f73d1301072aa31281d3f444fded4b6e429e4f28367c713708402d33a
+DIST freebsd-sources-SA-1806-debugreg.11.1.patch 10505 BLAKE2B 1071869efe163bcba8b118cde3eb85a5a3cf31f589f270735b63d9f670a12d17fcf4bca297d266c5d8a89e73ee20abaf0ef0193a1d9d5cbce934e34946cee827 SHA512 06386a69b386f05ecb115d8dd511ca2afa6b8fe18290eab92357b111e62277b7180ea116620ce854a12ae6f42f997a0d57db8c7fdeb42584f8711c23ab50db44
+DIST freebsd-sources-SA-1807-lazyfpu-11.patch 10024 BLAKE2B 0dfa6e0a86d6227230a686963f80dbc4c512486471c02577d769110899e74e8064f3cdab45afb29a8283bf9423bd521c085d70174560361529b21fddea1787a6 SHA512 932cead50235a77b8bb0a41b600e7bb1722dd5b5d95601d30041a953b0c1a6a421d794138f1b6adfcb71e5e1904f09288e8ec3a8ce7f9c879ad8d9c77ffdb162
+DIST freebsd-sources-SA-1809-l1tf-11.1.patch 5357 BLAKE2B f7b93d61a63827908afc66fd5f28b15c4e951a7f50038eba92f7d3b824c771fb22fc6ea4e55316c0565ac73e2f27af0f39a189a7ee3f8914ed4d87819208959d SHA512 9920f43f5cf26bc72b7cb704276073a1f44a57dec340cdd369d119465d3f4a6585fa760d164c246c101f629af30d74c249b2892e5b25f17534a1d7caff98263c
DIST freebsd-src-11.1.tar.xz 147661560 BLAKE2B a9e6ba9d0e12c8b56ac58575d5f02931edbb6a3545d9dccae78810d2d0470a29b29dd7f724b03b8afafbca23717a71346e4cfbd3530e0f40118a23609c3f414e SHA512 b97707ec7a601ca6bcb682c45f6d94a38484301ac24630d7285eff6f88b027ce6900c93fc62f8ce36e0cf32c91f73a9d1c999db397b7f8782fd74a8551a03aca
EBUILD freebsd-sources-11.1_p2.ebuild 4594 BLAKE2B b4861bdab72dcfbaaadccacd98efabada77878264140e35428acbe427e17a9d56edda10c5275bb7abcc9107badfe010fa642bcc1bf760e02241b4da6c9644887 SHA512 a700daa8edbfc20f6aa9e82288529f613bc2134ed5dab624d0aba56b4189b78a680ec3a13110d7e4aa15471c4133651ce4472096ae242c772a73faa953df10ab
+EBUILD freebsd-sources-11.1_p3.ebuild 5306 BLAKE2B 30bd04cd1b97c778c07cfa8059be9737d1fe05bac0b6f7af7b5182524ffb026f3f1217d755db53cb7d0efe15c6bc487bd145833df4239f86e324d4025065b8c0 SHA512 695422cbf5270ab90aa8c93a8ce4b467746a2132720018c286284b525f02f2b88b89ea8310c508f002b89d5047e93cc351e38cf5da9edc7dc36d3e6115466ae7
MISC metadata.xml 444 BLAKE2B 26160b0d71ed4eb333357e7d3d5fd131038abfeb50db42107cabab63fe2123cc9d495d53a33bc8fea3622dee7994076c57163ab9904c452c1d3bbdad569481b9 SHA512 9e2abef67d9a4092a62f92a0b32e5d8547a046d26551ef15c577dedf3b56231ba055702a7476104993a8ed15717b5610d1cdbd6c167b0571a84392f41f177cdc
diff --git a/sys-freebsd/freebsd-sources/freebsd-sources-11.1_p3.ebuild b/sys-freebsd/freebsd-sources/freebsd-sources-11.1_p3.ebuild
new file mode 100644
index 000000000000..2fb9e00362f0
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/freebsd-sources-11.1_p3.ebuild
@@ -0,0 +1,188 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit bsdmk freebsd flag-o-matic toolchain-funcs
+
+DESCRIPTION="FreeBSD kernel sources"
+SRC_URI+="
+ https://dev.gentoo.org/~mgorny/dist/${P}-patchset.tar.xz"
+
+SLOT="0"
+LICENSE="BSD dtrace? ( CDDL ) zfs? ( CDDL )"
+
+IUSE="+build-kernel debug dtrace zfs"
+
+# Security Advisory and Errata patches.
+# (commented out patches go via FILESDIR/PATCHES)
+UPSTREAM_PATCHES=(
+ "SA-17:08/ptrace.patch"
+ "SA-17:10/kldstat.patch"
+ "EN-17:07/vnet.patch"
+ "EN-17:08/pf.patch"
+ "SA-18:01/ipsec-11.patch"
+# "SA-18:03/speculative_execution-amd64-11.patch"
+ "SA-18:04/vt.patch"
+ "SA-18:05/ipsec.patch"
+ "EN-18:04/mem.11.patch"
+ "EN-18:05/mem.11.1.patch"
+ "SA-18:06/debugreg.11.1.patch"
+ "SA-18:07/lazyfpu-11.patch"
+ "EN-18:07/pmap.patch"
+# "SA-18:08/tcp-11.patch"
+ "SA-18:09/l1tf-11.1.patch"
+# "SA-18:10/ip.patch"
+)
+
+if [[ ${PV} != *9999* ]]; then
+ KEYWORDS="~amd64-fbsd ~x86-fbsd"
+ SRC_URI="${SRC_URI}
+ $(freebsd_upstream_patches)"
+fi
+
+EXTRACTONLY="sys/"
+
+RDEPEND="dtrace? ( >=sys-freebsd/freebsd-cddl-9.2_rc1 )
+ =sys-freebsd/freebsd-mk-defs-${RV}*
+ !sys-freebsd/virtio-kmod
+ !sys-fs/fuse4bsd
+ !<sys-freebsd/freebsd-sources-9.2_beta1"
+DEPEND="build-kernel? (
+ dtrace? ( >=sys-freebsd/freebsd-cddl-9.2_rc1 )
+ >=sys-freebsd/freebsd-usbin-9.1
+ =sys-freebsd/freebsd-mk-defs-${RV}*
+ )"
+
+RESTRICT="strip binchecks"
+
+S="${WORKDIR}/sys"
+
+KERN_BUILD=GENTOO
+
+PATCHES=(
+ "${FILESDIR}/${PN}-9.0-disable-optimization.patch"
+ "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch"
+ "${FILESDIR}/${PN}-8.0-subnet-route-pr40133.patch"
+ "${FILESDIR}/${PN}-7.1-includes.patch"
+ "${FILESDIR}/${PN}-9.0-sysctluint.patch"
+ "${FILESDIR}/${PN}-11.0-gentoo.patch"
+ "${FILESDIR}/${PN}-11.0-gentoo-gcc.patch"
+ "${FILESDIR}/${PN}-10.1-gcc48.patch"
+
+ "${WORKDIR}/${P}-patchset/${PN}-SA-1803-speculative_execution-amd64-11.patch"
+ "${WORKDIR}/${P}-patchset/${PN}-SA-1808-tcp-11.patch"
+ "${WORKDIR}/${P}-patchset/${PN}-SA-1810-ip.patch"
+)
+
+pkg_setup() {
+ # Add the required source files.
+ use dtrace && EXTRACTONLY+="cddl/ "
+
+ # WITHOUT_SSP= is required to boot kernel that compiled with newer gcc, bug #477914
+ [[ $(tc-getCC) == *gcc* ]] && mymakeopts="${mymakeopts} WITHOUT_SSP= WITHOUT_FORMAT_EXTENSIONS="
+ use dtrace || mymakeopts="${mymakeopts} WITHOUT_CDDL="
+ use zfs || mymakeopts="${mymakeopts} WITHOUT_ZFS="
+}
+
+src_unpack() {
+ unpack "${P}-patchset.tar.xz"
+ freebsd_src_unpack
+}
+
+src_prepare() {
+ local conf="${S}/$(tc-arch-kernel)/conf/${KERN_BUILD}"
+
+ # This replaces the gentoover patch, it doesn't need reapply every time.
+ sed -i -e 's:^REVISION=.*:REVISION="'${PVR}'":' \
+ -e 's:^BRANCH=.*:BRANCH="Gentoo":' \
+ -e 's:^VERSION=.*:VERSION="${TYPE} ${BRANCH} ${REVISION}":' \
+ "${S}/conf/newvers.sh"
+
+ # __FreeBSD_cc_version comes from FreeBSD's gcc.
+ # on 11.0-RELEASE it's 1100001.
+ # FYI, we can get it from gnu/usr.bin/cc/cc_tools/freebsd-native.h.
+ sed -e "s:-D_KERNEL:-D_KERNEL -D__FreeBSD_cc_version=1100001:g" \
+ -i "${S}/conf/kern.pre.mk" \
+ -i "${S}/conf/kmod.mk" || die "Couldn't set __FreeBSD_cc_version"
+
+ # Remove -Werror
+ sed -e "s:-Werror:-Wno-error:g" \
+ -i "${S}/conf/kern.pre.mk" \
+ -i "${S}/conf/kmod.mk" || die
+
+ # Set the kernel configuration using USE flags.
+ cp -f "${FILESDIR}/config-GENTOO" "${conf}" || die
+ use debug || echo 'nomakeoptions DEBUG' >> "${conf}"
+ use dtrace || echo 'nomakeoptions WITH_CTF' >> "${conf}"
+
+ # hyperv fails to compile on x86-fbsd.
+ if use x86-fbsd && [[ $(tc-getCC) == *gcc* ]] ; then
+ echo 'nodevice hyperv' >> "${conf}"
+ dummy_mk modules/hyperv
+ fi
+
+ # Only used with USE=build-kernel, let the kernel build with its own flags, its safer.
+ unset LDFLAGS CFLAGS CXXFLAGS ASFLAGS KERNEL
+}
+
+src_configure() {
+ if use build-kernel ; then
+ tc-export CC
+ cd "${S}/$(tc-arch-kernel)/conf" || die
+ config ${KERN_BUILD} || die
+ fi
+}
+
+src_compile() {
+ if use build-kernel ; then
+ cd "${S}/$(tc-arch-kernel)/compile/${KERN_BUILD}" || die
+ freebsd_src_compile depend
+ freebsd_src_compile
+ else
+ einfo "Nothing to compile.."
+ fi
+}
+
+src_install() {
+ if use build-kernel ; then
+ cd "${S}/$(tc-arch-kernel)/compile/${KERN_BUILD}" || die
+ freebsd_src_install
+ rm -rf "${S}/$(tc-arch-kernel)/compile/${KERN_BUILD}"
+ cd "${S}"
+ fi
+
+ insinto "/usr/src/sys"
+ doins -r "${S}/".
+ if use dtrace ; then
+ insinto "/usr/src/cddl"
+ doins -r "${WORKDIR}/cddl/".
+ fi
+}
+
+pkg_preinst() {
+ if [[ -L "${ROOT}/usr/src/sys" ]]; then
+ einfo "/usr/src/sys is a symlink, removing it..."
+ rm -f "${ROOT}/usr/src/sys"
+ fi
+
+# if use sparc-fbsd ; then
+# ewarn "WARNING: kldload currently causes kernel panics"
+# ewarn "on sparc64. This is probably a gcc-4.1 issue, but"
+# ewarn "we need gcc-4.1 to compile the kernel correctly :/"
+# ewarn "Please compile all modules you need into the kernel"
+# fi
+
+ ewarn "If you want to manually compile (not recommended), please don't forget the following steps."
+# if ! use sparc-fbsd ; then
+# ewarn "export CC=clang"
+# ewarn "export CXX=clang++"
+# fi
+ if ! use zfs ; then
+ ewarn "export WITHOUT_CDDL="
+ ewarn "Note, Please set USE=zfs if you want to enable modules under the CDDL."
+ fi
+ if ! use dtrace && ! has_version '>=sys-freebsd/freebsd-cddl-9.2_beta1' ; then
+ ewarn "The GENERIC config requires sys-freebsd/freebsd-cddl. Please emerge it."
+ fi
+}
diff --git a/sys-freebsd/freebsd-usbin/Manifest b/sys-freebsd/freebsd-usbin/Manifest
index 198f7ebf568d..258eb84ae7a6 100644
--- a/sys-freebsd/freebsd-usbin/Manifest
+++ b/sys-freebsd/freebsd-usbin/Manifest
@@ -2,6 +2,7 @@ AUX freebsd-usbin-10.3-bsdxml2expat.patch 406 BLAKE2B bddbdf3869a084f4a3eed61639
AUX freebsd-usbin-11.0-workaround.patch 374 BLAKE2B 7e4b18ccddd1da87fc2d6bb8d8c98be45cc1b2d1d8b383316746a793b6eb3aa9d722e11ea600d0c49111b00c5ddb237eaa019b2babeed86da7d0beef6ff0189d SHA512 c9e8b493d99581dd7beac48def291843e31649a2962f720ed06ef095a128b039e8308662cfbbfcbecfbd0265132bb7a4df9d895ffe69aac09c129389ba5be518
AUX freebsd-usbin-11.1-bsdxml2expat.patch 841 BLAKE2B 89b5b0ed64dcf5c95eb727110651bb77079a4ccfc346fbd9ac1b26e3a4d53c452d657379ca876e6eb8b50dd90be59737b84405de873613dadf3bebeae7c788de SHA512 69f9055dc536132f1ec46389b53e25261632d726bc74857210ecb5511114f07d4b550e5e4a7a6e066a4a68c4a4bb4e44309d01f569b154fc773247dbd7f3fb23
AUX freebsd-usbin-9.0-newsyslog.patch 507 BLAKE2B 7c95ebd60ca6cc1bac56b84359a389dada9e71de9f275cf99d72f329fb408bd16845fb46d60037c514deb4ea21cd894da57ae28193e56970e383c5a8e1c689b7 SHA512 5423fc577035c2a272d4cb4305c5ee5e1e910a68af44595524665f7b867bd0a48bab0349b2fa13eabc385b2ec29c8f578d018cd8196f3ad20a13a68d36a335ae
+AUX freebsd-usbin-SA-1803-speculative_execution-amd64-11.patch 3658 BLAKE2B 4c7c4aa7d65ae2f36ea08568ca6fb9412456dda432f459a99b5e68858dc5b2ea6e023cb257e6659a5ca31e572c537c9169c832cc5ca39cad7a38efc2c52283df SHA512 c46b73a1c104470d631f3b874e592e33d2bf100258d774fbaec406c3d3985fb3283bce2f51911a5d73e5f66b5a3bc5d38d4cbeab0439acd21cfbf376e496971a
AUX freebsd-usbin-adduser.patch 428 BLAKE2B 3008953aa7ea14405b0e914f518fa05a5de744283110959900ab1ee9887b8b48d8d15131f26280773ff0173f1c60c077c66fedfad1b0310d0e6c5abb5a2b1370 SHA512 51720e3db9bf3728afc0dc370a469746cb1bf61623c44a20c58e27d647e5a5d0360145b1d174382176d803f2558afa2f2a29eca6c85c638529d0e11e2859c0c3
AUX iscsid.initd 429 BLAKE2B 366c216bf7f4584d1aa115302547b7066105b5107a976504c68725a1f7ca80adb7bd19b4acdaa2ea41b45c42bfed2b028a17ab28201163222788432768f2e5a6 SHA512 49a90719aa0279e19899a2107113cad0784a2cf3b57a0c24ad08549fa4b44dcb1aceecd71027e363b8d2cbbe1b590480ef7806cb05d8b00c1830c2d77b8a8540
AUX nfs.confd 303 BLAKE2B 69f72512c7e518f9078ea3873c5a2c9f0e1fef02ba3d769a18d1c8f347a8f8d5981cbe7ce34946431b373ae2b580505d74714f7bdbc0a7298745f02f96d35404 SHA512 4224c7f525e39b105b8d80caa7db0f3e0b07d6c521970b2aacfd707ef524262cbdb9ed8aa5151022d571a759151dd25a280fc765a38e67864b0c446ee9fd6b5a
@@ -13,4 +14,5 @@ AUX rpc.lockd.initd 530 BLAKE2B 03926d9b01e3d191030a18785ef53824836d1826895d064a
AUX rpc.statd.initd 520 BLAKE2B 701d58e57520dd9237a7e2261071304a1f820816c0902e06122a4729872432e6c29dc62a686f53d674a75f2c3050b6adf04b2d3c665f2f3639362fecf0ca929c SHA512 62c3bef69ca0619e3492050379a4c8b490305ab0ee7620143c31be7af414b1f1cbd79feaee345bd5e6bfdfa6c93bcce3cc9ff61a2f63e235a3807920e260cb7a
DIST freebsd-src-11.1.tar.xz 147661560 BLAKE2B a9e6ba9d0e12c8b56ac58575d5f02931edbb6a3545d9dccae78810d2d0470a29b29dd7f724b03b8afafbca23717a71346e4cfbd3530e0f40118a23609c3f414e SHA512 b97707ec7a601ca6bcb682c45f6d94a38484301ac24630d7285eff6f88b027ce6900c93fc62f8ce36e0cf32c91f73a9d1c999db397b7f8782fd74a8551a03aca
EBUILD freebsd-usbin-11.1.ebuild 5442 BLAKE2B 68a9b16ec4eceded11cbfda41eaf8e5d5108e43ba16d351c8e7e82480ab747f9088592bf6dc9aeb35507cfe0d53936108dee467ed0ddac1b728141116925f42b SHA512 ec043c20093c49637c5ee352259015addcf23c610c893a21b3a9f512b097b3d659ed788316540435b3edfedbe3b949325f2a935a8d46acd61593cb27dd6756ac
+EBUILD freebsd-usbin-11.1_p1.ebuild 5548 BLAKE2B 6217891573dc7dd83498f33f90b8c0c8a64ea6ace55694f395a95c9a076047235d8418874f3fc93fb858370a70ed52c3cbeb65a7e053a72ecea5f6feb02d9d9c SHA512 ffa8839deadf38ee3607f372d4aecc418254417c026b712deeb68cb2c7527c2d91f845580d3d3e31f985c6bd975a3524aa54786a76c115beaee765a2fc6f9d3e
MISC metadata.xml 599 BLAKE2B 70b00a85a1d670dc842bf5234aa6a82cc31564ec25c2f1789440b5beae5e4e0ab76b7b16122b92205d616e86225d892eb183f21c3e0c8aa63cb32f60a0647265 SHA512 afe1f9e8ccacac89bcd308b6476bba009035542f86d71f70f27df029ff20dda7ff7ff8c9510e6939d502a31750c6bf69de608440fb61b1d590d018446aa14f99
diff --git a/sys-freebsd/freebsd-usbin/files/freebsd-usbin-SA-1803-speculative_execution-amd64-11.patch b/sys-freebsd/freebsd-usbin/files/freebsd-usbin-SA-1803-speculative_execution-amd64-11.patch
new file mode 100644
index 000000000000..0cc67ad8f342
--- /dev/null
+++ b/sys-freebsd/freebsd-usbin/files/freebsd-usbin-SA-1803-speculative_execution-amd64-11.patch
@@ -0,0 +1,189 @@
+--- usr.sbin/cpucontrol/cpucontrol.8.orig
++++ usr.sbin/cpucontrol/cpucontrol.8
+@@ -24,7 +24,7 @@
+ .\"
+ .\" $FreeBSD$
+ .\"
+-.Dd June 30, 2009
++.Dd January 5, 2018
+ .Dt CPUCONTROL 8
+ .Os
+ .Sh NAME
+@@ -36,44 +36,48 @@
+ .Nm
+ .Op Fl vh
+ .Fl m Ar msr
+-.Bk
+ .Ar device
+ .Ek
++.Bk
+ .Nm
+ .Op Fl vh
+ .Fl m Ar msr Ns = Ns Ar value
+-.Bk
+ .Ar device
+ .Ek
++.Bk
+ .Nm
+ .Op Fl vh
+ .Fl m Ar msr Ns &= Ns Ar mask
+-.Bk
+ .Ar device
+ .Ek
++.Bk
+ .Nm
+ .Op Fl vh
+ .Fl m Ar msr Ns |= Ns Ar mask
+-.Bk
+ .Ar device
+ .Ek
++.Bk
+ .Nm
+ .Op Fl vh
+ .Fl i Ar level
+-.Bk
+ .Ar device
+ .Ek
++.Bk
+ .Nm
+ .Op Fl vh
+ .Fl i Ar level,level_type
+-.Bk
+ .Ar device
+ .Ek
++.Bk
+ .Nm
+ .Op Fl vh
+ .Op Fl d Ar datadir
+ .Fl u
++.Ar device
++.Ek
+ .Bk
++.Nm
++.Fl e
+ .Ar device
+ .Ek
+ .Sh DESCRIPTION
+@@ -129,6 +133,20 @@
+ .Nm
+ utility will walk through the configured data directories
+ and apply all firmware updates available for this CPU.
++.It Fl e
++Re-evaluate the kernel flags indicating the present CPU features.
++This command is typically executed after a firmware update was applied
++which changes information reported by the
++.Dv CPUID
++instruction.
++.Pp
++.Bf -symbolic
++Only execute the
++.Fl e
++command after the microcode update was applied to all CPUs in the system.
++The kernel does not operate correctly if the features of processors are
++not identical.
++.Ef
+ .It Fl v
+ Increase the verbosity level.
+ .It Fl h
+--- usr.sbin/cpucontrol/cpucontrol.c.orig
++++ usr.sbin/cpucontrol/cpucontrol.c
+@@ -60,6 +60,7 @@
+ #define FLAG_I 0x01
+ #define FLAG_M 0x02
+ #define FLAG_U 0x04
++#define FLAG_E 0x10
+
+ #define OP_INVAL 0x00
+ #define OP_READ 0x01
+@@ -114,7 +115,7 @@
+ if (name == NULL)
+ name = "cpuctl";
+ fprintf(stderr, "Usage: %s [-vh] [-d datadir] [-m msr[=value] | "
+- "-i level | -i level,level_type | -u] device\n", name);
++ "-i level | -i level,level_type | -e | -u] device\n", name);
+ exit(EX_USAGE);
+ }
+
+@@ -338,6 +339,25 @@
+ }
+
+ static int
++do_eval_cpu_features(const char *dev)
++{
++ int fd, error;
++
++ assert(dev != NULL);
++
++ fd = open(dev, O_RDWR);
++ if (fd < 0) {
++ WARN(0, "error opening %s for writing", dev);
++ return (1);
++ }
++ error = ioctl(fd, CPUCTL_EVAL_CPU_FEATURES, NULL);
++ if (error < 0)
++ WARN(0, "ioctl(%s, CPUCTL_EVAL_CPU_FEATURES)", dev);
++ close(fd);
++ return (error);
++}
++
++static int
+ do_update(const char *dev)
+ {
+ int fd;
+@@ -431,11 +451,14 @@
+ * 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:ehi:m:uv")) != -1) {
+ switch (c) {
+ case 'd':
+ datadir_add(optarg);
+ break;
++ case 'e':
++ flags |= FLAG_E;
++ break;
+ case 'i':
+ flags |= FLAG_I;
+ cmdarg = optarg;
+@@ -464,22 +487,25 @@
+ /* NOTREACHED */
+ }
+ dev = argv[0];
+- c = flags & (FLAG_I | FLAG_M | FLAG_U);
++ c = flags & (FLAG_E | FLAG_I | FLAG_M | FLAG_U);
+ switch (c) {
+- case FLAG_I:
+- if (strstr(cmdarg, ",") != NULL)
+- error = do_cpuid_count(cmdarg, dev);
+- else
+- error = do_cpuid(cmdarg, dev);
+- break;
+- case FLAG_M:
+- error = do_msr(cmdarg, dev);
+- break;
+- case FLAG_U:
+- error = do_update(dev);
+- break;
+- default:
+- usage(); /* Only one command can be selected. */
++ case FLAG_I:
++ if (strstr(cmdarg, ",") != NULL)
++ error = do_cpuid_count(cmdarg, dev);
++ else
++ error = do_cpuid(cmdarg, dev);
++ break;
++ case FLAG_M:
++ error = do_msr(cmdarg, dev);
++ break;
++ case FLAG_U:
++ error = do_update(dev);
++ break;
++ case FLAG_E:
++ error = do_eval_cpu_features(dev);
++ break;
++ default:
++ usage(); /* Only one command can be selected. */
+ }
+ SLIST_FREE(&datadirs, next, free);
+ return (error == 0 ? 0 : 1);
diff --git a/sys-freebsd/freebsd-usbin/freebsd-usbin-11.1_p1.ebuild b/sys-freebsd/freebsd-usbin/freebsd-usbin-11.1_p1.ebuild
new file mode 100644
index 000000000000..7eb0e4f04f7c
--- /dev/null
+++ b/sys-freebsd/freebsd-usbin/freebsd-usbin-11.1_p1.ebuild
@@ -0,0 +1,191 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit bsdmk freebsd flag-o-matic eutils
+
+DESCRIPTION="FreeBSD /usr/sbin tools"
+SLOT="0"
+LICENSE="BSD zfs? ( CDDL )"
+
+# Security Advisory and Errata patches.
+# UPSTREAM_PATCHES=()
+
+if [[ ${PV} != *9999* ]]; then
+ KEYWORDS="~amd64-fbsd ~x86-fbsd"
+ SRC_URI="${SRC_URI}
+ $(freebsd_upstream_patches)"
+fi
+
+EXTRACTONLY="
+ usr.sbin/
+ contrib/
+ usr.bin/
+ lib/
+ sbin/
+ etc/
+ gnu/
+"
+
+RDEPEND="=sys-freebsd/freebsd-lib-${RV}*[usb?,bluetooth?,netware?]
+ build? ( sys-apps/baselayout )
+ ssl? ( dev-libs/openssl:0 )
+ >=app-arch/libarchive-3
+ sys-apps/tcp-wrappers
+ dev-util/dialog
+ >=dev-libs/libedit-20120311.3.0-r1
+ net-libs/libpcap
+ kerberos? ( app-crypt/heimdal )"
+DEPEND="${RDEPEND}
+ =sys-freebsd/freebsd-mk-defs-${RV}*
+ =sys-freebsd/freebsd-ubin-${RV}*
+ zfs? ( =sys-freebsd/freebsd-cddl-${RV}* )
+ !build? ( =sys-freebsd/freebsd-sources-${RV}*
+ >=sys-freebsd/freebsd-sources-11.1_p3 )
+ sys-apps/texinfo
+ sys-devel/flex"
+
+S="${WORKDIR}/usr.sbin"
+
+IUSE="acpi atm audit bluetooth floppy ipv6 kerberos minimal netware nis pam ssl usb build zfs"
+
+pkg_setup() {
+ # Add the required source files.
+ use nis && EXTRACTONLY+="libexec/ "
+ use build && EXTRACTONLY+="sys/ include/ "
+ use zfs && EXTRACTONLY+="cddl/ "
+
+ # Release crunch is something like minimal. It seems to remove everything
+ # which is not needed to work.
+ use minimal && mymakeopts="${mymakeopts} RELEASE_CRUNCH= "
+
+ use acpi || mymakeopts="${mymakeopts} WITHOUT_ACPI= "
+ use atm || mymakeopts="${mymakeopts} WITHOUT_ATM= "
+ use audit || mymakeopts="${mymakeopts} WITHOUT_AUDIT= "
+ use bluetooth || mymakeopts="${mymakeopts} WITHOUT_BLUETOOTH= "
+ use ipv6 || mymakeopts="${mymakeopts} WITHOUT_INET6= WITHOUT_INET6_SUPPORT= "
+ use netware || mymakeopts="${mymakeopts} WITHOUT_IPX= WITHOUT_IPX_SUPPORT= WITHOUT_NCP= "
+ use nis || mymakeopts="${mymakeopts} WITHOUT_NIS= "
+ use pam || mymakeopts="${mymakeopts} WITHOUT_PAM_SUPPORT= "
+ use ssl || mymakeopts="${mymakeopts} WITHOUT_OPENSSL= "
+ use usb || mymakeopts="${mymakeopts} WITHOUT_USB= "
+ use floppy || mymakeopts="${mymakeopts} WITHOUT_FLOPPY= "
+ use kerberos || mymakeopts="${mymakeopts} WITHOUT_GSSAPI= "
+ use zfs || mymakeopts="${mymakeopts} WITHOUT_CDDL= "
+
+ mymakeopts="${mymakeopts} WITHOUT_PF= WITHOUT_LPR= WITHOUT_SENDMAIL= WITHOUT_AUTHPF= WITHOUT_MAILWRAPPER= WITHOUT_UNBOUND= "
+
+ append-flags $(test-flags -fno-strict-aliasing)
+}
+
+PATCHES=(
+ "${FILESDIR}/${PN}-adduser.patch"
+ "${FILESDIR}/${PN}-9.0-newsyslog.patch"
+ "${FILESDIR}/${PN}-11.1-bsdxml2expat.patch"
+ "${FILESDIR}/${PN}-10.3-bsdxml2expat.patch"
+ "${FILESDIR}/${PN}-11.0-workaround.patch"
+ "${FILESDIR}/${PN}-SA-1803-speculative_execution-amd64-11.patch"
+ )
+
+REMOVE_SUBDIRS="
+ tcpdchk tcpdmatch
+ sendmail praliases editmap mailstats makemap
+ pc-sysinstall cron mailwrapper ntp bsnmpd
+ tcpdump ndp inetd
+ wpa/wpa_supplicant wpa/hostapd wpa/hostapd_cli wpa/wpa_cli wpa/wpa_passphrase
+ zic amd
+ pkg freebsd-update service sysrc bsdinstall"
+
+src_prepare() {
+ if ! use build; then
+ [[ ! -e "${WORKDIR}/sys" ]] && ln -s "/usr/src/sys" "${WORKDIR}/sys"
+ [[ ! -e "${WORKDIR}/include" ]] && ln -s "/usr/include" "${WORKDIR}/include"
+ else
+ dummy_mk mount_smbfs
+ fi
+}
+
+src_compile() {
+ # Preparing to build nmtree, ypldap
+ for dir in libnetbsd libopenbsd; do
+ cd "${WORKDIR}/lib/${dir}" || die
+ freebsd_src_compile -j1
+ done
+
+ cd "${S}" || die
+ freebsd_src_compile
+}
+
+src_install() {
+ # By creating these directories we avoid having to do a
+ # more complex hack
+ dodir /usr/share/doc
+ dodir /sbin
+ dodir /usr/libexec
+ dodir /usr/bin
+
+ # FILESDIR is used by some makefiles which will install files
+ # in the wrong place, just put it in the doc directory.
+ freebsd_src_install DOCDIR=/usr/share/doc/${PF}
+
+ # Most of these now come from openrc.
+ for util in iscsid nfs nfsuserd rpc.statd rpc.lockd; do
+ newinitd "${FILESDIR}/"${util}.initd ${util}
+ if [[ -e "${FILESDIR}"/${util}.confd ]]; then \
+ newconfd "${FILESDIR}"/${util}.confd ${util}
+ fi
+ done
+
+ for class in daily monthly weekly; do
+ cat - > "${T}/periodic.${class}" <<EOS
+#!/bin/sh
+/usr/sbin/periodic ${class}
+EOS
+ exeinto /etc/cron.${class}
+ newexe "${T}/periodic.${class}" periodic
+ done
+
+ # Install the pw.conf file to let pw use Gentoo's skel location
+ insinto /etc
+ doins "${FILESDIR}/pw.conf"
+
+ cd "${WORKDIR}/etc" || die
+ doins apmd.conf syslog.conf newsyslog.conf nscd.conf
+
+ if use bluetooth; then
+ insinto /etc/bluetooth
+ doins bluetooth/*
+ rm -f "${D}"/etc/bluetooth/Makefile
+ fi
+
+ cd "${S}"/ppp || die
+ insinto /etc/ppp
+ doins ppp.conf
+
+ # Install the periodic stuff (needs probably to be ported in a more
+ # gentooish way)
+ cd "${WORKDIR}/etc/periodic" || die
+
+ doperiodic daily daily/*.accounting
+ doperiodic monthly monthly/*.accounting
+}
+
+pkg_postinst() {
+ # We need to run pwd_mkdb if key files are not present
+ # If they are, then there is no need to run pwd_mkdb
+ if [[ ! -e "${ROOT}etc/passwd" || ! -e "${ROOT}etc/pwd.db" || ! -e "${ROOT}etc/spwd.db" ]] ; then
+ if [[ -e "${ROOT}etc/master.passwd" ]] ; then
+ einfo "Generating passwd files from ${ROOT}etc/master.passwd"
+ "${ROOT}"usr/sbin/pwd_mkdb -p -d "${ROOT}etc" "${ROOT}etc/master.passwd"
+ else
+ eerror "${ROOT}etc/master.passwd does not exist!"
+ eerror "You will no be able to log into your system!"
+ fi
+ fi
+
+ for logfile in messages security auth.log maillog lpd-errs xferlog cron \
+ debug.log slip.log ppp.log; do
+ [[ -f "${ROOT}/var/log/${logfile}" ]] || touch "${ROOT}/var/log/${logfile}"
+ done
+}