# 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.26 extra=1
+kver=2.6.26 extra=2
-if unifdef /dev/null; then :; else
- echo unifdef is required >&2
- exit 1
+case $1 in
+--force) die () { echo ERROR: "$@": ignored >&2; }; shift;;
+*) die () { echo "$@" >&2; exit 1; };;
+esac
+
+if unifdef -Utest /dev/null; then :; else
+ die unifdef is required
fi
check=`echo $0 | sed 's,/[^/]*$,,'`/deblob-check
function clean_file {
#$1 = filename
if test ! -f $1; then
- echo $1 does not exist, something is wrong >&2
- exit 1
+ die $1 does not exist, something is wrong
fi
rm -v $1
}
function check_changed {
if test ! -f $1; then
- echo $1 does not exist, something is wrong >&2
- exit 1
+ die $1 does not exist, something is wrong
elif cmp $1.deblob $1 > /dev/null; then
- echo $1 did not change, something is wrong >&2
- exit 1
+ die $1 did not change, something is wrong
fi
mv $1.deblob $1
}
#$1 = filename
if $have_check; then
if test ! -f $1; then
- echo $1 does not exist, something is wrong >&2
- exit 1
+ die $1 does not exist, something is wrong
fi
name=$1
echo Removing blobs from $name
function clean_ifdef {
#$1 = filename $2 = macro to -U
echo unifdefing $1 with -U$2
- unifdef $1 -U$2 > $1.deblob
+ unifdef -U$2 $1 > $1.deblob
check_changed $1
}
sound/pci/cs46xx/imgs/cwcdma.asp \
; do
if test ! $f; then
- echo $f is not present, something is amiss >&2
- exit 1
+ die $f is not present, something is amiss
fi
done
# sed -i '/cs46xx\/ \\/d' sound/pci/Makefile
# SND_KORG1212 - Korg 1212 IO
-clean_ifdef sound/pci/korg1212/korg1212.c CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL
clean_blob sound/pci/korg1212/korg1212-firmware.h
+clean_ifdef sound/pci/korg1212/korg1212.c CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL
+clean_kconfig sound/pci/Kconfig 'SND_KORG1212_FIRMWARE_IN_KERNEL'
# SND_MAESTRO3 - ESS Allegro/Maestro3
clean_ifdef sound/pci/maestro3.c CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
+clean_kconfig sound/pci/Kconfig 'SND_MAESTRO3_FIRMWARE_IN_KERNEL'
# SND_YMFPCI - Yamaha YMF724/740/744/754
clean_blob sound/pci/ymfpci/ymfpci_image.h
clean_ifdef sound/pci/ymfpci/ymfpci_main.c CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL
+clean_kconfig sound/pci/Kconfig 'SND_YMFPCI_FIRMWARE_IN_KERNEL'
# SND_SB16_CSP_FIRMWARE_IN_KERNEL - SB16 Advanced Signal Processor
clean_blob sound/isa/sb/sb16_csp_codecs.h
-clean_kconfig sound/isa/Kconfig SND_SB16_CSP_FIRMWARE_IN_KERNEL
+clean_kconfig sound/isa/Kconfig 'SND_SB16_CSP_FIRMWARE_IN_KERNEL'
# SND_WAVEFRONT_FIRMWARE_IN_KERNEL
# Most of this file is not matched by deblob-check because of WAIT_IDLE.
# Just remove it.
clean_file sound/isa/wavefront/yss225.c
-clean_kconfig sound/isa/Kconfig SND_WAVEFRONT_FIRMWARE_IN_KERNEL
+clean_kconfig sound/isa/Kconfig 'SND_WAVEFRONT_FIRMWARE_IN_KERNEL'
exit 0
#! /bin/sh
-# deblob-check version 2008-08-01
+# deblob-check version 2008-09-07
# Inspired in gNewSense's find-firmware script.
# Written by Alexandre Oliva <lxoliva@fsfla.org>
addx "$1[^;]*;\\?" $2
}
+ # Same as initnc, but require the terminating semicolon.
+ defsnc () {
+ addx "$1[^;]*;" $2
+ }
+
# Look for a multi-line definition starting with a line that matches
# $1 (implicitly anchored to the beginning of the line), and ending
# at the first ';' that's not within comments.
# 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.
- accept " static const u32 test_pat\[4\]\[6\] = {$sepx$blobpat*$sepx};" drivers/net/tg3.c
+ defsnc ' static const u32 test_pat\[4\]\[6\] =' drivers/net/tg3.c
accept " }\\(,\\? mem_tbl_5\\(70x\\|705\\|755\\|906\\)\\[\\] = {$sepx$blobpat*$sepx}\\)*;" drivers/net/tg3.c
;;
*/*linux*.tar* | */*kernel*.tar* | */*linux-*.*.*/*)
# checked:
accept ' \$3 = {{pge = {{ste = {\(\([0-9][0-9a-fx{},\n ]*\|\(pge\|ste\) =\|<repeats [0-9]\+ times>\)[{},\n ]*\)*<repeats 11 times>}'"$eol"
- # arch/sparc/lib/divdi3.S
- accept '__clz_tab:[\n] \.byte 0\(,[0-5]\)\+'"$sepx$blobpat*"
- accept 'PITBL:[\n] \.long 0xC0040000,0xC90FDAA2,'"$blobpat*"
- # arch/m68k/mac/mac_penguin.S
- accept '\(0x[0F][0F],\)\+\\[\n]\(\(0x[0F][0F],\)\+\\[\n]\)*\(0x[0F][0F],\)\+0x00'
+ accept '__clz_tab:[\n] \.byte 0\(,[0-5]\)\+'"$sepx$blobpat*" arch/sparc/lib/divdi3.S
+ accept 'PITBL:[\n] \.long 0xC0040000,0xC90FDAA2,'"$blobpat*" arch/sparc/lib/divdi3.S
+ accept '\(0x[0F][0F],\)\+\\[\n]\(\(0x[0F][0F],\)\+\\[\n]\)*\(0x[0F][0F],\)\+0x00' arch/m68k/mac/mac_penguin.S
accept '\.lowcase:[\n] \.byte 0x00\(,0x0[1-7]\)\+'"$sepx$blobpat*$eol" arch/s390/kernel/head.S
accept '_zb_findmap:[\n] \.byte 0\(,[123],0\)\+,4'"$sepx$blobpat*$eol" arch/s390/kernel/bitmap.S
accept '_sb_findmap:[\n] \.byte 8\(,0,[123]\)\+,0'"$sepx$blobpat*$eol" arch/s390/kernel/bitmap.S
initnc 'static short dmasound_[au]law2dma16\[\] ='
initnc 'static const unsigned short DACVolTable\[101\] ='
+ # in 2.6.22
+ initnc 'static const UQItype __clz_tab\[\] =' arch/arm26/lib/udivdi3.c
+ initnc ' static unsigned char scale\[101\] =' sound/oss/opl3sa2.c
+ initnc '} syncs\[\] =' drivers/scsi/53c7xx.c
+ initnc 'genoa_md:'"$sepx$blobpat*"'[\n] \.ascii "Genoa"' arch/i386/boot/video.S
+
+ # in 2.6.21
+ initnc 'Vendor ID Product ID[\n]-\+ -\+[\n]'"$blobpat*" Documentation/video4linux/sn9c102.txt
+ defsnc 'static short [au]law2dma16\[\]' arch/ppc/8xx_io/cs4218_tdm.c
+ defsnc ' static const char minimal_ascii_table\[\]' drivers/ieee1394/csr1212.c
+ defsnc 'static u16 key_map \[256\] =' drivers/media/dvb/ttpci/av7110_ir.c
+ defsnc 'static unsigned char gf64_inv\[64\] =' drivers/mtd/nand/cafe_ecc.c
+ defsnc 'static unsigned short err_pos_lut\[4096\] =' drivers/mtd/nand/cafe_ecc.c
+ defsnc 'static unsigned char testdata\[TESTDATA_LEN\] =' fs/jffs2/comprtest.c
+
# new in 2.6.25
accept "%canned_values = ([\\n] \\([0-9]\\+ => \\[[ \\n]\\+\\(\\([0-9]\\+\\|'0x[0-9a-f]\\+'\\),[ \\n]*\\)*\\]\\(, \\|[\\n]\\)\\)*);"
# These are regarded as ok
initnc 'static const u8 SN9C102_\(Y\|UV\)_QTABLE[01]\[64\] = {'
- initnc ' static const u8 jpeg_header\[589\] = {'
+ initnc ' static \(const \)\?u8 jpeg_header\[589\] = {' media/video/sn9c102/sn9c102_core.c
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 ' #define WakeupSeq {'
initnc ' SetRate44100\[\] ='
initnc ' const short period\[32\] ='
- initnc ' \(const static\|static const\) int desc_idx_table\[\] ='
+ defsnc ' \(const static\|static const\) int desc_idx_table\[\] =' 'arch/arm/include/asm/hardware/iop3xx-adma.h|include/asm-arm/hardware/iop3xx-adma.h'
initnc ' int prop_bcomm_irq\[3\*16\] ='
initnc ' static char logSlopeTable\[128\] ='
initnc ' static const int uc_\(dup\|word\)_table\[\]\[2\] ='
initnc ' static unsigned char CRCTable2\[\] ='
initnc ' static unsigned char default_colors\[\] ='
initnc ' static unsigned char iso_regs\[8\]\[4\] ='
- initnc ' static unsigned char log_scale\[101\] ='
+ initnc ' static unsigned char log_scale\[101\] =' sound/oss/pss.c
initnc ' static unsigned char msg\[\] ='
initnc ' static unsigned char static_pad\[\] ='
initnc ' static unsigned char table_alaw2ulaw\[\] ='
initnc '#define OV511_QUANTABLESIZE 64'
initnc 'BYTE BtCard::SRAMTable_\(NTSC\|PAL\)\[\] ='
initnc 'BYTE SRAMTable\[\]\[ 60 \] ='
- accept 'irq_prio_[hdlc]*:'"$sepx$blobpat*"
+ accept 'irq_prio_\([hdl]\|l[cd]\):'"$sepx$blobpat*" 'arch/arm/inlcude/asm/hardware/entry-macro-iomd.S|include/asm-arm/hardware/entry-macro-iomd.S'
initc '__u8 _ascebc\[256\] ='
initc '__u8 _ebc_tolower\[256\] ='
initc '__u8 _ebc_toupper\[256\] ='
initnc 'static __u8 init7121ntsc\[\] ='
initnc 'static __u8 init7121pal\[\] ='
initnc 'static byte capidtmf_leading_zeroes_table\[0x100\] ='
- initnc 'static char channel_map_madi_ss\[HDSPM_MAX_CHANNELS\] ='
+ defsnc 'static char channel_map_madi_[sdq]s\[HDSPM_MAX_CHANNELS\] =' sound/pci/rme9652/hdspm.c
initnc 'static char coefficients\[NM_TOTAL_COEFF_COUNT \* 4\] ='
initnc 'static char ecc_syndrome_table\[\] ='
initnc 'static char isdn_audio_alaw_to_ulaw\[\] ='
initnc 'static const unsigned short wd7000_iobase\[\] ='
initnc 'static const unsigned short x86_keycodes\[256\] ='
initnc 'static const unsigned table\[\] ='
- initnc 'static int MV300_reg_8bit\[256\] ='
+ initnc 'static int MV300_reg_8bit\[256\] \?=' drivers/video/atafb.c
initnc 'static int fifo_map\[\]\[MAX_TX_FIFOS\] ='
initnc 'static int initial_lfsr\[\] ='
initnc 'static int log_tbl\[129\] ='
initnc 'static int reserve_list\[MAX_RES_ARGS\] ='
initnc 'static int reverse6\[64\] ='
initnc 'static short attack_time_tbl\[128\] ='
- initnc 'static short beep_wform\[256\] ='
+ defsnc 'static short beep_wform\[256\] =' 'sound/ppc/beep.c|sound/oss/dmasound/dmasound_awacs.c|arch/ppc/8xx_io/cs4218_tdm.c'
initnc 'static short decay_time_tbl\[128\] ='
initnc 'static short isdn_audio_[ua]law_to_s16\[\] ='
initnc 'static struct cipher_testvec anubis_cbc_dec_tv_template\[\] ='
initnc 'static unsigned char a2232_65EC02code\[\] ='
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 banner_table\[\] =' arch/sh/boards/superh/microdev/led.c
initnc 'static unsigned char bootlogo_bits\[\] ='
initnc 'static unsigned char bus2core_8260\[\] ='
initnc 'static unsigned char bus2core_8280\[\] ='
initnc 'static const __u8 cxjpeg_\(640\|352\|320\|176\|qtable\)\[\]\[8\] =' drivers/media/video/gspca/conex.c
initnc 'static const unsigned char quant\[\]\[0x88\] =' drivers/media/video/gspca/jpeg.h
initnc 'static unsigned char huffman\[\] =' drivers/media/video/gspca/jpeg.h
- initc ' static const struct ov_i2c_regvals norm_76[1247]0\[\] =' drivers/media/video/gspca/ov519.c
+ initc ' \?static const struct ov_i2c_regvals norm_76[1247]0\[\] =' drivers/media/video/gspca/ov519.c
initnc 'static const __u8 pac207_sensor_init\[\]\[8\] =' drivers/media/video/gspca/pac207.c
initnc 'static const __u8 pac7311_jpeg_header\[\] =' drivers/media/video/gspca/pac7311.c
+ initnc 'static const __u8 \(start\|page[34]\)_73\(02\|11\)\[\] =' drivers/media/video/gspca/pac7311.c
initnc 'static const __u8 init\(Hv7131\|Ov\(6650\|7630\(_3\)\?\)\|Pas\(106\|202\)\|Tas51[13]0\)\[\] =' drivers/media/video/gspca/sonixb.c
initnc 'static const __u8 \(hv7131\|ov\(6650\|7630\(_3\)\?\)\|pas\(106\|202\)\|tas51[13]0\)_sensor_init\(_com\)\?\[\]\[8\] =' drivers/media/video/gspca/sonixb.c
- initnc 'static const __u8 \(hv7131r\|mi0360\|mo4000\|ov76\(60\|48\)\)_sensor_init\[\]\[8\] =' drivers/media/video/gspca/sonixj.c
+ defsnc 'static \(const \)\?__u8 \(hv7131r\|mi0360\|mo4000\|ov76\([36]0\|48\)\|om6802\)_sensor_init\[\]\[8\] =' drivers/media/video/gspca/sonixj.c
initnc 'static const __u8 qtable4\[\] =' drivers/media/video/gspca/sonixj.c
initnc 'static const __u16 \(spca500_visual\|Clicksmart510\)_defaults\[\]\[3\] =' drivers/media/video/gspca/spca500.c
initnc 'static const __u8 qtable_\(creative_pccam\|kodak_ez200\|pocketdv\)\[2\]\[64\] =' drivers/media/video/gspca/spca500.c
initnc 'static u8 sample_\(german_\(all\|old\)\|american_\(dialtone\|ringing\|busy\)\|special[123]\|silence\)\[\] =' drivers/isdn/mISDN/dsp_tones.c
initnc 'struct pattern {[^}]*int tone;[^}]*} pattern\[\] =' drivers/isdn/mISDN/dsp_tones.c
initnc 'static u8 \([au]\|_4\)law_to_\([ua]law\|4bit\)\[256\] =' drivers/isdn/mISDN/l1oip_codec.c
+ initnc 'static unsigned char banner_table\[\] =' arch/sh/boards/mach-microdev/led.c
+ initnc ';[/][*]@@ -[0-9]*,[0-9]* +[0-9]*,[0-9]* @@ static const \(yytype_u\?int\(8\|16\)\|\(unsigned \)\?\(short\( int\)\?\|char\)\) yy[^[]*\[\] =[*][/];' scripts/genksyms/parse.c_shipped
+ accept 'irq_prio_\([hdl]\|l[cd]\):'"$sepx$blobpat*" arch/arm/inlcude/asm/hardware/entry-macro-iomd.S
+ defsnc ' static const int desc_idx_table\[\] =' arch/arm/include/asm/hardware/iop3xx-adma.h
+ defsnc ';[/][*]@@ -[0-9]*,[0-9]* +[0-9]*,[0-9]* @@ static const __u8 \(hv7131r\|mi0360\|mo4000\|ov76\(60\|48\)\)_sensor_init\[\]\[8\] = {[*][/];' drivers/media/video/gspca/sonixj.c
+ defsnc 'static const struct ath_hal ar5416hal =' drivers/net/wireless/ath9k/hw.c
+ defsnc 'static \(const \)\?u32 ar\(5416\|9280\)\(Modes\(_fast_clock\)\?\|Common\|BB_RfGain\|Bank6\(TPC\)\?\|Addac\)\(_91[06]0\(1_1\)\?\|_9280\(_2\)\?\)\?\[\]\[[236]\] =' drivers/net/wireless/ath9k/initvals.h
;;
accept ' '"'"'0x[^\n]*[\n]\([^\n]*[\n]\)* \]\(, [0-9]\+ => \[\)\?'"$eol"
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\)\[\] ='
;;
- */nouveau-drm*.patch)
- initnc '\(static uint32_t\|}\) nv04_graph_ctx_regs \[\] ='
- initnc 'static int nv10_graph_ctx_regs \[\] ='
+ */*drm*.patch)
+ # linux-2.6-drm-i915-modeset.patch, nouveau-drm*.patch,
+ # drm-fedora9-rollup.patch
+ initnc 'static const u32 filter_table\[\] =' drivers/char/drm/intel_tv.c
+ initnc '\(static uint32_t\|}\) nv04_graph_ctx_regs \[\] =' drivers/char/drm/nv04_graph.c
+ initnc 'static int nv10_graph_ctx_regs \[\] =' drivers/char/drm/nv10_graph.c
# Although the developers of the drivers are not trying to stop
# anyone from modifying it or understanding it, they acknowledge
# of the blobs have power to stop others from modifying them.
# Non-Free software, for sure.
- # initnc 'static uint32_t nv\(4[013467ace]\|49_4b\|8[46]\)_ctx_\(voodoo\|prog\)\[\] ='
+ # initnc 'static uint32_t nv\(4[013467ace]\|49_4b\|8[46]\)_ctx_\(voodoo\|prog\)\[\] =' 'drivers/char/drm/nv40_graph.c|.*'
;;
*/linux-2.6-lirc.patch)
initnc 'const unsigned char map_table\[\] ='
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 },'
;;
- */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\[\] ='
# behind, and then it will refuse to run again before you clean it up
# by hand. It takes extra care to avoid overwriting useful files.
+# If deblob-$mver finds any unexpected situation, it will error out,
+# and then deblob-main will quit. Pass --force to deblob-main, before
+# any other argument, for deblob-main to ignore any such situations.
+
+case $1 in
+--force) force=--force; shift;;
+*) force=;;
+esac
+
mver=$1 extra=$2 sver=$3
kver=$mver$sver libre=libre$extra
deblob= dir=`echo $0 | sed 's,/[^/]*$,,'`
fi
x1="kver=$mver extra=$extra"
-x2=`grep "^kver=[^ ]* extra=[0-9]*$" $deblob`
+x2=`grep "^kver=[^ ]* extra=" $deblob`
if test "$x1" = "$x2"; then
:
else
cp -lR linux-$kver/. linux-$kver-$libre
echo Deblobbing within linux-$kver-$libre
-(cd linux-$kver-$libre && /bin/sh ../$deblob) || exit 1
+if (cd linux-$kver-$libre && /bin/sh ../$deblob $force); then
+ :
+else
+ echo $deblob failed, aborting >&2
+ exit 1
+fi
rm -f linux-$kver-$libre.patch
-# Do not copy these scripts for now, deblob-check regards itself as a blog.
+# Do not copy these scripts for now, deblob-check regards itself as a blob.
# cp -p $0 $deblob deblob-check linux-$kver-$libre
echo Generating linux-$kver-$libre.patch
rm -rf linux-$kver orig-linux-$kver
echo Creating xdelta between linux-$kver.tar and linux-$kver-$libre.tar
-xdelta delta -0 linux-$kver.tar linux-$kver-$libre.tar linux-$kver-$libre.xdelta || :
+xdelta delta -0 linux-$kver.tar linux-$kver-$libre.tar linux-$kver-$libre.xdelta || : # xdelta returns nonzero on success
echo Compressing linux-$kver-$libre.tar and linux-$kver-$libre.xdelta
rm -f linux-$kver.tar
-bzip2 -9 linux-$kver-$libre.tar linux-$kver-$libre.xdelta
+bzip2 -9 linux-$kver-$libre.tar
+if test -f linux-$kver-$libre.xdelta; then
+ bzip2 -9 linux-$kver-$libre.xdelta
+fi
trap "status=$?; (exit $status); exit" 0 1 2 15
gpg -a --detach-sign linux-$kver-$libre.tar.bz2
mv linux-$kver-$libre.tar.bz2.asc linux-$kver-$libre.tar.bz2.sign
-gpg -a --detach-sign linux-$kver-$libre.xdelta.bz2
-mv linux-$kver-$libre.xdelta.bz2.asc linux-$kver-$libre.xdelta.bz2.sign
+if test -f linux-$kver-$libre.xdelta.bz2; then
+ gpg -a --detach-sign linux-$kver-$libre.xdelta.bz2
+ mv linux-$kver-$libre.xdelta.bz2.asc linux-$kver-$libre.xdelta.bz2.sign
+fi
echo All set, please review linux-$kver-$libre.patch