aboutsummarylogtreecommitdiffstats
path: root/pre-hook
blob: 7dfe05c9f1c6f16038ed76d268a24dbc63f763be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash

#set -o xtrace
set -o errexit -o nounset -o pipefail -o errtrace
IFS=$'\n\t'

cd /usr/lib/modules/saved-kernel-modules

running_kernel=$(uname -r)

# is it already saved?
if [ -e modules/$running_kernel ] ; then
    exit 0
fi

# copy with hardlinks, much faster
cp --archive --link /usr/lib/modules/$running_kernel modules/