From 1dabe290b6b4b1b11c7fce880647bc9f0ad4efe8 Mon Sep 17 00:00:00 2001 From: Wes Barnett Date: Thu, 16 Aug 2018 07:17:24 -0400 Subject: [PATCH] Don't symlink linux kernel modules. Fixes #22, #21, and #19. --- man8/snap-pac.8 | 21 --------------------- scripts/snap-pac | 21 --------------------- 2 files changed, 42 deletions(-) diff --git a/man8/snap-pac.8 b/man8/snap-pac.8 index 0403d6f..d938a22 100644 --- a/man8/snap-pac.8 +++ b/man8/snap-pac.8 @@ -57,27 +57,6 @@ Number of characters to limit length of descriptions used for snapper. Default is "72". .RE -\fBLINK_MODULES=\fR\fB\fIyes\fR\fR\fB or \fR\fB\fIno\fR\fR -.RS 4 -When set to "yes" this, if the \fIlinux\fR package (or another package -specified by KERNEL_PACKAGE; see below) is updated, then a -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 all symlinks in the kernel modules directory if this is set -to "yes", in order to clean up the directory. - -Default is "no". -.RE - -\fBKERNEL_PACKAGE=\fR\fB\fIstring\fR\fR -.RS 4 -Used to trigger module linking if LINK_MODULES is set to "yes". - -Default is "linux". -.RE - The following are possible settings used on each specific snapper configuration you have. To use them, first create the folder \fI/etc/snap-pac\fR if it does not already exist. Then create a file diff --git a/scripts/snap-pac b/scripts/snap-pac index 57f50e7..7dc7cd5 100755 --- a/scripts/snap-pac +++ b/scripts/snap-pac @@ -75,17 +75,6 @@ truncate_description() { fi } -package_updated() { - check="$1" - for x in ${packages[@]}; do - if [[ "$x" == "$check" ]]; then - echo "yes" - return - fi - done - echo "no" -} - trap 'traperror ${LINENO} $? "$BASH_COMMAND" $BASH_LINENO "${FUNCNAME[@]}"' ERR trap trapkill SIGTERM SIGINT @@ -97,11 +86,8 @@ read_config "$SNAPPAC_CONFIG_FILE" readonly DESC_LIMIT=${DESC_LIMIT:-72} readonly ABORT_ON_FAIL=${ABORT_ON_FAIL:-"no"} -readonly LINK_MODULES=${LINK_MODULES:-"no"} -readonly KERNEL_PACKAGE=${KERNEL_PACKAGE:-"linux"} mapfile -t packages -kernel_updated=$(package_updated "$KERNEL_PACKAGE") for CONFIG in $SNAPPER_CONFIGS; do @@ -129,14 +115,7 @@ 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" - ln -sv /.snapshots/$(<$prefile)/snapshot/usr/lib/modules/$(uname -r) /usr/lib/modules/ - fi x=$($snapper_cmd "$(truncate_description $POST_DESCRIPTION)" --pre-number "$(< "$prefile")") printf "==> %s: %s\n" "$CONFIG" "$x" rm -f "$prefile"