Remove old module symlinks on pre snapshot
Only do this if LINK_MODULES is set to yes. This prevents old symlinks getting in the way of other packages. Fixes #21.
This commit is contained in:
parent
42f12d216f
commit
39dee2be1f
2 changed files with 5 additions and 5 deletions
|
|
@ -65,10 +65,8 @@ symlink will be created in the kernel modules directory for the
|
|||
currently running kernel to same directory in the pre snapshot of the
|
||||
"root" configuration. This is so that the kernel modules will still be
|
||||
available for use before a reboot is required. snap-pac will also
|
||||
delete broken symlinks in the kernel modules directory if this is set
|
||||
to "yes". (snapper
|
||||
removes configurations according to the specified cleanup algorithm,
|
||||
so eventually symlinks to old kernel modules directories will break).
|
||||
delete all symlinks in the kernel modules directory if this is set
|
||||
to "yes", in order to clean up the directory.
|
||||
|
||||
Default is "no".
|
||||
.RE
|
||||
|
|
|
|||
|
|
@ -129,10 +129,12 @@ for CONFIG in $SNAPPER_CONFIGS; do
|
|||
if [[ "$pre_or_post" == "pre" ]]; then
|
||||
x=$($snapper_cmd "$(truncate_description $PRE_DESCRIPTION)")
|
||||
printf "==> %s: $(echo $x | tee "$prefile")\n" "$CONFIG"
|
||||
if [[ "$LINK_MODULES" == "yes" && "$CONFIG" == "root" ]]; then
|
||||
find /usr/lib/modules -xtype l -delete
|
||||
fi
|
||||
elif [[ -f $prefile && "$pre_or_post" == "post" ]]; then
|
||||
if [[ "$LINK_MODULES" == "yes" && "$kernel_updated" == "yes" && "$CONFIG" == "root" ]]; then
|
||||
printf "==> Symlinking old kernel modules...\n"
|
||||
find /usr/lib/modules -xtype l -delete
|
||||
ln -sv /.snapshots/$(<$prefile)/snapshot/usr/lib/modules/$(uname -r) /usr/lib/modules/
|
||||
fi
|
||||
x=$($snapper_cmd "$(truncate_description $POST_DESCRIPTION)" --pre-number "$(< "$prefile")")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue