Date: Sun, 22 Jan 2012 21:18:14 +0100 From: Robert Millan <rmh@freebsd.org> To: freebsd-arch@freebsd.org Cc: Kostik Belousov <kostikbel@gmail.com>, Adrian Chadd <adrian@freebsd.org> Subject: RFC: MK_BLOBS build option Message-ID: <20120122201814.GA32081@thorin>
next in thread | raw e-mail | index | archive | help
--VrqPEDrXMn8OVzN4
Content-Type: multipart/mixed; boundary="AqsLC8rIMeq19msA"
Content-Disposition: inline
--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hi everyone,
I propose this build option so that users can select if they want to disable
blobs of binary code in their kernel. Currently Debian does this by patchi=
ng
the build system; having a build option would make things much easier, but
it can also be useful for users whose preference is not to install those
modules.
Description:
Add MK_BLOBS build option. Setting MK_BLOBS to "no" will disable kernel
modules that include binary-only blobs of code.
More fine-grained control is provided via MK_BLOBS_HOST (for native code
that runs on host CPU) and MK_BLOBS_UCODE (for microcode).
Please comment!
--=20
Robert Millan
--AqsLC8rIMeq19msA
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="mk_blobs.diff"
Content-Transfer-Encoding: quoted-printable
Index: sys/modules/sound/driver/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/modules/sound/driver/Makefile (revision 230389)
+++ sys/modules/sound/driver/Makefile (working copy)
@@ -1,10 +1,21 @@
# $FreeBSD$
=20
-SUBDIR=3D ad1816 als4000 atiixp cs4281 csa ds1 emu10k1 emu10kx
-SUBDIR+=3D envy24 envy24ht es137x ess fm801 hda ich maestro maestro3
+.include <bsd.own.mk>
+
+# Modules that include binary-only blobs of microcode should be selectable=
by
+# MK_BLOBS_UCODE option (see below).
+
+SUBDIR=3D ad1816 als4000 atiixp cs4281 ${_csa} ${_ds1} emu10k1 emu10kx
+SUBDIR+=3D envy24 envy24ht es137x ess fm801 hda ich maestro ${_maestro3}
SUBDIR+=3D neomagic sb16 sb8 sbc solo spicds t4dwave via8233
SUBDIR+=3D via82c686 vibes driver uaudio
=20
+.if ${MK_BLOBS_UCODE} !=3D "no"
+_csa=3D csa
+_ds1=3D ds1
+_maestro3=3D maestro3
+.endif
+
.if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=3D "amd64"
SUBDIR+=3D cmi mss
.endif
Index: sys/modules/drm/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/modules/drm/Makefile (revision 230389)
+++ sys/modules/drm/Makefile (working copy)
@@ -1,15 +1,26 @@
# $FreeBSD$
=20
+.include <bsd.own.mk>
+
+# Modules that include binary-only blobs of microcode should be selectable=
by
+# MK_BLOBS_UCODE option (see below).
+
SUBDIR =3D \
drm \
i915 \
mach64 \
- mga \
- r128 \
- radeon \
+ ${_mga} \
+ ${_r128} \
+ ${_radeon} \
savage \
sis \
tdfx \
via
=20
+.if ${MK_BLOBS_UCODE} !=3D "no"
+_mga=3D mga
+_r128=3D r128
+_radeon=3D radeon
+.endif
+
.include <bsd.subdir.mk>
Index: sys/modules/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/modules/Makefile (revision 230389)
+++ sys/modules/Makefile (working copy)
@@ -2,6 +2,9 @@
=20
.include <bsd.own.mk>
=20
+# Modules that include binary-only blobs of microcode should be selectable=
by
+# MK_BLOBS_UCODE option (see below).
+
SUBDIR=3D ${_3dfx} \
${_3dfx_linux} \
${_aac} \
@@ -36,7 +39,7 @@
ath \
ath_pci \
${_auxio} \
- bce \
+ ${_bce} \
bfe \
bge \
${_bxe} \
@@ -95,13 +98,13 @@
${_ex} \
${_exca} \
${_ext2fs} \
- fatm \
+ ${_fatm} \
fdc \
fdescfs \
${_fe} \
firewire \
firmware \
- fxp \
+ ${_fxp} \
gem \
geom \
${_glxiic} \
@@ -147,7 +150,7 @@
${_ipwfw} \
iscsi \
isp \
- ispfw \
+ ${_ispfw} \
${_iwi} \
${_iwifw} \
${_iwn} \
@@ -208,7 +211,7 @@
${_mthca} \
mvs \
mwl \
- mwlfw \
+ ${_mwlfw} \
mxge \
my \
${_ncp} \
@@ -258,14 +261,14 @@
puc \
${_qlxgb} \
ral \
- ralfw \
+ ${_ralfw} \
${_random} \
rc4 \
${_rdma} \
re \
reiserfs \
rl \
- runfw \
+ ${_runfw} \
${_s3} \
${_safe} \
${_sbni} \
@@ -275,7 +278,7 @@
sdhci \
sem \
send \
- sf \
+ ${_sf} \
${_sfxge} \
sge \
siba_bwn \
@@ -284,7 +287,7 @@
sis \
sk \
${_smbfs} \
- sn \
+ ${_sn} \
${_snc} \
snp \
${_sound} \
@@ -299,7 +302,7 @@
${_sym} \
${_syscons} \
sysvipc \
- ti \
+ ${_ti} \
tl \
tmpfs \
${_tpm} \
@@ -308,7 +311,7 @@
twe \
tws \
tx \
- txp \
+ ${_txp} \
uart \
ubsec \
udf \
@@ -357,8 +360,10 @@
# No barrier instruction support (specific to this driver)
_sym=3D sym
# intr_disable() is a macro, causes problems
+.if ${MK_BLOBS_UCODE} !=3D "no"
_cxgb=3D cxgb
.endif
+.endif
=20
.if ${MK_CRYPT} !=3D "no" || defined(ALL_MODULES)
.if exists(${.CURDIR}/../opencrypto)
@@ -400,6 +405,20 @@
.endif
.endif
=20
+.if ${MK_BLOBS_UCODE} !=3D "no"
+_bce=3D bce
+_fatm=3D fatm
+_fxp=3D fxp
+_ispfw=3D ispfw
+_mwlfw=3D mwlfw
+_ralfw=3D ralfw
+_runfw=3D runfw
+_sf=3D sf
+_sn=3D sn
+_ti=3D ti
+_txp=3D txp
+.endif
+
.if ${MACHINE_CPUARCH} =3D=3D "i386"
# XXX some of these can move to the general case when de-i386'ed
# XXX some of these can move now, but are untested on other architectures.
@@ -415,9 +434,13 @@
_bxe=3D bxe
_cardbus=3D cardbus
_cbb=3D cbb
+.if ${MK_BLOBS_UCODE} !=3D "no"
_ce=3D ce
+.endif
_coff=3D coff
+.if ${MK_BLOBS_UCODE} !=3D "no"
_cp=3D cp
+.endif
_cpuctl=3D cpuctl
_cpufreq=3D cpufreq
_cs=3D cs
@@ -506,35 +529,51 @@
_cm=3D cm
_cmx=3D cmx
_coretemp=3D coretemp
+.if ${MK_BLOBS_UCODE} !=3D "no"
_ctau=3D ctau
+.endif
_dpt=3D dpt
_ex=3D ex
+.if ${MK_BLOBS_HOST} !=3D "no"
_hpt27xx=3D hpt27xx
+.endif
_hptiop=3D hptiop
+.if ${MK_BLOBS_HOST} !=3D "no"
_hptmv=3D hptmv
_hptrr=3D hptrr
+.endif
_ichwd=3D ichwd
_ida=3D ida
_iir=3D iir
_ipmi=3D ipmi
_ips=3D ips
_ipw=3D ipw
+.if ${MK_BLOBS_UCODE} !=3D "no"
_ipwfw=3D ipwfw
+.endif
_iwi=3D iwi
+.if ${MK_BLOBS_UCODE} !=3D "no"
_iwifw=3D iwifw
+.endif
_iwn=3D iwn
+.if ${MK_BLOBS_UCODE} !=3D "no"
_iwnfw=3D iwnfw
+.endif
_ixgb=3D ixgb
_ixgbe=3D ixgbe
_mly=3D mly
_nfe=3D nfe
+.if ${MK_BLOBS_HOST} !=3D "no"
_nve=3D nve
+.endif
_nvram=3D nvram
_nxge=3D nxge
_tpm=3D tpm
_viawd=3D viawd
_wpi=3D wpi
+.if ${MK_BLOBS_UCODE} !=3D "no"
_wpifw=3D wpifw
+.endif
.if ${MK_CRYPT} !=3D "no" || defined(ALL_MODULES)
_padlock=3D padlock
.endif
@@ -586,10 +625,14 @@
_em=3D em
_exca=3D exca
_ext2fs=3D ext2fs
+.if ${MK_BLOBS_HOST} !=3D "no"
_hpt27xx=3D hpt27xx
+.endif
_hptiop=3D hptiop
+.if ${MK_BLOBS_HOST} !=3D "no"
_hptmv=3D hptmv
_hptrr=3D hptrr
+.endif
_i2c=3D i2c
_ichwd=3D ichwd
_ida=3D ida
@@ -600,11 +643,17 @@
_ipmi=3D ipmi
_ips=3D ips
_ipw=3D ipw
+.if ${MK_BLOBS_UCODE} !=3D "no"
_ipwfw=3D ipwfw
+.endif
_iwi=3D iwi
+.if ${MK_BLOBS_UCODE} !=3D "no"
_iwifw=3D iwifw
+.endif
_iwn=3D iwn
+.if ${MK_BLOBS_UCODE} !=3D "no"
_iwnfw=3D iwnfw
+.endif
_ixgb=3D ixgb
_ixgbe=3D ixgbe
_lindev=3D lindev
@@ -620,7 +669,9 @@
.endif
_ndis=3D ndis
_nfe=3D nfe
+.if ${MK_BLOBS_HOST} !=3D "no"
_nve=3D nve
+.endif
_nvram=3D nvram
_nxge=3D nxge
.if ${MK_CDDL} !=3D "no" || defined(ALL_MODULES)
@@ -650,7 +701,9 @@
_x86bios=3D x86bios
_wi=3D wi
_wpi=3D wpi
+.if ${MK_BLOBS_UCODE} !=3D "no"
_wpifw=3D wpifw
+.endif
.if ${MK_ZFS} !=3D "no" || defined(ALL_MODULES)
_zfs=3D zfs
.endif
Index: sys/modules/usb/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/modules/usb/Makefile (revision 230389)
+++ sys/modules/usb/Makefile (working copy)
@@ -25,16 +25,28 @@
# SUCH DAMAGE.
#
=20
+.include <bsd.own.mk>
+
+# Modules that include binary-only blobs of microcode should be selectable=
by
+# MK_BLOBS_UCODE option (see below).
+
SUBDIR =3D usb
SUBDIR +=3D ehci musb ohci uhci xhci uss820dci ${_at91dci} ${_atmegadci} $=
{_avr32dci}
-SUBDIR +=3D rum run uath upgt usie ural zyd ${_urtw}
+SUBDIR +=3D ${_rum} run ${_uath} upgt usie ural ${_zyd} ${_urtw}
SUBDIR +=3D atp uhid ukbd ums udbp ufm uep
SUBDIR +=3D ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipa=
q ulpt \
umct umcs umodem umoscom uplcom uslcom uvisor uvscom
-SUBDIR +=3D uether aue axe cdce cue kue mos rue udav uhso ipheth
+SUBDIR +=3D uether aue axe cdce cue ${_kue} mos rue udav uhso ipheth
SUBDIR +=3D usfs umass urio
SUBDIR +=3D quirk template
=20
+.if ${MK_BLOBS_UCODE} !=3D "no"
+_rum=3D rum
+_uath=3D uath
+_zyd=3D zyd
+_kue=3D kue
+.endif
+
.if ${MACHINE_CPUARCH} =3D=3D "amd64"
_urtw=3D urtw
.endif
Index: share/mk/bsd.own.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- share/mk/bsd.own.mk (revision 230389)
+++ share/mk/bsd.own.mk (working copy)
@@ -320,6 +320,9 @@
BOOT \
BSD_CPIO \
BSNMP \
+ BLOBS \
+ BLOBS_HOST \
+ BLOBS_UCODE \
BZIP2 \
CALENDAR \
CAPSICUM \
@@ -511,6 +514,11 @@
MK_BIND_ETC:=3D no
.endif
=20
+.if ${MK_BLOBS} =3D=3D "no"
+MK_BLOBS_HOST:=3D no
+MK_BLOBS_UCODE:=3D no
+.endif
+
.if ${MK_CDDL} =3D=3D "no"
MK_ZFS:=3D no
MK_CTF:=3D no
Index: tools/build/options/WITHOUT_BLOBS
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tools/build/options/WITHOUT_BLOBS (revision 0)
+++ tools/build/options/WITHOUT_BLOBS (revision 0)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to not build kernel modules that include binary-only blobs of code (ei=
ther microcode or native code for host CPU).
Index: tools/build/options/WITHOUT_BLOBS_HOST
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tools/build/options/WITHOUT_BLOBS_HOST (revision 0)
+++ tools/build/options/WITHOUT_BLOBS_HOST (revision 0)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to not build kernel modules that include binary-only blobs of native c=
ode for host CPU.
Index: tools/build/options/WITHOUT_BLOBS_UCODE
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tools/build/options/WITHOUT_BLOBS_UCODE (revision 0)
+++ tools/build/options/WITHOUT_BLOBS_UCODE (revision 0)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to not build kernel modules that include binary-only blobs of microcod=
e.
--AqsLC8rIMeq19msA--
--VrqPEDrXMn8OVzN4
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/kFreeBSD)
iQIcBAEBCAAGBQJPHG8FAAoJELd1onhloKnOSdEQAK0I+5Lj0aP6E0I9Hz3IUiJe
TwGDB9o6R+CZ4VxBNoZs+87XrDOSTxPsSkfvA6UGGHmOcdUNO7ZUoTc4QpDSM4Fl
fCpXkoeuMf8DB/T0L61mkv1oZvQ0Rv+UwODyCQhMDh/no8m+v1JmUomUzIlIBrMi
9iBaLg8KR5OP8xl0IK6bIjL8eUtWQ4+dLEUZ1de+agWY3Bq5UjH5LaMFc2BGfW4R
+9cefeQ8/3dyg8AgrE/namgDlaPEqEj/iSM+PrDSy+z6prlIefdryq1NUNqWTk4F
iuu82CGkxsYIaWnr37kFwl4f3PunhuZ4iHXlcGV5wcMG4g0g+UlbWgGyWlPlmXUy
vkEuhNdADB3Y/QrpSpk3k/1EjzEdF0cWbSJ8oZbXMIxCb1WR5JIp5tVIxMz6yjCN
LXUj5W/MrZm5yjXaNm23U/hBlD7hseqKDDZYlaKU4Ydx2L9FyDTEQ3YscyJIIyyj
2VMcsQauySWtRco3oVeE13XlYoaaZrEQs4SltMYqg9r7rWwrzDX1c/ebb6PU/QUJ
vZ2ShGXAdbZ5uyvkT03cqI2Rh9eXK/ORBfMyE8DfGkUJNPPP90lRkateFEGhccxM
kJX7+cMCiu6EppoDDJQB8jJe25eJSjFSiDO8FEOqQqNzawosVzDtM/mgbLJGRPi9
7EYGZOuHvQFvtKXIXgam
=hzoV
-----END PGP SIGNATURE-----
--VrqPEDrXMn8OVzN4--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120122201814.GA32081>
