- * data in hexadecimal or equivalent format, provided this copyright
- * notice is accompanying it.
*/
-
-
+
+
EOF
clean_blob drivers/net/tg3.c -s 9
if $have_check; then
- sed -i 's:\(\/\*(DEBLOBBED)\*\/\),:\1:' drivers/net/tg3.c
+ sed -i 's:\(\/\*(DEBLOBBED)\*\/\),:\1:' drivers/net/tg3.c
else
clean_kconfig drivers/net/Kconfig 'TIGON3'
clean_mk CONFIG_TIGON3 drivers/net/Makefile
- * data in hexadecimal or equivalent format, provided this copyright
- * notice is accompanying it.
*/
-
-
+
+
EOF
clean_blob drivers/net/tg3.c -s 9
if $have_check; then
- sed -i 's:\(\/\*(DEBLOBBED)\*\/\),:\1:' drivers/net/tg3.c
+ sed -i 's:\(\/\*(DEBLOBBED)\*\/\),:\1:' drivers/net/tg3.c
else
clean_kconfig drivers/net/Kconfig 'TIGON3'
clean_mk CONFIG_TIGON3 drivers/net/Makefile
- * data in hexadecimal or equivalent format, provided this copyright
- * notice is accompanying it.
*/
-
-
+
+
EOF
clean_blob drivers/net/tg3.c -s 9
if $have_check; then
- sed -i 's:\(\/\*(DEBLOBBED)\*\/\),:\1:' drivers/net/tg3.c
+ sed -i 's:\(\/\*(DEBLOBBED)\*\/\),:\1:' drivers/net/tg3.c
else
clean_kconfig drivers/net/Kconfig 'TIGON3'
clean_mk CONFIG_TIGON3 drivers/net/Makefile
- * data in hexadecimal or equivalent format, provided this copyright
- * notice is accompanying it.
*/
-
-
+
+
EOF
clean_blob drivers/net/tg3.c -s 9
if $have_check; then
- sed -i 's:\(\/\*(DEBLOBBED)\*\/\),:\1:' drivers/net/tg3.c
+ sed -i 's:\(\/\*(DEBLOBBED)\*\/\),:\1:' drivers/net/tg3.c
else
clean_kconfig drivers/net/Kconfig 'TIGON3'
clean_mk CONFIG_TIGON3 drivers/net/Makefile
- * data in hexadecimal or equivalent format, provided this copyright
- * notice is accompanying it.
*/
-
-
+
+
EOF
clean_blob drivers/net/tg3.c -s 9
if $have_check; then
- sed -i 's:\(\/\*(DEBLOBBED)\*\/\),:\1:' drivers/net/tg3.c
+ sed -i 's:\(\/\*(DEBLOBBED)\*\/\),:\1:' drivers/net/tg3.c
else
clean_kconfig drivers/net/Kconfig 'TIGON3'
clean_mk CONFIG_TIGON3 drivers/net/Makefile
filetest $2 || return
sed -e "$1" "$2" > "$2".deblob || {
die $2: failed: ${3-applied sed script $1} && return 1; }
- check_changed $2 && echo $2: ${3-applied sed script $1}
+ check_changed $2 && echo $2: ${3-applied sed script $1}
}
reject_firmware () {
filetest $2 || return
sed -e "$1" "$2" > "$2".deblob || {
die $2: failed: ${3-applied sed script $1} && return 1; }
- check_changed $2 && echo $2: ${3-applied sed script $1}
+ check_changed $2 && echo $2: ${3-applied sed script $1}
}
reject_firmware () {
/for (p = PhyUcode/i\
printk(KERN_ERR KBUILD_MODNAME ": missing Free firmware\\n");\
return (STATUS_FAILURE);\
-#define PhyUcode NULL
+#define PhyUcode NULL
}' drivers/staging/sxg/sxg.c 'report missing Free firmware'
clean_blob drivers/staging/sxg/sxg.c
clean_kconfig drivers/staging/sxg/Kconfig 'SXG'
filetest $2 || return
sed -e "$1" "$2" > "$2".deblob || {
die $2: failed: ${3-applied sed script $1} && return 1; }
- check_changed $2 && echo $2: ${3-applied sed script $1}
+ check_changed $2 && echo $2: ${3-applied sed script $1}
}
reject_firmware () {
/for (p = PhyUcode/i\
printk(KERN_ERR KBUILD_MODNAME ": missing Free firmware\\n");\
return (STATUS_FAILURE);\
-#define PhyUcode NULL
+#define PhyUcode NULL
}' drivers/staging/sxg/sxg.c 'report missing Free firmware'
clean_blob drivers/staging/sxg/sxg.c
clean_kconfig drivers/staging/sxg/Kconfig 'SXG'
filetest $2 || return
sed -e "$1" "$2" > "$2".deblob || {
die $2: failed: ${3-applied sed script $1} && return 1; }
- check_changed $2 && echo $2: ${3-applied sed script $1}
+ check_changed $2 && echo $2: ${3-applied sed script $1}
}
reject_firmware () {
/for (p = PhyUcode/i\
printk("%s: missing Free firmware\\n", __func__);\
return (STATUS_FAILURE);\
-#define PhyUcode NULL
+#define PhyUcode NULL
}' drivers/staging/sxg/sxg.c 'report missing Free firmware'
clean_blob drivers/staging/sxg/sxg.c
clean_kconfig drivers/staging/sxg/Kconfig 'SXG'
filetest $2 || return
sed -e "$1" "$2" > "$2".deblob || {
die $2: failed: ${3-applied sed script $1} && return 1; }
- check_changed $2 && echo $2: ${3-applied sed script $1}
+ check_changed $2 && echo $2: ${3-applied sed script $1}
}
reject_firmware () {
/for (p = PhyUcode/i\
printk("%s: missing Free firmware\\n", __func__);\
return (STATUS_FAILURE);\
-#define PhyUcode NULL
+#define PhyUcode NULL
}' drivers/staging/sxg/sxg.c 'report missing Free firmware'
clean_blob drivers/staging/sxg/sxg.c
clean_kconfig drivers/staging/sxg/Kconfig 'SXG'
filetest $2 || return
sed -e "$1" "$2" > "$2".deblob || {
die $2: failed: ${3-applied sed script $1} && return 1; }
- check_changed $2 && echo $2: ${3-applied sed script $1}
+ check_changed $2 && echo $2: ${3-applied sed script $1}
}
reject_firmware () {
filetest $2 || return
sed -e "$1" "$2" > "$2".deblob || {
die $2: failed: ${3-applied sed script $1} && return 1; }
- check_changed $2 && echo $2: ${3-applied sed script $1}
+ check_changed $2 && echo $2: ${3-applied sed script $1}
}
reject_firmware () {
# to be blobs, be they known false positives or not.
# -p --mark-false-positives: print the processed input, replacing
-# sequences that match the blob detector test, even those
+# sequences that match the blob detector test, even those
# known to be false positives, with /*(DEBLOBBED)*/.
# -P --list-false-positives: list files that contain false positives.
rm="rm -f"
for echo in 'echo' 'printf %s\n'; do
- case `$echo '\nx'` in
+ case `$echo '\nx'` in
'\nx') break;;
esac
done
-case `$echo '\nx'` in
+case `$echo '\nx'` in
'\nx') ;; *) echo Cannot find out what echo to use >&2; exit 1;;
esac
for echo_n in "echo -n" "printf %s"; do
- case `$echo_n '\na'; $echo_n '\nb'` in
+ case `$echo_n '\na'; $echo_n '\nb'` in
'\na\nb') break;;
esac
done
-case `$echo_n a; $echo_n b` in
+case `$echo_n a; $echo_n b` in
'ab') ;; *) echo Cannot find out an echo -n equivalent to use >&2; exit 1;;
esac
;;
esac
;;
-*)
+*)
v="# "
vp="0"
;;
set_cmd=set_eqscript_cmd;
set_main_cmd=set_perl_main;
;;
-
+
--use-awk)
shift;
set_cmd=set_eqscript_cmd;
allpass=:
for tool in awk perl python sed; do
echo testing $tool...
-
+
targs="-s 4 -i /deblob-check-testsuite/ --use-$tool"
pass=:
blobname 'whiteheat\(_loader\(_debug\)\?\)\?\.fw' drivers/usb/serial/whiteheat.c
blob 'static[ ]struct[ ]BA1struct[ ]BA1Struct[ ]=[ ][{][^;]*[}][;]' sound/pci/cs46xx/cs46xx_image.h
-
+
blob 'static[ ]u32[ ]cwc\(4630\|async\|snoop\)_\(code\|parameter\)\[\][ ]=[ ][{][^;]*[}][;]' 'sound/pci/cs46xx/imgs/cwc\(4630\|async\|snoop\)\.h'
# cwcbinhack appears to have been created by hand.
# cwcdma has sources (not verified) in cwcdma.asp.
blobname '\([/]etc[/]sound[/]\)\?pss_synth' sound/oss/pss.c
accept '[ ][$][(]obj[)][/]bin2hex[ ]pss_synth' sound/oss/Makefile
accept '[ ][ ]*echo[ ][\'"'"']static[ ]\(unsigned[ ]char[ ][*][ ]*\|int[ ]\)pss_synth\(Len\)\?[ ]=[ ]\(NULL\|0\)[;]' sound/oss/Makefile
-
+
accept '[ ]\.request_firmware[ ]=[ ]NULL,' drivers/media/dvb/dvb-usb/m920x.c
accept '[ ]*["]request_firmware[ ]\(fatal[ ]error\|unable[ ]to[ ]locate\|:[ ]Failed[ ]to[ ]find\)' drivers/media/video/pvrusb2/pvrusb2-hdw.c
blobname 'blobeol[^\n]*[\n]'
;;
esac
-}
+}
# Regular expression that matches a literal constant.
constx="[0-9][0-9a-fA-FxX]*"
s,^\([-+]\)\(\^\?\)\(.*\)\(\$\?\)$,\2(?s:\3)\4\1,g
s,[+]$, { falsepos (); },
s,[-]$, { blob (); },
-'
+'
echo '%%' > "$scriptname"
${SED-sed} "$adjust_rx" < "$regex_name" >> "$scriptname"
s,^\\(.*\\)\$,blob = r'(?P<blob>\\1)',;\
"' p;}' >> "$scriptname"
- echo "\\($initblob\\|$defineblob\\|$asmblob\\)" |
+ echo "\\($initblob\\|$defineblob\\|$asmblob\\)" |
${SED-sed} -e "$adjust_rx" \
-e "s,^\\(.*\\)\$,cblob = r'(?P<cblob>\\1)'," >> "$scriptname"
assert filenames != None
s += line
continue
-
+
if verbose:
print 'looking for matches'
sfilenames = filenames
else:
if verbose: print 'match is a false positive'
falses += 1
-
+
if blob_p and replace_blob or not blob_p and replace_falsepos:
s = s[:match.start(what)] + replacement + s[match.end(what):]
p = match.start(what) + len(replacement)
s,^\\(.*\\)\$,my \$blob = qr'(?<blob>\\1)'ms;,;\
"' p;}' >> "$scriptname"
- echo "\\($initblob\\|$defineblob\\|$asmblob\\)" |
+ echo "\\($initblob\\|$defineblob\\|$asmblob\\)" |
${SED-sed} -e "$adjust_rx" \
-e "s,^\\(.*\\)\$,my \$cblob = qr'(?<cblob>\\1)'ms if \$with_context;," >> "$scriptname"
$s .= $_;
next;
}
-
+
if ($verbose) {
print "looking for matches in\n";
for (my $i = $nfilenames; --$i > 0; ) {
}
print substr ($s, $pp) if $print_nomatch;
-
+
print "no further matches\n" if $verbose;
$s = '';
case " = $@ = " in
*" = with_context = "*) cblob=`
- $echo "\\($initblob\\|$defineblob\\|$asmblob\\)" |
+ $echo "\\($initblob\\|$defineblob\\|$asmblob\\)" |
${SED-sed} -e "$adjust_rx"
`;;
*) cblob='$.^';;
pend = length (s)
}
}
-
+
if (verbose) print "search until", pend;
if (!(matchfound = match (substr (s, p),
s,^\([-+]\)\(\^\?\)\(.*\)\(\$\?\)$,\2(?s:\3)\4\1,g
s,[+]$, { falsepos (); },
s,[-]$, { blob (); },
-'
+'
echo '%%' > "$scriptname"
${SED-sed} "$adjust_rx" < "$regex_name" >> "$scriptname"
s,^.*$,;/*begin &*/;\\n;/*&*/;,;
p;
d;
- }
+ }
s,^[ !$s],,;"
cmd='${SED-sed} "$sedpatch"'
;;
continue
;;
esac
-
+
# If we print anything whatsoever (even a blank line) while
# processing it, we've failed.
if check "$file"; then
rm -f linux-$kver-$libre.log linux-$kver-$libre.log.tmp
echo Deblobbing within linux-$kver-$libre, saving output to linux-$kver-$libre.log
-# We can't just pipe deblob into tee, for then we fail to detect
+# We can't just pipe deblob into tee, for then we fail to detect
# error conditions. Use file renaming to tell whether we succeeded.
if (cd linux-$kver-$libre && /bin/sh ../$deblob $force) 2>&1; then
mv linux-$kver-$libre.log.tmp linux-$kver-$libre.log