[elbe-devel] [PATCH v1 2/2] examples: busybox based rescue initramfs with shared libraries

Holger Dengler dengler at linutronix.de
Thu Aug 31 14:34:22 CEST 2017


This example creates a busybox based rescue initramfs with shared libs.
It can be used as base for rescue filesystems, which requires further
packages. Adding packages to <pkg-list> will increase the size of the
initramfs only by the size of the package itself and its pre-requisits.

Build size:
  - cpio: 11M
  - cpio.gz: 4.9M

Note:
If the basic glibc built-in iconv/gconv modules are sufficient, the
shared modules in /usr/lib/x86_64-linux-gnu/gconv can be removed. This
will save ~6M (cpio) and ~2.5M (cpio.gz) respectively.

Signed-off-by: Holger Dengler <dengler at linutronix.de>
---
 examples/x86_64-pc-rescue-busybox-dyn-cpio.xml | 79 ++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 examples/x86_64-pc-rescue-busybox-dyn-cpio.xml

diff --git a/examples/x86_64-pc-rescue-busybox-dyn-cpio.xml b/examples/x86_64-pc-rescue-busybox-dyn-cpio.xml
new file mode 100644
index 00000000..c6686edc
--- /dev/null
+++ b/examples/x86_64-pc-rescue-busybox-dyn-cpio.xml
@@ -0,0 +1,79 @@
+<ns0:RootFileSystem xmlns:ns0="https://www.linutronix.de/projects/Elbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" created="2009-05-20T08:50:56" revision="6" xsi:schemaLocation="https://www.linutronix.de/projects/Elbe dbsfed.xsd">
+	<project>
+		<name>x86_64-rescue-image</name>
+		<version>1.0</version>
+		<description>
+			busybox based rescue rfs for x86_64
+			with shared libs
+		</description>
+		<buildtype>amd64</buildtype>
+		<mirror>
+			<primary_host>ftp.de.debian.org</primary_host>
+			<primary_path>/debian</primary_path>
+			<primary_proto>http</primary_proto>
+		</mirror>
+		<suite>stretch</suite>
+	</project>
+	<target>
+		<hostname>rescue</hostname>
+		<domain>linutronix.de</domain>
+		<passwd>foo</passwd>
+		<console>ttyS0,115200</console>
+		<package>
+			<cpio><name>rescue.cpio</name></cpio>
+		</package>
+		<fstab>
+			<bydev>
+				<source>none</source>
+				<mountpoint>/proc</mountpoint>
+				<fs>
+					<type>proc</type>
+				</fs>
+			</bydev>
+			<bydev>
+				<source>none</source>
+				<mountpoint>/sys</mountpoint>
+				<fs>
+					<type>sysfs</type>
+				</fs>
+			</bydev>
+			<bydev>
+				<source>none</source>
+				<mountpoint>/dev</mountpoint>
+				<fs>
+					<type>devtmpfs</type>
+				</fs>
+			</bydev>
+			<bydev>
+				<source>none</source>
+				<mountpoint>/sys/kernel/debug</mountpoint>
+				<fs>
+					<type>debugfs</type>
+				</fs>
+			</bydev>
+		</fstab>
+		<diet />
+		<norecommend />
+		<finetuning>
+			<!-- Create missing directories -->
+			<mkdir>/bin</mkdir>
+			<mkdir>/sbin</mkdir>
+			<mkdir>/usr/bin</mkdir>
+			<mkdir>/usr/sbin</mkdir>
+			<mkdir>/etc/init.d</mkdir>
+			<!-- Complete Busybox installation -->
+			<raw_cmd>/bin/busybox --install -s</raw_cmd>
+			<ln path="/sbin/init">/init</ln>
+			<!-- Add start script (may be moved to archive) -->
+			<command>echo "#!/bin/sh" | tee    /etc/init.d/rcS</command>
+			<command>echo "mount -a"  | tee -a /etc/init.d/rcS</command>
+			<command>chmod +x /etc/init.d/rcS</command>
+			<!-- Delete documentation and unused files -->
+			<rm>/usr/share</rm>
+		</finetuning>
+		<pkg-list>
+			<pkg>libc6</pkg>
+			<pkg>busybox</pkg>
+		</pkg-list>
+	</target>
+</ns0:RootFileSystem>
-- 
2.14.1




More information about the elbe-devel mailing list