aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/blobs-discover/blobs-discover18
-rw-r--r--tools/blobs-discover/patches/detect-linux.patch13
-rwxr-xr-xtools/blobs-discover/sources/deblob-check2
3 files changed, 30 insertions, 3 deletions
diff --git a/tools/blobs-discover/blobs-discover b/tools/blobs-discover/blobs-discover
index 1a72d7cf..46870855 100755
--- a/tools/blobs-discover/blobs-discover
+++ b/tools/blobs-discover/blobs-discover
@@ -36,13 +36,27 @@ usage() {
}
update() {
+ local tool_path=$( tool_path "$tool" )
local sources_path=$( tool_sources_path "$tool" )
local deblob_check_path="$sources_path/deblob-check"
+ local patches_path="$tool_path/$PATCHES/$WILDDOTPATCH"
wget "https://www.fsfla.org/svn/fsfla/software/linux-libre/scripts/deblob-check" -O "$deblob_check_path"
perl -0777 -i -pe "s/ blobna \(\) \{[^\}]*\}/ blobna () \{\n true\n \}/" "$deblob_check_path"
perl -0777 -i -pe "s/ blobname \(\) \{[^\}]*\}/ blobname () \{\n true\n \}/" "$deblob_check_path"
chmod a+x "$deblob_check_path"
+
+ cd "$sources_path"
+
+ path_wildcard_expand "$patches_path" | while read patch_path
+ do
+ if ! [ -f "$patch_path" ]
+ then
+ continue
+ fi
+
+ patch -p1 < "$patch_path"
+ done
}
verify() {
@@ -139,7 +153,7 @@ execute() {
printf "\nDiscovering new blobs, this may take a while...\n"
- files=$( cd "$project_sources_path" ; find * -type f | grep -vP "\.git/|\.tar|\.patch" )
+ files=$( find "$project_sources_path" -type f | grep -vP "\.git/|\.tar|\.patch" )
touch "$project_blobs_discover_path"
@@ -154,7 +168,7 @@ execute() {
fi
fi
- match=$( cd "$project_sources_path" ; "$deblob_check_path" "$file" || true )
+ match=$( "$deblob_check_path" -l -i "" "$file" || true )
if ! [ -z "$match" ]
then
echo "$match" >> "$project_blobs_discover_path"
diff --git a/tools/blobs-discover/patches/detect-linux.patch b/tools/blobs-discover/patches/detect-linux.patch
new file mode 100644
index 00000000..8c393f92
--- /dev/null
+++ b/tools/blobs-discover/patches/detect-linux.patch
@@ -0,0 +1,13 @@
+diff --git a/deblob-check b/deblob-check
+index 1c50c0f..649a212 100755
+--- a/deblob-check
++++ b/deblob-check
+@@ -904,7 +904,7 @@ set_except () {
+ # blobna '\(f\|ht\)tp:[/]\([/]\+[^/ \n ]\+\)\+'
+
+ case $prefix$1 in
+- */*linux*.tar* | */*kernel*.tar* | */*linux-*.*/*)
++ */*linux*.tar* | */*kernel*.tar* | */*linux-*.*/* | */*linux*/*)
+ # false alarms, contain source
+ # drivers/net/wan/wanxlfw.inc_shipped -> wanxlfw.S
+ accept 'static[ ]u8[ ]firmware\[\]=[{][\n]0x60,\(0x00,\)*0x16,\(0x00,\)*\([\n]\(0x[0-9A-F][0-9A-F],\)*\)*[\n]0x23,0xFC,0x00,0x00,0x00,0x01,0xFF,0xF9,0x00,0xD4,0x61,0x00,0x06,0x74,0x33,0xFC,\([\n]\(0x[0-9A-F][0-9A-F],\)*\)*0x00[\n][}][;]'
diff --git a/tools/blobs-discover/sources/deblob-check b/tools/blobs-discover/sources/deblob-check
index 1c50c0fc..649a2124 100755
--- a/tools/blobs-discover/sources/deblob-check
+++ b/tools/blobs-discover/sources/deblob-check
@@ -904,7 +904,7 @@ set_except () {
# blobna '\(f\|ht\)tp:[/]\([/]\+[^/ \n ]\+\)\+'
case $prefix$1 in
- */*linux*.tar* | */*kernel*.tar* | */*linux-*.*/*)
+ */*linux*.tar* | */*kernel*.tar* | */*linux-*.*/* | */*linux*/*)
# false alarms, contain source
# drivers/net/wan/wanxlfw.inc_shipped -> wanxlfw.S
accept 'static[ ]u8[ ]firmware\[\]=[{][\n]0x60,\(0x00,\)*0x16,\(0x00,\)*\([\n]\(0x[0-9A-F][0-9A-F],\)*\)*[\n]0x23,0xFC,0x00,0x00,0x00,0x01,0xFF,0xF9,0x00,0xD4,0x61,0x00,0x06,0x74,0x33,0xFC,\([\n]\(0x[0-9A-F][0-9A-F],\)*\)*0x00[\n][}][;]'