On Mon, 17 Aug 2015 10:52:14 +0100 Andy Whitcroft <[email protected]> wrote: > Package: initramfs-tools > Version: 0.120 > Severity: normal > > Allow hooks to supply specific root mount failure handlers. These can > both report more specific failure reasons, and in some cases may even be > able to attempt recovery. This is useful for more complex scenarios > such as LVM and mdadm setups. > > We use this in Ubuntu to allow augmented lvm2 and mdadm hooks to recover > failed raids and the like. > > NOTE: that the splash handling here may well be Ubuntu specific.
Thanks for your patch.
Can you explain why this was implemented by extending existing scripts
rather than by adding a new phase (possibly with stamp files to control
what they do)?
[...]
> --- a/scripts/functions
> +++ b/scripts/functions
[...]
> +# Run failure hooks.
> +# When a failure hook exits "1", it has not done anything to correct the
> +# system. Exiting "0" means that something has been attempted to resolve
> +# the lack of a root filesystem.
> +# Hooks are run in lexigraphical order, and are responsible for removing
> +# themselves if they should not re-run in a later cycle. When one exits
> +# "0", the stack is stopped, so the caller can return to the main rootfs
> +# wait loop.
'Hook' is reserved for build-time scripts, so use 'script' here.
> +try_failure_hooks()
> +{
> + local hook
> +
> + # Disable usplash so text from hooks can be seen
> + if [ -x /sbin/usplash_write ]; then
> + /sbin/usplash_write "QUIT"
> + fi
> + chvt 1
> + if [ -x /bin/plymouth ] && plymouth --ping; then
> + /bin/plymouth hide-splash > /dev/null 2>&1
> + fi
[...]
This bit can be handled by 'panic' scripts once #602331 is fixed
(currently pending).
Ben.
--
Ben Hutchings
I'm always amazed by the number of people who take up solipsism because
they heard someone else explain it. - E*Borg on alt.fan.pratchett
signature.asc
Description: This is a digitally signed message part

