]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - debian/scripts/retpoline-extract
UBUNTU: [Packaging] resync retpoline extraction
[mirror_ubuntu-bionic-kernel.git] / debian / scripts / retpoline-extract
index 53d81847c7f4d3073a0d42b037c99f1573c3cd41..a4bff5f65c248bfc915a94b4baea8ba78426680f 100755 (executable)
@@ -5,17 +5,19 @@ cd "$1" || exit 1
 # Find all valid retpoline information, collate the detected and
 # safe information together.  Join the result to find the detected
 # but non-safe elements.  These are our concern.
-tmp="/tmp/retpoline-check.$$"
+ur_detected=$(mktemp --tmpdir "retpoline-check-XXXXXX.ur-detected")
+ur_safe=$(mktemp --tmpdir "retpoline-check-XXXXXX.ur-safe")
+
 find "." -path './drivers/firmware/efi/libstub' -prune -o \
         -path './arch/x86/boot' -prune -o \
         -path './arch/x86/purgatory' -prune -o \
         -name \*.ur-detected | xargs cat | \
        sed -e "s@^$1@@" -e "s@ $2/@ @" -e "s@^/@@" | \
-       sort -k 1b,1 >"$tmp.ur-detected"
+       sort -k 1b,1 >"$ur_detected"
 find "." -name \*.ur-safe | xargs cat | \
        sed -e "s@^$1@@" -e "s@^/@@" | \
-       sort -k 1b,1 >"$tmp.ur-safe"
+       sort -k 1b,1 >"$ur_safe"
 
-join -v 1 -j 1 "$tmp.ur-detected" "$tmp.ur-safe" | sed -s 's/[^ ]*  *//'
+join -v 1 -j 1 "$ur_detected" "$ur_safe" | sed -s 's/[^ ]*  *//'
 
-rm -f "$tmp".*
+rm -f "$ur_detected" "$ur_safe"