| 1 | #!/bin/bash |
| 2 | |
| 3 | set -euo pipefail |
| 4 | |
| 5 | # Extract EFW version from CI workflow file |
| 6 | efw_version=$(awk -F': ' '/CI_MAX_EFW_VERSION:/ {gsub(/['\''"]/, "", $2); print $2}' .github/workflows/ci.yml) |
| 7 | |
| 8 | if [ -z "$efw_version" ]; then |
| 9 | echo "Error: Could not extract CI_MAX_EFW_VERSION from .github/workflows/ci.yml" >&2 |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
| 13 | echo "Using EFW version: $efw_version" |
| 14 | |
| 15 | tmp=$(mktemp -d) |
| 16 | |
| 17 | cleanup() { |
| 18 | rm -r "$tmp" |
| 19 | } |
| 20 | |
| 21 | trap cleanup EXIT |
| 22 | |
| 23 | # Download and process ebpf_structs.h |
| 24 | curl -fL "https://github.com/microsoft/ebpf-for-windows/raw/refs/tags/Release-v${efw_version}/include/ebpf_structs.h" -o "$tmp/ebpf_structs.h" |
| 25 | "./internal/cmd/genwinfunctions.awk" "$tmp/ebpf_structs.h" | gofmt > "./asm/func_win.go" |