Blob Blame History Raw
From 39339512e2ea0724de9474a8bdac81e5abaf8c97 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 23 Jan 2012 10:41:41 +0100
Subject: [PATCH] plymouth/kernel: cleanup not needed parts for shutdown

remove plymouth and kernel parts from /run/initramfs, which are not
needed at shutdown.

https://bugzilla.redhat.com/show_bug.cgi?id=751189
---
 modules.d/50plymouth/module-setup.sh         |    1 +
 modules.d/50plymouth/plymouth-cleanup.sh     |    5 +++++
 modules.d/90kernel-modules/kernel-cleanup.sh |    5 +++++
 modules.d/90kernel-modules/module-setup.sh   |    1 +
 4 files changed, 12 insertions(+), 0 deletions(-)
 create mode 100755 modules.d/50plymouth/plymouth-cleanup.sh
 create mode 100755 modules.d/90kernel-modules/kernel-cleanup.sh

diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
index b78c718..5c9eaee 100755
--- a/modules.d/50plymouth/module-setup.sh
+++ b/modules.d/50plymouth/module-setup.sh
@@ -46,6 +46,7 @@ install() {
 
     inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh
     inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh
+    inst_hook pre-pivot 10 "$moddir"/plymouth-cleanup.sh
     inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
     inst readlink
 }
diff --git a/modules.d/50plymouth/plymouth-cleanup.sh b/modules.d/50plymouth/plymouth-cleanup.sh
new file mode 100755
index 0000000..d6d11e6
--- /dev/null
+++ b/modules.d/50plymouth/plymouth-cleanup.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+rm -fr /usr/share/plymouth /usr/lib/plymouth /usr/lib64/plymouth
diff --git a/modules.d/90kernel-modules/kernel-cleanup.sh b/modules.d/90kernel-modules/kernel-cleanup.sh
new file mode 100755
index 0000000..d17714d
--- /dev/null
+++ b/modules.d/90kernel-modules/kernel-cleanup.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+rm -fr /lib/modules
\ No newline at end of file
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index 46d8591..88f0e2d 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -75,6 +75,7 @@ install() {
         inst_simple "$i"
     done
     inst_hook cmdline 01 "$moddir/parse-kernel.sh"
+    inst_hook pre-pivot 20 "$moddir/kernel-cleanup.sh"
     inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
 
     for _f in modules.builtin.bin modules.builtin; do