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

Bug#886337: marked as done (live-boot-initramfs-tools: Please support building smaller initrd)



Your message dated Wed, 28 Mar 2018 19:36:02 +0000
with message-id <E1f1Gra-000Cgi-K2@fasolo.debian.org>
and subject line Bug#886337: fixed in live-boot 1:20180328
has caused the Debian Bug report #886337,
regarding live-boot-initramfs-tools: Please support building smaller initrd
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
886337: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886337
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: live-boot-initramfs-tools
Version: 1:20170623
Severity: normal
Tags: patch

Hi,

Please add several environment variables to strip down the initrd size
(for minimal systems that do not need all features). This allows me to
reduce the initrd size from 8.5 MiB to 8.0 MiB when also using busybox's
mount (see Debian bug #868559) and wget (see Debian bug #885455). A
tested patch is attached.

-- 
Benjamin Drung
System Developer
Debian & Ubuntu Developer

ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin

Email: benjamin.drung@profitbricks.com
URL: https://www.profitbricks.de

Sitz der Gesellschaft: Berlin
Registergericht: Amtsgericht Charlottenburg, HRB 125506 B
Geschäftsführer: Achim Weiss, Matthias Steinberg
>From 0e3f0bd0705a8395c93bf212d7b7051fb87319da Mon Sep 17 00:00:00 2001
From: Benjamin Drung <benjamin.drung@profitbricks.com>
Date: Thu, 4 Jan 2018 15:05:37 +0100
Subject: [PATCH] Support building smaller initrd

Add several environment variables to strip down the initrd size (for
minimal systems that do not need all features). This allows me to reduce
the initrd size from 8.5 MiB to 8.0 MiB when also using busybox's
mount (see Debian bug #868559) and wget (see Debian bug #885455).

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
---
 backend/initramfs-tools/live.hook | 86 +++++++++++++++++++++++----------------
 manpages/en/live-boot.7           | 25 ++++++++++++
 2 files changed, 77 insertions(+), 34 deletions(-)

diff --git a/backend/initramfs-tools/live.hook b/backend/initramfs-tools/live.hook
index 97f4c5e..41ba7f0 100755
--- a/backend/initramfs-tools/live.hook
+++ b/backend/initramfs-tools/live.hook
@@ -53,12 +53,15 @@ do
 done
 
 # udev dependencies
-for FILE in /lib/udev/*_id
-do
-	copy_exec "${FILE}"
-done
+if [ "${MINIMAL-}" != "y" ]
+then
+	for FILE in /lib/udev/*_id
+	do
+		copy_exec "${FILE}"
+	done
+fi
 
-if [ -e /lib/udev/rules.d/60-cdrom_id.rules ]
+if [ -e /lib/udev/rules.d/60-cdrom_id.rules ] && [ "${DISABLE_CDROM-}" != "y" ]
 then
 	mkdir -p "${DESTDIR}/lib/udev/rules.d"
 	cp -p /lib/udev/rules.d/60-cdrom_id.rules "${DESTDIR}/lib/udev/rules.d"
@@ -103,7 +106,7 @@ manual_add_modules hfsplus
 # Filesystem: jffs2
 manual_add_modules jffs2
 
-if [ -x /usr/bin/rsync ]
+if [ -x /usr/bin/rsync ] && [ "${MINIMAL-}" != "y" ]
 then
 	copy_exec /usr/bin/rsync /bin
 fi
@@ -120,25 +123,37 @@ manual_add_modules aufs
 manual_add_modules overlay
 
 # Filesystem: vfat
-manual_add_modules nls_cp437
-manual_add_modules nls_iso8859-1
-manual_add_modules nls_utf8
-manual_add_modules nls_ascii
-manual_add_modules vfat
+if [ "${DISABLE_FAT-}" != "y" ]
+then
+	manual_add_modules nls_cp437
+	manual_add_modules nls_iso8859-1
+	manual_add_modules nls_utf8
+	manual_add_modules nls_ascii
+	manual_add_modules vfat
+fi
 
 # Filesystem: ntfs
-manual_add_modules ntfs
+if [ "${DISABLE_NTFS-}" != "y" ]
+then
+	manual_add_modules ntfs
+fi
 
 [ "${QUIET}" ] || echo -n " devices"
 # Hardware: cdrom
-manual_add_modules ide-cd
-manual_add_modules ide-generic
-manual_add_modules ohci1394
-manual_add_modules sbp2
-manual_add_modules sr_mod
+if [ "${DISABLE_CDROM-}" != "y" ]
+then
+	manual_add_modules ide-cd
+	manual_add_modules ide-generic
+	manual_add_modules ohci1394
+	manual_add_modules sbp2
+	manual_add_modules sr_mod
+fi
 
 # Hardware: usb
-manual_add_modules sd_mod
+if [ "${DISABLE_USB-}" != "y" ]
+then
+	manual_add_modules sd_mod
+fi
 
 # Hardware: network
 auto_add_modules net
@@ -194,24 +209,27 @@ then
 fi
 
 # FUSE kernel module
-manual_add_modules fuse
-
-# FUSE filesystem: httpfs2
-if [ -x /usr/bin/httpfs2_ssl ]
-then
-	[ "${QUIET}" ] || echo -n " httpfs:ssl"
-	copy_exec /usr/bin/httpfs2_ssl /bin/httpfs
-elif [ -x /usr/bin/httpfs2 ]
+if [ "${DISABLE_FUSE-}" != "y" ]
 then
-	[ "${QUIET}" ] || echo -n " httpfs"
-	copy_exec /usr/bin/httpfs2 /bin/httpfs
-fi
+	manual_add_modules fuse
 
-# FUSE filesystem: curlftpfs
-if [ -x /usr/bin/curlftpfs ]
-then
-	[ "${QUIET}" ] || echo -n " ftpfs"
-	copy_exec /usr/bin/curlftpfs /bin
+	# FUSE filesystem: httpfs2
+	if [ -x /usr/bin/httpfs2_ssl ]
+	then
+		[ "${QUIET}" ] || echo -n " httpfs:ssl"
+		copy_exec /usr/bin/httpfs2_ssl /bin/httpfs
+	elif [ -x /usr/bin/httpfs2 ]
+	then
+		[ "${QUIET}" ] || echo -n " httpfs"
+		copy_exec /usr/bin/httpfs2 /bin/httpfs
+	fi
+
+	# FUSE filesystem: curlftpfs
+	if [ -x /usr/bin/curlftpfs ]
+	then
+		[ "${QUIET}" ] || echo -n " ftpfs"
+		copy_exec /usr/bin/curlftpfs /bin
+	fi
 fi
 
 # iSCSI
diff --git a/manpages/en/live-boot.7 b/manpages/en/live-boot.7
index 72184cc..e0ce482 100644
--- a/manpages/en/live-boot.7
+++ b/manpages/en/live-boot.7
@@ -24,6 +24,31 @@ In addition, there are some more boot parameters to influence the behaviour, see
 
 .SS Configuration Files
 \fBlive\-boot\fR can be configured (but not activated) through configuration files. Those files can be placed either in the root filesystem itself (/etc/live/boot.conf, /etc/live/boot/*), or on the live media (live/boot.conf, live/boot/*).
+These environment variables can only be set in the configuration files:
+
+.TP
+\fBDISABLE_CDROM\fR=[\fIy\fR|\fIn\fR]
+Disable support for booting from CD-ROMs.  If set to '\fIy\fR' mkinitramfs will build an initramfs without the kernel modules for reading CD-ROMs.
+
+.TP
+\fBDISABLE_FAT\fR=[\fIy\fR|\fIn\fR]
+Disable support for booting from FAT file systems.  If set to '\fIy\fR' mkinitramfs will build an initramfs without the kernel module vfat and some nls_* modules.
+
+.TP
+\fBDISABLE_FUSE\fR=[\fIy\fR|\fIn\fR]
+Disable support for booting from FUSE-based file systems.  If set to '\fIy\fR' mkinitramfs will build an initramfs without the kernel module fuse and file systems that depend on it (like curlftpfs and httpfs2).
+
+.TP
+\fBDISABLE_NTFS\fR=[\fIy\fR|\fIn\fR]
+Disable support for booting from NTFS file systems.  If set to '\fIy\fR' mkinitramfs will build an initramfs without the kernel module ntfs.
+
+.TP
+\fBDISABLE_USB\fR=[\fIy\fR|\fIn\fR]
+Disable support for booting from USB devices.  If set to '\fIy\fR' mkinitramfs will build an initramfs without the kernel module sd_mod.
+
+.TP
+\fBMINIMAL\fR=[\fIy\fR|\fIn\fR]
+Build a minimal initramfs.  If set to '\fIy\fR' mkinitramfs will build an initramfs without some udev scripts and without rsync.
 
 .SH OPTIONS
 \fBlive\-boot\fR currently features the following parameters.
-- 
2.14.1


--- End Message ---
--- Begin Message ---
Source: live-boot
Source-Version: 1:20180328

We believe that the bug you reported is fixed in the latest version of
live-boot, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 886337@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Luca Boccassi <bluca@debian.org> (supplier of updated live-boot package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Wed, 28 Mar 2018 20:07:39 +0100
Source: live-boot
Binary: live-boot live-boot-doc live-boot-initramfs-tools
Architecture: source
Version: 1:20180328
Distribution: unstable
Urgency: low
Maintainer: Live Systems Maintainers <debian-live@lists.debian.org>
Changed-By: Luca Boccassi <bluca@debian.org>
Description:
 live-boot  - Live System Boot Components
 live-boot-doc - Live System Boot Components (documentation)
 live-boot-initramfs-tools - Live System Boot Components (initramfs-tools backend)
Closes: 856482 868559 877776 884355 884886 885453 885455 885466 886328 886337 892772
Changes:
 live-boot (1:20180328) unstable; urgency=low
 .
   [ Raphaël Hertzog ]
   * Fix read-only persistence mode with overlayfs. Closes: #877776
     Thanks to Ronny Standtke <ronny.standtke@fhnw.ch> for the patch.
   * Add a small warning in the long description that the
     package must not be installed on a regular system, but only in
     a live image. Closes: #884886
   * Strip comments from checksums files passed to "shaXsum -c"
     Thanks to Andreas Heinlein for the report (Closes: #856482)
 .
   [ Steve McIntyre ]
   * Repo moved to salsa
 .
   [ Benjamin Drung ]
   * Don't replace busybox's wget by the true wget.
     It was likely done for https support but since buster the busybox
     provided wget has https support too. We save a lot of space by
     doing so (8 Mb). (Closes: #885455)
   * Avoid double slashes in some paths (Closes: #885453)
   * Support setting upperdir tmpfs size with overlay-size boot parameter
     (Closes: #885466)
   * Simplify mount point handling by using /run/live instead of /lib/live/mount
     (Closes: #886328)
   * Add configuration variables to build a stripped down initrd
     (Closes: #886337)
 .
   [ Daniel Reichelt ]
   * Use klibc's mount again for fuse mounts (Closes: #868559)
 .
   [ raizo62 ]
   * Update DNSFILE even if DNSFILE contains only commented or empty lines
 .
   [ Sameer Agrawal ]
   * Fix ifconfig parsing (Closes: #892772)
 .
   [ Chas Williams ]
   * Add back persistence fsck option
   * Remove workaround for ipconfig issues
 .
   [ Benjamin Drung ]
   * Remove sourcing /scripts/functions in components
   * Support live-{top,premount,bottom} hooks (Closes: #884355)
 .
   [ Luca Boccassi ]
   * Add backward compatibility rbind mount /lib/live/mount -> /run/live.
     The paths used in the current released versions of live-boot are a
     form of public API, and existing applications and scripts might rely
     on them. Do a recursive bind mount of the new path on the previous one
     so that they do not break on upgrade (see #886328).
     This backward-compatible mount point will be deprecated and removed
     before the Bullseye (Debian 11) release. Users are recommended to start
     migrating to the new /run/live path as soon as possible.
 .
   [ Erik Ziegenbalg ]
   * fromiso: add support for local ISO (ONIE)
 .
   [ Luca Boccassi ]
   * Clarify FROMISO documentation in live-boot manpage
   * Use HTTPS in debian/copyright (policy 4.0.0).
   * Remove dead link to live-systems.org from debian/copyright.
   * Bump Standards-Version to 4.1.3, no changes.
   * Add myself to Uploaders.
Checksums-Sha1:
 3f5b3c5a5ad40b6a5d59b5595174ea234c5c0178 1548 live-boot_20180328.dsc
 c7251bc1398cea57cc3ce08759a8cfd08c87d602 101172 live-boot_20180328.tar.xz
 4d9ab1a3a5a8ce3cfeab09ea4acd0f3d7c2fb62a 6110 live-boot_20180328_source.buildinfo
Checksums-Sha256:
 a94801aa0bc428bf21c57ba382ab8e5a6e8a5128275ff925b389d65fc651a49c 1548 live-boot_20180328.dsc
 58acb3a961c40707350f7cd61e58f255d330f6dfdad9022b2962e4335a29c469 101172 live-boot_20180328.tar.xz
 232fa4dfc580417be8f267e4b1abe7f1046190c638ad1941ee6ba17cf1b2cfa4 6110 live-boot_20180328_source.buildinfo
Files:
 50529a169e238d221981166260b34fbb 1548 misc optional live-boot_20180328.dsc
 43184c037c144665bd3e96710850c0a5 101172 misc optional live-boot_20180328.tar.xz
 a1adbcdd7e789312055c0498aedc5fa1 6110 misc optional live-boot_20180328_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQFFBAEBCgAvFiEE6g0RLAGYhL9yp9G8SylmgFB4UWIFAlq76koRHGJsdWNhQGRl
Ymlhbi5vcmcACgkQSylmgFB4UWIwVQgAmIk7GLLWbSGkyCTfJUSNTEpLgHPY6SJv
0TlDP69ndXMNl8FxKBG9pUpByZ4sCmEtjkktV2s3pIHyG2YuhXeLXiZOo0BYUA/t
r10jnYDTfRn3qxHKtluEJgX2JIU4S1fEa5sWQ2TV9rTsihV8vpl4KvryQZmRW/Qu
OsB4j4N4tp0WYiEl8ZJFJdnXvYZhsq4a7XUESOkAqaUkvUbqwPVVuatIe/2m6c1P
u7Kj5qhIyQOM2oOVvG4YZnyJl5gKD6XcfZEmBBx37o0IXu6ZCRlju23uE8wus9sZ
dGJfSCZblItwRMfgC1IM3EfFYlV9rqdbQyQM/26eF6eC0bKuV96sjA==
=6rI8
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: