#! /bin/sh
-# deblob-check version 2008-03-29 $Rev$
+# deblob-check version 2008-07-16
# Inspired in gNewSense's find-firmware script.
# Written by Alexandre Oliva <lxoliva@fsfla.org>
# usage: deblob-check [-S] [-vv] [-s S] [-lDdBbCcXxPpFftVh?H] \
-# [*.tar* patch-* *.patch]
+# [*.tar* patch-* *.patch *.diff]
# Look for too-long undocumented sequences of numbers (generally blobs
# in disguise) in source files.
# sensitivity, so make sure the sequences of numbers that are not
# blobs are not deblobbed. FIXME: we should have patterns to
# recognize the blobs instead.
- initnc ' static const u32 test_pat\[4\]\[6\] ='
- initnc ' }, mem_tbl_5705\[\] ='
+ accept " static const u32 test_pat\[4\]\[6\] = {$sepx$blobpat*$sepx};" drivers/net/tg3.c
+ accept " }\\(,\\? mem_tbl_5\\(70x\\|705\\|755\\|906\\)\\[\\] = {$sepx$blobpat*$sepx}\\)*;" drivers/net/tg3.c
;;
*/*linux*.tar* | */*kernel*.tar* | */*linux-*.*.*/*)
# false alarms, contain source
initnc ' static const unsigned char invert5\[\] ='
initnc 'static unsigned char alpa2target\[\] ='
initnc 'static unsigned char target2alpa\[\] ='
- oprepline '#define INIT_THREAD [{0},]\+[ ]*\\[ ]*[{0},]\+'
+ oprepline '#define INIT_THREAD [{0},]\+[ ]*\\[\n][ ]*[{0},]\+'
initnc 'static uint tas300\(1c\|4\)_\(master\|mixer\|treble\|bass\)_tab\[\]='
initnc 'static short dmasound_[au]law2dma16\[\] ='
initnc 'static const unsigned short DACVolTable\[101\] ='
initnc 'static const struct ath5k_ini_rf rfregs_5413\[\] ='
initnc 'const u\(8\|16\|32\) b43_ntab_\(\(adjustpower\|estimatepowerlt\|gainctl\|iqlt\|loftlt\|noisevar1\|tdi[24]0a\)[01]\|channelest\|frame\(lookup\|struct\)\|mcs\|pilot\|tdtrn\|tmap\)\[\] ='
+ # new in 2.6.26
+ initnc 'static u64 vec2off\[68\] =' arch/ia64/kvm/process.c
+ initnc " interrupts = <\\(0x\\)\\?3 \\(0x\\)\\?0 \\(0x\\)\\?0 $blobpat*>;" 'arch/powerpc/boot/dts/\(cm5200\|lite5200b\?\|kuroboxHG\|pcm030\|tqm5200\).dts'
+ initnc 'static const u32 crctab32\[\] =' arch/x86/boot/tools/build.c
+ initnc 'static struct mse2snr_tab \(vsb\|qam\(64\|256\)\)_mse2snr_tab\[\] =' drivers/media/dvb/frontends/au8522.c
+ initnc '} \(VSB\|QAM\)_mod_tab\[\] =' drivers/media/dvb/frontends/au8522.c
+ initnc '} itd1000_\(lpf_pga\|fre_values\)\[\] =' drivers/media/dvb/frontends/itd1000.c
+ initnc '} \(vsb\|qam\(64\|256\)\)_snr_tab\[\] =' drivers/media/dvb/frontends/s5h1411.c
+ initnc '} snr_tab\[\] =' drivers/media/dvb/frontends/tda10048.c
+ initnc 'static u32 reg_init_initialize\[\] =' drivers/media/video/saa717x.c
+ initnc 'static const u32 \(main\|gear\)_seedset\[BACKOFF_SEEDSET_ROWS\]\[BACKOFF_SEEDSET_LFSRS\] =' drivers/net/forcedeth.c
+ initnc 'static const struct ath5k_ini_mode rf24\(13\|25\)_ini_mode_end\[\] =' drivers/net/wireless/ath5k/initvals.c
+ initnc 'static const u16 wm9713_reg\[\] =' sound/soc/codecs/wm9713.c
+
+ # This looks suspicious, but it pretty much just sets stuff to zero.
+ initnc 'static __u8 mode8420\(pro\|con\)\[\] =' drivers/media/video/cs8420.h
+
# quite suspicious
# arch/parisc/kernel/perf_images.h
initc 'static uint32_t onyx_images\[\]\[PCXU_IMAGE_SIZE\/sizeof(uint32_t)\] __read_mostly ='
accept '[ ]\{1,2\}err = sn9c102_write_const_regs(cam\(,[ \n]\+{0x[0-9a-fA-F][0-9a-fA-F], 0x[0-9a-fA-F][0-9a-fA-F]}\)*);'
# too lax?
- initnc 'static yyconst flex_int\(16\|32\)_t yy_[^[]*\[[][0-9]*\] ='
- initnc 'static const \(yytype_u\?int\(8\|16\)\|unsigned \(short\( int\)\?\|char\)\) yy[^[]*\[\] ='
+ initnc 'static yyconst \(flex_int\(16\|32\)_t\|\(\(short \)\?int\)\) yy_[^[]*\[[][0-9]*\] ='
+ initnc 'static const \(yytype_u\?int\(8\|16\)\|\(unsigned \)\?\(short\( int\)\?\|char\)\) yy[^[]*\[\] ='
initnc '\(\| \)static \(const \|\)\(unsigned \(short\|char\)\|struct SiS_[^ ]*\) SiS[^[]*\(\[[] [*0-9]*\]\)\+ *='
initnc 'static const a3d_Hrtf_t A3dHrirZeros = {'
initnc ' #define WakeupSeq {'
initnc ' SetRate44100\[\] ='
initnc ' const short period\[32\] ='
- initnc ' const static int desc_idx_table\[\] ='
+ initnc ' \(const static\|static const\) int desc_idx_table\[\] ='
initnc ' int prop_bcomm_irq\[3\*16\] ='
initnc ' static char logSlopeTable\[128\] ='
initnc ' static const int uc_\(dup\|word\)_table\[\]\[2\] ='
initnc 'static __const__ __u16 gx_coeff\[256\] ='
initnc 'static __u8 init7121ntsc\[\] ='
initnc 'static __u8 init7121pal\[\] ='
- initnc 'static __u8 mode8420\(pro\|con\)\[\] ='
initnc 'static byte capidtmf_leading_zeroes_table\[0x100\] ='
initnc 'static char channel_map_madi_ss\[HDSPM_MAX_CHANNELS\] ='
initnc 'static char coefficients\[NM_TOTAL_COEFF_COUNT \* 4\] ='
initnc 'static uchar sbox\[8\]\[4\]\[16\] ='
initnc 'static uint16_t crc_table\[256\] ='
initnc 'static uint8_t lpfcAlpaArray\[\] ='
- initnc 'static uint8_t seqprog\[\] ='
+ initnc 'static \(const \)\?uint8_t seqprog\[\] ='
initnc 'static unsigned char V110_OffMatrix_9600\[\] ='
initnc 'static unsigned char V110_OnMatrix_9600\[\] ='
initnc 'static unsigned char a2232_65EC02code\[\] ='
- initnc 'static unsigned char alaw_main\[\] ='
initnc 'static unsigned char atkbd_set3_keycode\[512\] ='
initnc 'static unsigned char atkbd_unxlate_table\[128\] ='
initnc 'static unsigned char banner_table\[\] ='
initnc 'static unsigned char expressiontab\[128\] ='
initnc 'static unsigned char header2\[\] ='
initnc 'static unsigned char hidp_keycode\[256\] ='
- initnc 'static unsigned char ima_adpcm_capture\[\] ='
- initnc 'static unsigned char ima_adpcm_init\[\] ='
- initnc 'static unsigned char ima_adpcm_playback\[\] ='
initnc 'static unsigned char irq_xlate\[32\] ='
- initnc 'static unsigned char mulaw_main\[\] ='
initnc 'static unsigned char nkbd_keycode\[128\] ='
initnc 'static unsigned char pan_volumes\[256\] ='
initnc 'static unsigned char parm_block\[32\] ='
initnc '} vsb_snr_tab\[\] ='
initnc '} yss225_registers\[\] __devinitdata ='
;;
+ */patch*2.6.27-rc* | */patch*2.6.26-git*)
+ accept ' \.section __ex_table,"a"'"$sepx$blobpat*" 'arch/x86/lib/copy_user_\(nocache_\)\?64.S'
+ initnc 'static struct cipher_testvec des3_ede_cbc_\(enc\|dec\)_tv_template\[\] =' crypto/tcrypt.h
+
+ accept 'desc_config1:[\n] \.byte 0x09, 0x02'"$sepx$blobpat*" 'firmware/keyspan_pda/\(keyspan_pda\|xircom_pgs\).S'
+ accept 'string_mfg:[\n]\?\(;\? \.byte[^\n]*[\n]\)\+string_mfg_end:' 'firmware/keyspan_pda/\(keyspan_pda\|xircom_pgs\).S'
+ accept 'string_product:[\n]\?\(;\? \.byte[^\n]*[\n]\)\+string_product_end:' 'firmware/keyspan_pda/\(keyspan_pda\|xircom_pgs\).S'
+ accept ':03000000020200F9[\n]:040023000205\(9B0037\|5F0073\)[\n]\(:050030000000000000CB[\n]\|:0400430002010000B6[\n]\)*'"$sepx$blobpat*"'[\n]:\(0E06E0006400670065007400060334003700F4\|0606A000060334003700E0\)[\n]:00000001FF[\n]' 'firmware/keyspan_pda/\(keyspan_pda\|xircom_pgs\).HEX'
+ initnc 'static const u16 uda1380_reg\[UDA1380_CACHEREGNUM\] =' sound/soc/codecs/uda1380.c
+ initnc 'static const u16 wm8510_reg\[WM8510_CACHEREGNUM\] =' sound/soc/codecs/wm8510.c
+ ;;
+
*/patch*2.6.26-rc*)
initnc 'static u64 vec2off\[68\] =' arch/ia64/kvm/process.c
initnc " interrupts = <\\(0x\\)\\?3 \\(0x\\)\\?0 \\(0x\\)\\?0 $blobpat*>;" 'arch/powerpc/boot/dts/\(cm5200\|lite5200b\?\|kuroboxHG\|pcm030\|tqm5200\).dts'
initnc 'static u32 reg_init_initialize\[\] =' drivers/media/video/saa717x.c
initnc ' } vals\[\] =' drivers/media/video/saa717x.c
initnc 'static const u32 \(main\|gear\)_seedset\[BACKOFF_SEEDSET_ROWS\]\[BACKOFF_SEEDSET_LFSRS\] =' drivers/net/forcedeth.c
- blob '^unsigned char \(IDX_ACTIVATE_\(READ\|WRITE\)\|\(CM\|ULP\)_\(ENABLE\|SETUP\)\|DM_ACT\) = '"$blobsep$blobseq*$blobsep;" drivers/s390/net/qeth_core_mpc.c # from drivers/s390/net/qeth_mpc.c in 2.6.25
+ blob '^unsigned char \(IDX_ACTIVATE_\(READ\|WRITE\)\|\(CM\|ULP\)_\(ENABLE\|SETUP\)\|DM_ACT\) = '"$sepx$blobseq*$sepx;" drivers/s390/net/qeth_core_mpc.c # from drivers/s390/net/qeth_mpc.c in 2.6.25
initnc '} pll_table\[\] =' drivers/video/geode/lxfb_ops.c
accept " { 0x00014284, 19688 },[\n] { 0x00011104, 20400 },[\n] { $blobpat* }," drivers/video/geode/lxfb_ops.c # won't be necessary in rc3
initnc 'static const u16 wm9713_reg\[\] =' sound/soc/codecs/wm9713.c
initnc 'static const struct ath5k_ini_mode rf\(5413\|24\(13\|25\)\)_ini_mode_end\[\] =' drivers/net/wireless/ath5k/initvals.c # ?
initnc ' } blinkrates\[\] ='
+ initnc 'static const u8 rtl8225z2_agc\[\] =' drivers/net/wireless/rtl8187_rtl8225.c
+ initnc 'static const u8 rtl8225z2_ofdm\[\] =' drivers/net/wireless/rtl8187_rtl8225.c
+ initnc 'static const u8 rtl8225z2_tx_power_cck\[\] =' drivers/net/wireless/rtl8187_rtl8225.c
+ initnc 'static const u8 rtl8225z2_tx_power_cck_ch14\[\] =' drivers/net/wireless/rtl8187_rtl8225.c
+
# git logs
accept ' sudo modprobe ath5k debug=0x00000400[\n][ ]*[\n]\([ ]*Band[^\n]*[\n]\([ ]*\(\(channels\|rates\):\|[- 0-9a-f]*\|\[\.\.\. etc \]\)[\n]\)\+\)\+ 540 000c 0000 0000'
oprepline ' { 1, MODULATION_XR, 3000, 1, 150, 3 },'
# Regular expression that matches an assembly label followed by a blob
# without any intervening label.
-asmblob="[a-zA-Z_.][^\\n:;#/ ]*[ ]*:\\([^:]*\\|$asmcomment\\)*$blobseq\\([^:]*\\|$asmcomment\\)*"
+asmblob="[a-zA-Z_.][^\\n:;#/ ]*[ ]*:\\([^:{}]*\\|$asmcomment\\)*$blobseq\\([^:]*\\|$asmcomment\\)*"
# Regular expression that matches one or more blobs without
# intervening line breaks.
*.tar*)
cmd="tar -xf - --to-command='echo \";/*begin \$TAR_FILENAME*/;\"; cat; echo \";/**/;\"; echo \";/*end \$TAR_FILENAME*/;\"'"
;;
- *patch* | *diff*)
+ *.patch | */patch-* | *.diff)
sedpatch='
/^[-]/d;
/^\(@@\|+++\) / {