All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Cc: initramfs <initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: check_finished() syntax weirdness
Date: Tue, 13 May 2014 12:22:08 +0200	[thread overview]
Message-ID: <5371F250.9040708@redhat.com> (raw)
In-Reply-To: <5371EC2E.4020209-l3A5Bk7waGM@public.gmane.org>

On 13.05.2014 11:55, Hannes Reinecke wrote:
> On 05/13/2014 11:48 AM, Harald Hoyer wrote:
>> On 13.05.2014 11:44, Hannes Reinecke wrote:
>>> Hi all,
>>>
>>> I'm trying to figure out why my initqueue scripts are never called.
>>> Eg 95fcoe is just installing an initqueue job, which should call
>>> 'fcoe-up' on the interface.
>>> However, this script is never called, irrespective of any 'fcoe=' parameters.
>>>
>>> Looking a dracut-initqueue.sh, we have this:
>>>
>>> while :; do
>>>
>>>      check_finished && break
>>>
>>>      udevadm settle --exit-if-exists=$hookdir/initqueue/work
>>>
>>>      check_finished && break
>>>
>>>      if [ -f $hookdir/initqueue/work ]; then
>>>          rm -f -- "$hookdir/initqueue/work"
>>>      fi
>>>
>>>      for job in $hookdir/initqueue/*.sh; do
>>>          [ -e "$job" ] || break
>>>          job=$job . $job
>>>          check_finished && break 2
>>>      done
>>>
>>>      udevadm settle --timeout=0 >/dev/null 2>&1 || continue
>>> ...
>>>
>>> and check_finished is:
>>>
>>> check_finished() {
>>>      local f
>>>      for f in $hookdir/initqueue/finished/*.sh; do
>>>          [ "$f" = "$hookdir/initqueue/finished/*.sh" ] && return 0
>>>          { [ -e "$f" ] && ( . "$f" ) ; } || return 1
>>>      done
>>>      return 0
>>> }
>>>
>>> IE if no scripts are present in the 'finished' queue, 'check_finished' will
>>> return '0', causing the main initqueue to short-circuit and the actual
>>> initqueue jobs will never be executed.
>>>
>>> Is this the intended outcome?
>>> IE are all jobs for the initqueue are _required_ to supply a 'finished' job?
>>>
>>> I would have thought it to be a bit more permissive, ie do a
>>> 'return 1' if no finish j0bs have been found ...
>>>
>>> Cheers,
>>>
>>> Hannes
>>
>> Yes, the finished queue defines when to end the main loop. If you want to hang
>> around in the main loop, you have to define the "break" condition, or in this
>> case the negative-continue condition.
> 
> Ah. So fcoe never worked?
> (As it doesn't supply an 'finished' script)
> 
> Cheers,
> 
> Hannes

What do you mean? Normally there are "finished" scripts installed, which wait
for the root device to appear. So the loop continues until the fcoe device appears.

  parent reply	other threads:[~2014-05-13 10:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13  9:44 check_finished() syntax weirdness Hannes Reinecke
     [not found] ` <5371E992.1080802-l3A5Bk7waGM@public.gmane.org>
2014-05-13  9:48   ` Harald Hoyer
     [not found]     ` <5371EA56.3000203-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-05-13  9:55       ` Hannes Reinecke
     [not found]         ` <5371EC2E.4020209-l3A5Bk7waGM@public.gmane.org>
2014-05-13 10:22           ` Harald Hoyer [this message]
     [not found]             ` <5371F250.9040708-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-05-13 10:30               ` Hannes Reinecke
     [not found]                 ` <5371F448.5030208-l3A5Bk7waGM@public.gmane.org>
2014-05-13 10:39                   ` Harald Hoyer
     [not found]                     ` <5371F645.3080309-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-05-13 10:42                       ` Hannes Reinecke
     [not found]                         ` <5371F729.2000100-l3A5Bk7waGM@public.gmane.org>
2014-05-13 12:10                           ` Harald Hoyer
     [not found]                             ` <53720BCF.5080806-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-05-13 14:21                               ` Hannes Reinecke
     [not found]                                 ` <53722A84.7080205-l3A5Bk7waGM@public.gmane.org>
2014-05-13 14:32                                   ` Harald Hoyer
     [not found]                                     ` <53722CFC.6060500-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-05-20  8:46                                       ` Hannes Reinecke
     [not found]                                         ` <537B1677.9050402-l3A5Bk7waGM@public.gmane.org>
2014-05-20  9:18                                           ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5371F250.9040708@redhat.com \
    --to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=hare-l3A5Bk7waGM@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.