github.com/cilium/ebpf@v0.15.1-0.20240517100537-8079b37aa138/examples/headers/update.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # Version of libbpf to fetch headers from
     4  LIBBPF_VERSION=0.6.1
     5  
     6  # The headers we want
     7  prefix=libbpf-"$LIBBPF_VERSION"
     8  headers=(
     9      "$prefix"/LICENSE.BSD-2-Clause
    10      "$prefix"/src/bpf_endian.h
    11      "$prefix"/src/bpf_helper_defs.h
    12      "$prefix"/src/bpf_helpers.h
    13      "$prefix"/src/bpf_tracing.h
    14  )
    15  
    16  # Fetch libbpf release and extract the desired headers
    17  curl -sL "https://github.com/libbpf/libbpf/archive/refs/tags/v${LIBBPF_VERSION}.tar.gz" | \
    18      tar -xz --xform='s#.*/##' "${headers[@]}"