]>
Commit | Line | Data |
---|---|---|
0fa05ca6 AW |
1 | #!/bin/bash |
2 | ||
3 | cd "$1" || exit 1 | |
4 | ||
1e390209 AW |
5 | # Find all valid retpoline information, collate the detected and |
6 | # safe information together. Join the result to find the detected | |
7 | # but non-safe elements. These are our concern. | |
7d21b076 KE |
8 | ur_detected=$(mktemp --tmpdir "retpoline-check-XXXXXX.ur-detected") |
9 | ur_safe=$(mktemp --tmpdir "retpoline-check-XXXXXX.ur-safe") | |
10 | ||
1e390209 AW |
11 | find "." -path './drivers/firmware/efi/libstub' -prune -o \ |
12 | -path './arch/x86/boot' -prune -o \ | |
13 | -path './arch/x86/purgatory' -prune -o \ | |
b09e1b87 | 14 | -name \*.ur-detected -print0 | xargs -0 cat | \ |
1e390209 | 15 | sed -e "s@^$1@@" -e "s@ $2/@ @" -e "s@^/@@" | \ |
7d21b076 | 16 | sort -k 1b,1 >"$ur_detected" |
b09e1b87 | 17 | find "." -name \*.ur-safe -print0 | xargs -0 cat | \ |
1e390209 | 18 | sed -e "s@^$1@@" -e "s@^/@@" | \ |
7d21b076 | 19 | sort -k 1b,1 >"$ur_safe" |
1e390209 | 20 | |
7d21b076 | 21 | join -v 1 -j 1 "$ur_detected" "$ur_safe" | sed -s 's/[^ ]* *//' |
1e390209 | 22 | |
7d21b076 | 23 | rm -f "$ur_detected" "$ur_safe" |