Fix locale errors on build, add chromium support

add option to easily install chromium after build since firefox doesnt have functional sound
remove regdb files, they serve no purpose as the wireless driver will not load them. This is a kernel bug and is fixed in
4.19, where they are't needed at all.
This commit is contained in:
Hal Emmerich 2019-01-10 13:43:03 -06:00
parent 17c4d734ad
commit 188082b20c
34 changed files with 538 additions and 2792 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
linux-*
open-ath9k-htc-firmware
PrawnOS-Alpha-c201-libre-2GB.img
tmp.*

View File

@ -5,3 +5,7 @@ Pin-Priority: 700
Package: *
Pin: release a=testing
Pin-Priority: 650
Package: *
Pin: release a=unstable
Pin-Priority: 600

View File

@ -0,0 +1,503 @@
# This file lists locales that you wish to have built. You can find a list
# of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add
# user defined locales to /usr/local/share/i18n/SUPPORTED. If you change
# this file, you need to rerun locale-gen.
# aa_DJ ISO-8859-1
# aa_DJ.UTF-8 UTF-8
# aa_ER UTF-8
# aa_ER@saaho UTF-8
# aa_ET UTF-8
# af_ZA ISO-8859-1
# af_ZA.UTF-8 UTF-8
# ak_GH UTF-8
# am_ET UTF-8
# an_ES ISO-8859-15
# an_ES.UTF-8 UTF-8
# anp_IN UTF-8
# ar_AE ISO-8859-6
# ar_AE.UTF-8 UTF-8
# ar_BH ISO-8859-6
# ar_BH.UTF-8 UTF-8
# ar_DZ ISO-8859-6
# ar_DZ.UTF-8 UTF-8
# ar_EG ISO-8859-6
# ar_EG.UTF-8 UTF-8
# ar_IN UTF-8
# ar_IQ ISO-8859-6
# ar_IQ.UTF-8 UTF-8
# ar_JO ISO-8859-6
# ar_JO.UTF-8 UTF-8
# ar_KW ISO-8859-6
# ar_KW.UTF-8 UTF-8
# ar_LB ISO-8859-6
# ar_LB.UTF-8 UTF-8
# ar_LY ISO-8859-6
# ar_LY.UTF-8 UTF-8
# ar_MA ISO-8859-6
# ar_MA.UTF-8 UTF-8
# ar_OM ISO-8859-6
# ar_OM.UTF-8 UTF-8
# ar_QA ISO-8859-6
# ar_QA.UTF-8 UTF-8
# ar_SA ISO-8859-6
# ar_SA.UTF-8 UTF-8
# ar_SD ISO-8859-6
# ar_SD.UTF-8 UTF-8
# ar_SS UTF-8
# ar_SY ISO-8859-6
# ar_SY.UTF-8 UTF-8
# ar_TN ISO-8859-6
# ar_TN.UTF-8 UTF-8
# ar_YE ISO-8859-6
# ar_YE.UTF-8 UTF-8
# as_IN UTF-8
# ast_ES ISO-8859-15
# ast_ES.UTF-8 UTF-8
# ayc_PE UTF-8
# az_AZ UTF-8
# be_BY CP1251
# be_BY.UTF-8 UTF-8
# be_BY@latin UTF-8
# bem_ZM UTF-8
# ber_DZ UTF-8
# ber_MA UTF-8
# bg_BG CP1251
# bg_BG.UTF-8 UTF-8
# bhb_IN.UTF-8 UTF-8
# bho_IN UTF-8
# bn_BD UTF-8
# bn_IN UTF-8
# bo_CN UTF-8
# bo_IN UTF-8
# br_FR ISO-8859-1
# br_FR.UTF-8 UTF-8
# br_FR@euro ISO-8859-15
# brx_IN UTF-8
# bs_BA ISO-8859-2
# bs_BA.UTF-8 UTF-8
# byn_ER UTF-8
# ca_AD ISO-8859-15
# ca_AD.UTF-8 UTF-8
# ca_ES ISO-8859-1
# ca_ES.UTF-8 UTF-8
# ca_ES.UTF-8@valencia UTF-8
# ca_ES@euro ISO-8859-15
# ca_ES@valencia ISO-8859-15
# ca_FR ISO-8859-15
# ca_FR.UTF-8 UTF-8
# ca_IT ISO-8859-15
# ca_IT.UTF-8 UTF-8
# ce_RU UTF-8
# chr_US UTF-8
# cmn_TW UTF-8
# crh_UA UTF-8
# cs_CZ ISO-8859-2
# cs_CZ.UTF-8 UTF-8
# csb_PL UTF-8
# cv_RU UTF-8
# cy_GB ISO-8859-14
# cy_GB.UTF-8 UTF-8
# da_DK ISO-8859-1
# da_DK.UTF-8 UTF-8
# de_AT ISO-8859-1
# de_AT.UTF-8 UTF-8
# de_AT@euro ISO-8859-15
# de_BE ISO-8859-1
# de_BE.UTF-8 UTF-8
# de_BE@euro ISO-8859-15
# de_CH ISO-8859-1
# de_CH.UTF-8 UTF-8
# de_DE ISO-8859-1
# de_DE.UTF-8 UTF-8
# de_DE@euro ISO-8859-15
# de_IT ISO-8859-1
# de_IT.UTF-8 UTF-8
# de_LI.UTF-8 UTF-8
# de_LU ISO-8859-1
# de_LU.UTF-8 UTF-8
# de_LU@euro ISO-8859-15
# doi_IN UTF-8
# dv_MV UTF-8
# dz_BT UTF-8
# el_CY ISO-8859-7
# el_CY.UTF-8 UTF-8
# el_GR ISO-8859-7
# el_GR.UTF-8 UTF-8
# en_AG UTF-8
# en_AU ISO-8859-1
# en_AU.UTF-8 UTF-8
# en_BW ISO-8859-1
# en_BW.UTF-8 UTF-8
# en_CA ISO-8859-1
# en_CA.UTF-8 UTF-8
# en_DK ISO-8859-1
# en_DK.ISO-8859-15 ISO-8859-15
# en_DK.UTF-8 UTF-8
# en_GB ISO-8859-1
# en_GB.ISO-8859-15 ISO-8859-15
# en_GB.UTF-8 UTF-8
# en_HK ISO-8859-1
# en_HK.UTF-8 UTF-8
# en_IE ISO-8859-1
# en_IE.UTF-8 UTF-8
# en_IE@euro ISO-8859-15
# en_IL UTF-8
# en_IN UTF-8
# en_NG UTF-8
# en_NZ ISO-8859-1
# en_NZ.UTF-8 UTF-8
# en_PH ISO-8859-1
# en_PH.UTF-8 UTF-8
# en_SG ISO-8859-1
# en_SG.UTF-8 UTF-8
# en_US ISO-8859-1
# en_US.ISO-8859-15 ISO-8859-15
en_US.UTF-8 UTF-8
# en_ZA ISO-8859-1
# en_ZA.UTF-8 UTF-8
# en_ZM UTF-8
# en_ZW ISO-8859-1
# en_ZW.UTF-8 UTF-8
# eo UTF-8
# es_AR ISO-8859-1
# es_AR.UTF-8 UTF-8
# es_BO ISO-8859-1
# es_BO.UTF-8 UTF-8
# es_CL ISO-8859-1
# es_CL.UTF-8 UTF-8
# es_CO ISO-8859-1
# es_CO.UTF-8 UTF-8
# es_CR ISO-8859-1
# es_CR.UTF-8 UTF-8
# es_CU UTF-8
# es_DO ISO-8859-1
# es_DO.UTF-8 UTF-8
# es_EC ISO-8859-1
# es_EC.UTF-8 UTF-8
# es_ES ISO-8859-1
# es_ES.UTF-8 UTF-8
# es_ES@euro ISO-8859-15
# es_GT ISO-8859-1
# es_GT.UTF-8 UTF-8
# es_HN ISO-8859-1
# es_HN.UTF-8 UTF-8
# es_MX ISO-8859-1
# es_MX.UTF-8 UTF-8
# es_NI ISO-8859-1
# es_NI.UTF-8 UTF-8
# es_PA ISO-8859-1
# es_PA.UTF-8 UTF-8
# es_PE ISO-8859-1
# es_PE.UTF-8 UTF-8
# es_PR ISO-8859-1
# es_PR.UTF-8 UTF-8
# es_PY ISO-8859-1
# es_PY.UTF-8 UTF-8
# es_SV ISO-8859-1
# es_SV.UTF-8 UTF-8
# es_US ISO-8859-1
# es_US.UTF-8 UTF-8
# es_UY ISO-8859-1
# es_UY.UTF-8 UTF-8
# es_VE ISO-8859-1
# es_VE.UTF-8 UTF-8
# et_EE ISO-8859-1
# et_EE.ISO-8859-15 ISO-8859-15
# et_EE.UTF-8 UTF-8
# eu_ES ISO-8859-1
# eu_ES.UTF-8 UTF-8
# eu_ES@euro ISO-8859-15
# eu_FR ISO-8859-1
# eu_FR.UTF-8 UTF-8
# eu_FR@euro ISO-8859-15
# fa_IR UTF-8
# ff_SN UTF-8
# fi_FI ISO-8859-1
# fi_FI.UTF-8 UTF-8
# fi_FI@euro ISO-8859-15
# fil_PH UTF-8
# fo_FO ISO-8859-1
# fo_FO.UTF-8 UTF-8
# fr_BE ISO-8859-1
# fr_BE.UTF-8 UTF-8
# fr_BE@euro ISO-8859-15
# fr_CA ISO-8859-1
# fr_CA.UTF-8 UTF-8
# fr_CH ISO-8859-1
# fr_CH.UTF-8 UTF-8
# fr_FR ISO-8859-1
# fr_FR.UTF-8 UTF-8
# fr_FR@euro ISO-8859-15
# fr_LU ISO-8859-1
# fr_LU.UTF-8 UTF-8
# fr_LU@euro ISO-8859-15
# fur_IT UTF-8
# fy_DE UTF-8
# fy_NL UTF-8
# ga_IE ISO-8859-1
# ga_IE.UTF-8 UTF-8
# ga_IE@euro ISO-8859-15
# gd_GB ISO-8859-15
# gd_GB.UTF-8 UTF-8
# gez_ER UTF-8
# gez_ER@abegede UTF-8
# gez_ET UTF-8
# gez_ET@abegede UTF-8
# gl_ES ISO-8859-1
# gl_ES.UTF-8 UTF-8
# gl_ES@euro ISO-8859-15
# gu_IN UTF-8
# gv_GB ISO-8859-1
# gv_GB.UTF-8 UTF-8
# ha_NG UTF-8
# hak_TW UTF-8
# he_IL ISO-8859-8
# he_IL.UTF-8 UTF-8
# hi_IN UTF-8
# hne_IN UTF-8
# hr_HR ISO-8859-2
# hr_HR.UTF-8 UTF-8
# hsb_DE ISO-8859-2
# hsb_DE.UTF-8 UTF-8
# ht_HT UTF-8
# hu_HU ISO-8859-2
# hu_HU.UTF-8 UTF-8
# hy_AM UTF-8
# hy_AM.ARMSCII-8 ARMSCII-8
# ia_FR UTF-8
# id_ID ISO-8859-1
# id_ID.UTF-8 UTF-8
# ig_NG UTF-8
# ik_CA UTF-8
# is_IS ISO-8859-1
# is_IS.UTF-8 UTF-8
# it_CH ISO-8859-1
# it_CH.UTF-8 UTF-8
# it_IT ISO-8859-1
# it_IT.UTF-8 UTF-8
# it_IT@euro ISO-8859-15
# iu_CA UTF-8
# ja_JP.EUC-JP EUC-JP
# ja_JP.UTF-8 UTF-8
# ka_GE GEORGIAN-PS
# ka_GE.UTF-8 UTF-8
# kk_KZ PT154
# kk_KZ.RK1048 RK1048
# kk_KZ.UTF-8 UTF-8
# kl_GL ISO-8859-1
# kl_GL.UTF-8 UTF-8
# km_KH UTF-8
# kn_IN UTF-8
# ko_KR.EUC-KR EUC-KR
# ko_KR.UTF-8 UTF-8
# kok_IN UTF-8
# ks_IN UTF-8
# ks_IN@devanagari UTF-8
# ku_TR ISO-8859-9
# ku_TR.UTF-8 UTF-8
# kw_GB ISO-8859-1
# kw_GB.UTF-8 UTF-8
# ky_KG UTF-8
# lb_LU UTF-8
# lg_UG ISO-8859-10
# lg_UG.UTF-8 UTF-8
# li_BE UTF-8
# li_NL UTF-8
# lij_IT UTF-8
# ln_CD UTF-8
# lo_LA UTF-8
# lt_LT ISO-8859-13
# lt_LT.UTF-8 UTF-8
# lv_LV ISO-8859-13
# lv_LV.UTF-8 UTF-8
# lzh_TW UTF-8
# mag_IN UTF-8
# mai_IN UTF-8
# mg_MG ISO-8859-15
# mg_MG.UTF-8 UTF-8
# mhr_RU UTF-8
# mi_NZ ISO-8859-13
# mi_NZ.UTF-8 UTF-8
# mk_MK ISO-8859-5
# mk_MK.UTF-8 UTF-8
# ml_IN UTF-8
# mn_MN UTF-8
# mni_IN UTF-8
# mr_IN UTF-8
# ms_MY ISO-8859-1
# ms_MY.UTF-8 UTF-8
# mt_MT ISO-8859-3
# mt_MT.UTF-8 UTF-8
# my_MM UTF-8
# nan_TW UTF-8
# nan_TW@latin UTF-8
# nb_NO ISO-8859-1
# nb_NO.UTF-8 UTF-8
# nds_DE UTF-8
# nds_NL UTF-8
# ne_NP UTF-8
# nhn_MX UTF-8
# niu_NU UTF-8
# niu_NZ UTF-8
# nl_AW UTF-8
# nl_BE ISO-8859-1
# nl_BE.UTF-8 UTF-8
# nl_BE@euro ISO-8859-15
# nl_NL ISO-8859-1
# nl_NL.UTF-8 UTF-8
# nl_NL@euro ISO-8859-15
# nn_NO ISO-8859-1
# nn_NO.UTF-8 UTF-8
# nr_ZA UTF-8
# nso_ZA UTF-8
# oc_FR ISO-8859-1
# oc_FR.UTF-8 UTF-8
# om_ET UTF-8
# om_KE ISO-8859-1
# om_KE.UTF-8 UTF-8
# or_IN UTF-8
# os_RU UTF-8
# pa_IN UTF-8
# pa_PK UTF-8
# pap_AW UTF-8
# pap_CW UTF-8
# pl_PL ISO-8859-2
# pl_PL.UTF-8 UTF-8
# ps_AF UTF-8
# pt_BR ISO-8859-1
# pt_BR.UTF-8 UTF-8
# pt_PT ISO-8859-1
# pt_PT.UTF-8 UTF-8
# pt_PT@euro ISO-8859-15
# quz_PE UTF-8
# raj_IN UTF-8
# ro_RO ISO-8859-2
# ro_RO.UTF-8 UTF-8
# ru_RU ISO-8859-5
# ru_RU.CP1251 CP1251
# ru_RU.KOI8-R KOI8-R
# ru_RU.UTF-8 UTF-8
# ru_UA KOI8-U
# ru_UA.UTF-8 UTF-8
# rw_RW UTF-8
# sa_IN UTF-8
# sat_IN UTF-8
# sc_IT UTF-8
# sd_IN UTF-8
# sd_IN@devanagari UTF-8
# se_NO UTF-8
# sgs_LT UTF-8
# shs_CA UTF-8
# si_LK UTF-8
# sid_ET UTF-8
# sk_SK ISO-8859-2
# sk_SK.UTF-8 UTF-8
# sl_SI ISO-8859-2
# sl_SI.UTF-8 UTF-8
# so_DJ ISO-8859-1
# so_DJ.UTF-8 UTF-8
# so_ET UTF-8
# so_KE ISO-8859-1
# so_KE.UTF-8 UTF-8
# so_SO ISO-8859-1
# so_SO.UTF-8 UTF-8
# sq_AL ISO-8859-1
# sq_AL.UTF-8 UTF-8
# sq_MK UTF-8
# sr_ME UTF-8
# sr_RS UTF-8
# sr_RS@latin UTF-8
# ss_ZA UTF-8
# st_ZA ISO-8859-1
# st_ZA.UTF-8 UTF-8
# sv_FI ISO-8859-1
# sv_FI.UTF-8 UTF-8
# sv_FI@euro ISO-8859-15
# sv_SE ISO-8859-1
# sv_SE.ISO-8859-15 ISO-8859-15
# sv_SE.UTF-8 UTF-8
# sw_KE UTF-8
# sw_TZ UTF-8
# szl_PL UTF-8
# ta_IN UTF-8
# ta_LK UTF-8
# tcy_IN.UTF-8 UTF-8
# te_IN UTF-8
# tg_TJ KOI8-T
# tg_TJ.UTF-8 UTF-8
# th_TH TIS-620
# th_TH.UTF-8 UTF-8
# the_NP UTF-8
# ti_ER UTF-8
# ti_ET UTF-8
# tig_ER UTF-8
# tk_TM UTF-8
# tl_PH ISO-8859-1
# tl_PH.UTF-8 UTF-8
# tn_ZA UTF-8
# tr_CY ISO-8859-9
# tr_CY.UTF-8 UTF-8
# tr_TR ISO-8859-9
# tr_TR.UTF-8 UTF-8
# ts_ZA UTF-8
# tt_RU UTF-8
# tt_RU@iqtelif UTF-8
# ug_CN UTF-8
# uk_UA KOI8-U
# uk_UA.UTF-8 UTF-8
# unm_US UTF-8
# ur_IN UTF-8
# ur_PK UTF-8
# uz_UZ ISO-8859-1
# uz_UZ.UTF-8 UTF-8
# uz_UZ@cyrillic UTF-8
# ve_ZA UTF-8
# vi_VN UTF-8
# wa_BE ISO-8859-1
# wa_BE.UTF-8 UTF-8
# wa_BE@euro ISO-8859-15
# wae_CH UTF-8
# wal_ET UTF-8
# wo_SN UTF-8
# xh_ZA ISO-8859-1
# xh_ZA.UTF-8 UTF-8
# yi_US CP1255
# yi_US.UTF-8 UTF-8
# yo_NG UTF-8
# yue_HK UTF-8
# zh_CN GB2312
# zh_CN.GB18030 GB18030
# zh_CN.GBK GBK
# zh_CN.UTF-8 UTF-8
# zh_HK BIG5-HKSCS
# zh_HK.UTF-8 UTF-8
# zh_SG GB2312
# zh_SG.GBK GBK
# zh_SG.UTF-8 UTF-8
# zh_TW BIG5
# zh_TW.EUC-TW EUC-TW
# zh_TW.UTF-8 UTF-8
# zu_ZA ISO-8859-1
# zu_ZA.UTF-8 UTF-8
# agr_PE UTF-8
# az_IR UTF-8
# bho_NP UTF-8
# bi_VU UTF-8
# ca_ES@valencia UTF-8
# dsb_DE UTF-8
# el_GR@euro ISO-8859-7
# en_SC.UTF-8 UTF-8
# hif_FJ UTF-8
# kab_DZ UTF-8
# mai_NP UTF-8
# mfe_MU UTF-8
# miq_NI UTF-8
# mjw_IN UTF-8
# sah_RU UTF-8
# shn_MM UTF-8
# sm_WS UTF-8
# to_TO UTF-8
# tpi_PG UTF-8
# yuw_PG UTF-8

View File

@ -1,2 +0,0 @@
key.priv.pem
dbparse.pyc

View File

@ -1,49 +0,0 @@
This project embraces the Developer Certificate of Origin (DCO) for
contributions. This means you must agree to the following prior to submitting
patches, if you agree with this developer certificate you acknowledge this by
adding a Signed-off-by tag to your patch commit log. Every submitted patch
must have this.
The source for the DCO:
http://developercertificate.org/
-----------------------------------------------------------------------
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

View File

@ -1,16 +0,0 @@
Copyright (c) 2008, Luis R. Rodriguez <mcgrof@gmail.com>
Copyright (c) 2008, Johannes Berg <johannes@sipsolutions.net>
Copyright (c) 2008, Michael Green <Michael.Green@Atheros.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -1,129 +0,0 @@
# Install prefix
PREFIX ?= /usr
CRDA_PATH ?= $(PREFIX)/lib/crda
CRDA_KEY_PATH ?= $(CRDA_PATH)/pubkeys
FIRMWARE_PATH ?= /lib/firmware
MANDIR ?= $(PREFIX)/share/man/
SHA1SUM ?= /usr/bin/sha1sum
LSB_RELEASE ?= /usr/bin/lsb_release
WHOAMI ?= /usr/bin/whoami
# Distro name: Ubuntu, Debian, Fedora, if not present you get
# "custom-distro", if your distribution does not have the LSB stuff,
# then set this variable when calling make if you don't want "custom-distro"
LSB_ID ?= $(shell if [ -f $(LSB_RELEASE) ]; then \
$(LSB_RELEASE) -i -s; \
else \
echo custom-distro; \
fi)
DISTRO_PRIVKEY ?= ~/.wireless-regdb-$(LSB_ID).key.priv.pem
DISTRO_PUBKEY ?= ~/.wireless-regdb-$(LSB_ID).key.priv.pem
REGDB_AUTHOR ?= $(shell if [ -f $(DISTRO_PRIVKEY) ]; then \
echo $(LSB_ID) ; \
elif [ -f $(WHOAMI) ]; then \
$(WHOAMI); \
else \
echo custom-user; \
fi)
REGDB_PRIVKEY ?= ~/.wireless-regdb-$(REGDB_AUTHOR).key.priv.pem
REGDB_PUBKEY ?= $(REGDB_AUTHOR).key.pub.pem
REGDB_PUBCERT ?= $(REGDB_AUTHOR).x509.pem
REGDB_UPSTREAM_PUBKEY ?= sforshee.key.pub.pem
REGDB_CHANGED = $(shell $(SHA1SUM) -c --status sha1sum.txt >/dev/null 2>&1; \
if [ $$? -ne 0 ]; then \
echo maintainer-clean $(REGDB_PUBKEY) $(REGDB_PUBCERT); \
fi)
.PHONY: all clean mrproper install maintainer-clean install-distro-key
all: $(REGDB_CHANGED) regulatory.bin sha1sum.txt regulatory.db.p7s
clean:
@rm -f *.pyc *.gz
maintainer-clean: clean
@rm -f regulatory.bin regulatory.db regulatory.db.p7s
mrproper: clean maintainer-clean
@echo Removed public key, regulatory.bin, regulatory.db* and compressed man pages
@rm -f $(REGDB_PUBKEY) $(REGDB_PUBCERT) .custom
regulatory.bin: db.txt $(REGDB_PRIVKEY) $(REGDB_PUBKEY)
@echo Generating $@ digitally signed by $(REGDB_AUTHOR)...
./db2bin.py regulatory.bin db.txt $(REGDB_PRIVKEY)
regulatory.db: db.txt db2fw.py
@echo "Generating $@"
./db2fw.py regulatory.db db.txt
regulatory.db.p7s: regulatory.db $(REGDB_PRIVKEY) $(REGDB_PUBCERT)
@echo "Signing regulatory.db (by $(REGDB_AUTHOR))..."
@openssl smime -sign \
-signer $(REGDB_PUBCERT) \
-inkey $(REGDB_PRIVKEY) \
-in $< -nosmimecap -binary \
-outform DER -out $@
sha1sum.txt: db.txt
sha1sum $< > $@
$(REGDB_PUBKEY): $(REGDB_PRIVKEY)
@echo "Generating public key for $(REGDB_AUTHOR)..."
openssl rsa -in $(REGDB_PRIVKEY) -out $(REGDB_PUBKEY) -pubout -outform PEM
$(REGDB_PUBCERT): $(REGDB_PRIVKEY)
@echo "Generating certificate for $(REGDB_AUTHOR)..."
./gen-pubcert.sh $(REGDB_PRIVKEY) $(REGDB_PUBCERT)
@echo $(REGDB_PUBKEY) > .custom
$(REGDB_PRIVKEY):
@echo "Generating private key for $(REGDB_AUTHOR)..."
openssl genrsa -out $(REGDB_PRIVKEY) 2048
ifneq ($(shell test -e $(DISTRO_PRIVKEY) && echo yes),yes)
$(DISTRO_PRIVKEY):
@echo "Generating private key for $(LSB_ID) packager..."
openssl genrsa -out $(DISTRO_PRIVKEY) 2048
endif
install-distro-key: maintainer-clean $(DISTRO_PRIVKEY)
%.gz: %
gzip < $< > $@
# Users should just do:
# sudo make install
#
# Developers should do:
# make maintainer-clean
# make
# sudo make install
#
# Distributions packagers should do only once:
# make install-distro-key
# This will create a private key for you and install it into
# ~/.wireless-regdb-$(LSB_ID).key.priv.pem
# To make new releaes just do:
# make maintainer-clean
# make
# sudo make install
install: regulatory.bin.5.gz regulatory.db.5.gz
install -m 755 -d $(DESTDIR)/$(CRDA_PATH)
install -m 755 -d $(DESTDIR)/$(CRDA_KEY_PATH)
install -m 755 -d $(DESTDIR)/$(FIRMWARE_PATH)
if [ -f .custom ]; then \
install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(shell cat .custom); \
fi
install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(REGDB_UPSTREAM_PUBKEY)
install -m 644 -t $(DESTDIR)/$(CRDA_PATH)/ regulatory.bin
install -m 644 -t $(DESTDIR)/$(FIRMWARE_PATH) regulatory.db regulatory.db.p7s
install -m 755 -d $(DESTDIR)/$(MANDIR)/man5/
install -m 644 -t $(DESTDIR)/$(MANDIR)/man5/ regulatory.bin.5.gz regulatory.db.5.gz

View File

@ -1,29 +0,0 @@
This repository contains the plain text version of the regulatory
database file I maintain for use with Central Regulatory Database
Agent daemon. Also included is the compiled binary version of this
file signed with my RSA key. This represents a good faith attempt
to capture regulatory information that is correct at the time of its last
modification. This information is provided to you with no warranty
either expressed or implied.
Also included are the tools used to compile and sign the regulatory.bin
file as well as a MoinMoin macro used for viewing the database.
TECHNICAL INFORMATION
=======================
The regulatory information in `db.txt' is stored in a human-readable
format which can be read using the `dbparse.py' python module. This
python module is used by the web viewer (Regulatory.py) which is
implemented as a MoinMoin macro (and used on http://wireless.kernel.org)
to allow viewing the database for verification.
The dbparse module is also used by db2bin.py and db2fw.py, the `compilers'
that compile the database to its binary formats.
For more information, please see the CRDA git repository:
git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git
John W. Linville
17 November 2008

File diff suppressed because it is too large Load Diff

View File

@ -1,147 +0,0 @@
#!/usr/bin/env python
from io import BytesIO, open
import struct
import hashlib
from dbparse import DBParser
import sys
MAGIC = 0x52474442
VERSION = 19
if len(sys.argv) < 3:
print('Usage: %s output-file input-file [key-file]' % sys.argv[0])
sys.exit(2)
def create_rules(countries):
result = {}
for c in countries.values():
for rule in c.permissions:
result[rule] = 1
return list(result)
def create_collections(countries):
result = {}
for c in countries.values():
result[c.permissions] = 1
return list(result)
def be32(output, val):
output.write(struct.pack('>I', val))
class PTR(object):
def __init__(self, output):
self._output = output
self._pos = output.tell()
be32(output, 0xFFFFFFFF)
def set(self, val=None):
if val is None:
val = self._output.tell()
self._offset = val
pos = self._output.tell()
self._output.seek(self._pos)
be32(self._output, val)
self._output.seek(pos)
def get(self):
return self._offset
p = DBParser()
countries = p.parse(open(sys.argv[2], 'r', encoding='utf-8'))
countrynames = list(countries)
countrynames.sort()
power = []
bands = []
for alpha2 in countrynames:
for perm in countries[alpha2].permissions:
if not perm.freqband in bands:
bands.append(perm.freqband)
if not perm.power in power:
power.append(perm.power)
rules = create_rules(countries)
rules.sort()
collections = create_collections(countries)
collections.sort()
output = BytesIO()
# struct regdb_file_header
be32(output, MAGIC)
be32(output, VERSION)
reg_country_ptr = PTR(output)
# add number of countries
be32(output, len(countries))
siglen = PTR(output)
power_rules = {}
for pr in power:
power_rules[pr] = output.tell()
pr = [int(v * 100.0) for v in (pr.max_ant_gain, pr.max_eirp)]
# struct regdb_file_power_rule
output.write(struct.pack('>II', *pr))
freq_ranges = {}
for fr in bands:
freq_ranges[fr] = output.tell()
fr = [int(f * 1000.0) for f in (fr.start, fr.end, fr.maxbw)]
# struct regdb_file_freq_range
output.write(struct.pack('>III', *fr))
reg_rules = {}
for reg_rule in rules:
freq_range, power_rule = reg_rule.freqband, reg_rule.power
reg_rules[reg_rule] = output.tell()
# struct regdb_file_reg_rule
output.write(struct.pack('>III', freq_ranges[freq_range], power_rules[power_rule],
reg_rule.flags))
reg_rules_collections = {}
for coll in collections:
reg_rules_collections[coll] = output.tell()
# struct regdb_file_reg_rules_collection
coll = list(coll)
be32(output, len(coll))
coll.sort()
for regrule in coll:
be32(output, reg_rules[regrule])
# update country pointer now!
reg_country_ptr.set()
for alpha2 in countrynames:
coll = countries[alpha2]
# struct regdb_file_reg_country
output.write(struct.pack('>BBxBI', alpha2[0], alpha2[1], coll.dfs_region, reg_rules_collections[coll.permissions]))
if len(sys.argv) > 3:
# Load RSA only now so people can use this script
# without having those libraries installed to verify
# their SQL changes
from M2Crypto import RSA
# determine signature length
key = RSA.load_key(sys.argv[3])
hash = hashlib.sha1()
hash.update(output.getvalue())
sig = key.sign(hash.digest())
# write it to file
siglen.set(len(sig))
# sign again
hash = hashlib.sha1()
hash.update(output.getvalue())
sig = key.sign(hash.digest())
output.write(sig)
else:
siglen.set(0)
outfile = open(sys.argv[1], 'wb')
outfile.write(output.getvalue())

View File

@ -1,158 +0,0 @@
#!/usr/bin/env python
from io import BytesIO, open
import struct
import hashlib
from dbparse import DBParser
import sys
from math import log
MAGIC = 0x52474442
VERSION = 20
if len(sys.argv) < 3:
print('Usage: %s output-file input-file' % sys.argv[0])
sys.exit(2)
def create_rules(countries):
result = {}
for c in countries.values():
for rule in c.permissions:
result[rule] = 1
return list(result)
def create_collections(countries):
result = {}
for c in countries.values():
result[(c.permissions, c.dfs_region)] = 1
return list(result)
def create_wmms(countries):
result = {}
for c in countries.values():
for rule in c.permissions:
if rule.wmmrule is not None:
result[rule.wmmrule] = 1
return list(result)
def be32(output, val):
output.write(struct.pack('>I', val))
def be16(output, val):
output.write(struct.pack('>H', val))
class PTR(object):
def __init__(self, output):
self._output = output
self._pos = output.tell()
be16(output, 0)
self._written = False
def set(self, val=None):
if val is None:
val = self._output.tell()
assert val & 3 == 0
self._offset = val
pos = self._output.tell()
self._output.seek(self._pos)
be16(self._output, val >> 2)
self._output.seek(pos)
self._written = True
def get(self):
return self._offset
@property
def written(self):
return self._written
p = DBParser()
countries = p.parse(open(sys.argv[2], 'r', encoding='utf-8'))
rules = create_rules(countries)
rules.sort()
collections = create_collections(countries)
collections.sort()
wmms = create_wmms(countries)
wmms.sort()
output = BytesIO()
# struct regdb_file_header
be32(output, MAGIC)
be32(output, VERSION)
country_ptrs = {}
countrynames = list(countries)
countrynames.sort()
for alpha2 in countrynames:
coll = countries[alpha2]
output.write(struct.pack('>BB', alpha2[0], alpha2[1]))
country_ptrs[alpha2] = PTR(output)
output.write(b'\x00' * 4)
wmmdb = {}
for w in wmms:
assert output.tell() & 3 == 0
wmmdb[w] = output.tell() >> 2
for r in w._as_tuple():
ecw = int(log(r[0] + 1, 2)) << 4 | int(log(r[1] + 1, 2))
ac = (ecw, r[2],r[3])
output.write(struct.pack('>BBH', *ac))
reg_rules = {}
flags = 0
for reg_rule in rules:
freq_range, power_rule, wmm_rule = reg_rule.freqband, reg_rule.power, reg_rule.wmmrule
reg_rules[reg_rule] = output.tell()
assert power_rule.max_ant_gain == 0
flags = 0
# convert to new rule flags
assert reg_rule.flags & ~0x899 == 0
if reg_rule.flags & 1<<0:
flags |= 1<<0
if reg_rule.flags & 1<<3:
flags |= 1<<1
if reg_rule.flags & 1<<4:
flags |= 1<<2
if reg_rule.flags & 1<<7:
flags |= 1<<3
if reg_rule.flags & 1<<11:
flags |= 1<<4
rule_len = 16
cac_timeout = 0 # TODO
if not (flags & 1<<2):
cac_timeout = 0
if cac_timeout or wmm_rule:
rule_len += 2
if wmm_rule is not None:
rule_len += 2
output.write(struct.pack('>BBHIII', rule_len, flags, int(power_rule.max_eirp * 100),
int(freq_range.start * 1000), int(freq_range.end * 1000), int(freq_range.maxbw * 1000),
))
if rule_len > 16:
output.write(struct.pack('>H', cac_timeout))
if rule_len > 18:
be16(output, wmmdb[wmm_rule])
while rule_len % 4:
output.write('\0')
rule_len += 1
for coll in collections:
for alpha2 in countrynames:
if (countries[alpha2].permissions, countries[alpha2].dfs_region) == coll:
assert not country_ptrs[alpha2].written
country_ptrs[alpha2].set()
slen = 3
output.write(struct.pack('>BBBx', slen, len(list(coll[0])), coll[1]))
coll = list(coll[0])
for regrule in coll:
be16(output, reg_rules[regrule] >> 2)
if len(coll) % 2:
be16(output, 0)
for alpha2 in countrynames:
assert country_ptrs[alpha2].written
outfile = open(sys.argv[1], 'wb')
outfile.write(output.getvalue())

View File

@ -1,516 +0,0 @@
#!/usr/bin/env python
from builtins import bytes
from functools import total_ordering
import sys, math
from math import ceil, log
from collections import defaultdict, OrderedDict
import attr
# must match <linux/nl80211.h> enum nl80211_reg_rule_flags
flag_definitions = {
'NO-OFDM': 1<<0,
'NO-CCK': 1<<1,
'NO-INDOOR': 1<<2,
'NO-OUTDOOR': 1<<3,
'DFS': 1<<4,
'PTP-ONLY': 1<<5,
'PTMP-ONLY': 1<<6,
'NO-IR': 1<<7,
# hole at bit 8
# hole at bit 9. FIXME: Where is NO-HT40 defined?
'NO-HT40': 1<<10,
'AUTO-BW': 1<<11,
}
dfs_regions = {
'DFS-FCC': 1,
'DFS-ETSI': 2,
'DFS-JP': 3,
}
@total_ordering
@attr.s(frozen=True, cmp=False)
class WmmRule(object):
vo_c = attr.ib()
vi_c = attr.ib()
be_c = attr.ib()
bk_c = attr.ib()
vo_ap = attr.ib()
vi_ap = attr.ib()
be_ap = attr.ib()
bk_ap = attr.ib()
def _as_tuple(self):
return (self.vo_c, self.vi_c, self.be_c, self.bk_c,
self.vo_ap, self.vi_ap, self.be_ap, self.bk_ap)
def __eq__(self, other):
if other is None:
return False
return (self._as_tuple() == other._as_tuple())
def __ne__(self, other):
return not (self == other)
def __lt__(self, other):
if other is None:
return False
return (self._as_tuple() < other._as_tuple())
def __hash__(self):
return hash(self._as_tuple())
class FreqBand(object):
def __init__(self, start, end, bw, comments=None):
self.start = start
self.end = end
self.maxbw = bw
self.comments = comments or []
def _as_tuple(self):
return (self.start, self.end, self.maxbw)
def __eq__(self, other):
return (self._as_tuple() == other._as_tuple())
def __ne__(self, other):
return not (self == other)
def __lt__(self, other):
return (self._as_tuple() < other._as_tuple())
def __hash__(self):
return hash(self._as_tuple())
def __str__(self):
return '<FreqBand %.3f - %.3f @ %.3f>' % (
self.start, self.end, self.maxbw)
@total_ordering
class PowerRestriction(object):
def __init__(self, max_ant_gain, max_eirp, comments = None):
self.max_ant_gain = max_ant_gain
self.max_eirp = max_eirp
self.comments = comments or []
def _as_tuple(self):
return (self.max_ant_gain, self.max_eirp)
def __eq__(self, other):
return (self._as_tuple() == other._as_tuple())
def __ne__(self, other):
return not (self == other)
def __lt__(self, other):
return (self._as_tuple() < other._as_tuple())
def __hash__(self):
return hash(self._as_tuple())
def __str__(self):
return '<PowerRestriction ...>'
class DFSRegionError(Exception):
def __init__(self, dfs_region):
self.dfs_region = dfs_region
class FlagError(Exception):
def __init__(self, flag):
self.flag = flag
@total_ordering
class Permission(object):
def __init__(self, freqband, power, flags, wmmrule):
assert isinstance(freqband, FreqBand)
assert isinstance(power, PowerRestriction)
assert isinstance(wmmrule, WmmRule) or wmmrule is None
self.freqband = freqband
self.power = power
self.wmmrule = wmmrule
self.flags = 0
for flag in flags:
if not flag in flag_definitions:
raise FlagError(flag)
self.flags |= flag_definitions[flag]
self.textflags = flags
def _as_tuple(self):
return (self.freqband, self.power, self.flags, self.wmmrule)
def __eq__(self, other):
return (self._as_tuple() == other._as_tuple())
def __ne__(self, other):
return not (self == other)
def __lt__(self, other):
return (self._as_tuple() < other._as_tuple())
def __hash__(self):
return hash(self._as_tuple())
def __str__(self):
return str(self.freqband) + str(self.power) + str(self.wmmrule)
class Country(object):
def __init__(self, dfs_region, permissions=None, comments=None):
self._permissions = permissions or []
self.comments = comments or []
self.dfs_region = 0
if dfs_region:
if not dfs_region in dfs_regions:
raise DFSRegionError(dfs_region)
self.dfs_region = dfs_regions[dfs_region]
def add(self, perm):
assert isinstance(perm, Permission)
self._permissions.append(perm)
self._permissions.sort()
def __contains__(self, perm):
assert isinstance(perm, Permission)
return perm in self._permissions
def __str__(self):
r = ['(%s, %s)' % (str(b), str(p)) for b, p in self._permissions]
return '<Country (%s)>' % (', '.join(r))
def _get_permissions_tuple(self):
return tuple(self._permissions)
permissions = property(_get_permissions_tuple)
class SyntaxError(Exception):
pass
class DBParser(object):
def __init__(self, warn=None):
self._warn_callout = warn or sys.stderr.write
def _syntax_error(self, txt=None):
txt = txt and ' (%s)' % txt or ''
raise SyntaxError("Syntax error in line %d%s" % (self._lineno, txt))
def _warn(self, txt):
self._warn_callout("Warning (line %d): %s\n" % (self._lineno, txt))
def _parse_band_def(self, bname, banddef, dupwarn=True):
try:
freqs, bw = banddef.split('@')
bw = float(bw)
except ValueError:
bw = 20.0
try:
start, end = freqs.split('-')
start = float(start)
end = float(end)
# The kernel will reject these, so might as well reject this
# upon building it.
if start <= 0:
self._syntax_error("Invalid start freq (%d)" % start)
if end <= 0:
self._syntax_error("Invalid end freq (%d)" % end)
if start > end:
self._syntax_error("Inverted freq range (%d - %d)" % (start, end))
if start == end:
self._syntax_error("Start and end freqs are equal (%d)" % start)
except ValueError:
self._syntax_error("band must have frequency range")
b = FreqBand(start, end, bw, comments=self._comments)
self._comments = []
self._banddup[bname] = bname
if b in self._bandrev:
if dupwarn:
self._warn('Duplicate band definition ("%s" and "%s")' % (
bname, self._bandrev[b]))
self._banddup[bname] = self._bandrev[b]
self._bands[bname] = b
self._bandrev[b] = bname
self._bandline[bname] = self._lineno
def _parse_band(self, line):
try:
bname, line = line.split(':', 1)
if not bname:
self._syntax_error("'band' keyword must be followed by name")
except ValueError:
self._syntax_error("band name must be followed by colon")
if bname in flag_definitions:
self._syntax_error("Invalid band name")
self._parse_band_def(bname, line)
def _parse_power(self, line):
try:
pname, line = line.split(':', 1)
if not pname:
self._syntax_error("'power' keyword must be followed by name")
except ValueError:
self._syntax_error("power name must be followed by colon")
if pname in flag_definitions:
self._syntax_error("Invalid power name")
self._parse_power_def(pname, line)
def _parse_power_def(self, pname, line, dupwarn=True):
try:
max_eirp = line
if max_eirp == 'N/A':
max_eirp = '0'
max_ant_gain = float(0)
def conv_pwr(pwr):
if pwr.endswith('mW'):
pwr = float(pwr[:-2])
return 10.0 * math.log10(pwr)
else:
return float(pwr)
max_eirp = conv_pwr(max_eirp)
except ValueError:
self._syntax_error("invalid power data")
p = PowerRestriction(max_ant_gain, max_eirp,
comments=self._comments)
self._comments = []
self._powerdup[pname] = pname
if p in self._powerrev:
if dupwarn:
self._warn('Duplicate power definition ("%s" and "%s")' % (
pname, self._powerrev[p]))
self._powerdup[pname] = self._powerrev[p]
self._power[pname] = p
self._powerrev[p] = pname
self._powerline[pname] = self._lineno
def _parse_wmmrule(self, line):
regions = line[:-1].strip()
if not regions:
self._syntax_error("'wmmrule' keyword must be followed by region")
regions = regions.split(',')
self._current_regions = {}
for region in regions:
if region in self._wmm_rules:
self._warn("region %s was added already to wmm rules" % region)
self._current_regions[region] = 1
self._comments = []
def _validate_input(self, cw_min, cw_max, aifsn, cot):
if cw_min < 1:
self._syntax_error("Invalid cw_min value (%d)" % cw_min)
if cw_max < 1:
self._syntax_error("Invalid cw_max value (%d)" % cw_max)
if cw_min > cw_max:
self._syntax_error("Inverted contention window (%d - %d)" %
(cw_min, cw_max))
if not (bin(cw_min + 1).count('1') == 1 and cw_min < 2**15):
self._syntax_error("Invalid cw_min value should be power of 2 - 1 (%d)"
% cw_min)
if not (bin(cw_max + 1).count('1') == 1 and cw_max < 2**15):
self._syntax_error("Invalid cw_max value should be power of 2 - 1 (%d)"
% cw_max)
if aifsn < 1:
self._syntax_error("Invalid aifsn value (%d)" % aifsn)
if cot < 0:
self._syntax_error("Invalid cot value (%d)" % cot)
def _validate_size(self, var, bytcnt):
return bytcnt < ceil(len(bin(var)[2:]) / 8.0)
def _parse_wmmrule_item(self, line):
bytcnt = (2.0, 2.0, 1.0, 2.0)
try:
ac, cval = line.split(':')
if not ac:
self._syntax_error("wmm item must have ac prefix")
except ValueError:
self._syntax_error("access category must be followed by colon")
p = tuple([int(v.split('=', 1)[1]) for v in cval.split(',')])
self._validate_input(*p)
for v, b in zip(p, bytcnt):
if self._validate_size(v, b):
self._syntax_error("unexpected input size expect %d got %d"
% (b, v))
for r in self._current_regions:
self._wmm_rules[r][ac] = p
def _parse_country(self, line):
try:
cname, cvals= line.split(':', 1)
dfs_region = cvals.strip()
if not cname:
self._syntax_error("'country' keyword must be followed by name")
except ValueError:
self._syntax_error("country name must be followed by colon")
cnames = cname.split(',')
self._current_countries = {}
for cname in cnames:
if len(cname) != 2:
self._warn("country '%s' not alpha2" % cname)
cname = bytes(cname, 'ascii')
if not cname in self._countries:
self._countries[cname] = Country(dfs_region, comments=self._comments)
self._current_countries[cname] = self._countries[cname]
self._comments = []
def _parse_country_item(self, line):
if line[0] == '(':
try:
band, line = line[1:].split('),', 1)
bname = 'UNNAMED %d' % self._lineno
self._parse_band_def(bname, band, dupwarn=False)
except:
self._syntax_error("Badly parenthesised band definition")
else:
try:
bname, line = line.split(',', 1)
if not bname:
self._syntax_error("country definition must have band")
if not line:
self._syntax_error("country definition must have power")
except ValueError:
self._syntax_error("country definition must have band and power")
if line[0] == '(':
items = line.split('),', 1)
if len(items) == 1:
pname = items[0]
line = ''
if not pname[-1] == ')':
self._syntax_error("Badly parenthesised power definition")
pname = pname[:-1]
flags = []
else:
pname = items[0]
flags = items[1].split(',')
power = pname[1:]
pname = 'UNNAMED %d' % self._lineno
self._parse_power_def(pname, power, dupwarn=False)
else:
line = line.split(',')
pname = line[0]
flags = line[1:]
w = None
if flags and 'wmmrule' in flags[-1]:
try:
region = flags.pop().split('=', 1)[1]
if region not in self._wmm_rules.keys():
self._syntax_error("No wmm rule for %s" % region)
except IndexError:
self._syntax_error("flags is empty list or no region was found")
w = WmmRule(*self._wmm_rules[region].values())
if not bname in self._bands:
self._syntax_error("band does not exist")
if not pname in self._power:
self._syntax_error("power does not exist")
self._bands_used[bname] = True
self._power_used[pname] = True
# de-duplicate so binary database is more compact
bname = self._banddup[bname]
pname = self._powerdup[pname]
b = self._bands[bname]
p = self._power[pname]
try:
perm = Permission(b, p, flags, w)
except FlagError as e:
self._syntax_error("Invalid flag '%s'" % e.flag)
for cname, c in self._current_countries.items():
if perm in c:
self._warn('Rule "%s, %s" added to "%s" twice' % (
bname, pname, cname))
else:
c.add(perm)
def parse(self, f):
self._current_countries = None
self._current_regions = None
self._bands = {}
self._power = {}
self._countries = {}
self._bands_used = {}
self._power_used = {}
self._bandrev = {}
self._powerrev = {}
self._banddup = {}
self._powerdup = {}
self._bandline = {}
self._powerline = {}
self._wmm_rules = defaultdict(lambda: OrderedDict())
self._comments = []
self._lineno = 0
for line in f:
self._lineno += 1
line = line.strip()
if line[0:1] == '#':
self._comments.append(line[1:].strip())
line = line.replace(' ', '').replace('\t', '')
if not line:
self._current_regions = None
self._comments = []
line = line.split('#')[0]
if not line:
continue
if line[0:4] == 'band':
self._parse_band(line[4:])
self._current_countries = None
self._current_regions = None
self._comments = []
elif line[0:5] == 'power':
self._parse_power(line[5:])
self._current_countries = None
self._current_regions = None
self._comments = []
elif line[0:7] == 'country':
self._parse_country(line[7:])
self._comments = []
self._current_regions = None
elif self._current_countries is not None:
self._current_regions = None
self._parse_country_item(line)
self._comments = []
elif line[0:7] == 'wmmrule':
self._parse_wmmrule(line[7:])
self._current_countries = None
self._comments = []
elif self._current_regions is not None:
self._parse_wmmrule_item(line)
self._current_countries = None
self._comments = []
else:
self._syntax_error("Expected band, power or country definition")
countries = self._countries
bands = {}
for k, v in self._bands.items():
if k in self._bands_used:
bands[self._banddup[k]] = v
continue
# we de-duplicated, but don't warn again about the dupes
if self._banddup[k] == k:
self._lineno = self._bandline[k]
self._warn('Unused band definition "%s"' % k)
power = {}
for k, v in self._power.items():
if k in self._power_used:
power[self._powerdup[k]] = v
continue
# we de-duplicated, but don't warn again about the dupes
if self._powerdup[k] == k:
self._lineno = self._powerline[k]
self._warn('Unused power definition "%s"' % k)
return countries

View File

@ -1,5 +0,0 @@
wireless-regdb (2009.01.15-1) unstable; urgency=low
* Initial release
-- Luis R. Rodriguez <mcgrof@gmail.com> Thu, 22 Jan 2009 16:00:00 +0100

View File

@ -1,15 +0,0 @@
Source: wireless-regdb
Section: admin
Priority: optional
Maintainer: Luis R. Rodriguez <mcgrof@gmail.com>
Build-Depends: cdbs, debhelper (>= 5), python
Standards-Version: 3.7.3
Package: wireless-regdb
Architecture: all
Depends:
Suggests: crda
Description: The Linux wireless regulatory database
This package contains the wireless regulatory database used by all
cfg80211 based Linux wireless drivers. The wireless database being
used is maintained by Seth Forshee.

View File

@ -1,21 +0,0 @@
This package was debianized by Luis Rodriguez <mcgrof@gmail.com> on
Thu, 22 Jan 2009 16:00:00 +0100.
The wireless-regdb packages was downloaded from <http://wireless.kernel.org/download/wireless-regdb/>
Copyright (c) 2008, Luis R. Rodriguez <mcgrof@gmail.com>
Copyright (c) 2008, Johannes Berg <johannes@sipsolutions.net>
Copyright (c) 2008, Michael Green <Michael.Green@Atheros.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -1,10 +0,0 @@
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
PREFIX = /usr
CRDA_LIB ?= $(PREFIX)/lib/crda
install/wireless-regdb::
install -o 0 -g 0 -m 755 -d debian/$(cdbs_curpkg)/$(CRDA_LIB)
install -o 0 -g 0 -m 644 regulatory.bin debian/$(cdbs_curpkg)/$(CRDA_LIB)/regulatory.bin

View File

@ -1,18 +0,0 @@
#!/bin/bash
if [[ $# -ne 2 ]]; then
echo "Usage: $0 priv-key out-file"
exit 1
fi
openssl req -new -key "$1" -days 36500 -utf8 -nodes -batch \
-x509 -outform PEM -out "$2" \
-config <(cat <<-EOF
[ req ]
distinguished_name = req_distinguished_name
string_mask = utf8only
prompt = no
[ req_distinguished_name ]
commonName = sforshee
EOF
)

View File

@ -1,49 +0,0 @@
.TH regulatory.bin 5 "21 December 2017" "regulatory.bin" "Linux"
.SH NAME
regulatory.bin, regulatory.db \- The Linux wireless regulatory database
.ad l
.in +8
.ti -8
.SS
.SH Description
.B regulatory.bin
and
.B regulatory.db
are the files used by the Linux wireless subsystem to keep its regulatory
database information.
.PP
.B regulatory.bin
is read by
.B crda
upon the Linux kernel's request for regulatory information for a specific
ISO / IEC 3166 alpha2 country code.
.PP
.B regulatory.db
is a newer, extensible database format which (since Linux 4.15) is read
by the kernel directly as a firmware file.
The regulatory database is kept in a small binary format for size and code
efficiency. The
.B regulatory.bin
file can be parsed and read in human format by using the
.B regdbdump
command. The regulatory database files should be updated upon regulatory
changes or corrections.
.SH Upkeeping
The regulatory database is maintained by the community as such
you are encouraged to send any corrections or updates to the
linux-wireless and wireless-regdb mailing lists:
.B linux-wireless@vger.kernel.org
and
.B wireless-regdb@lists.infradead.org
.SH SEE ALSO
.BR regdbdump (8)
.BR crda (8)
.BR iw (8)
.BR http://wireless.kernel.org/en/developers/Regulatory/

View File

@ -1 +0,0 @@
.so man5/regulatory.bin.5.gz

View File

@ -1,9 +0,0 @@
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtUDjnCiEOQPyOddmLEE4
Fax+pYNxJX6QfGjdbz/Z11k4n3xqUsIDKi1+ZvQesxJwIFvUlzI9cYs7GwgXFGth
xFeLlhYc/STVCwn5aBGE+8pRDNFFGdoQRIrZ/nap/WAtGAsolbIt6oiYuNFWIfBT
H/ECb+lGm5NfKJAPrDb6aCNxV1b2zNPffSrZG3NF67onhe96f6XLgMcwNtJT7uys
Hucx8TainGPGZVt/JXVooerTfgBcml7YIBgydwcpEmYeNnPnlwRBN7Gxciv0oSkg
fJZ5CyvQ2N7IbD+T+8XueFIRFRt69uJomef7RhaE48eh5uDSRtXhxF+gZvTaxP+V
HQIDAQAB
-----END PUBLIC KEY-----

View File

@ -1,17 +0,0 @@
-----BEGIN CERTIFICATE-----
MIICpDCCAYwCCQCyjd9HrvnOpzANBgkqhkiG9w0BAQsFADATMREwDwYDVQQDDAhz
Zm9yc2hlZTAgFw0xNzEwMDYxOTQwMzVaGA8yMTE3MDkxMjE5NDAzNVowEzERMA8G
A1UEAwwIc2ZvcnNoZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC1
QOOcKIQ5A/I512YsQTgVrH6lg3ElfpB8aN1vP9nXWTiffGpSwgMqLX5m9B6zEnAg
W9SXMj1xizsbCBcUa2HEV4uWFhz9JNULCfloEYT7ylEM0UUZ2hBEitn+dqn9YC0Y
CyiVsi3qiJi40VYh8FMf8QJv6Uabk18okA+sNvpoI3FXVvbM0999Ktkbc0XruieF
73p/pcuAxzA20lPu7Kwe5zHxNqKcY8ZlW38ldWih6tN+AFyaXtggGDJ3BykSZh42
c+eXBEE3sbFyK/ShKSB8lnkLK9DY3shsP5P7xe54UhEVG3r24miZ5/tGFoTjx6Hm
4NJG1eHEX6Bm9NrE/5UdAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAIcD2vKCwt2v
fEQvhtNfTJNIuf4HF7sh9yUjTqoiDBa5c66dRnx12cNJV0e/M7eX7PVAdcBGIvCg
XZx5E6H/uKMve44GP8i25Goo8jRcIz8ywOatD6zPVXRHc9MBhbcLIlYkfZ8JqQ6G
njdbnG0C2YzIUGriWfMWBuqyQrVY/rrRgVca77I4iFj2qsQui1on5KXopMpnXKxy
Z8NvE8MtNXnXiuf11CEwStX2o9l5VvIPEPd90FGTL0f4fUsKhFUSCn1OOx8rL/wo
s2k04YCAu+KvudYw8R1UhyOZn1EDTEV9AmVzq/3PlMwNOmD9PBQvFjOpIR/LULGP
A+6gZqkWeRQ=
-----END CERTIFICATE-----

View File

@ -1 +0,0 @@
027c038d4bb051c1e0b17ec007ab9a283a21a06b db.txt

View File

@ -1,166 +0,0 @@
# -*- coding: iso-8859-1 -*-
"""
Regulatory Database
@copyright: 2008 Johannes Berg
@license: ISC, see LICENSE for details.
"""
import codecs, math
from dbparse import DBParser, flag_definitions
Dependencies = ["time"]
def _country(macro, countries, code):
result = []
f = macro.formatter
result.extend([
f.heading(1, 1),
f.text('Regulatory definition for %s' % _get_iso_code(code)),
f.heading(0, 1),
])
try:
country = countries[code]
except:
result.append(f.text('No information available'))
return ''.join(result)
if country.comments:
result.extend([
f.preformatted(1),
f.text('\n'.join(country.comments)),
f.preformatted(0),
])
result.append(f.table(1))
result.extend([
f.table_row(1),
f.table_cell(1), f.strong(1),
f.text('Band [MHz]'),
f.strong(0), f.table_cell(0),
f.table_cell(1), f.strong(1),
f.text('Max BW [MHz]'),
f.strong(0), f.table_cell(0),
f.table_cell(1), f.strong(1),
f.text('Flags'),
f.strong(0), f.table_cell(0),
f.table_cell(1), f.strong(1),
f.text('Max antenna gain [dBi]'),
f.strong(0), f.table_cell(0),
f.table_cell(1), f.strong(1),
f.text('Max EIRP [dBm'),
f.hardspace,
f.text('(mW)]'),
f.strong(0), f.table_cell(0),
f.table_row(0),
])
for perm in country.permissions:
def str_or_na(val, dBm=False):
if val and not dBm:
return '%.2f' % val
elif val:
return '%.2f (%.2f)' % (val, math.pow(10, val/10.0))
return 'N/A'
result.extend([
f.table_row(1),
f.table_cell(1),
f.text('%.3f - %.3f' % (perm.freqband.start, perm.freqband.end)),
f.table_cell(0),
f.table_cell(1),
f.text('%.3f' % (perm.freqband.maxbw,)),
f.table_cell(0),
f.table_cell(1),
f.text(', '.join(perm.textflags)),
f.table_cell(0),
f.table_cell(1),
f.text(str_or_na(perm.power.max_ant_gain)),
f.table_cell(0),
f.table_cell(1),
f.text(str_or_na(perm.power.max_eirp, dBm=True)),
f.table_cell(0),
f.table_row(0),
])
result.append(f.table(0))
result.append(f.linebreak(0))
result.append(f.linebreak(0))
result.append(macro.request.page.link_to(macro.request, 'return to country list'))
return ''.join(result)
_iso_list = {}
def _get_iso_code(code):
if not _iso_list:
for line in codecs.open('/usr/share/iso-codes/iso_3166.tab', encoding='utf-8'):
line = line.strip()
c, name = line.split('\t')
_iso_list[c] = name
return _iso_list.get(code, 'Unknown (%s)' % code)
def macro_Regulatory(macro):
_ = macro.request.getText
request = macro.request
f = macro.formatter
country = request.form.get('alpha2', [None])[0]
dbpath = '/tmp/db.txt'
if hasattr(request.cfg, 'regdb_path'):
dbpath = request.cfg.regdb_path
result = []
if request.form.get('raw', [None])[0]:
result.append(f.code_area(1, 'db-raw', show=1, start=1, step=1))
for line in open(dbpath):
result.extend([
f.code_line(1),
f.text(line.rstrip()),
f.code_line(0),
])
result.append(f.code_area(0, 'db-raw'))
result.append(macro.request.page.link_to(macro.request, 'return to country list'))
return ''.join(result)
warnings = []
countries = DBParser(warn=lambda x: warnings.append(x)).parse(open(dbpath))
if country:
return _country(macro, countries, country)
countries = countries.keys()
countries = [(_get_iso_code(code), code) for code in countries]
countries.sort()
result.extend([
f.heading(1, 1),
f.text('Countries'),
f.heading(0, 1),
])
result.append(f.bullet_list(1))
for name, code in countries:
result.extend([
f.listitem(1),
request.page.link_to(request, name, querystr={'alpha2': code}),
f.listitem(0),
])
result.append(f.bullet_list(0))
if warnings:
result.append(f.heading(1, 2))
result.append(f.text("Warnings"))
result.append(f.heading(0, 2))
result.append(f.preformatted(1))
result.extend(warnings)
result.append(f.preformatted(0))
result.append(request.page.link_to(request, 'view raw database', querystr={'raw': 1}))
return ''.join(result)

View File

@ -1,35 +0,0 @@
Summary: Linux wireless regulatory database
Name: wireless-regdb
Version: 2009.01.15
Release: 1
License: ISC
Group: System Enviroment/Base
Source: http://wireless.kernel.org/download/wireless-regdb/wireless-regdb-2009-01-15.tar.bz2
URL: http://wireless.kernel.org/en/developers/Regulatory/
Packager: Luis R. Rodriguez <mcgrof@gmail.com>
BuildRoot : /var/tmp/%{name}-buildroot
Requires: python
BuildArch: noarch
%define crda_lib /usr/lib/crda
%description
This package contains the wireless regulatory database used by all
cfg80211 based Linux wireless drivers. The wireless database being
used is maintained by Seth Forshee.
http://wireless.kernel.org/en/developers/Regulatory/
%prep
%setup -n %name-2009-01-15
%build
%install
install -m 755 -d %buildroot/%crda_lib
install -m 644 regulatory.bin %buildroot/%{crda_lib}/regulatory.bin
%files
%crda_lib/regulatory.bin
%doc README LICENSE
%changelog
* Fri Jan 23 2009 - mcgrof@gmail.com
- Started wireless-regdb package

View File

@ -9,4 +9,8 @@ deb-src http://security.debian.org/debian-security/ stretch/updates main
#Add buster to grab a functional firefox release
# /etc/apt/preferences prevents this from updating the whole system
deb http://deb.debian.org/debian/ testing main
deb http://deb.debian.org/debian/ testing main
#Add sid to grab a functional chromium release
# /etc/apt/preferences prevents this from updating the whole system
deb http://deb.debian.org/debian/ unstable main

View File

@ -0,0 +1,2 @@
[PlankDockItemPreferences]
Launcher=file:///usr/share/applications/chromium.desktop

View File

@ -27,15 +27,17 @@ while true; do
esac
done
locale-gen
#Install shared packages
apt install -y xorg acpi-support lightdm tasksel dpkg librsvg2-common xorg xserver-xorg-input-libinput alsa-utils anacron avahi-daemon eject iw libnss-mdns xdg-utils mousepad vlc dconf-cli dconf-editor sudo dtrx emacs25
apt install -y network-manager-gnome network-manager-openvpn network-manager-openvpn-gnome
#install firefox from buster
# #install chromium from sid
# apt -t unstable install -y chromium
# #install firefox from buster
apt -t testing install -y firefox-esr
[ "$DE" = "xfce" ] && apt install -y xfce4 dbus-user-session system-config-printer tango-icon-theme xfce4-power-manager xfce4-terminal xfce4-goodies numix-gtk-theme plank accountsservice firefox-esr
[ "$DE" = "xfce" ] && apt install -y xfce4 dbus-user-session system-config-printer tango-icon-theme xfce4-power-manager xfce4-terminal xfce4-goodies numix-gtk-theme plank accountsservice
[ "$DE" = "lxqt" ] && apt install -y lxqt pavucontrol-qt
if [ "$DE" = "xfce" ]
@ -111,7 +113,11 @@ dmesg -D
#Have the user set a root password
echo " Enter a password for the root user"
passwd
until passwd
do
echo " Enter a password for the root user"
passwd
done
#Force a safe username
while true; do

View File

@ -58,7 +58,7 @@ trap cleanup INT TERM EXIT
create_image() {
# it's a sparse file - that's how we fit a 16GB image inside a 2GB one
# it's a sparse file - that's how we fit a 16GB image inside a 3GB one
dd if=/dev/zero of=$1 bs=$3 count=$4 conv=sparse
parted --script $1 mklabel gpt
cgpt create $1
@ -75,7 +75,7 @@ create_image() {
mount -o noatime ${2}p2 $5
}
# create a 2GB image with the Chrome OS partition layout
# create a 3GB image with the Chrome OS partition layout
create_image PrawnOS-Alpha-c201-libre-2GB.img $outdev 50M 40 $outmnt
# install Debian on it
@ -99,7 +99,7 @@ cp $build_resources/sources.list $outmnt/etc/apt/sources.list
cp $build_resources/apt-preferences $outmnt/etc/apt/preferences
#Setup the locale
chroot $outmnt echo en_US.UTF-8 UTF-8 > /etc/locale.gen
cp $build_resources/locale.gen $outmnt/etc/locale.gen
chroot $outmnt locale-gen
#Install the base packages
@ -110,16 +110,20 @@ chroot $outmnt apt install -y initscripts udev kmod net-tools inetutils-ping tra
chroot $outmnt apt-get autoremove --purge
chroot $outmnt apt-get clean
#Download the packages to be installed by Install.sh:
chroot $outmnt apt-get install -y -d xorg acpi-support lightdm tasksel dpkg librsvg2-common xorg xserver-xorg-input-libinput alsa-utils anacron avahi-daemon eject iw libnss-mdns xdg-utils lxqt crda xfce4 dbus-user-session system-config-printer tango-icon-theme xfce4-power-manager xfce4-terminal xfce4-goodies mousepad vlc libutempter0 xterm numix-gtk-theme dconf-cli dconf-editor plank network-manager-gnome network-manager-openvpn network-manager-openvpn-gnome dtrx emacs25 accountsservice firefox-esr sudo pavucontrol-qt
#Grab firefox from buster, since stretch is broken
chroot $outmnt apt -t testing install -y -d firefox-esr
#Download support for libinput-gestures
chroot $outmnt apt install -y libinput-tools xdotool build-essential
#Package is copied into /InstallResources/packages
#Download the packages to be installed by Install.sh:
chroot $outmnt apt-get install -y -d xorg acpi-support lightdm tasksel dpkg librsvg2-common xorg xserver-xorg-input-libinput alsa-utils anacron avahi-daemon eject iw libnss-mdns xdg-utils lxqt crda xfce4 dbus-user-session system-config-printer tango-icon-theme xfce4-power-manager xfce4-terminal xfce4-goodies mousepad vlc libutempter0 xterm numix-gtk-theme dconf-cli dconf-editor plank network-manager-gnome network-manager-openvpn network-manager-openvpn-gnome dtrx emacs25 accountsservice sudo pavucontrol-qt
# #grab chromium from sid, since stretch and buster are broken
# chroot $outmnt apt-get -t unstable install -d -y chromium
# #grab firefox from buster, since stretch is broken
chroot $outmnt apt-get -t testing install -d -y firefox-esr
#Cleanup hosts
rm -rf $outmnt/etc/hosts #This is what https://wiki.debian.org/EmDebian/CrossDebootstrap suggests
echo -n "127.0.0.1 PrawnOS-Alpha" > $outmnt/etc/hosts
@ -132,9 +136,6 @@ rm -f $outmnt/lib/modules/3.14.0/{build,source}
install -D -m 644 build/open-ath9k-htc-firmware/target_firmware/htc_9271.fw $outmnt/lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
install -D -m 644 build/open-ath9k-htc-firmware/target_firmware/htc_7010.fw $outmnt/lib/firmware/ath9k_htc/htc_7010-1.4.0.fw
#Install the regulatory.db files
install -m 644 $build_resources/regdb/wireless-regdb-2018.09.07/regulatory.db* $outmnt/lib/firmware/
umount -l $outmnt > /dev/null 2>&1
rmdir $outmnt > /dev/null 2>&1
losetup -d $outdev > /dev/null 2>&1