Control: tag -1 patch
On Tue, 2016-01-19 at 15:28 +0000, Ben Hutchings wrote:
> Control: tag -1 moreinfo
>
> On Tue, 19 Jan 2016 11:44:39 +0100 Roderich Schupp wrote:
> > Package: initramfs-tools-core
> > Version: 0.121
> > Severity: critical
> >
> > boot with an initrd generated by initramfs-tools-core 1.21
> > fails with "run-init: opening console: No such file or directory"
> > (see attached screenshot)
> >
> > It seems to be caused by validate_init() in /usr/share/initramfs-tools/init
> > which has been reduced to just "run-init -n ..." using the new option -n to
> > klibc's run-init. The latter bombs out in
> >
> > if ((confd = open(console, O_RDWR)) < 0)
> > return "opening console";
> >
> > Dunny why, as sticking "ls -l /dev/console" into /usr/share/initramfs-
> > tools/init
> > right before "run-init -n ..." shows that /dev/console exists...
> [...]
>
> That's showing you the /dev/console in the initramfs. However, run-
> init will open it from the 'real' root filesystem.
>
> At the recovery shell prompt, what does "ls -l /root/dev/console" show?
I think I understand the problem. Could you try the packages (version
0.122~a.test) from https://people.debian.org/~benh/packages/ ;?
The patch is below.
Ben.
---
Subject: [PATCH initramfs-tools] init: Validate the real init after devtmpfs
is mounted under the real root
Currently 'run-init -n' will fail if there's no static /dev/console on
the real root. We have to run it after udev's init-bottom script has
moved /dev to ${rootmnt}/dev.
Closes: #811479
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
init | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/init b/init
index c10546f..f53760c 100755
--- a/init
+++ b/init
@@ -236,6 +236,20 @@ if read_fstab_entry /usr; then
log_end_msg
fi
+# Mount cleanup
+mount_bottom
+nfs_bottom
+local_bottom
+
+maybe_break bottom
+[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom"
+# We expect udev's init-bottom script to move /dev to ${rootmnt}/dev
+run_scripts /scripts/init-bottom
+[ "$quiet" != "y" ] && log_end_msg
+
+# Move /run to the root
+mount -n -o move /run ${rootmnt}/run
+
validate_init() {
run-init -n "${rootmnt}" "${1}"
}
@@ -252,19 +266,6 @@ if ! validate_init "$init"; then
done
fi
-# Mount cleanup
-mount_bottom
-nfs_bottom
-local_bottom
-
-maybe_break bottom
-[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom"
-run_scripts /scripts/init-bottom
-[ "$quiet" != "y" ] && log_end_msg
-
-# Move /run to the root
-mount -n -o move /run ${rootmnt}/run
-
# No init on rootmount
if ! validate_init "${init}" ; then
panic "No init found. Try passing init= bootarg."
--
Ben Hutchings
Horngren's Observation:
Among economists, the real world is often a special case.
Attachment:
signature.asc
Description: Digital signature