Package: initramfs-tools
Version: 0.109
Severity: important
Tags: patch

I have attached two patches for your consideration:

1) Migration of /run to the rootfs is mandatory, i.e. /run is required to
   be present on the rootfs.  This will be the case for all jessie installs
   and upgrades (unlike wheezy, which needed the special-case logic to
   manually migrate udev/mdadm state).

2) Create /run/initramfs if needed.  This might also need fixing for wheezy,
   since I can't see where it's created (if at all), so opening the debug
   file might actually be broken at present.


Regards,
Roger
>From 13d1e4b4bf8dc163ae488016aa2da6a11b284f57 Mon Sep 17 00:00:00 2001
From: Roger Leigh <rle...@debian.org>
Date: Mon, 24 Dec 2012 13:36:53 +0000
Subject: [PATCH 1/2] init: Always migrate /run to the rootfs

---
 init |   16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/init b/init
index cb832ff..929de29 100755
--- a/init
+++ b/init
@@ -228,20 +228,8 @@ maybe_break bottom
 run_scripts /scripts/init-bottom
 [ "$quiet" != "y" ] && log_end_msg
 
-# Preserve information on old systems without /run on the rootfs
-if [ -d ${rootmnt}/run ]; then
-	mount -n -o move /run ${rootmnt}/run
-else
-	# The initramfs udev database must be migrated:
-	if [ -d /run/udev ] && [ ! -d /dev/.udev ]; then
-		mv /run/udev /dev/.udev
-	fi
-	# The initramfs debug info must be migrated:
-	if [ -d /run/initramfs ] && [ ! -d /dev/.initramfs ]; then
-		mv /run/initramfs /dev/.initramfs
-	fi
-	umount /run
-fi
+# Move /run to the root
+mount -n -o move /run ${rootmnt}/run
 
 validate_init() {
 	checktarget="${1}"
-- 
1.7.10.4

>From 29046070b93b4c97456ca9a8aadfbba0a54dc380 Mon Sep 17 00:00:00 2001
From: Roger Leigh <rle...@debian.org>
Date: Mon, 24 Dec 2012 13:38:40 +0000
Subject: [PATCH 2/2] init: Create /run/initramfs

---
 init |    1 +
 1 file changed, 1 insertion(+)

diff --git a/init b/init
index 929de29..c6c84d3 100755
--- a/init
+++ b/init
@@ -160,6 +160,7 @@ for x in $(cat /proc/cmdline); do
 	debug)
 		debug=y
 		quiet=n
+		mkdir -m 0700 /run/initramfs
 		exec >/run/initramfs/initramfs.debug 2>&1
 		set -x
 		;;
-- 
1.7.10.4

Reply via email to