fix error handling in initramfs-framework
cover fix error handling in initramfs-framework
While debugging the root=UUID failure when using IDE disks I noticed that the error messages from initramfs-module did not really explain the problem, and that my "drop to shell" patch was faulty. Here are the improvement respectively fix.
The following changes since commit 72682d72b52355c3fed947167ca3c6064340ead1:
autotools.bbclass: mkdir ${B} -> mkdir -p ${B} (2015-09-16 22:17:19 +0100)are available in the git repository at:
git://github.com/pohly/openembedded-core initramfs-rootfs-failure
https://github.com/pohly/openembedded-core/tree/initramfs-rootfs-failure
Patrick Ohly (2):
initramfs-framework: fix "support dropping into shell on failure"
initramfs-framework: better error reporting for invalid root boot
parameter
meta/recipes-core/initrdscripts/initramfs-framework/finish | 2 +- meta/recipes-core/initrdscripts/initramfs-framework/init | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.1.4
PATCH 2/2 initramfs-framework: better error reporting for invalid root boot parameter
In reply to Patrick OhlyWhen the "boot" parameter refers to a non-existent device, the only visible output at normal log levels was a rather confusing:
ERROR: There's no '/dev' on rootfs.
That's because the actual error, not being able to find the root device, was only a debug message, which gets ignored in the default mode.
Promoting the "root '$bootparam_root' doesn't exist." message from "debug" to "msg" gives sufficient context to understand the error. A more intrusive change would be to change also the control flow.
--- meta/recipes-core/initrdscripts/initramfs-framework/finish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/initrdscripts/initramfs-framework/finish +1 -1
@@ -37,7 +37,7 @@ finish_run() { fi mount $flags $bootparam_root $ROOTFS_DIR else - debug "root '$bootparam_root' doesn't exist." + msg "root '$bootparam_root' doesn't exist." fi fi
Signature · 1 line
2.1.4
PATCH 1/2 initramfs-framework: fix "support dropping into shell on failure"
In reply to Patrick OhlyDue to a missing $ before the variable name, all fatal errors ended up invoking a shell, instead of only doing that when init_fatal_sh is set as boot parameter.
--- meta/recipes-core/initrdscripts/initramfs-framework/init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/initrdscripts/initramfs-framework/init +1 -1
@@ -58,7 +58,7 @@ fatal() { echo $1 >/dev/console echo >/dev/console - if [ -n "bootparam_init_fatal_sh" ]; then + if [ -n "$bootparam_init_fatal_sh" ]; then sh else while [ "true" ]; do
Signature · 1 line
2.1.4
Re: [PATCH 2/2] initramfs-framework: better error reporting for invalid root boot parameter
In reply to Patrick OhlyQuoted 8 lines · Patrick Ohly
When the "boot" parameter refers to a non-existent device, the only visible output at normal log levels was a rather confusing:
ERROR: There's no '/dev' on rootfs.That's because the actual error, not being able to find the root device, was only a debug message, which gets ignored in the default mode.
Quoted 5 lines
Promoting the "root '$bootparam_root' doesn't exist." message from "debug" to "msg" gives sufficient context to understand the error. A more intrusive change would be to change also the control flow.
Signed-off-by Patrick Ohly <[email protected]>
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
Re: [PATCH 1/2] initramfs-framework: fix "support dropping into shell on failure"
In reply to Patrick OhlyQuoted 5 lines · Patrick Ohly
Due to a missing $ before the variable name, all fatal errors ended up invoking a shell, instead of only doing that when
init_fatal_shis set as boot parameter.Signed-off-by Patrick Ohly <[email protected]>
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750