Recognize ath9k false positives. Don't deblob ath9k/init.c.
[releases.git] / deblob-2.6.33
index 3c297d7e86fc7fa07798f949a318ca8602238de1..090d591de9d63234f2c38ff604c185f0aa67ac1a 100755 (executable)
@@ -1,9 +1,13 @@
 #!/bin/sh
 
-#    Copyright (C) 2008, 2009, 2010 Alexandre Oliva <lxoliva@fsfla.org>
+#    Copyright (C) 2008-2012 Alexandre Oliva <lxoliva@fsfla.org>
 #    Copyright (C) 2008 Jeff Moe
 #    Copyright (C) 2009 Rubén Rodríguez <ruben@gnu.org>
 #
+#    This program is part of GNU Linux-libre, a GNU project that
+#    publishes scripts to clean up Linux so as to make it suitable for
+#    use in the GNU Project and in Free System Distributions.
+#
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 2 of the License, or
 # See also:
 # http://wiki.debian.org/KernelFirmwareLicensing
 # svn://svn.debian.org/kernel/dists/trunk/linux-2.6/debian/patches/debian/dfsg/files-1
-# http://svn.gnewsense.svnhopper.net/gnewsense/builder/trunk/firmware/firmware-removed
-# http://svn.gnewsense.svnhopper.net/gnewsense/builder/trunk/gen-kernel
+# http://wiki.gnewsense.org/Builder gen-kernel
 
 # Thanks to Brian Brazil @ gnewsense
 
 
 # For each kver release, start extra with an empty string, then count
 # from 1 if changes are needed that require rebuilding the tarball.
-kver=2.6.33 extra=-- # up to -rc7
+kver=2.6.33 extra=
 
 case $1 in
 --force)
@@ -190,21 +193,21 @@ clean_sed () {
   filetest $2 || return
   sed -e "$1" "$2" > "$2".deblob || {
     die $2: failed: ${3-applied sed script $1} && return 1; }
-  check_changed $2 && echo $2: ${3-applied sed script $1} 
+  check_changed $2 && echo $2: ${3-applied sed script $1}
 }
 
 reject_firmware () {
-  #$1 = file
+  #$1 = file $2 = pre sed pattern
   filetest $1 || return
-  clean_sed '
+  clean_sed "$2"'
 s,request\(_ihex\)\?_firmware\(_nowait\)\?,reject_firmware\2,g
 ' "$1" 'disabled non-Free firmware-loading machinery'
 }
 
 maybe_reject_firmware () {
-  #$1 = file
+  #$1 = file $2 = pre sed pattern
   filetest $1 || return
-  clean_sed '
+  clean_sed "$2"'
 s,request_firmware\(_nowait\)\?,maybe_reject_firmware\1,g
 ' "$1" 'retain Free firmware-loading machinery, disabling non-Free one'
 }
@@ -274,9 +277,48 @@ for f in \
 done
 
 # Identify the tarball.
-grep -q 'EXTRAVERSION.*-libre' Makefile ||
-clean_sed "s,^EXTRAVERSION.*,&-libre$extra,
-" Makefile 'added -libre to EXTRAVERSION'
+grep -q 'EXTRAVERSION.*-gnu' Makefile ||
+clean_sed "s,^EXTRAVERSION.*,&-gnu$extra,
+" Makefile 'added -gnu to EXTRAVERSION'
+
+grep -q Linux-libre README ||
+clean_sed '
+1,3 s,Linux kernel release.*kernel\.org.*,GNU Linux-libre <http://linux-libre.fsfla.org>,
+2,5 s,Linux version [0-9.]*,GNU Linux-libre,
+1,20 s,\(operating system \)\?Unix,Unix kernel,
+/WHAT IS LINUX/i\
+WHAT IS GNU Linux-libre?\
+\
+  GNU Linux-libre is a Free version of the kernel Linux (see below),\
+  suitable for use with the GNU Operating System in 100% Free\
+  GNU/Linux-libre System Distributions.\
+  http://www.gnu.org/distros/\
+\
+  It removes non-Free components from Linux, that are disguised as\
+  source code or distributed in separate files.  It also disables\
+  run-time requests for non-Free components, shipped separately or as\
+  part of Linux, and documentation pointing to them, so as to avoid\
+  (Free-)baiting users into the trap of non-Free Software.\
+  http://www.fsfla.org/anuncio/2010-11-Linux-2.6.36-libre-debait\
+\
+  Linux-libre started within the gNewSense GNU/Linux distribution.\
+  It was later adopted by Jeff Moe, who coined its name, and in 2008\
+  it became a project maintained by FSF Latin America.  In 2012, it\
+  became part of the GNU Project.\
+\
+  The GNU Linux-libre project takes a minimal-changes approach to\
+  cleaning up Linux, making no effort to substitute components that\
+  need to be removed with functionally equivalent Free ones.\
+  Nevertheless, we encourage and support efforts towards doing so.\
+  http://libreplanet.org/wiki/LinuxLibre:Devices_that_require_non-free_firmware\
+\
+  Our mascot is Freedo, a light-blue penguin that has just come out\
+  of the shower.  Although we like penguins, GNU is a much greater\
+  contribution to the entire system, so its mascot deserves more\
+  promotion.  See our web page for their images.\
+  http://linux-libre.fsfla.org/\
+
+' README 'added blurb about GNU Linux-libre'
 
 # Add reject_firmware and maybe_reject_firmware
 grep -q _LINUX_LIBRE_FIRMWARE_H include/linux/firmware.h ||
@@ -445,6 +487,13 @@ clean_mk CONFIG_MOXA_INTELLIO drivers/char/Makefile
 
 # gpu drm
 
+announce DRM_NOUVEAU - "Nouveau (nVidia) cards"
+reject_firmware drivers/gpu/drm/nouveau/nouveau_grctx.c
+clean_blob drivers/gpu/drm/nouveau/nouveau_grctx.c
+clean_blob drivers/gpu/drm/nouveau/nv50_graph.c
+clean_kconfig drivers/gpu/drm/nouveau/Kconfig 'DRM_NOUVEAU'
+clean_mk CONFIG_DRM_NOUVEAU drivers/gpu/drm/nouveau/Makefile
+
 announce DRM_MGA - "Matrox g200/g400"
 drop_fw_file firmware/matrox/g200_warp.H16 firmware/matrox/g200_warp.fw
 drop_fw_file firmware/matrox/g400_warp.H16 firmware/matrox/g400_warp.fw
@@ -799,6 +848,7 @@ clean_mk CONFIG_DVB_TTUSB_BUDGET drivers/media/dvb/ttusb-budget/Makefile
 announce DVB_TTUSB_DEC - "Technotrend/Hauppauge USB DEC devices"
 reject_firmware drivers/media/dvb/ttusb-dec/ttusb_dec.c
 clean_blob drivers/media/dvb/ttusb-dec/ttusb_dec.c
+clean_blob Documentation/dvb/ttusb-dec.txt
 clean_kconfig drivers/media/dvb/ttusb-dec/Kconfig 'DVB_TTUSB_DEC'
 clean_mk CONFIG_DVB_TTUSB_DEC drivers/media/dvb/ttusb-dec/Makefile
 
@@ -806,6 +856,8 @@ clean_mk CONFIG_DVB_TTUSB_DEC drivers/media/dvb/ttusb-dec/Makefile
 
 announce VIDEO_BT848 - "BT848 Video For Linux"
 reject_firmware drivers/media/video/bt8xx/bttv-cards.c
+clean_blob drivers/media/video/bt8xx/bttv-cards.c
+clean_blob Documentation/video4linux/bttv/README
 clean_kconfig drivers/media/video/bt8xx/Kconfig 'VIDEO_BT848'
 clean_mk CONFIG_VIDEO_BT848 drivers/media/video/bt8xx/Makefile
 
@@ -1029,6 +1081,7 @@ announce SPIDER_NET - "Spider Gigabit Ethernet driver"
 reject_firmware drivers/net/spider_net.c
 clean_sed 's,spider_fw\.bin,DEBLOBBED.bin,g' \
   drivers/net/spider_net.c 'removed non-Free firmware notes'
+clean_blob drivers/net/spider_net.c
 clean_blob drivers/net/spider_net.h
 clean_kconfig drivers/net/Kconfig 'SPIDER_NET'
 clean_mk CONFIG_SPIDER_NET drivers/net/Makefile
@@ -1100,38 +1153,44 @@ clean_blob drivers/net/pcmcia/smc91c92_cs.c
 clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_SMC91C92'
 clean_mk CONFIG_PCMCIA_SMC91C92 drivers/net/pcmcia/Makefile
 
-announce PCCARD - "PCCard (PCMCIA/CardBus) support"
-reject_firmware drivers/pcmcia/ds.c
-clean_kconfig drivers/pcmcia/Kconfig 'PCCARD'
-clean_mk CONFIG_PCCARD drivers/pcmcia/Makefile
+# CIS files are not software.
+# announce PCCARD - "PCCard (PCMCIA/CardBus) support"
+# reject_firmware drivers/pcmcia/ds.c
+# clean_kconfig drivers/pcmcia/Kconfig 'PCCARD'
+# clean_mk CONFIG_PCCARD drivers/pcmcia/Makefile
 
 announce PCMCIA_3C574 - "3Com 3c574 PCMCIA support"
+# This is not software; it's Free, but GPLed without in-tree sources.
 drop_fw_file firmware/cis/3CCFEM556.cis.ihex firmware/cis/3CCFEM556.cis
-clean_blob drivers/net/pcmcia/3c574_cs.c
-clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_3C574'
-clean_mk CONFIG_PCMCIA_3C574 drivers/net/pcmcia/Makefile
+clean_blob drivers/net/pcmcia/3c574_cs.c
+clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_3C574'
+clean_mk CONFIG_PCMCIA_3C574 drivers/net/pcmcia/Makefile
 
 announce PCMCIA_3C589 - "3Com 3c589 PCMCIA support"
+# This is not software; it's Free, but GPLed without in-tree sources.
 drop_fw_file firmware/cis/3CXEM556.cis.ihex firmware/cis/3CXEM556.cis
-clean_blob drivers/net/pcmcia/3c589_cs.c
-clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_3C589'
-clean_mk CONFIG_PCMCIA_3C589 drivers/net/pcmcia/Makefile
+clean_blob drivers/net/pcmcia/3c589_cs.c
+clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_3C589'
+clean_mk CONFIG_PCMCIA_3C589 drivers/net/pcmcia/Makefile
 
 announce PCMCIA_PCNET - "NE2000 compatible PCMCIA support"
+# These are not software; they're Free, but GPLed without in-tree sources.
 drop_fw_file firmware/cis/LA-PCM.cis.ihex firmware/cis/LA-PCM.cis
 drop_fw_file firmware/cis/PCMLM28.cis.ihex firmware/cis/PCMLM28.cis
 drop_fw_file firmware/cis/DP83903.cis.ihex firmware/cis/DP83903.cis
 drop_fw_file firmware/cis/NE2K.cis.ihex firmware/cis/NE2K.cis
 drop_fw_file firmware/cis/tamarack.cis.ihex firmware/cis/tamarack.cis
 drop_fw_file firmware/cis/PE-200.cis.ihex firmware/cis/PE-200.cis
-clean_blob drivers/net/pcmcia/pcnet_cs.c
-clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_PCNET'
-clean_mk CONFIG_PCMCIA_PCNET drivers/net/pcmcia/Makefile
+drop_fw_file firmware/cis/PE520.cis.ihex firmware/cis/PE520.cis
+# clean_blob drivers/net/pcmcia/pcnet_cs.c
+# clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_PCNET'
+# clean_mk CONFIG_PCMCIA_PCNET drivers/net/pcmcia/Makefile
 
 # tokenring
 
 announce 3C359 - "3Com 3C359 Token Link Velocity XL adapter"
 drop_fw_file firmware/3com/3C359.bin.ihex firmware/3com/3C359.bin
+reject_firmware drivers/net/tokenring/3c359.c
 clean_blob drivers/net/tokenring/3c359.c
 clean_kconfig drivers/net/tokenring/Kconfig '3C359'
 clean_mk CONFIG_3C359 drivers/net/tokenring/Makefile
@@ -1204,17 +1263,27 @@ clean_blob drivers/net/wireless/orinoco/fw.c
 clean_kconfig drivers/net/wireless/Kconfig 'HERMES'
 clean_mk CONFIG_HERMES drivers/net/wireless/orinoco/Makefile
 
-announce WLAGS49_H2 - 'Agere Systems HERMES II Wireless PC Card Model 0110'
+announce WLAGS49_H2 - "Agere Systems HERMES II Wireless PC Card Model 0110"
 # Some pieces of the firmware images are most definitely data, but
 # others seem to be code.
-clean_file drivers/staging/wlags49_h2/ap_h2.c
-clean_file drivers/staging/wlags49_h2/sta_h2.c
+clean_blob drivers/staging/wlags49_h2/ap_h2.c
+clean_blob drivers/staging/wlags49_h2/sta_h2.c
+echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/ap_h2.c
+echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/sta_h2.c
+clean_blob drivers/staging/wlags49_h2/wl_profile.c
+clean_sed '
+  s,\(.*hcf_status = \)dhf_download_fw(.*&fw_image );,//& /*(DEBLOBBED)*/\n\1HCF_ERR_INCOMP_FW;,
+' drivers/staging/wlags49_h2/wl_main.c 'reject built-in non-Free firmware'
 clean_kconfig drivers/staging/wlags49_h2/Kconfig 'WLAGS49_H2'
 clean_mk CONFIG_WLAGS49_H2 drivers/staging/Makefile
 
-announce WLAGS49_H25 - 'Linksys Systems HERMES II.5 Wireless-G_CompactFlash_Card'
-clean_file drivers/staging/wlags49_h2/ap_h25.c
-clean_file drivers/staging/wlags49_h2/sta_h25.c
+announce WLAGS49_H25 - "Linksys Systems HERMES II.5 Wireless-G_CompactFlash_Card"
+# Some pieces of the firmware images are most definitely data, but
+# others seem to be code.
+clean_blob drivers/staging/wlags49_h2/ap_h25.c
+clean_blob drivers/staging/wlags49_h2/sta_h25.c
+echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/ap_h25.c
+echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/sta_h25.c
 clean_kconfig drivers/staging/wlags49_h25/Kconfig 'WLAGS49_H25'
 clean_mk CONFIG_WLAGS49_H25 drivers/staging/Makefile
 
@@ -1264,7 +1333,7 @@ clean_mk CONFIG_IWM drivers/net/wireless/iwmc3200wifi/Makefile
 announce IWMC3200TOP - "Intel Wireless MultiCom Top Driver"
 reject_firmware drivers/misc/iwmc3200top/fw-download.c
 undefine_macro '_FW_NAME(api)' '"/*(DEBLOBBED)*/"' \
-  drivers/misc/iwmc3200top/iwmc3200top.h
+  'removed non-Free firmware name' drivers/misc/iwmc3200top/iwmc3200top.h
 clean_blob drivers/misc/iwmc3200top/main.c
 clean_kconfig drivers/misc/iwmc3200top/Kconfig 'IWMC3200TOP'
 clean_mk CONFIG_IWMC3200TOP drivers/misc/iwmc3200top/Makefile
@@ -1300,7 +1369,7 @@ clean_blob drivers/net/wireless/libertas_tf/if_usb.c
 clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS_THINFIRM_USB'
 clean_mk CONFIG_LIBERTAS_THINFIRM_USB drivers/net/wireless/libertas_tf/Makefile
 
-announce MWL8K - 'Marvell 88W8xxx PCI/PCIe Wireless support'
+announce MWL8K - "Marvell 88W8xxx PCI/PCIe Wireless support"
 reject_firmware drivers/net/wireless/mwl8k.c
 clean_blob drivers/net/wireless/mwl8k.c
 clean_kconfig drivers/net/wireless/Kconfig 'MWL8K'
@@ -1365,7 +1434,7 @@ clean_blob drivers/net/wireless/p54/p54usb.h
 clean_kconfig drivers/net/wireless/p54/Kconfig 'P54_USB'
 clean_mk CONFIG_P54_USB drivers/net/wireless/p54/Makefile
 
-announce PRISM54 - 'Intersil Prism GT/Duette/Indigo PCI/Cardbus'
+announce PRISM54 - "Intersil Prism GT/Duette/Indigo PCI/Cardbus"
 reject_firmware drivers/net/wireless/prism54/islpci_dev.c
 clean_blob drivers/net/wireless/prism54/islpci_dev.c
 clean_kconfig drivers/net/wireless/Kconfig 'PRISM54'
@@ -1454,12 +1523,14 @@ clean_mk CONFIG_VT6656 drivers/staging/vt6656/Makefile
 
 announce WL1251 - "TI wl1251 support"
 reject_firmware drivers/net/wireless/wl12xx/wl1251_main.c
+clean_blob drivers/net/wireless/wl12xx/wl1251_main.c
 clean_blob drivers/net/wireless/wl12xx/wl1251.h
 clean_kconfig drivers/net/wireless/wl12xx/Kconfig 'WL1251'
 clean_mk CONFIG_WL1251 drivers/net/wireless/wl12xx/Makefile
 
 announce WL1271 - "TI wl1271 support"
 reject_firmware drivers/net/wireless/wl12xx/wl1271_main.c
+clean_blob drivers/net/wireless/wl12xx/wl1271_main.c
 clean_blob drivers/net/wireless/wl12xx/wl1271.h
 clean_kconfig drivers/net/wireless/wl12xx/Kconfig 'WL1271'
 clean_mk CONFIG_WL1271 drivers/net/wireless/wl12xx/Makefile
@@ -1478,6 +1549,12 @@ clean_mk CONFIG_ZD1211RW drivers/net/wireless/zd1211rw/Makefile
 
 # bluetooth
 
+announce BT_ATH3K - "Atheros firmware download driver"
+reject_firmware drivers/bluetooth/ath3k.c
+clean_blob drivers/bluetooth/ath3k.c
+clean_kconfig drivers/bluetooth/Kconfig 'BT_ATH3K'
+clean_mk CONFIG_BT_ATH3K drivers/bluetooth/Makefile
+
 announce BT_HCIBCM203X - "HCI BCM203x USB driver"
 reject_firmware drivers/bluetooth/bcm203x.c
 clean_blob drivers/bluetooth/bcm203x.c
@@ -1500,7 +1577,7 @@ announce BT_MRVL_SDIO - "Marvell BT-over-SDIO driver"
 reject_firmware drivers/bluetooth/btmrvl_sdio.c
 clean_blob drivers/bluetooth/btmrvl_sdio.c
 clean_blob Documentation/btmrvl.txt
-clean_kconfig drivers/bluetooth/Kcofnig 'BT_MRVL_SDIO'
+clean_kconfig drivers/bluetooth/Kconfig 'BT_MRVL_SDIO'
 clean_mk CONFIG_BT_MRVL_SDIO drivers/bluetooth/Makefile
 
 # wimax
@@ -1510,7 +1587,7 @@ reject_firmware drivers/net/wimax/i2400m/fw.c
 clean_blob drivers/net/wimax/i2400m/sdio.c
 clean_blob drivers/net/wimax/i2400m/usb.c
 clean_blob Documentation/wimax/README.i2400m
-clean_kconfig drivers/net/wimax/i2400m/Kconfig CONFIG_WIMAX_I2400M
+clean_kconfig drivers/net/wimax/i2400m/Kconfig 'WIMAX_I2400M'
 clean_mk CONFIG_WIMAX_I2400M drivers/net/wimax/i2400m/Makefile
 
 ########
@@ -1534,16 +1611,21 @@ clean_mk CONFIG_MISDN_SPEEDFAX drivers/isdn/hardware/mISDN/Makefile
 ##########
 
 announce SERIAL_8250_CS - "8250/16550 PCMCIA device support"
+# These are not software; they're Free, but GPLed without in-tree sources.
 drop_fw_file firmware/cis/MT5634ZLX.cis.ihex firmware/cis/MT5634ZLX.cis
 drop_fw_file firmware/cis/RS-COM-2P.cis.ihex firmware/cis/RS-COM-2P.cis
 drop_fw_file firmware/cis/COMpad2.cis.ihex firmware/cis/COMpad2.cis
 drop_fw_file firmware/cis/COMpad4.cis.ihex firmware/cis/COMpad4.cis
+# These are not software; they're Free, but GPLed without textual sources.
+# It could be assumed that these binaries *are* sources, since they
+# can be trivially converted back to a textual form, without loss,
+# but we're better off safe than sorry, so remove them from our tree.
 drop_fw_file firmware/cis/SW_555_SER.cis.ihex firmware/cis/SW_555_SER.cis
 drop_fw_file firmware/cis/SW_7xx_SER.cis.ihex firmware/cis/SW_7xx_SER.cis
 drop_fw_file firmware/cis/SW_8xx_SER.cis.ihex firmware/cis/SW_8xx_SER.cis
-clean_blob drivers/serial/serial_cs.c
-clean_kconfig drivers/serial/Kconfig 'SERIAL_8250_CS'
-clean_mk CONFIG_SERIAL_8250_CS drivers/serial/Makefile
+clean_blob drivers/serial/serial_cs.c
+clean_kconfig drivers/serial/Kconfig 'SERIAL_8250_CS'
+clean_mk CONFIG_SERIAL_8250_CS drivers/serial/Makefile
 
 announce SERIAL_ICOM - "IBM Multiport Serial Adapter"
 reject_firmware drivers/serial/icom.c
@@ -2004,6 +2086,16 @@ clean_sed '
 }' sound/oss/Kconfig 'removed default firmware'
 clean_mk CONFIG_SOUND_MSNDPIN sound/oss/Makefile
 
+announce SND_SSCAPE - "Ensoniq SoundScape driver"
+reject_firmware sound/isa/sscape.c
+clean_blob sound/isa/sscape.c
+clean_sed '
+/^config SND_SSCAPE$/, /^config / {
+  s,"\(scope\|sndscape\)\.co[d?]","/*(DEBLOBBED)*/",g;
+}' sound/isa/Kconfig 'removed firmware names'
+clean_kconfig sound/isa/Kconfig 'SND_SSCAPE'
+clean_mk CONFIG_SND_SSCAPE sound/isa/Makefile
+
 announce SOUND_TRIX - "MediaTrix AudioTrix Pro support"
 clean_blob sound/oss/trix.c
 clean_kconfig sound/oss/Kconfig 'SOUND_TRIX'
@@ -2049,11 +2141,11 @@ clean_mk CONFIG_DX_SEP drivers/staging/sep/Makefile
 announce Documentation - "non-Free firmware scripts and documentation"
 clean_blob Documentation/dvb/avermedia.txt
 clean_blob Documentation/dvb/opera-firmware.txt
-clean_blob Documentation/dvb/ttusb-dec.txt
 clean_blob Documentation/sound/alsa/ALSA-Configuration.txt
 clean_blob Documentation/sound/oss/MultiSound
 clean_blob Documentation/sound/oss/PSS
 clean_blob Documentation/sound/oss/PSS-updates
+clean_blob Documentation/sound/oss/README.OSS
 clean_file Documentation/dvb/get_dvb_firmware
 clean_file Documentation/video4linux/extract_xc3028.pl
 clean_sed s,usb8388,whatever,g drivers/base/Kconfig 'removed blob name'