From c3e58b59a1d71041a2674a64c46130436bd67ffa Mon Sep 17 00:00:00 2001 From: Joachim Wiedorn Date: Fri, 17 Oct 2014 21:54:00 +0200 Subject: [PATCH] Add optional kernel hook scripts for no defragmenting --- debian/changelog | 5 ++++- debian/floppy/Makefile | 10 ++++++++++ debian/hooks/Makefile | 31 +++++++++++++++++++++++++++++++ debian/lilo.dirs | 5 ++++- debian/lilo.install | 10 +++++++--- debian/rules | 5 +++++ 6 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 debian/hooks/Makefile diff --git a/debian/changelog b/debian/changelog index b3cc886..9d807ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,11 +14,14 @@ lilo (1:24.1-1) UNRELEASED; urgency=medium - Fix hook scripts: kernel hook failed if RAID is degraded. Closes: #459713, #728622 - More documentation about -R option. Closes: #720129 - - Optional: Set no-defragment bit on XFS filesystems. See: #566035 + - Optional: Set no-defragment bit on XFS filesystems. - Update some patches, remove all other patches. * Use better link to upstream packages in debian/watch. * Bump Standards Version to 3.9.6 (no changes). + * Add hook scripts for saving kernel in /boot on XFS filesystems. + These scripts can be found in dir. /usr/lib/lilo/ for optional + installation. See: #566035 -- Joachim Wiedorn Fri, 17 Oct 2014 13:57:19 +0200 diff --git a/debian/floppy/Makefile b/debian/floppy/Makefile index 55478d2..3dba51b 100644 --- a/debian/floppy/Makefile +++ b/debian/floppy/Makefile @@ -1,7 +1,17 @@ +# -*- makefile -*- +# +# Copyright 2010-2014 Joachim Wiedorn +# +# Licensed under the terms of the GPL-2 or any later version. +# On Debian systems, the complete text of the GNU General Public License +# version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. + # Make a test floppy # this floppy will boot a machine and display the output of some diagnostic # programs to give you information on configuring LILO + floppy: disk.com bootsect.b + @echo Copy image onto boot floppy cat bootsect.b disk.com | dd of=/dev/fd0 bs=512 diff --git a/debian/hooks/Makefile b/debian/hooks/Makefile new file mode 100644 index 0000000..ace0a1f --- /dev/null +++ b/debian/hooks/Makefile @@ -0,0 +1,31 @@ +# -*- makefile -*- +# +# Copyright 2010-2014 Joachim Wiedorn +# +# Licensed under the terms of the GPL-2 or any later version. +# On Debian systems, the complete text of the GNU General Public License +# version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. + + +BASE := /etc +POSTINST := kernel/postinst.d +PREINST := kernel/preinst.d +PRERM := kernel/prerm.d + +all: + +install: + @echo Install kernel hook scripts + mkdir -p $(BASE)/$(POSTINST) + mkdir -p $(BASE)/$(PREINST) + mkdir -p $(BASE)/$(PRERM) + install -m 0755 $(POSTINST)/chattr-lilo $(BASE)/$(POSTINST) + install -m 0755 $(PREINST)/chattr-lilo $(BASE)/$(PREINST) + install -m 0755 $(PRERM)/chattr-lilo $(BASE)/$(PRERM) + +uninstall: + @echo Uninstall kernel hook scripts + rm $(BASE)/$(POSTINST)/chattr-lilo + rm $(BASE)/$(PREINST)/chattr-lilo + rm $(BASE)/$(PRERM)/chattr-lilo + diff --git a/debian/lilo.dirs b/debian/lilo.dirs index 557e92c..5d061c1 100644 --- a/debian/lilo.dirs +++ b/debian/lilo.dirs @@ -1,7 +1,10 @@ sbin usr/sbin -usr/lib/lilo +usr/lib/lilo/floppy usr/share/pixmaps usr/share/lilo etc/initramfs etc/kernel +usr/lib/lilo/hooks/kernel/postinst.d +usr/lib/lilo/hooks/kernel/preinst.d +usr/lib/lilo/hooks/kernel/prerm.d diff --git a/debian/lilo.install b/debian/lilo.install index 27f0639..fbbeb91 100644 --- a/debian/lilo.install +++ b/debian/lilo.install @@ -9,6 +9,10 @@ boot/*.bmp usr/share/lilo/ boot/*.dat usr/share/lilo/ debian/update-lilo usr/sbin/ debian/lilo-term.xpm usr/share/pixmaps/ -debian/floppy/Makefile usr/lib/lilo/ -src/bootsect.b usr/lib/lilo/ -src/disk.com usr/lib/lilo/ +debian/floppy/Makefile usr/lib/lilo/floppy/ +src/bootsect.b usr/lib/lilo/floppy/ +src/disk.com usr/lib/lilo/floppy/ +hooks/kernel/postinst.d/chattr-lilo usr/lib/lilo/hooks/kernel/postinst.d/ +hooks/kernel/preinst.d/chattr-lilo usr/lib/lilo/hooks/kernel/preinst.d/ +hooks/kernel/prerm.d/chattr-lilo usr/lib/lilo/hooks/kernel/prerm.d/ +debian/hooks/Makefile usr/lib/lilo/hooks/ diff --git a/debian/rules b/debian/rules index 92f0dc5..1dc48df 100755 --- a/debian/rules +++ b/debian/rules @@ -16,6 +16,11 @@ override_dh_auto_build: uudecode -o /dev/stdout debian/doc/tech.html.uu 2>/dev/null | tar -x -z -C debian uudecode -o /dev/stdout debian/doc/user.html.uu 2>/dev/null | tar -x -z -C debian +override_dh_install: + dh_install + @echo "Set execute flag to chattr-lilo hook scripts" + chmod 0755 debian/lilo/usr/lib/lilo/hooks/kernel/*/chattr-lilo + override_dh_auto_clean: rm -rf debian/html dh_auto_clean -- 2.39.2