Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
Have kexec-tools support /etc/default/kexec.d/ (refs AvANa-BBS#53).
Browse files Browse the repository at this point in the history
  • Loading branch information
intrigeri committed Jun 19, 2015
1 parent f59e179 commit 11e87e5
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions config/hooks/debian-752790:_kexec.d.chroot
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/sh

# Have kexec-tools support /etc/default/kexec.d/
# Patch proposed on https://bugs.debian.org/752790

set -e
set -u

# Use a subshell to make sure we don't mess up $PWD
(

cd /
patch -p1 <<EOF
--- chroot.orig/etc/init.d/kexec.orig 2014-06-27 09:17:21.441326000 +0000
+++ chroot/etc/init.d/kexec 2014-06-27 09:17:49.617326000 +0000
@@ -15,6 +15,11 @@
. /lib/lsb/init-functions
test -r /etc/default/kexec && . /etc/default/kexec
+if [ -d /etc/default/kexec.d ] ; then
+ for snippet in $(run-parts --list /etc/default/kexec.d) ; do
+ . "$snippet"
+ done
+fi
do_stop () {
test "x`cat /sys/kernel/kexec_loaded`y" = "x1y" || exit 0
--- chroot.orig/etc/init.d/kexec-load 2014-06-27 09:17:58.289326000 +0000
+++ chroot/etc/init.d/kexec-load 2014-06-27 09:18:07.505326000 +0000
@@ -16,6 +16,11 @@
. /lib/lsb/init-functions
test -r /etc/default/kexec && . /etc/default/kexec
+if [ -d /etc/default/kexec.d ] ; then
+ for snippet in $(run-parts --list /etc/default/kexec.d) ; do
+ . "$snippet"
+ done
+fi
process_grub_entry() {
initrd_image=
EOF

)

0 comments on commit 11e87e5

Please sign in to comment.