X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=deblob-check;h=1a38247fdd7e038373681a94db1a75405e1612a7;hb=a87f61d95d5dbea71d2c17a3c2a5fc74a9e7ab3f;hp=8c5e97fafd11db78af029dc657ba03cbc4822301;hpb=3f1941dd6f1bf3f8fac1af2c5cc9d2b9c533994a;p=releases.git diff --git a/deblob-check b/deblob-check index 8c5e97fafd11..1a38247fdd7e 100755 --- a/deblob-check +++ b/deblob-check @@ -1,6 +1,6 @@ #! /bin/sh -# deblob-check version 2008-07-22 +# deblob-check version 2008-07-24 # Inspired in gNewSense's find-firmware script. # Written by Alexandre Oliva @@ -38,6 +38,9 @@ # Specifies the number of consecutive integral or # character constants that trigger the blob detector. +# --reverse-patch: Test the removed parts of a patch, rather than +# the added ones. + # The default sensitivity is 32 constants. # The sensitivity, if present, must be the first option. The action @@ -250,6 +253,14 @@ case $1 in ;; esac +reverse_patch=false +case $1 in +--reverse-patch) + reverse_patch=: + shift; + ;; +esac + test_mode=false name=deblob-check @@ -1095,7 +1106,6 @@ set_except () { */patch*2.6.27-rc* | */patch*2.6.26-git* | */git-linus.diff) 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' @@ -1106,6 +1116,7 @@ set_except () { initnc 'static const unsigned short atkbd_set[23]_keycode\[512\] =' drivers/input/keyboard/atkbd.c initnc 'static const unsigned short atkbd_unxlate_table\[128\] =' drivers/input/keyboard/atkbd.c + initnc 'static const unsigned char usb_kbd_keycode\[256\] =' drivers/hid/usbhid/usbkbd.c initnc ' u8 buf, bufs\[\] =' drivers/media/dvb/dvb-usb/cxusb.c initnc 'static struct dvb_pll_desc [^\n]* =' drivers/media/dvb/frontends/dvb-pll.c initnc ' static int sysdiv_to_div_x_2\[\] =' arch/powerpc/platforms/512x/clock.c @@ -1140,6 +1151,8 @@ set_except () { 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 initnc 'static const __u16 t10_dif_crc_table\[256\] =' lib/crc-t10dif.c + initnc 'static crb_128M_2M_block_map_t crb_128M_2M_map\[64\] =' drivers/net/netxen/netxen_hw.c + initnc 'static const __u16 crc10_table\[256\] =' drivers/usb/serial/safe_serial.c ;; */patch*2.6.26-rc*) @@ -1930,17 +1943,22 @@ check () { cmd="tar -xf - --to-command='echo \";/*begin \$TAR_FILENAME*/;\"; cat; echo \";/**/;\"; echo \";/*end \$TAR_FILENAME*/;\"'" ;; *.patch | */patch-* | *.diff) - sedpatch=' - /^[-]/d; - /^\(@@\|+++\) / { - i\ -;/**/;\ -;/*end patchlet */;\ + if $reverse_patch; then + s=- r=+ + else + s=+ r=- + fi + sedpatch=" + /^[$r]/d; + /^\\(@@\\|$s$s$s\\) / { + i\\ +;/**/;\\ +;/*end patchlet */;\\ ;/*begin patchlet */; - s/^/;\/*/; - s/$/*\/;/; + s/^/;\\/*/; + s/\$/*\\/;/; }; - s/^[ +]//;' + s/^[ $s]//;" cmd='sed "$sedpatch"' ;; *)