[arch-projects] [mkinitcpio][PATCH 1/4] /run/initramfs: keep a copy of the initramfs

Tom Gundersen teg at jklm.no
Sat Nov 26 06:17:49 EST 2011


This is useful for the future shutdown hook, and might make debugging easier,
as well as potentially opening up for other usecases (that I cannot yet imagine ;-) ).

For the time being we exclude the kernel modules, this decision could be revisited in
the future.

Signed-off-by: Tom Gundersen <teg at jklm.no>
---
 init         |    4 ++++
 install/base |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/init b/init
index 53c64d5..7f809cc 100644
--- a/init
+++ b/init
@@ -112,6 +112,10 @@ if [ "${udevd_running}" -eq 1 ]; then
     udevadm info --cleanup-db
 fi
 
+# keep a copy of the initramfs around, excluding the kernel modules
+rm -r /lib/modules
+cp -ax / /run/initramfs
+
 exec env -i "TERM=$TERM" /sbin/switch_root /new_root $init "$@"
 
 # vim: set ft=sh ts=4 sw=4 et:
diff --git a/install/base b/install/base
index 0726fa2..84e7f02 100644
--- a/install/base
+++ b/install/base
@@ -10,6 +10,7 @@ build() {
     add_binary /sbin/blkid
     add_binary /bin/mount
     add_binary /sbin/switch_root
+    add_binary /bin/cp
 
     add_symlink "/etc/mtab" "/proc/self/mounts"
 
-- 
1.7.7.4



More information about the arch-projects mailing list