Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

David Härdeman-2
Package: sysvinit
Version: 2.86.ds1-38
Severity: wishlist
Tags: patch

Hi,

the attached patch changes the sysvinit init.d script(s) to allow splash
scripts to hook into the fsck stage so that special action can be taken
(in the case of usplash, this would be to set a high timeout and to let
the progressbar reflect that an unknown amount of time will be spent
fscking, splashy would probably want something similar).

--
David Härdeman


sysvinit-add_splash_hooks.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#423095: [Pkg-sysvinit-devel] Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

Petter Reinholdtsen
[David Härdeman]
> the attached patch changes the sysvinit init.d script(s) to allow splash
> scripts to hook into the fsck stage so that special action can be taken
> (in the case of usplash, this would be to set a high timeout and to let
> the progressbar reflect that an unknown amount of time will be spent
> fscking, splashy would probably want something similar).

This seem like a good idea to me, and I suspect we should move all the
current usplash hooks into the /lib/init/splash-functions-base file if
we go this way, to make it easier for splasy and others to hook into
the boot system.

Anyone got a complete patch replacing the code in /etc/init.d/rc using
'type usplash_write' to decide what to do?  I suspect at least some
splash_progress is needed. :)

Friendly,
--
Petter Reinholdtsen


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#423095: [Pkg-sysvinit-devel] Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

Otavio Salvador
Petter Reinholdtsen <[hidden email]> writes:

> [David Härdeman]
>> the attached patch changes the sysvinit init.d script(s) to allow splash
>> scripts to hook into the fsck stage so that special action can be taken
>> (in the case of usplash, this would be to set a high timeout and to let
>> the progressbar reflect that an unknown amount of time will be spent
>> fscking, splashy would probably want something similar).
>
> This seem like a good idea to me, and I suspect we should move all the
> current usplash hooks into the /lib/init/splash-functions-base file if
> we go this way, to make it easier for splasy and others to hook into
> the boot system.

I like this idea too. This makes our life easier and all the
integration work much nicer :-D

--
        O T A V I O    S A L V A D O R
---------------------------------------------
 E-mail: [hidden email]      UIN: 5906116
 GNU/Linux User: 239058     GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
 you the whole house."

Reply | Threaded
Open this post in threaded view
|

Bug#423095: [Pkg-sysvinit-devel] Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

David Härdeman-2
In reply to this post by Petter Reinholdtsen
On Wed, May 09, 2007 at 08:38:38PM +0200, Petter Reinholdtsen wrote:

>[David Härdeman]
>> the attached patch changes the sysvinit init.d script(s) to allow splash
>> scripts to hook into the fsck stage so that special action can be taken
>> (in the case of usplash, this would be to set a high timeout and to let
>> the progressbar reflect that an unknown amount of time will be spent
>> fscking, splashy would probably want something similar).
>
>This seem like a good idea to me, and I suspect we should move all the
>current usplash hooks into the /lib/init/splash-functions-base file if
>we go this way, to make it easier for splasy and others to hook into
>the boot system.
Here's a more complete stub (/lib/init/splash-functions-base) file which
should allow many more scripts to use the generic functions.

--
David Härdeman


splash-functions-base (760 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#423095: [Pkg-sysvinit-devel] Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

Petter Reinholdtsen
[David Härdeman]
> Here's a more complete stub (/lib/init/splash-functions-base) file which
> should allow many more scripts to use the generic functions.

This API looks quite good, and I suspect it will handle most needs.
We might need some splash_start_if_not_running() or similar, for the
cases where it need to be restarted.

Also, this function need to have more features:

> # Tells the splash the current boot progress in percent (as $1)
> splash_progress () { return 0; }

In usplash, the progress bar can go both ways, depending on the sign
of the progress value.  It is used during shutdown.  We probably want
to support it in the API.

Also, to stay compatible with the current behaviour, I suspect the
default functions should implement usplash support until usplash
includes the override file in the package.

Friendly,
--
Petter Reinholdtsen


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#423095: [Pkg-sysvinit-devel] Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

David Härdeman-2
On Thu, May 10, 2007 at 10:47:29PM +0200, Petter Reinholdtsen wrote:
>[David Härdeman]
>> Here's a more complete stub (/lib/init/splash-functions-base) file which
>> should allow many more scripts to use the generic functions.
>
>This API looks quite good, and I suspect it will handle most needs.
>We might need some splash_start_if_not_running() or similar, for the
>cases where it need to be restarted.

splash_start would perhaps be enough, that it's a NOP if a splash is
already running is implicit :)

>Also, this function need to have more features:
>
>> # Tells the splash the current boot progress in percent (as $1)
>> splash_progress () { return 0; }
>
>In usplash, the progress bar can go both ways, depending on the sign
>of the progress value.  It is used during shutdown.  We probably want
>to support it in the API.

Yes, should be enough to add one more line stating that shutdown
progress is defined as negative percent values?

>Also, to stay compatible with the current behaviour, I suspect the
>default functions should implement usplash support until usplash
>includes the override file in the package.

Even if we synchronize the uploads of a fixed usplash and sysvinit?

usplash is a bit broken right now with the integration with different
boot scripts so I'm not sure it's necessary...

--
David Härdeman


Reply | Threaded
Open this post in threaded view
|

Bug#423095: [Pkg-sysvinit-devel] Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

David Härdeman-2
In reply to this post by Petter Reinholdtsen
On Thu, May 10, 2007 at 10:47:29PM +0200, Petter Reinholdtsen wrote:

>[David Härdeman]
>> Here's a more complete stub (/lib/init/splash-functions-base) file which
>> should allow many more scripts to use the generic functions.
>
>This API looks quite good, and I suspect it will handle most needs.
>We might need some splash_start_if_not_running() or similar, for the
>cases where it need to be restarted.
>
>Also, this function need to have more features:
>
>> # Tells the splash the current boot progress in percent (as $1)
>> splash_progress () { return 0; }
>
>In usplash, the progress bar can go both ways, depending on the sign
>of the progress value.  It is used during shutdown.  We probably want
>to support it in the API.
I've thought a bit more about the API and also experimented with
implementing it in some different scripts which uncovered some more
functionality that was needed.

I've attached a new version of the hooks and an example implementation
for usplash to give you a fell of how it would work when implemented.

Please review.

--
David Härdeman


splash-functions-usplash (1K) Download Attachment
splash-functions-base (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#423095: [Pkg-sysvinit-devel] Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

Petter Reinholdtsen
[David Härdeman]
> I've attached a new version of the hooks and an example
> implementation for usplash to give you a fell of how it would work
> when implemented.

Looks quite good.  I have not tested it yet, but I noticed this line
which make me believe it only work with bash:

> local i

At least I suspect it isn't supported by all shells.  Did you test it
with /bin/sh -> dash?

Friendly,
--
Petter Reinholdtsen


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#423095: [Pkg-sysvinit-devel] Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

Maximilian Attems-3
On Sat, May 12, 2007 at 02:08:09PM +0200, Petter Reinholdtsen wrote:
> > local i
>
> At least I suspect it isn't supported by all shells.  Did you test it
> with /bin/sh -> dash?

according to dash(1)

        local [variable | -] ...

Local is implemented as a builtin command.

--
maks


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#423095: [Pkg-sysvinit-devel] Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

Otavio Salvador
In reply to this post by David Härdeman-2
David Härdeman <[hidden email]> writes:

> Please review.

Hello David,

There're some indentation mistakes (mixing tabs and spaces) and also I
don't like the  private_splash_progress method name. A better name
might be custom_splash_progress or my_splash_progress. Private looks
like something that ought not be touched.

--
        O T A V I O    S A L V A D O R
---------------------------------------------
 E-mail: [hidden email]      UIN: 5906116
 GNU/Linux User: 239058     GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
 you the whole house."

Reply | Threaded
Open this post in threaded view
|

Bug#423095: [Pkg-sysvinit-devel] Bug#423095: sysvinit: Allow bootsplash packages to hook into fsck events

David Härdeman-2
On Sat, May 12, 2007 at 10:20:58AM -0300, Otavio Salvador wrote:

>David Härdeman <[hidden email]> writes:
>
>> Please review.
>
>Hello David,
>
>There're some indentation mistakes (mixing tabs and spaces) and also I
>don't like the  private_splash_progress method name. A better name
>might be custom_splash_progress or my_splash_progress. Private looks
>like something that ought not be touched.

Sounds reasonable...I wont post a new file though since that should be
trivial to change for whoever commits them (if someone asks for it I can
of course do it).

--
David Härdeman