]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - debian/scripts/retpoline-extract
x86/speculation/mds: Add mitigation control for MDS
[mirror_ubuntu-bionic-kernel.git] / debian / scripts / retpoline-extract
CommitLineData
0fa05ca6
AW
1#!/bin/bash
2
3cd "$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
8ur_detected=$(mktemp --tmpdir "retpoline-check-XXXXXX.ur-detected")
9ur_safe=$(mktemp --tmpdir "retpoline-check-XXXXXX.ur-safe")
10
1e390209
AW
11find "." -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 17find "." -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 21join -v 1 -j 1 "$ur_detected" "$ur_safe" | sed -s 's/[^ ]* *//'
1e390209 22
7d21b076 23rm -f "$ur_detected" "$ur_safe"