Promote ../fedora/current/*/scripts/deblob.sh to deblob-main.
[releases.git] / deblob-check
index ef795b011eb5d66befab9b2e816ca3ae5644eb08..b65363e1e8ade5c78c8e2c636bc1d16df2c7fff9 100755 (executable)
 
 # Yeah, lots of stuff to do.  Want to help?
 
+# This makes it much faster, and mostly immune to non-ASCII stuff, as
+# long as a 8-bit-safe sed is used.  Probably a safe assumption these
+# days.
+case ${LANG+set} in set) LANG=C; export LANG;; esac
+
 rm="rm -f"
 case $1 in
 --save-scripts | -S)
@@ -499,6 +504,14 @@ set_except () {
   }
 
   case /$1 in
+  /drivers/net/tg3.c)
+    # This file contains firmwares that we deblob with high
+    # 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\[\] ='
+    ;;
   */*linux*.tar* | */*kernel*.tar* | */*linux-*.*.*/*)
     # false alarms, contain source
     # drivers/net/wan/wanxlfw.inc_shipped -> wanxlfw.S
@@ -591,6 +604,18 @@ set_except () {
     # drivers/media/video/saa7114.c
     initc 'static const unsigned char init\[\] = {[^;]*MODE=0 ;.*SAA_7114_NTSC_HSYNC_START'
 
+    # in 2.6.23 only
+    accept " Psize    Ipps       Tput     Rxint     Txint    Done     Ndone[\\n] ---------------------------------------------------------------\\([\\n][ 0-9]\\+\\)\\+$eol"
+    initnc 'static u_short ataplain_map\[NR_KEYS\] __initdata ='
+    initnc 'static RegInitializer initData\[\] __initdata ='
+    initnc '   static const unsigned char invert5\[\] ='
+    initnc 'static unsigned char alpa2target\[\] ='
+    initnc 'static unsigned char target2alpa\[\] ='
+    oprepline '#define INIT_THREAD [{0},]\+[   ]*\\[   ]*[{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\] ='
+
     # new in 2.6.25
     accept "%canned_values = ([\\n]    \\([0-9]\\+ => \\[[     \\n]\\+\\(\\([0-9]\\+\\|'0x[0-9a-f]\\+'\\),[    \\n]*\\)*\\]\\(, \\|[\\n]\\)\\)*);"
 
@@ -629,7 +654,7 @@ set_except () {
 
     # too lax?
     initnc 'static yyconst flex_int\(16\|32\)_t yy_[^[]*\[[][0-9]*\] ='
-    initnc 'static const yytype_u\?int\(8\|16\) yy[^[]*\[\] ='
+    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 = {'
@@ -750,12 +775,7 @@ set_except () {
     initnc 'static const int init_seq\[\] ='
     initnc 'static const int mobile_vid_table\[32\] ='
     initnc 'static const s16 snd_opl4_pitch_map\[0x600\] ='
-    initnc 'static const s8 b43_tssi2dbm_b_table\[\] ='
-    initnc 'static const s8 b43_tssi2dbm_g_table\[\] ='
-    initnc 'static const s8 b43legacy_tssi2dbm_b_table\[\] ='
-    initnc 'static const s8 b43legacy_tssi2dbm_g_table\[\] ='
-    initnc 'static const s8 bcm43xx_tssi2dbm_b_table\[\] ='
-    initnc 'static const s8 bcm43xx_tssi2dbm_g_table\[\] ='
+    initnc 'static const s8 \(b43\(\|legacy\)\|bcm43xx\)_tssi2dbm_[bg]_table\[\] ='
     initnc 'static const s8 budtab\[256\] ='
     initnc 'static const struct aper_size_info_32 u3_sizes\[8\] ='
     initnc 'static const struct aper_size_info_8 via_generic_sizes\[9\] ='
@@ -780,6 +800,7 @@ set_except () {
     initnc 'static const struct rf_channel rf_vals_seq\[\] ='
     initnc 'static const u16 Sbox\[256\] ='
     initnc 'static const u16 count_lut\[\] ='
+    # drivers/net/e1000e/phy.c
     initnc 'static const u16 e1000_igp_2_cable_length_table\[\] ='
     initnc 'static const u16 rtl8225bcd_rxgain\[\] ='
     initnc 'static const u16 rtl8225z2_rxgain\[\] ='
@@ -837,13 +858,13 @@ set_except () {
     initnc 'static const unsigned char blue\[256\] ='
     initnc 'static const unsigned char chktab[hl]\[256\] ='
     initnc 'static const unsigned char comet_miireg2offset\[32\] ='
-    initnc 'static const unsigned char euc2sjisibm_g3upper_map\[\]\[2\] ='
+    initnc 'static \(const \)\?unsigned char euc2sjisibm_g3upper_map\[\]\[2\] ='
     initnc 'static const unsigned char green\[256\] ='
     initnc 'static const unsigned char hash_table_ops\[64\*4\] ='
     initnc 'static const unsigned char hid_keyboard\[256\] ='
     initnc 'static const unsigned char mts_direction\[256\/8\] ='
     initnc 'static const unsigned char red\[256\] ='
-    initnc 'static const unsigned char sjisibm2euc_map\[\]\[2\] ='
+    initnc 'static \(const \)\?unsigned char sjisibm2euc_map\[\]\[2\] ='
     initnc 'static const unsigned char vol_cvt_datt\[128\] ='
     initnc 'static const unsigned char wm_vol\[256\] ='
     initnc 'static const unsigned int MulIdx\[16\]\[16\] ='
@@ -940,6 +961,9 @@ set_except () {
     initnc 'static u8 w1_crc8_table\[\] ='
     initnc 'static u_char const data_sizes_32\[32\] ='
     initnc 'static u_long ident_map\[32\] ='
+    initnc 'static u_short alt_map\[NR_KEYS\] ='
+    initnc 'static u_short altgr_map\[NR_KEYS\] ='
+    initnc 'static u_short ctrl_alt_map\[NR_KEYS\] ='
     initnc 'static u_short ctrl_map\[NR_KEYS\] *='
     initnc 'static u_short shift_ctrl_map\[NR_KEYS\] ='
     initnc 'static u_short shift_map\[NR_KEYS\] *='
@@ -1090,6 +1114,7 @@ set_except () {
     accept '     \( 49,\)*[\n]\([ 0-9,]*[\n]\)*     \( 49,\)*'"$eol"
     initnc 'static const unsigned char wm_vol\[256\] ='
     accept 'domain<N> <cpumask> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36'"$eol"
+    # drivers/net/e1000e/phy.c
     initnc 'static const u16 e1000_igp_2_cable_length_table\[\] ='
     accept '   24 => \[[\n]\([^\n]*[\n]\)*     \]\(, [0-9]\+ => \[\)\?'"$eol"
     accept '           '"'"'0x[^\n]*[\n]\([^\n]*[\n]\)*        \]\(, [0-9]\+ => \[\)\?'"$eol"
@@ -1114,8 +1139,24 @@ set_except () {
   */linux-2.6-modsign-mpilib.patch)
     initnc 'const unsigned char __clz_tab\[\] ='
     ;;
-  */linux-2.6-wireless.patch)
+  */linux-2.6-wireless*.patch)
     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\)\[\] ='
+    initnc 'static const s8 \(b43\(legacy\)\?\|bcm43xx\)_tssi2dbm_[bg]_table\[\] ='
+    initnc 'static struct iwl\(3945\)\?_tx_power power_gain_table\[2\]\[IWL_MAX_GAIN_ENTRIES\] ='
+    initnc 'static const struct gain_entry gain_table\[2\]\[108\] ='
+    initnc 'static const struct rf_channel rf_vals_5222\[\] ='
+    initnc 'static const struct rf_channel rf_vals_5225_2527\[\] ='
+    initnc 'static const struct rf_channel rf_vals_5226\[\] ='
+    initnc 'static const struct rf_channel rf_vals_bg\[\] ='
+    initnc 'static const struct rf_channel rf_vals_bg_2522\[\] ='
+    initnc 'static const struct rf_channel rf_vals_bg_2523\[\] ='
+    initnc 'static const struct rf_channel rf_vals_bg_2524\[\] ='
+    initnc 'static const struct rf_channel rf_vals_bg_2525\[\] ='
+    initnc 'static const struct rf_channel rf_vals_bg_2525e\[\] ='
+    initnc 'static const struct rf_channel rf_vals_bg_2528\[\] ='
+    initnc 'static const struct rf_channel rf_vals_noseq\[\] ='
+    initnc 'static const struct rf_channel rf_vals_seq\[\] ='
+    initnc '   static const u8 t\[\] ='
     initnc 'static const u16 rtl8225bcd_rxgain\[\] ='
     initnc 'static const u8 rtl8225_agc\[\] ='
     initnc 'static const u8 rtl8225_tx_power_cck\[\] ='
@@ -1131,16 +1172,9 @@ set_except () {
     oprepline '#define AR5K_RATES_TURBO '
     oprepline '#define AR5K_RATES_XR '
     initnc 'static const struct ath5k_ini ar5212_ini\[\] ='
-    initnc 'static const struct ath5k_ini_mode rf5413_ini_mode_end\[\] ='
+    initnc 'static const struct ath5k_ini_mode rf\(5413\|24\(13\|25\)\)_ini_mode_end\[\] ='
     initnc '           } blinkrates\[\] ='
-    ;;
-  */linux-2.6-wireless-pending.patch)
-    oprepline '#define AR5K_RATES_11A '
-    oprepline '#define AR5K_RATES_11B '
-    oprepline '#define AR5K_RATES_11G '
-    oprepline '#define AR5K_RATES_TURBO '
-    oprepline '#define AR5K_RATES_XR '
-    initnc 'static const struct ath5k_ini_mode rf24\(13\|25\)_ini_mode_end\[\] ='
+
     # 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 },'
@@ -1148,6 +1182,10 @@ set_except () {
   */linux-2.6-drm-i915-modeset.patch)
     initnc 'static const u32 filter_table\[\] ='
     ;;
+  */linux-2.6-netdev-e1000e*.patch)
+    # drivers/net/e1000e/phy.c
+    initnc 'static const u16 e1000_igp_2_cable_length_table\[\] ='
+    ;;
   esac
 }