diff options
Diffstat (limited to 'copy-modloop.in')
-rw-r--r-- | copy-modloop.in | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/copy-modloop.in b/copy-modloop.in new file mode 100644 index 0000000..0c0d3a2 --- /dev/null +++ b/copy-modloop.in @@ -0,0 +1,25 @@ +#!/bin/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 |