1234567891011121314151617181920212223242526272829303132333435 |
- #!/bin/sh
- set -e
-
- src_tarball=$(ls /usr/src/linux-source-* |sort -V | tail -n1)
- version=$(basename "$src_tarball" |sed -e 's/^linux-source-//' -e 's/\.tar\.xz//')
- tarball_hash=.debian_src_tarball.sha512
-
- src_dir=$(realpath linux-source)
-
- if [ -d "$src_dir" -a -L "linux-source" ]
- then
- if sha512sum -c "$tarball_hash"
- then
- exit 0
- fi
-
- if [ "$1" = "check" ]
- then
- exit 1
- fi
-
- make commit-config || true
- rm -Rf "$src_dir" || true
- rm "linux-source" || true
-
- elif [ "$1" = "check" ]
- then
- exit 1
- fi
-
- tar -xvf "$src_tarball"
-
- ln -vs "linux-source-${version}" "linux-source"
-
- sha512sum "$src_tarball" > "$tarball_hash"
|