From f912398fc6557c0a0ec291de099b32ae69870305 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Fri, 23 Dec 2016 21:39:10 +0100 Subject: tools: blobs-discover: Detect linux in deblob-check Signed-off-by: Paul Kocialkowski --- tools/blobs-discover/blobs-discover | 18 ++++++++++++++++-- tools/blobs-discover/patches/detect-linux.patch | 13 +++++++++++++ tools/blobs-discover/sources/deblob-check | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 tools/blobs-discover/patches/detect-linux.patch (limited to 'tools') 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][}][;]' -- cgit v1.2.3-70-g09d2