summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Drung <benjamin.drung@profitbricks.com>2018-01-04 14:05:37 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2018-09-15 11:05:30 +0000
commit688c81864d1361d3ea610be63e5777f6247c33b7 (patch)
tree25adfc3b0b6c8c6abb04c7c8c3a974b4f7b85f44
parentSimplify mount point handling by using /run/live instead of /lib/live/mount (... (diff)
downloadsystem-boot-688c81864d1361d3ea610be63e5777f6247c33b7.tar.xz
system-boot-688c81864d1361d3ea610be63e5777f6247c33b7.zip
Adding configuration variables to build a stripped down initrd (#886337).
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: Daniel Baumann <daniel.baumann@open-infrastructure.net>
-rwxr-xr-xbackend/initramfs-tools/live.hook86
-rw-r--r--manpages/en/live-boot.725
2 files changed, 77 insertions, 34 deletions
diff --git a/backend/initramfs-tools/live.hook b/backend/initramfs-tools/live.hook
index 269f1b1..effdc37 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
@@ -187,24 +202,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:-n}" != "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 9b5f0df..ae47cc7 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.