summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-01-12 09:24:33 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-01-12 09:24:33 +0000
commit5c851227ce857a995bb1a6141df7791c00d51dbf (patch)
treef45f7773f2dcc356da8ad2d7ace1c98dbd20de00
parent7a48c2c117b60c7be96a69da5366e260253cab18 (diff)
sys-boot/grub-config-redcore : version bump, protect the current configuration file
-rw-r--r--sys-boot/grub-config-redcore/grub-config-redcore-1801.ebuild (renamed from sys-boot/grub-config-redcore/grub-config-redcore-1710.ebuild)22
1 files changed, 13 insertions, 9 deletions
diff --git a/sys-boot/grub-config-redcore/grub-config-redcore-1710.ebuild b/sys-boot/grub-config-redcore/grub-config-redcore-1801.ebuild
index b40fa95e..baf5cf85 100644
--- a/sys-boot/grub-config-redcore/grub-config-redcore-1710.ebuild
+++ b/sys-boot/grub-config-redcore/grub-config-redcore-1801.ebuild
@@ -17,20 +17,24 @@ RDEPEND="sys-boot/grub"
S="${FILESDIR}"
-src_install() {
- dodir "/etc/default" || die
- insinto "/etc/default" || die
- doins -r "${S}/"* || die
-}
-
pkg_preinst() {
+ # Backup GRUB configuration file
if [[ -f ""${ROOT}"etc/default/grub" ]]; then
cp -avx ""${ROOT}"etc/default/grub" ""${ROOT}"etc/default/grub.backup"
fi
}
+src_install() {
+ # if we overwrite /etc/default/grub we may break users setup
+ # so install the new GRUB configuration file as example only
+ dodir "etc/default" || die
+ insinto "etc/default" || die
+ newins grub grub.example || die
+}
+
pkg_postinst() {
- elog "Your previous GRUB configuration was saved as /etc/default/grub.backup"
- elog "Please adjust the new configuration to suit you and regenerate the GRUB menu"
- elog "by using : /usr/sbin/grub2-mkconfig -o /boot/grub/grub.cfg"
+ # Restore GRUB configuration file
+ if [[ -f ""${ROOT}"etc/default/grub.backup" ]]; then
+ cp -avx ""${ROOT}"etc/default/grub.backup" ""${ROOT}"etc/default/grub"
+ fi
}