summaryrefslogtreecommitdiff
path: root/copy-modloop.in
blob: e72b64553211080a1a271b7f4a93f8c540518cad (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
28
#!/bin/sh

PREFIX=@PREFIX@
. "$PREFIX/lib/libalpine.sh"

set -e

if ! rc-service -q modloop status; then
	echo "modloop is not started"
	exit 1
fi

if [ -n "$DO_UMOUNT" ] && [ -z "$modloop_media" ]; then
	modloop_media=$(find_modloop_media)
fi

modulesdir=/lib/modules
if [ -L "$modulesdir" ]; then
	modulesdir=$(readlink "$modulesdir")
fi
cp -a "$modulesdir" /lib/modules.tmp
rc-service modloop stop
rm -r /lib/modules
mv /lib/modules.tmp /lib/modules

if [ -n "$DO_UMOUNT" ]; then
	umount "$modloop_media"
fi