[PATCH 2/4] remove anaconda-cleanup-initramfs.service

Will Woods wwoods at redhat.com
Sun Feb 10 02:10:31 UTC 2013


This service operated under the assumption that the initramfs would be
saved at /run/initramfs. Otherwise, it doesn't do anything.

And initramfs doesn't get saved to /run/initramfs anymore. So this
service no longer does anything.

This patch removes it.
---
 data/systemd/Makefile.am                        |  5 +---
 data/systemd/anaconda-cleanup-initramfs         | 35 -------------------------
 data/systemd/anaconda-cleanup-initramfs.service | 11 --------
 data/systemd/anaconda.target                    |  1 -
 4 files changed, 1 insertion(+), 51 deletions(-)
 delete mode 100755 data/systemd/anaconda-cleanup-initramfs
 delete mode 100644 data/systemd/anaconda-cleanup-initramfs.service

diff --git a/data/systemd/Makefile.am b/data/systemd/Makefile.am
index a0bcbfd..2c4e692 100644
--- a/data/systemd/Makefile.am
+++ b/data/systemd/Makefile.am
@@ -26,11 +26,8 @@ dist_systemd_DATA = anaconda.service \
 		    anaconda-tmux at .service \
 		    anaconda-shell at .service \
 		    instperf.service \
-		    anaconda-sshd.service \
-		    anaconda-cleanup-initramfs.service
+		    anaconda-sshd.service
 
 dist_generator_SCRIPTS = anaconda-generator
 
-dist_sbin_SCRIPTS = anaconda-cleanup-initramfs
-
 MAINTAINERCLEANFILES = Makefile.in
diff --git a/data/systemd/anaconda-cleanup-initramfs b/data/systemd/anaconda-cleanup-initramfs
deleted file mode 100755
index f2bd274..0000000
--- a/data/systemd/anaconda-cleanup-initramfs
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-# anaconda-cleanup-initramfs - clean up initramfs to save RAM.
-#
-# Normal systems just throw away the initramfs after boot, since they have a
-# copy of it in /boot/initramfs-$(uname -r).img that they can unpack and use
-# to shut down the system cleanly. (See dracut-shutdown.service.)
-#
-# We have to keep initramfs because we don't have it laying around in /boot,
-# and we might want to read some files out of it (e.g. /etc/cmdline*)
-#
-# There are still redundant/unneeded files, though, and we can save RAM by
-# cleaning those up.
-
-systemd-notify --pid --status="Removing unneeded files..."
-# the runtime has all the firmware/modules we need.
-# removing the ssl certs saves another easy ~1MB.
-rm -rf /run/initramfs/usr/lib/{firmware,modules} \
-       /run/initramfs/etc/ssl
-
-# Try to compress the remaining initramfs contents.
-# 99% of the RAM used by initramfs is in usr/, so just compress/remove that.
-# (this also means we save etc/cmdline* and we don't have to move mounts)
-
-# check for cpio and pigz/gzip.
-# (xz would be ~4MB smaller but uses 100MB RAM (!). gzip uses ~2MB.)
-type -P cpio >/dev/null || exit 0
-gzip=$(type -P pigz || type -P gzip) || exit 0
-
-# systemd-notify --ready --> continue startup, do the rest in the background
-systemd-notify --ready --status="Compressing initramfs contents..."
-
-mkdir -p /boot
-initramfs=/boot/initramfs-$(uname -r).img
-find /run/initramfs/usr | cpio -co 2>/dev/null | $gzip -c > $initramfs
-rm -rf /run/initramfs/usr
diff --git a/data/systemd/anaconda-cleanup-initramfs.service b/data/systemd/anaconda-cleanup-initramfs.service
deleted file mode 100644
index cc49357..0000000
--- a/data/systemd/anaconda-cleanup-initramfs.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Clean Up Initramfs
-Before=anaconda.service
-ConditionPathIsDirectory=/run/initramfs/usr/lib/modules
-
-[Service]
-Type=notify
-NotifyAccess=all
-RemainAfterExit=yes
-Nice=19
-ExecStart=/usr/sbin/anaconda-cleanup-initramfs
diff --git a/data/systemd/anaconda.target b/data/systemd/anaconda.target
index 597adfd..65ad131 100644
--- a/data/systemd/anaconda.target
+++ b/data/systemd/anaconda.target
@@ -3,7 +3,6 @@ Description=Anaconda System Services
 Requires=basic.target
 After=basic.target
 AllowIsolate=yes
-Wants=anaconda-cleanup-initramfs.service
 Wants=instperf.service
 Wants=rsyslog.service
 Wants=udev-settle.service
-- 
1.8.1



More information about the anaconda-patches mailing list