summaryrefslogtreecommitdiff
path: root/pkg/linux-headers/fetch.sh
blob: 0866f9b743240556575e60235605a1f9f9a151e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
set -e

dir=$1
shift

cd "$dir"

if [ -e src ] ; then
        rm -rf src
fi

if ! sh "$OLDPWD/scripts/checksum.sh" -c sha256 2>/dev/null ; then
        curl -L -K url -O
        sh "$OLDPWD/scripts/checksum.sh" -c sha256
fi

read -r _ archive <sha256
sh "$OLDPWD/scripts/extract.sh" "$archive" -s ',^[^/]*,src,' \
	'linux-*/Makefile' \
	'linux-*/arch/*/include/uapi' \
	'linux-*/arch/*/syscalls' \
	'linux-*/include/uapi' \
	'linux-*/scripts/unifdef.c'

if [ -d patch ] ; then
	git apply -v --whitespace=nowarn --directory "$dir/src" patch/*
fi