diff options
author | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2021-01-18 12:27:01 -0500 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2021-02-15 12:10:16 +0000 |
commit | 59cea34505cfc8563e1164d1ba81cb5ea2f3369f (patch) | |
tree | f96bceade621ab3acb3c1a3d29a634966bb10426 /copy-modloop.in | |
parent | 6fff80e3d5211e708337f0c486c5a3607133ce77 (diff) | |
download | alpine-conf-59cea34505cfc8563e1164d1ba81cb5ea2f3369f.zip |
split modloop copy to a separate script
fixes #10468
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 |