Bug#757298: Grub patch to add fallback boot entry for sysvinit when systemd is the active init

2014-09-09 Thread Michael Biebl
On Tue, 9 Sep 2014 15:47:10 +0200 Mathieu Parent 
wrote:
> Hello,
> 
> Here is a simple patch (without the triggering).

Have you seen that I already attached a patch?
My patch also makes sure to not create a fallback entry if sysvinit-core
is the active init.


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#757298: Grub patch to add fallback boot entry for sysvinit when systemd is the active init

2014-09-09 Thread Mathieu Parent
Hello,

Here is a simple patch (without the triggering).

Regards
-- 
Mathieu
From 511da86d2e4cb80e97dd042179a585a0980ec62f Mon Sep 17 00:00:00 2001
From: Mathieu Parent 
Date: Tue, 9 Sep 2014 15:43:40 +0200
Subject: [PATCH] Add sysvinit fallback/flashback boot entry

---
 util/grub.d/10_linux.in | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 79fa03a..3b14c9d 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -115,6 +115,8 @@ linux_entry ()
   case $type in
 	  recovery)
 	  title="$(gettext_printf "%s, with Linux %s (%s)" "${os}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")" ;;
+	  sysvinit)
+	  title="$(gettext_printf "%s, with Linux %s (%s)" "${os}" "${version}" "sysvinit")" ;;
 	  *)
 	  title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
   esac
@@ -339,6 +341,10 @@ while [ "x$list" != "x" ] ; do
 
   linux_entry "${OS}" "${version}" advanced \
   "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+  if [ -x /lib/sysvinit/init ]; then
+linux_entry "${OS}" "${version}" sysvinit \
+"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} init=/lib/sysvinit/init"
+  fi
   if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
 linux_entry "${OS}" "${version}" recovery \
 "${GRUB_CMDLINE_LINUX_RECOVERY} ${GRUB_CMDLINE_LINUX}"
-- 
2.1.0