From 94af7fc2de9751adb17a648c408ac5add412a86d Mon Sep 17 00:00:00 2001 From: lxoliva Date: Thu, 19 Mar 2009 06:01:24 +0000 Subject: [PATCH] Fix internal error at the end of the tarball. Fix trailing EOL in deblobbed files. Adjust some patterns, drop some redundant deblobbing. Fix request_firmware uses in reject_firmware. git-svn-id: http://www.fsfla.org/svn/fsfla/software/linux-libre/scripts@4780 559672b5-ba27-0410-b829-e8f1faed8b1b --- deblob-2.6.28 | 49 +++++++++++++++++++++++++++---------------------- deblob-check | 18 ++++++++++++------ 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/deblob-2.6.28 b/deblob-2.6.28 index a23e94386a9..55ae2e48cee 100755 --- a/deblob-2.6.28 +++ b/deblob-2.6.28 @@ -184,7 +184,7 @@ clean_sed () { reject_firmware () { #$1 = file clean_sed ' -s,request\(_ihex\)\?_firmware\(_nowait\)\?,reject_firmware\2, +s,request\(_ihex\)\?_firmware\(_nowait\)\?,reject_firmware\2,g ' "$1" 'disabled non-Free firmware-loading machinery' } @@ -263,12 +263,12 @@ report_missing_free_firmware(const char *name, const char *what)\ return -EINVAL;\ }\ static inline int\ -reject_firmware(const struct firmware **fw, +reject_firmware(const struct firmware **fw,\ const char *name, struct device *device)\ {\ - struct firmware *xfw = NULL;\ + const struct firmware *xfw = NULL;\ int retval;\ - report_missing_free_firmware(device->name, NULL);\ + report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware(&xfw, NONFREE_FIRMWARE, device);\ if (!retval)\ release_firmware(xfw);\ @@ -296,7 +296,7 @@ reject_firmware_nowait(struct module *module, int uevent,\ void *context))\ {\ int retval;\ - report_missing_free_firmware(device->name, NULL);\ + report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_nowait(module, uevent, NONFREE_FIRMWARE,\ device, NULL,\ discard_rejected_firmware);\ @@ -440,6 +440,7 @@ clean_sed ' return -EINVAL; } }' drivers/gpu/drm/radeon/radeon_cp.c 'report missing Free microcode' +clean_blob drivers/gpu/drm/radeon/radeon_cp.c clean_blob drivers/gpu/drm/radeon/radeon_microcode.h clean_kconfig drivers/gpu/drm/Kconfig 'DRM_RADEON' clean_mk CONFIG_DRM_RADEON drivers/gpu/drm/Makefile @@ -463,7 +464,6 @@ undefault_firmware 'XC\(2028\|3028L\)' \ drivers/media/video/em28xx/em28xx-cards.c \ drivers/media/dvb/dvb-usb/dib0700_devices.c \ drivers/media/dvb/dvb-usb/cxusb.c -clean_blob drivers/media/common/tuners/tuner-xc2028.h reject_firmware drivers/media/common/tuners/tuner-xc2028.c clean_kconfig drivers/media/common/tuners/Kconfig 'MEDIA_TUNER_XC2028' clean_mk CONFIG_MEDIA_TUNER_XC2028 drivers/media/common/tuners/Makefile @@ -471,13 +471,11 @@ clean_mk CONFIG_MEDIA_TUNER_XC2028 drivers/media/common/tuners/Makefile announce MEDIA_TUNER_XC5000 - "Xceive XC5000 silicon tuner" undefault_firmware 'XC5000' drivers/media/common/tuners/xc5000.c reject_firmware drivers/media/common/tuners/xc5000.c -clean_blob drivers/media/common/tuners/xc5000.c clean_kconfig drivers/media/common/tuners/Kconfig 'MEDIA_TUNER_XC5000' clean_mk CONFIG_MEDIA_TUNER_XC5000 drivers/media/common/tuners/Makefile announce DVB_USB - "Support for various USB DVB devices" reject_firmware drivers/media/dvb/dvb-usb/dvb-usb-firmware.c -clean_blob drivers/media/dvb/dvb-usb/dvb-usb-firmware.c clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB' clean_mk CONFIG_DVB_USB drivers/media/dvb/dvb-usb/Makefile @@ -602,6 +600,10 @@ announce DVB_BCM3510 - "Broadcom BCM3510" undefault_firmware 'BCM3510' drivers/media/dvb/frontends/bcm3510.c reject_firmware drivers/media/dvb/frontends/bcm3510.c reject_firmware drivers/media/dvb/frontends/bcm3510.h +clean_sed ' +/You.ll need a firmware/,/dvb-fe-bcm/d; +' drivers/media/dvb/frontends/bcm3510.c \ + "removed non-Free firmware notes" clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_BCM3510' clean_mk CONFIG_DVB_BCM3510 drivers/media/dvb/frontends/Makefile @@ -636,7 +638,6 @@ clean_mk CONFIG_DVB_SP8870 drivers/media/dvb/frontends/Makefile announce DVB_CX24116 - "Conexant CX24116 based" undefault_firmware CX24116 drivers/media/dvb/frontends/cx24116.c reject_firmware drivers/media/dvb/frontends/cx24116.c -clean_blob drivers/media/dvb/frontends/cx24116.c clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_CX24116' clean_mk CONFIG_DVB_CX24116 drivers/media/dvb/frontends/Makefile @@ -675,7 +676,6 @@ s,mwdebi(.*bootcode.*$,/* & */, ' drivers/media/dvb/ttpci/av7110_hw.c 'adjust bootcode loader' clean_blob drivers/media/dvb/ttpci/av7110_hw.c reject_firmware drivers/media/dvb/ttpci/av7110.c -reject_firmware drivers/media/dvb/ttpci/av7110.c clean_blob drivers/media/dvb/ttpci/av7110.c clean_sed ' /^config DVB_AV7110_FIRMWARE_FILE$/, /^config / { @@ -715,7 +715,6 @@ clean_mk CONFIG_DVB_SIANO_SMS1XXX drivers/media/dvb/siano/Makefile announce DVB_TTUSB_BUDGET - "Technotrend/Hauppauge Nova-USB devices" drop_fw_file firmware/ttusb-budget/dspbootcode.bin.ihex firmware/ttusb-budget/dspbootcode.bin reject_firmware drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c -reject_firmware drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c clean_blob drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c clean_kconfig drivers/media/dvb/ttusb-budget/Kconfig 'DVB_TTUSB_BUDGET' clean_mk CONFIG_DVB_TTUSB_BUDGET drivers/media/dvb/ttusb-budget/Makefile @@ -730,7 +729,6 @@ 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_kconfig drivers/media/video/bt8xx/Kconfig 'VIDEO_BT848' clean_mk CONFIG_VIDEO_BT848 drivers/media/video/bt8xx/Makefile @@ -745,7 +743,6 @@ announce VIDEO_CX18 - "Conexant cx23418 MPEG encoder support" reject_firmware drivers/media/video/cx18/cx18-av-firmware.c reject_firmware drivers/media/video/cx18/cx18-firmware.c clean_blob drivers/media/video/cx18/cx18-av-firmware.c -clean_blob drivers/media/video/cx18/cx18-firmware.c clean_kconfig drivers/media/video/cx18/Kconfig 'VIDEO_CX18' clean_mk CONFIG_VIDEO_CX18 drivers/media/video/cx18/Makefile @@ -792,7 +789,6 @@ clean_mk CONFIG_VIDEO_GO7007 drivers/staging/go7007/Makefile announce VIDEO_SAA7134_DVB - "DVB/ATSC Support for saa7134 based TV cards" reject_firmware drivers/media/video/saa7134/saa7134-dvb.c -clean_blob drivers/media/video/saa7134/saa7134-dvb.c clean_kconfig drivers/media/video/saa7134/Kconfig 'VIDEO_SAA7134_DVB' clean_mk CONFIG_VIDEO_SAA7134_DVB drivers/media/video/saa7134/Makefile @@ -889,6 +885,7 @@ clean_kconfig drivers/net/Kconfig 'CASSINI' clean_mk CONFIG_CASSINI drivers/net/Makefile announce CHELSIO_T3 - "Chelsio AEL 2005 support" +reject_firmware drivers/net/cxgb3/cxgb3_main.c clean_sed ' /^static int ael2005_setup_\(sr\|twinax\)_edc([^;]*$/,/^}$/{ /for.*ARRAY_SIZE(\(sr\|twinax\)_edc)/i\ @@ -896,6 +893,7 @@ clean_sed ' CH_ERR(phy->adapter, "Missing Free firwmare\\n");\ err = -EINVAL; }' drivers/net/cxgb3/ael1002.c 'report missing Free firmware' +clean_blob drivers/net/cxgb3/cxgb3_main.c clean_blob drivers/net/cxgb3/ael1002.c clean_kconfig drivers/net/Kconfig 'CHELSIO_T3' clean_mk CONFIG_CHELSIO_T3 drivers/net/cxgb3/Makefile @@ -949,6 +947,8 @@ clean_mk CONFIG_SLICOSS drivers/staging/slicoss/Makefile 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.h clean_kconfig drivers/net/Kconfig 'SPIDER_NET' clean_mk CONFIG_SPIDER_NET drivers/net/Makefile @@ -1043,7 +1043,6 @@ clean_mk CONFIG_USB_IRDA drivers/net/irda/Makefile # pcmcia announce PCMCIA_SMC91C92 - "SMC 91Cxx PCMCIA" -clean_blob drivers/net/pcmcia/ositech.h clean_sed ' /^\(static int \)\?osi_setup([^;]*$/,/^}$/{ s/^\(.*\)[/][*] Download.*firmware [*][/]/\1printk(KERN_ERR "%s: Missing Free firmware\\n", dev->name);\n\1rc = -EINVAL;\n\1goto free_cfg_mem;\n&/ @@ -1052,12 +1051,13 @@ clean_sed ' /^\(static int \)\?smc91c92_resume([^;]*$/,/^}$/{ s/^\(.*\)[/][*] Download.*firmware [*][/]/\1printk(KERN_ERR "%s: Missing Free firmware\\n", dev->name);\n\1return -EINVAL;\n&/ }' drivers/net/pcmcia/smc91c92_cs.c 'report another missing Free firmware' +clean_blob drivers/net/pcmcia/ositech.h +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_blob drivers/pcmcia/ds.c clean_kconfig drivers/pcmcia/Kconfig 'PCCARD' clean_mk CONFIG_PCCARD drivers/pcmcia/Makefile @@ -1170,7 +1170,6 @@ clean_mk CONFIG_IWL3945 drivers/net/wireless/iwlwifi/Makefile announce IWLAGN - "Intel Wireless WiFi Next Gen AGN" reject_firmware drivers/net/wireless/iwlwifi/iwl-agn.c -clean_blob drivers/net/wireless/iwlwifi/iwl-agn.c clean_kconfig drivers/net/wireless/iwlwifi/Kconfig 'IWLAGN' clean_mk CONFIG_IWLAGN drivers/net/wireless/iwlwifi/Makefile @@ -1218,6 +1217,7 @@ clean_mk CONFIG_P54_PCI drivers/net/wireless/p54/Makefile announce P54_USB - "Prism54 USB support" reject_firmware drivers/net/wireless/p54/p54usb.c clean_blob drivers/net/wireless/p54/p54usb.c +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 @@ -1233,7 +1233,6 @@ clean_mk CONFIG_PRISM54 drivers/net/wireless/prism54/Makefile announce RT2X00_LIB_FIRMWARE - "Ralink driver firmware support" reject_firmware drivers/net/wireless/rt2x00/rt2x00firmware.c -clean_blob drivers/net/wireless/rt2x00/rt2x00firmware.c clean_kconfig drivers/net/wireless/rt2x00/Kconfig 'RT2X00_LIB_FIRMWARE' clean_mk CONFIG_RT2X00_LIB_FIRMWARE drivers/net/wireless/rt2x00/Makefile @@ -1727,8 +1726,11 @@ announce SOUND_MSNDCLAS - "Support for Turtle Beach MultiSound Classic, Tahiti, clean_blob sound/oss/msnd_classic.h clean_kconfig sound/oss/Kconfig 'SOUND_MSNDCLAS' clean_sed ' -/^config MSNDCLAS_\(INIT\|PERM\)_FILE$/, /^config / { - /^ default.*msnd\(init\|perm\)\.bin/ s,".*","/*(DEBLOBBED)*/",; +/^config MSNDCLAS_INIT_FILE$/, /^config / { + /^ default.*msndinit\.bin/ s,".*","/*(DEBLOBBED)*/",; +} +/^config MSNDCLAS_PERM_FILE$/, /^config / { + /^ default.*msndperm\.bin/ s,".*","/*(DEBLOBBED)*/",; }' sound/oss/Kconfig 'removed default firmware' clean_mk CONFIG_SOUND_MSNDCLAS sound/oss/Makefile @@ -1736,8 +1738,11 @@ announce SOUND_MSNDPIN - "Support for Turtle Beach MultiSound Pinnacle" clean_blob sound/oss/msnd_pinnacle.h clean_kconfig sound/oss/Kconfig 'SOUND_MSNDPIN' clean_sed ' -/^config MSNDPIN_\(INIT\|PERM\)_FILE$/, /^config / { - /^ default.*pndsp\(ini\|erm\)\.bin/ s,".*","/*(DEBLOBBED)*/",; +/^config MSNDPIN_INIT_FILE$/, /^config / { + /^ default.*pndspini\.bin/ s,".*","/*(DEBLOBBED)*/",; +} +/^config MSNDPIN_PERM_FILE$/, /^config / { + /^ default.*pndsperm\.bin/ s,".*","/*(DEBLOBBED)*/",; }' sound/oss/Kconfig 'removed default firmware' clean_mk CONFIG_SOUND_MSNDPIN sound/oss/Makefile diff --git a/deblob-check b/deblob-check index 41906f6776e..a81daa1bc90 100755 --- a/deblob-check +++ b/deblob-check @@ -845,8 +845,8 @@ set_except () { accept '[/][*][*][\n] [*] request_firmware_nowait: asynchronous version[^{]*[\n]{[\n]\([^}]\|[^\n}]}*\)*[\n]}[\n]' drivers/base/firmware_class.c accept 'EXPORT_SYMBOL(request_firmware\(_nowait\)\?);' drivers/base/firmware_class.c accept 'int request_firmware\(_nowait\)\?([^;]*);' include/linux/firmware.h - accept 'static inline int request_firmware\(_nowait\)\?([^{]*)[\n]{[\n][\t]return -EINVAL;[\n]}[\n]' include/linux/firmware.h - accept 'static inline int \(maybe_\)\?reject_firmware\(_nowait\)\?([^{;]*)[\n]{[\n]\([^}]\|[^\n}]}*\)*[\n]}[\n]' include/linux/firmware.h + accept 'static inline int request_firmware\(_nowait\)\?([^{]*)[\n]{[\n][\t]return -EINVAL;[\n]}' include/linux/firmware.h + accept 'static inline int[\n]\(maybe_\)\?reject_firmware\(_nowait\)\?([^{;]*)[\n]{[\n]\([^}]\|[^\n}]}*\)*[\n]}' include/linux/firmware.h accept 'static inline int request_ihex_firmware\?([^{]*)[\n]{[\n]\([^}]\|[^\n}]}*\)*[\n]}[\n]' include/linux/ihex.h ocomment '[/][*] Optional firmware\([^\n]*[\n] [*]\)*[^\n]* MODULE_FIRMWARE()' @@ -889,7 +889,7 @@ set_except () { blob ' sprintf([^;]*fore200[^;]*FW_EXT[^;]*);' drivers/atm/fore200e.c blobname '\(pc\|sb\)a200e\(_ecd\)\?\.bin[12]?' drivers/atm/fore200e.c - blobna 'The supplied firmware images.*fore.*Rebuild and reinstall[^.]*\.' Documentation/networking/fore200e.txt + blobna 'The supplied firmware images.*fore.*Rebuild and re-install[^.]*\.' Documentation/networking/fore200e.txt blobname 'intelliport2\.bin' drivers/char/ip2/ip2main.c @@ -957,6 +957,7 @@ set_except () { blobna 'static u16 \(sr\|twinax\)_edc\[\] = {[^;]*};' drivers/net/cxgb3/ael1002.c blobna 'for ([^\n]*ARRAY_SIZE(\(sr\|twinax\)_edc)[^\n]*)[\n][^;]*mdio_write[^;]*;' drivers/net/cxgb3/ael1002.c + blobname 't3fw\(_protocol_sram\)\?-\(%d\|[0-9]*\)\.\(%d\|[0-9]*\)\.\(%d\|[0-9]*\)\.bin' drivers/net/cxgb3/cxgb3_main.c blob '\([/][*][*]*[*][/][\n]*\)*\([/][*]\([^/]\|[^*/][/]*\)*Micro code\([^/]\|[^*/][/]*\)*8086:\([^/]\|[^*/][/]*\)*[*][/]\([\n]*[/][*]\([^/]\|[^*/][/]*\)*[*][/]\)*\|#define *D10\(1M\(_B\)\?\|1S\|2_E\)_\(CPUSAVER_\(TIMER\|BUNDLE\|MIN_SIZE\)_DWORD\|RCVBUNDLE_UCODE\)[ ]\(\\[\n]\|[^\n]\)*\)\([\n]*[/][*]\([^/]\|[^*/][/]*\|[*][/][\n]*[/][*]\)*Micro code\([^/]\|[^*/][/]*\)*8086:\([^/]\|[^*/][/]*\)*[*][/]\([\n]*[/][*]\([^/]\|[^*/][/]*\)*[*][/]\)*\|[\n][\n]*#define *D10\(1M\(_B\)\?\|1S\|2_E\)_\(CPUSAVER_\(TIMER\|BUNDLE\|MIN_SIZE\)_DWORD\|RCVBUNDLE_UCODE\)[ ]\(\\[\n]\|[^\n]\)*\)*' drivers/net/e100.c blobna '\([/][*]\([^/]\|[*][/]*\)*[*][/][\n]* \)\(ucode\[opts->\(timer\|bundle\|min_size\)_dword\] .= [^;]*;[\n][\n]* \)*[^}]*UCODE_SIZE[^}]*cb_ucode[^}]*return;[\n] }' drivers/net/e100.c @@ -1051,6 +1052,7 @@ set_except () { accept 'int xc_request_firmware(struct xc *[*] *x);' arch/arm/mach-netx/include/mach/xc.h accept 'int xc_request_firmware(struct xc *[*] *x)[\n]{' arch/arm/mach-netx/xc.c + accept ' dev_err(x->dev, "request_firmware failed\\n");' arch/arm/mach-netx/xc.c accept 'EXPORT_SYMBOL(xc_request_firmware);' arch/arm/mach-netx/xc.c accept ' if (xc_request_firmware(priv->xc)) {' drivers/net/netx-eth.c @@ -1079,7 +1081,7 @@ set_except () { blobname 'isi\(6\(08\|\(08\|16\)em\)\|46\(08\|16\)\)\.bin' drivers/char/isicom.c - blobname 'c\(218t\|p204\|320t\)unx\.code' drivers/char/moxa.c + blobname 'c\(218t\|p204\|320t\)unx\.cod' drivers/char/moxa.c accept ' printk(KERN_ERR "MOXA: request_firmware failed' drivers/char/moxa.c # This driver enables the user to update the non-Free BIOS, but it @@ -1130,6 +1132,7 @@ set_except () { blobname 'lbtf_usb\.bin' drivers/net/wireless/libertas_tf/if_usb.c blobname 'isl38\(86\|87usb_bare\|90usb\)' 'drivers/net/wireless/p54/p54\(pci\.c\|usb\.[ch]\)' + blob '[/][*] for isl3886 register definitions\([^/]\|[^*][/]*\)*[*][/]' drivers/net/wireless/p54/p54usb.h blobna 'If you enable this\([^\n]\|[\n][ ]*[^ \n]\)*isl3890\([^\n]\|[\n][ ]*[^ \n]\)*' drivers/net/wireless/Kconfig blobname 'isl38\(77\|86\|90\)' drivers/net/wireless/prism54/islpci_dev.c @@ -2151,12 +2154,14 @@ g; fi sedmain=" +/^$/N; /^[\n]\?;[/][*]\\(end .*\\)\\?[*][/];$/{ $4; d; } /^;[/][*]begin /!{ : internal_error + $v:internal_error i\\ Internal error at p; @@ -2174,8 +2179,9 @@ n; H; g; $4 -s/^\(;[/][*]begin [^\n]*[\n]\)*//; -s/\\($bol;[/][*]\\(end [^\n]*\\)\\?[*][/];\\)*$//; +$v:read all +s/^\\(;[/][*]begin [^\n]*[\\n]\\)*//; +s/\\($bol[\n]\?;[/][*]\\(end [^\\n]*\\)\\?[*][/];\\)*$//; $v:???!blobfast /$blobfast/!b clean; $check_false_positives -- 2.31.1