diff options
author | Markus Schanz | 2018-01-05 22:32:38 +0100 |
---|---|---|
committer | Markus Schanz | 2018-01-05 22:50:37 +0100 |
commit | 766320157ec3499c287e88d48ee02cb6c1e104b6 (patch) | |
tree | 3dc7f692497ef5b1ccf30f67110f2924b5e395e4 | |
parent | e50ce5ebdecae990efb103fc1d8836eba455d7a9 (diff) | |
download | aur-766320157ec3499c287e88d48ee02cb6c1e104b6.tar.gz |
Make location of the backup path (source & destination) configurable
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | 50_bootbackup.hook | 2 | ||||
-rw-r--r-- | CHANGELOG | 6 | ||||
-rw-r--r-- | PKGBUILD | 20 | ||||
-rw-r--r-- | pacman-boot-backup.conf | 13 | ||||
-rw-r--r-- | pre-kernel-upgrade-rsync | 5 |
6 files changed, 45 insertions, 9 deletions
@@ -1,6 +1,6 @@ pkgbase = pacman-boot-backup-hook pkgdesc = Pacman hook that uses rsync to backup the /boot directory prior to upgrades of the linux or systemd package. - pkgver = 1.0 + pkgver = 1.1 pkgrel = 1 changelog = CHANGELOG arch = any @@ -8,8 +8,12 @@ pkgbase = pacman-boot-backup-hook depends = rsync source = LICENSE source = 50_bootbackup.hook + source = pacman-boot-backup.conf + source = pre-kernel-upgrade-rsync md5sums = ac9ac34b11dd5a53d096a734ab677479 - md5sums = e2a3034dbae1e27ed782c8b44cbd7f72 + md5sums = f731f5aee99eecc75d6c0686742d3a23 + md5sums = 27819f1384ade1a543a1c110bf9fc846 + md5sums = 0fdff0b79eb987701a2c54c40910fed0 pkgname = pacman-boot-backup-hook diff --git a/50_bootbackup.hook b/50_bootbackup.hook index bb0fe452b2a9..bdc3853b748b 100644 --- a/50_bootbackup.hook +++ b/50_bootbackup.hook @@ -10,5 +10,5 @@ Target = systemd Description = Backing up /boot... When = PreTransaction Depends = rsync -Exec = /usr/bin/rsync -azq --delete /boot/ /.bootbackup +Exec = /usr/share/libalpm/scripts/pre-kernel-upgrade-rsync AbortOnFail diff --git a/CHANGELOG b/CHANGELOG index 19a988a1e95c..3df6196278e1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1 +1,5 @@ -v1.0: Initial release +v1.1 (2018/01/05): +- The location of the data to be backedup (and where to) can now be configured + +v1.0 (2017/12/31): +- Initial release @@ -1,6 +1,6 @@ # Maintainer: Markus Schanz <coksnuss@googlemail.com> pkgname=pacman-boot-backup-hook -pkgver=1.0 +pkgver=1.1 pkgrel=1 pkgdesc="Pacman hook that uses rsync to backup the /boot directory prior to upgrades of the linux or systemd package." arch=('any') @@ -9,14 +9,24 @@ changelog=CHANGELOG depends=('rsync') source=('LICENSE' - '50_bootbackup.hook') + '50_bootbackup.hook' + 'pacman-boot-backup.conf' + 'pre-kernel-upgrade-rsync') md5sums=('ac9ac34b11dd5a53d096a734ab677479' - 'e2a3034dbae1e27ed782c8b44cbd7f72') + 'f731f5aee99eecc75d6c0686742d3a23' + '27819f1384ade1a543a1c110bf9fc846' + '0fdff0b79eb987701a2c54c40910fed0') package() { install -m 0755 -d $pkgdir/usr/share/licenses/$pkgname - install -m 0755 -d $pkgdir/usr/share/libalpm/hooks - install -m 0644 $srcdir/LICENSE $pkgdir/usr/share/licenses/$pkgname + + install -m 0755 -d $pkgdir/etc + install -m 0644 $srcdir/pacman-boot-backup.conf $pkgdir/etc + + install -m 0755 -d $pkgdir/usr/share/libalpm/hooks install -m 0644 $srcdir/50_bootbackup.hook $pkgdir/usr/share/libalpm/hooks + + install -m 0755 -d $pkgdir/usr/share/libalpm/scripts + install -m 0755 $srcdir/pre-kernel-upgrade-rsync $pkgdir/usr/share/libalpm/scripts } diff --git a/pacman-boot-backup.conf b/pacman-boot-backup.conf new file mode 100644 index 000000000000..869b535979da --- /dev/null +++ b/pacman-boot-backup.conf @@ -0,0 +1,13 @@ +# Configuration of pacman-boot-backup-hook +# +# Use this configuration to override the default directories from/to which +# backups are created/stored when the linux or systemd package is upgraded. +# By default the contents of /boot will be backed up to /.bootbackup +# +# Note: The values of the variables will be passed to rsync. Therefore, if you +# wish to only backup the files _within_ the source directory, make sure to +# append a slash to its path. +# WARNING: Any contents under the destination path will be deleted by rsync! + +#BACKUP_PATH_SRC=/boot/ +#BACKUP_PATH_DEST=/.bootbackup diff --git a/pre-kernel-upgrade-rsync b/pre-kernel-upgrade-rsync new file mode 100644 index 000000000000..a7452894e047 --- /dev/null +++ b/pre-kernel-upgrade-rsync @@ -0,0 +1,5 @@ +#!/bin/bash + +[[ -f /etc/pacman-boot-backup.conf ]] && . /etc/pacman-boot-backup.conf + +/usr/bin/rsync -azq --delete "${BACKUP_PATH_SRC:-/boot/}" "${BACKUP_PATH_DEST:-/.bootbackup}" |