Blame SOURCES/rhbz1051649.6.patch

f43afa
From 65dc00af707a48948d08dd4fec97ecb22459dd0c Mon Sep 17 00:00:00 2001
f43afa
From: Jonathan Lebon <jlebon@redhat.com>
f43afa
Date: Wed, 26 Mar 2014 13:56:20 -0400
f43afa
Subject: [PATCH] initscript: skip dracut stap module by default
f43afa
f43afa
We previously always enabled the dracut stap module as long as there
f43afa
were scripts to include. This can lead to issues since the params.conf
f43afa
file may be obsolete/not in sync e.g. during a kernel update. We now
f43afa
make the module an opt-in feature, and make the initscript explicit
f43afa
specify its inclusion.
f43afa
---
f43afa
 initscript/99stap/module-setup.sh.in | 10 +++++++---
f43afa
 initscript/systemtap.in              |  6 ++----
f43afa
 2 files changed, 9 insertions(+), 7 deletions(-)
f43afa
f43afa
diff --git a/initscript/99stap/module-setup.sh.in b/initscript/99stap/module-setup.sh.in
f43afa
index 4f4583d..7b2b401 100644
f43afa
--- a/initscript/99stap/module-setup.sh.in
f43afa
+++ b/initscript/99stap/module-setup.sh.in
f43afa
@@ -5,10 +5,14 @@
f43afa
 
f43afa
 # Return 0 --> install stap module
f43afa
 # Return 1 --> skip stap module
f43afa
+# Return 255 --> install stap module only if explicitly requested
f43afa
 check() {
f43afa
-   # Install it if we have early-boot scripts
f43afa
-   [ "$ONBOOT_SCRIPTS" ] && return 0
f43afa
-   return 1
f43afa
+   # Do not include stap module if there are no scripts to include
f43afa
+   [ "$ONBOOT_SCRIPTS" ] || return 1
f43afa
+   # We're disabled by default: the initscript explicitly uses dracut's
f43afa
+   # '--add stap' when creating the initramfs. Otherwise, we might be
f43afa
+   # mistakenly included during e.g. kernel updates.
f43afa
+   return 255
f43afa
 }
f43afa
 
f43afa
 # We don't depend on anything
f43afa
diff --git a/initscript/systemtap.in b/initscript/systemtap.in
f43afa
index 075226e..ab882e9 100755
f43afa
--- a/initscript/systemtap.in
f43afa
+++ b/initscript/systemtap.in
f43afa
@@ -859,10 +859,8 @@ onboot () {
f43afa
     do_failure "Failed to make temporary file in $dir"
f43afa
     return 1
f43afa
   fi
f43afa
-  # Create the initramfs image. We could have combined this with the
f43afa
-  # new-kernel-pkg call below using --dracut, but then we would have
f43afa
-  # lost error-checking and our backing up facilities.
f43afa
-  out=$($DRACUT --force $TMPINITRAMFS $KRELEASE 2>&1)
f43afa
+  # Create the initramfs image with stap module enabled.
f43afa
+  out=$($DRACUT --add stap --force $TMPINITRAMFS $KRELEASE 2>&1)
f43afa
   # dracut will report success even if some modules (e.g. stap) failed
f43afa
   # to install some files, so we need to be a bit more involved in
f43afa
   # checking for errors
f43afa
-- 
f43afa
1.8.3.1
f43afa