libreboot
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libreboot] [PATCH 1/2] coreboot-libre: make it path independant.


From: Denis 'GNUtoo' Carikli
Subject: [Libreboot] [PATCH 1/2] coreboot-libre: make it path independant.
Date: Thu, 19 Nov 2015 15:20:23 +0100

This way it can be used on any coreboot directory.
The script is expected to run inside coreboot's top directory.

It was also cleaned up while doing it:
* Converted to use less commands
* Clarified comments and prints

Signed-off-by: Denis 'GNUtoo' Carikli <address@hidden>
---
 resources/utilities/coreboot-libre/deblob    |  4 ---
 resources/utilities/coreboot-libre/findblobs | 41 +++++++++++-----------------
 2 files changed, 16 insertions(+), 29 deletions(-)

diff --git a/resources/utilities/coreboot-libre/deblob 
b/resources/utilities/coreboot-libre/deblob
index 882bab0..d526a05 100755
--- a/resources/utilities/coreboot-libre/deblob
+++ b/resources/utilities/coreboot-libre/deblob
@@ -26,8 +26,6 @@ set -u -e
 
 printf "Deleting blobs in coreboot\n"
 
-cd "coreboot/"
-
 # ---------------------
 # AMD: CPU microcode updates
 # ---------------------
@@ -148,5 +146,3 @@ rm -f \
 "3rdparty/vboot/tests/futility/data/zinger.unsigned"
 
 printf "\n\n"
-
-cd "../"
diff --git a/resources/utilities/coreboot-libre/findblobs 
b/resources/utilities/coreboot-libre/findblobs
index 4fcda2a..b43535d 100755
--- a/resources/utilities/coreboot-libre/findblobs
+++ b/resources/utilities/coreboot-libre/findblobs
@@ -1,8 +1,9 @@
-#!/bin/bash
+#!/bin/sh
 
 #  find blobs in coreboot
 #
-#      Copyright (C) 2014, 2015 Francis Rowe <address@hidden>
+#    Copyright (C) 2014, 2015 Francis Rowe <address@hidden>
+#    Copyright (C) 2015 Denis 'GNUtoo' Carikli <address@hidden>
 #
 #    This program is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
@@ -21,38 +22,28 @@
 [ "x${DEBUG+set}" = 'xset' ] && set -v
 set -e -u
 
-# This is used when updating the version of
-# coreboot that libreboot uses, to know what
-# new blobs have landed in coreboot
+# This script is used to semi-automatically find blobs in coreboot.
+# It is typically when updating libreboot to use new versions of coreboot:
+# The goal is to detect new blobs added in coreboot to remove them in 
libreboot.
 
-# full deblob scripts based on linux-libre
-# will replace this script later on. For now, 
-# this will have to do.
+# The full deblob scripts are based on linux-libre's.
+# Later on it might be replaced by more scripts targetting coreboot more
+# specifically.
 
 printf "Searching for blobs in coreboot\n"
-cp "deblob-check" "../../../coreboot"
-cd "../../../coreboot/"
+install "$(dirname $0)/deblob-check" "$(pwd)"
+install "$(dirname $0)/nonblobs"     "$(pwd)"
+echo -n "" > tocheck
 
-chmod +x "deblob-check"
-find -type f | xargs ./deblob-check > "blobs"
-rm -f "deblob-check"
-
-rm -f "tocheck"
-touch "tocheck"
+find -type f -not -path '\.git/*' | xargs ./deblob-check > "blobs"
 
 for file in $(cat blobs)
 do
-       if ! grep -Fxq "${file}" 
"../resources/utilities/coreboot-libre/nonblobs"
+       if ! grep -Fxq "${file}" "nonblobs"
        then
                 printf "%s\n" "${file}" >> tocheck
        fi
 done
-rm -f "blobs"
-
-rm -f "../resources/utilities/coreboot-libre/tocheck"
-mv "tocheck" "../resources/utilities/coreboot-libre/"
-
-cd "../resources/utilities/coreboot-libre/"
 
-printf "Done! open resources/utilities/coreboot-libre/tocheck in an editor\n"
-printf "This will contain the names of the files that you must decide whether 
they are blobs or not\n\n"
+printf "Done! Now open %s/tocheck in an editor:\n" "$(pwd)"
+printf "You will then need to manually check each file content to verify if 
each one contains a blob.\n\n"
-- 
2.6.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]