[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#866127: initramfs-tools: Please allow fully disabling initramfs generation



Package: initramfs-tools
Version: 0.130
Severity: wishlist
Tags: patch

Hi,

Setting update_initramfs=no in update-initramfs.conf still triggers
initramfs creation on kernel updates.
While this generally makes sense some systems don't need initramfs to
boot and currently there is
no nice way of fully disabling initramfs generation.

The attached patch introduces update_initramfs=never which skips
initramfs generation even when the kernel is upgraded. Please consider
accepting it in a future upload.

Cheers,
Balint

--
Balint Reczey
Debian & Ubuntu Developer
From f603fdc05a27ed37b9f1e021a17cb9aecdeefab9 Mon Sep 17 00:00:00 2001
From: Balint Reczey <balint.reczey@canonical.com>
Date: Tue, 27 Jun 2017 16:58:38 +0200
Subject: [PATCH] Add setting to never update initramfs

---
 conf/update-initramfs.conf | 3 ++-
 update-initramfs           | 5 +++++
 update-initramfs.conf.5    | 3 ++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf
index 31823e2..3f684e3 100644
--- a/conf/update-initramfs.conf
+++ b/conf/update-initramfs.conf
@@ -3,11 +3,12 @@
 #
 
 #
-# update_initramfs [ yes | all | no ]
+# update_initramfs [ yes | all | no | never ]
 #
 # Default is yes
 # If set to all update-initramfs will update all initramfs
 # If set to no disables any update to initramfs beside kernel upgrade
+# If set to never disables every update to initramfs including kernel upgrade
 
 update_initramfs=yes
 
diff --git a/update-initramfs b/update-initramfs
index 04145c5..9821a4d 100755
--- a/update-initramfs
+++ b/update-initramfs
@@ -415,6 +415,11 @@ if [ -z "${mode}" ]; then
 	usage "You must specify at least one of -c, -u, or -d."
 fi
 
+if [ "${update_initramfs}" = "never" ]; then
+	printf "Skipping initramfs generation due to setting update_initramfs=never.\n"
+	exit 0
+fi
+
 if [ "${version}" = "all" ] \
 	|| ( [ "${update_initramfs}" = "all" ] && [ -z "${version}" ] ); then
 	: FIXME check for --yes, and if not ask are you sure
diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5
index bd41132..86db0ca 100644
--- a/update-initramfs.conf.5
+++ b/update-initramfs.conf.5
@@ -15,7 +15,8 @@ newest Linux image.
 Setting it to \fIall\fP updates any known initramfs.
 It is possible to set it to \fIno\fP for remote servers or boxes where
 conservative manners needs to be applied. This disables
-the \fBupdate_initramfs \-u\fP call.
+the \fBupdate_initramfs \-u\fP call. Setting it to \fInever\fP disables updating initramfs completely. This may
+be useful on systems requiring no kernel modules.
 .TP
 \fB backup_initramfs
 If set \fBupdate_initramfs\fP keeps an .bak file of the previous initramfs. If unset the backup initramfs will not be kept.
-- 
2.11.0


Reply to: