summaryrefslogtreecommitdiff
path: root/pkg/linux-headers/fetch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/linux-headers/fetch.sh')
-rw-r--r--pkg/linux-headers/fetch.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkg/linux-headers/fetch.sh b/pkg/linux-headers/fetch.sh
new file mode 100644
index 00000000..316e4382
--- /dev/null
+++ b/pkg/linux-headers/fetch.sh
@@ -0,0 +1,24 @@
+set -e
+
+dir=$1
+shift
+
+cd "$dir"
+
+if [ -e src ] ; then
+ rm -rf src
+fi
+
+if ! sha256sum -c sha256 2>/dev/null ; then
+ curl -L -K url -O
+ sha256sum -c sha256
+fi
+
+read -r _ archive <sha256
+
+xzcat "$archive" | ${PAXREAD:-pax -r} -s ',^[^/]*,src,' \
+ 'linux-*/Makefile' \
+ 'linux-*/arch/*/include/uapi' \
+ 'linux-*/arch/*/syscalls' \
+ 'linux-*/include/uapi' \
+ 'linux-*/scripts/unifdef.c'