All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Add an exception handle check function
@ 2012-12-21  8:55 Baoquan He
       [not found] ` <76d7b2f339455dcea6a2827b004bfcd9c6fa2315.1356080083.git.bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Baoquan He @ 2012-12-21  8:55 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Baoquan He

In some cases, exception happened, default handling is called. However,
user may not like the handling, want to specify a handler for these
exceptions.

Add an exception handle check function. Call it where exceptions happened,
and specify a extra special handler. If user want the special handler handles
this exception, related cmdline is added.

Then Dracut will check the cmdline, if related cmdline exists, call the
specified handler; if not, call the default handler.

The function can be called like below:
exception_handle_check -h continue_on_fail

Signed-off-by: Baoquan He <bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 modules.d/99base/dracut-lib.sh |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index cc6c7e8..35ed3a3 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -938,6 +938,46 @@ emergency_shell()
     [ -e /run/initramfs/.die ] && exit 1
 }
 
+exception_handle_check()
+{
+    local action_wanted
+    if [ "$1" = "-h" ]; then
+        [ $# -le 1 ] && echo "No exception handler specified" && emergency_shell
+        action_wanted=$2; 
+        case "$action_wanted" in
+        continue_on_fail)
+            ;;
+        reboot)
+            ;;
+        emergency_shell)
+            ;;
+        *)
+            echo "Wrong exception handler input: $action_wanted"
+            action_wanted=emergency_shell
+        esac
+    else
+        action_wanted=emergency_shell
+    fi
+
+    case "$action_wanted" in
+    continue_on_fail)
+        action=$(getarg rd.exceptionhandler=)
+        [ -z "$action" -o  "$action" != "continue_on_fail" ]  && emergency_shell
+        ;;
+    emergency_shell)
+        emergency_shell
+        ;;
+    reboot)
+        reboot -f
+        ;;
+    *) #default
+        ##impossible come here
+        ;;
+    esac
+
+    return 0
+}
+
 # Retain the values of these variables but ensure that they are unexported
 # This is a POSIX-compliant equivalent of bash's "export -n"
 export_n()
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] Specify a special handler when initqueue timeout
       [not found] ` <76d7b2f339455dcea6a2827b004bfcd9c6fa2315.1356080083.git.bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-12-21  8:55   ` Baoquan He
  2012-12-21  8:55   ` [PATCH 3/3] Add a special handler when mount rootfs failed Baoquan He
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Baoquan He @ 2012-12-21  8:55 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Baoquan He

In kdump, When the dump device was removed, dracut will drop to shell
during second kernel boot. That means kdump isn't even started. But
in this case, if the target isn't presented, we should dump to a rootfs
device as a default action.

Here call exception_handle_check and specify a handler continue_on_fail
which may be wanted by user, like kdump. If kdump add a cmdline like
rd.exceptionhandler=continue_on_fail, then nothoing done and go on. If
no cmdline rd.exceptionhandler=continue_on_fail added, just drop into
shell as before.

Signed-off-by: Baoquan He <bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 modules.d/98systemd/dracut-initqueue.sh |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
index e9da432..c10b32f 100755
--- a/modules.d/98systemd/dracut-initqueue.sh
+++ b/modules.d/98systemd/dracut-initqueue.sh
@@ -17,6 +17,7 @@ RDRETRY=${RDRETRY:-30}
 RDRETRY=$(($RDRETRY*2))
 export RDRETRY
 
+failure="no"
 main_loop=0
 export main_loop
 
@@ -61,9 +62,14 @@ while :; do
     fi
 
     main_loop=$(($main_loop+1))
-    [ $main_loop -gt $RDRETRY ] && emergency_shell "Could not boot."
+    [ $main_loop -gt $RDRETRY ] && failure="yes" && break 
 done
 
+if [ "$failure" = "yes" ]; then
+    failure="no"
+    exception_handler_check -h "continue_on_fail" "Could not boot"
+fi
+
 unset job
 unset queuetriggered
 unset main_loop
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] Add a special handler when mount rootfs failed
       [not found] ` <76d7b2f339455dcea6a2827b004bfcd9c6fa2315.1356080083.git.bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2012-12-21  8:55   ` [PATCH 2/3] Specify a special handler when initqueue timeout Baoquan He
@ 2012-12-21  8:55   ` Baoquan He
       [not found]     ` <d98a268350d0f13f6dd4d464a1a21517668eeb57.1356080083.git.bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2012-12-21  9:30   ` [PATCH 1/3] Add an exception handle check function Baoquan
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Baoquan He @ 2012-12-21  8:55 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Baoquan He

Dracut will drop into shell in case anything wrong with rootfs mounting,
but for kdump we does not depends on rootfs for non-rootfs dump and
kdump will handle the default fail action based on user configuration
in /etc/kdump.conf.

Here call exception_handle_check and specify a handler continue_on_fail.
If user add a cmdline like rd.exceptionhandler=continue_on_fail, then
go on. If no cmdline rd.exceptionhandler=continue_on_fail added, just
drop into shell as before.

Signed-off-by: Baoquan He <bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 modules.d/98systemd/dracut-initqueue.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
index c10b32f..1d8d5a5 100755
--- a/modules.d/98systemd/dracut-initqueue.sh
+++ b/modules.d/98systemd/dracut-initqueue.sh
@@ -102,9 +102,14 @@ while :; do
     done
 
     i=$(($i+1))
-    [ $i -gt 20 ] && emergency_shell "Can't mount root filesystem"
+    [ $i -gt 20 ] && failure='yes' $$ break
 done
 
+if [ "$failure" = "yes" ]; then
+    exception_handle_check -h "continue_on_fail" "Can't mount root filesystem"
+    failure="no"
+fi
+
 {
     echo -n "Mounted root filesystem "
     while read dev mp rest; do [ "$mp" = "$NEWROOT" ] && echo $dev; done < /proc/mounts
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] Add an exception handle check function
       [not found] ` <76d7b2f339455dcea6a2827b004bfcd9c6fa2315.1356080083.git.bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2012-12-21  8:55   ` [PATCH 2/3] Specify a special handler when initqueue timeout Baoquan He
  2012-12-21  8:55   ` [PATCH 3/3] Add a special handler when mount rootfs failed Baoquan He
@ 2012-12-21  9:30   ` Baoquan
  2013-01-15  7:22   ` Baoquan
  2013-01-17 10:03   ` Dave Young
  4 siblings, 0 replies; 9+ messages in thread
From: Baoquan @ 2012-12-21  9:30 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Vivek Goyal, Dave Young

Sorry, cc Vivek and Dave.


On 12/21/2012 04:55 PM, Baoquan He wrote:
> In some cases, exception happened, default handling is called. However,
> user may not like the handling, want to specify a handler for these
> exceptions.
>
> Add an exception handle check function. Call it where exceptions happened,
> and specify a extra special handler. If user want the special handler handles
> this exception, related cmdline is added.
>
> Then Dracut will check the cmdline, if related cmdline exists, call the
> specified handler; if not, call the default handler.
>
> The function can be called like below:
> exception_handle_check -h continue_on_fail
>
> Signed-off-by: Baoquan He<bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>   modules.d/99base/dracut-lib.sh |   40 ++++++++++++++++++++++++++++++++++++++++
>   1 files changed, 40 insertions(+), 0 deletions(-)
>
> diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
> index cc6c7e8..35ed3a3 100755
> --- a/modules.d/99base/dracut-lib.sh
> +++ b/modules.d/99base/dracut-lib.sh
> @@ -938,6 +938,46 @@ emergency_shell()
>       [ -e /run/initramfs/.die ]&&  exit 1
>   }
>
> +exception_handle_check()
> +{
> +    local action_wanted
> +    if [ "$1" = "-h" ]; then
> +        [ $# -le 1 ]&&  echo "No exception handler specified"&&  emergency_shell
> +        action_wanted=$2;
> +        case "$action_wanted" in
> +        continue_on_fail)
> +            ;;
> +        reboot)
> +            ;;
> +        emergency_shell)
> +            ;;
> +        *)
> +            echo "Wrong exception handler input: $action_wanted"
> +            action_wanted=emergency_shell
> +        esac
> +    else
> +        action_wanted=emergency_shell
> +    fi
> +
> +    case "$action_wanted" in
> +    continue_on_fail)
> +        action=$(getarg rd.exceptionhandler=)
> +        [ -z "$action" -o  "$action" != "continue_on_fail" ]&&  emergency_shell
> +        ;;
> +    emergency_shell)
> +        emergency_shell
> +        ;;
> +    reboot)
> +        reboot -f
> +        ;;
> +    *) #default
> +        ##impossible come here
> +        ;;
> +    esac
> +
> +    return 0
> +}
> +
>   # Retain the values of these variables but ensure that they are unexported
>   # This is a POSIX-compliant equivalent of bash's "export -n"
>   export_n()

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] Add a special handler when mount rootfs failed
       [not found]     ` <d98a268350d0f13f6dd4d464a1a21517668eeb57.1356080083.git.bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-12-31  8:12       ` Baoquan
  0 siblings, 0 replies; 9+ messages in thread
From: Baoquan @ 2012-12-31  8:12 UTC (permalink / raw)
  To: Baoquan He; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On 12/21/2012 04:55 PM, Baoquan He wrote:
> Dracut will drop into shell in case anything wrong with rootfs mounting,
> but for kdump we does not depends on rootfs for non-rootfs dump and
> kdump will handle the default fail action based on user configuration
> in /etc/kdump.conf.
>
> Here call exception_handle_check and specify a handler continue_on_fail.
> If user add a cmdline like rd.exceptionhandler=continue_on_fail, then
> go on. If no cmdline rd.exceptionhandler=continue_on_fail added, just
> drop into shell as before.
>
> Signed-off-by: Baoquan He<bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>   modules.d/98systemd/dracut-initqueue.sh |    7 ++++++-
>   1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
> index c10b32f..1d8d5a5 100755
> --- a/modules.d/98systemd/dracut-initqueue.sh
> +++ b/modules.d/98systemd/dracut-initqueue.sh
> @@ -102,9 +102,14 @@ while :; do
>       done
>
>       i=$(($i+1))
> -    [ $i -gt 20 ]&&  emergency_shell "Can't mount root filesystem"
In below code "$$" should be "&&". I tested this patchset by changing 
mount-loop limitation count to 1.
     +    [ $i -gt 20 ] && failure='yes' && break
> +    [ $i -gt 20 ]&&  failure='yes' $$ break
>   done
>
> +if [ "$failure" = "yes" ]; then
> +    exception_handle_check -h "continue_on_fail" "Can't mount root filesystem"
> +    failure="no"
> +fi
> +
>   {
>       echo -n "Mounted root filesystem "
>       while read dev mp rest; do [ "$mp" = "$NEWROOT" ]&&  echo $dev; done<  /proc/mounts

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] Add an exception handle check function
       [not found] ` <76d7b2f339455dcea6a2827b004bfcd9c6fa2315.1356080083.git.bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (2 preceding siblings ...)
  2012-12-21  9:30   ` [PATCH 1/3] Add an exception handle check function Baoquan
@ 2013-01-15  7:22   ` Baoquan
  2013-01-17 10:03   ` Dave Young
  4 siblings, 0 replies; 9+ messages in thread
From: Baoquan @ 2013-01-15  7:22 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

Hi Harald,

Could you review this patchset and give some suggestion?

Thanks a lot!


On 12/21/2012 04:55 PM, Baoquan He wrote:
> In some cases, exception happened, default handling is called. However,
> user may not like the handling, want to specify a handler for these
> exceptions.
>
> Add an exception handle check function. Call it where exceptions happened,
> and specify a extra special handler. If user want the special handler handles
> this exception, related cmdline is added.
>
> Then Dracut will check the cmdline, if related cmdline exists, call the
> specified handler; if not, call the default handler.
>
> The function can be called like below:
> exception_handle_check -h continue_on_fail
>
> Signed-off-by: Baoquan He<bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>   modules.d/99base/dracut-lib.sh |   40 ++++++++++++++++++++++++++++++++++++++++
>   1 files changed, 40 insertions(+), 0 deletions(-)
>
> diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
> index cc6c7e8..35ed3a3 100755
> --- a/modules.d/99base/dracut-lib.sh
> +++ b/modules.d/99base/dracut-lib.sh
> @@ -938,6 +938,46 @@ emergency_shell()
>       [ -e /run/initramfs/.die ]&&  exit 1
>   }
>
> +exception_handle_check()
> +{
> +    local action_wanted
> +    if [ "$1" = "-h" ]; then
> +        [ $# -le 1 ]&&  echo "No exception handler specified"&&  emergency_shell
> +        action_wanted=$2;
> +        case "$action_wanted" in
> +        continue_on_fail)
> +            ;;
> +        reboot)
> +            ;;
> +        emergency_shell)
> +            ;;
> +        *)
> +            echo "Wrong exception handler input: $action_wanted"
> +            action_wanted=emergency_shell
> +        esac
> +    else
> +        action_wanted=emergency_shell
> +    fi
> +
> +    case "$action_wanted" in
> +    continue_on_fail)
> +        action=$(getarg rd.exceptionhandler=)
> +        [ -z "$action" -o  "$action" != "continue_on_fail" ]&&  emergency_shell
> +        ;;
> +    emergency_shell)
> +        emergency_shell
> +        ;;
> +    reboot)
> +        reboot -f
> +        ;;
> +    *) #default
> +        ##impossible come here
> +        ;;
> +    esac
> +
> +    return 0
> +}
> +
>   # Retain the values of these variables but ensure that they are unexported
>   # This is a POSIX-compliant equivalent of bash's "export -n"
>   export_n()

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] Add an exception handle check function
       [not found] ` <76d7b2f339455dcea6a2827b004bfcd9c6fa2315.1356080083.git.bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (3 preceding siblings ...)
  2013-01-15  7:22   ` Baoquan
@ 2013-01-17 10:03   ` Dave Young
       [not found]     ` <50F7CC85.5060303-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  4 siblings, 1 reply; 9+ messages in thread
From: Dave Young @ 2013-01-17 10:03 UTC (permalink / raw)
  To: Baoquan He; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On 12/21/2012 04:55 PM, Baoquan He wrote:
> In some cases, exception happened, default handling is called. However,
> user may not like the handling, want to specify a handler for these
> exceptions.
> 
> Add an exception handle check function. Call it where exceptions happened,
> and specify a extra special handler. If user want the special handler handles
> this exception, related cmdline is added.
> 
> Then Dracut will check the cmdline, if related cmdline exists, call the
> specified handler; if not, call the default handler.
> 
> The function can be called like below:
> exception_handle_check -h continue_on_fail

I think exception_handle is not a good name, how about use "failaction"
instead?

And maybe use below action names:
failaction=continue/shell

IMHO, reboot is not useful for usual initrd. For kdump add a "continue"
is enough because kdump module will handle failure of itself as long as
dracut ignore previous failures.

These 3 patches should better to be one patch. Or split them to 2
patches as below
1/2: make emergency_shell as a fail action
2/2: add a new fail action of "continue"

> 
> Signed-off-by: Baoquan He <bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  modules.d/99base/dracut-lib.sh |   40 ++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 40 insertions(+), 0 deletions(-)
> 
> diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
> index cc6c7e8..35ed3a3 100755
> --- a/modules.d/99base/dracut-lib.sh
> +++ b/modules.d/99base/dracut-lib.sh
> @@ -938,6 +938,46 @@ emergency_shell()
>      [ -e /run/initramfs/.die ] && exit 1
>  }
>  
> +exception_handle_check()
> +{
> +    local action_wanted
> +    if [ "$1" = "-h" ]; then
> +        [ $# -le 1 ] && echo "No exception handler specified" && emergency_shell

Not necessary use "-h", just make shell as the default action.

Add a functions like get_fail_action(), and do_fail_action(), call them
at different points.

> +        action_wanted=$2; 
> +        case "$action_wanted" in
> +        continue_on_fail)
> +            ;;
> +        reboot)
> +            ;;
> +        emergency_shell)
> +            ;;
> +        *)
> +            echo "Wrong exception handler input: $action_wanted"
> +            action_wanted=emergency_shell
> +        esac
> +    else
> +        action_wanted=emergency_shell
> +    fi
> +
> +    case "$action_wanted" in
> +    continue_on_fail)
> +        action=$(getarg rd.exceptionhandler=)
> +        [ -z "$action" -o  "$action" != "continue_on_fail" ]  && emergency_shell
> +        ;;
> +    emergency_shell)
> +        emergency_shell
> +        ;;
> +    reboot)
> +        reboot -f
> +        ;;
> +    *) #default
> +        ##impossible come here
> +        ;;
> +    esac
> +
> +    return 0
> +}
> +
>  # Retain the values of these variables but ensure that they are unexported
>  # This is a POSIX-compliant equivalent of bash's "export -n"
>  export_n()
> 


-- 
Thanks
Dave


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] Add an exception handle check function
       [not found]     ` <50F7CC85.5060303-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2013-01-18  2:06       ` Dave Young
  2013-01-24  3:12       ` Baoquan
  1 sibling, 0 replies; 9+ messages in thread
From: Dave Young @ 2013-01-18  2:06 UTC (permalink / raw)
  To: Baoquan He; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On 01/17/2013 06:03 PM, Dave Young wrote:
> On 12/21/2012 04:55 PM, Baoquan He wrote:
>> In some cases, exception happened, default handling is called. However,
>> user may not like the handling, want to specify a handler for these
>> exceptions.
>>
>> Add an exception handle check function. Call it where exceptions happened,
>> and specify a extra special handler. If user want the special handler handles
>> this exception, related cmdline is added.
>>
>> Then Dracut will check the cmdline, if related cmdline exists, call the
>> specified handler; if not, call the default handler.
>>
>> The function can be called like below:
>> exception_handle_check -h continue_on_fail
> 
> I think exception_handle is not a good name, how about use "failaction"
> instead?
> 
> And maybe use below action names:
> failaction=continue/shell
> 
> IMHO, reboot is not useful for usual initrd. For kdump add a "continue"
> is enough because kdump module will handle failure of itself as long as
> dracut ignore previous failures.
> 
> These 3 patches should better to be one patch. Or split them to 2
> patches as below
> 1/2: make emergency_shell as a fail action
> 2/2: add a new fail action of "continue"
> 
>>
>> Signed-off-by: Baoquan He <bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> ---
>>  modules.d/99base/dracut-lib.sh |   40 ++++++++++++++++++++++++++++++++++++++++
>>  1 files changed, 40 insertions(+), 0 deletions(-)
>>
>> diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
>> index cc6c7e8..35ed3a3 100755
>> --- a/modules.d/99base/dracut-lib.sh
>> +++ b/modules.d/99base/dracut-lib.sh
>> @@ -938,6 +938,46 @@ emergency_shell()
>>      [ -e /run/initramfs/.die ] && exit 1
>>  }
>>  
>> +exception_handle_check()
>> +{
>> +    local action_wanted
>> +    if [ "$1" = "-h" ]; then
>> +        [ $# -le 1 ] && echo "No exception handler specified" && emergency_shell
> 
> Not necessary use "-h", just make shell as the default action.
> 
> Add a functions like get_fail_action(), and do_fail_action(), call them
> at different points.
> 
>> +        action_wanted=$2; 
>> +        case "$action_wanted" in
>> +        continue_on_fail)
>> +            ;;
>> +        reboot)
>> +            ;;
>> +        emergency_shell)
>> +            ;;
>> +        *)
>> +            echo "Wrong exception handler input: $action_wanted"
>> +            action_wanted=emergency_shell
>> +        esac
>> +    else
>> +        action_wanted=emergency_shell
>> +    fi
>> +
>> +    case "$action_wanted" in
>> +    continue_on_fail)
>> +        action=$(getarg rd.exceptionhandler=)

Another thing is, doc also need update for the new cmdline param

>> +        [ -z "$action" -o  "$action" != "continue_on_fail" ]  && emergency_shell
>> +        ;;
>> +    emergency_shell)
>> +        emergency_shell
>> +        ;;
>> +    reboot)
>> +        reboot -f
>> +        ;;
>> +    *) #default
>> +        ##impossible come here
>> +        ;;
>> +    esac
>> +
>> +    return 0
>> +}
>> +
>>  # Retain the values of these variables but ensure that they are unexported
>>  # This is a POSIX-compliant equivalent of bash's "export -n"
>>  export_n()
>>
> 
> 


-- 
Thanks
Dave


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] Add an exception handle check function
       [not found]     ` <50F7CC85.5060303-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2013-01-18  2:06       ` Dave Young
@ 2013-01-24  3:12       ` Baoquan
  1 sibling, 0 replies; 9+ messages in thread
From: Baoquan @ 2013-01-24  3:12 UTC (permalink / raw)
  To: Dave Young; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On 01/17/2013 06:03 PM, Dave Young wrote:
>> In some cases, exception happened, default handling is called. However,
>> >  user may not like the handling, want to specify a handler for these
>> >  exceptions.
>> >  
>> >  Add an exception handle check function. Call it where exceptions happened,
>> >  and specify a extra special handler. If user want the special handler handles
>> >  this exception, related cmdline is added.
>> >  
>> >  Then Dracut will check the cmdline, if related cmdline exists, call the
>> >  specified handler; if not, call the default handler.
>> >  
>> >  The function can be called like below:
>> >  exception_handle_check -h continue_on_fail
> I think exception_handle is not a good name, how about use "failaction"
> instead?
>
> And maybe use below action names:
> failaction=continue/shell
>
> IMHO, reboot is not useful for usual initrd. For kdump add a "continue"
> is enough because kdump module will handle failure of itself as long as
> dracut ignore previous failures.
>
> These 3 patches should better to be one patch. Or split them to 2
> patches as below
> 1/2: make emergency_shell as a fail action
> 2/2: add a new fail action of "continue"
>
I hesitated to name this function, maybe failaction is a good name.

I thought at least there were 3 options, 'continue_on_fail', 
'emergency_shell'  and 'reboot'. After thinking, maybe 'reboot' is not 
necessary. After all rebooting system may not be wanted by user after a 
fail occurred,.

If only 'continue_on_fail' and 'emergency_shell', things will be easier. 
The only question is all insert point of the failaction will take the 
same action. e.g mount loop for rootfs, inirqueue loop and dump target 
mount loop, if user add the  cmdline:
failaction=continue_on_fail
Then all insert point will do the continue on fail.

Anyway, I will repost based on two options 'continue_on_fail' and 
'emergency_shell'.

Baoquan
Thanks a lot!



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-01-24  3:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-21  8:55 [PATCH 1/3] Add an exception handle check function Baoquan He
     [not found] ` <76d7b2f339455dcea6a2827b004bfcd9c6fa2315.1356080083.git.bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-12-21  8:55   ` [PATCH 2/3] Specify a special handler when initqueue timeout Baoquan He
2012-12-21  8:55   ` [PATCH 3/3] Add a special handler when mount rootfs failed Baoquan He
     [not found]     ` <d98a268350d0f13f6dd4d464a1a21517668eeb57.1356080083.git.bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-12-31  8:12       ` Baoquan
2012-12-21  9:30   ` [PATCH 1/3] Add an exception handle check function Baoquan
2013-01-15  7:22   ` Baoquan
2013-01-17 10:03   ` Dave Young
     [not found]     ` <50F7CC85.5060303-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-18  2:06       ` Dave Young
2013-01-24  3:12       ` Baoquan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.