summaryrefslogtreecommitdiffstats
path: root/sys/tools
diff options
context:
space:
mode:
authorflz <flz@FreeBSD.org>2007-03-02 11:42:56 +0000
committerflz <flz@FreeBSD.org>2007-03-02 11:42:56 +0000
commitc0775f86888ac69eabbdca7fc103926bb2270208 (patch)
tree517101ea9394815527365b53ddc7e9425e8d0495 /sys/tools
parent38868f2cec1b862a3a51e02f4c3836e4644545e2 (diff)
downloadFreeBSD-src-c0775f86888ac69eabbdca7fc103926bb2270208.zip
FreeBSD-src-c0775f86888ac69eabbdca7fc103926bb2270208.tar.gz
- Add Intel firmwares for Intel PRO/Wireless LAN 2100/2200/2915 cards in a
uuencoded format along with their respective LICENSE files. - Add new share/doc/legal directory to BSD.usr.dist mtree file. This is the place we install LICENSE files for restricted firmwares. - Teach firmware(9) and kmod.mk about licensed firmwares. Restricted firmwares won't load properly unless legal.<name>.license_ack is set to 1, either via kenv(1) or /boot/loader.conf. Reviewed by: mlaier, sam Permitted by: Intel (via Andrew Wilson) MFC after: 1 month
Diffstat (limited to 'sys/tools')
-rw-r--r--sys/tools/fw_stub.awk34
1 files changed, 30 insertions, 4 deletions
diff --git a/sys/tools/fw_stub.awk b/sys/tools/fw_stub.awk
index 0a0bdba..ddcca01 100644
--- a/sys/tools/fw_stub.awk
+++ b/sys/tools/fw_stub.awk
@@ -33,7 +33,7 @@
function usage ()
{
- print "usage: fw_stub <firmware:name>* [-m modname] [-c outfile]";
+ print "usage: fw_stub <firmware:name>* [-l name] [-m modname] [-c outfile]";
exit 1;
}
@@ -84,6 +84,17 @@ for (i = 1; i < ARGC; i++) {
else
usage();
}
+ } else if (o == "l") {
+ if (length(ARGV[i]) > j) {
+ opt_l = substr(ARGV[i], j + 1);
+ break;
+ }
+ else {
+ if (++i < ARGC)
+ opt_l = ARGV[i];
+ else
+ usage();
+ }
} else
usage();
}
@@ -113,7 +124,12 @@ printc("#include <sys/param.h>\
#include <sys/kernel.h>\
#include <sys/module.h>\
#include <sys/linker.h>\
-#include <sys/firmware.h>\n");
+#include <sys/firmware.h>\
+#include <sys/systm.h>\n");
+
+if (opt_l) {
+ printc("static long " opt_l "_license_ack = 0;");
+}
for (file_i = 0; file_i < num_files; file_i++) {
symb = filenames[file_i];
@@ -128,7 +144,17 @@ opt_m "_fw_modevent(module_t mod, int type, void *unused)\
const struct firmware *fp, *parent;\
int error;\
switch (type) {\
- case MOD_LOAD:");
+ case MOD_LOAD:\n");
+
+if (opt_l) {
+ printc("\
+ TUNABLE_LONG_FETCH(\"legal." opt_l ".license_ack\", &" opt_l "_license_ack);\
+ if (!" opt_l "_license_ack) {\
+ printf(\"" opt_m ": You need to read the LICENSE file in /usr/share/doc/legal/" opt_l "/.\\n\");\
+ printf(\"" opt_m ": If you agree with the license, set legal." opt_l ".license_ack=1 in /boot/loader.conf.\\n\");\
+ return(EPERM);\
+ }\n");
+}
for (file_i = 0; file_i < num_files; file_i++) {
short = shortnames[file_i];
@@ -158,7 +184,7 @@ for (file_i = 0; file_i < num_files; file_i++) {
printc("\t\treturn (0);");
for (file_i = num_files - 1; file_i > 0; file_i--) {
- printc("\tfail_" file_i ":")
+ printc("fail_" file_i ":")
printc("\t\t(void)firmware_unregister(\"" shortnames[file_i - 1] "\");");
}
OpenPOWER on IntegriCloud