fast-booting Debian
Fabio Fabbri
fabio at llgp.org
Mon Aug 1 14:09:27 UTC 2005
> http://www.hoeg.org/blog/2005/07/27/fast-booting-debian/
Nooo, you stole my idea! I had to patent it :)
I'm thinking on a way to implement parallelized boot since the last
release of my live distro (http://www.llgp.org). I, too, think it could
be implemented modifying "/etc/init.d/rc".
I think your hack could be improved modifying the "startup" function.
Actually it looks like:
startup() {
case "$1" in
*.sh)
$debug sh "$@"
;;
*)
$debug "$@"
;;
esac
}
but it may become:
startup() {
DEPENDS=$(getDependencies $1);
for i in $DEPENDS; do
isStarted $i
done
case "$1" in
*.sh)
$debug sh "$@"
;;
*)
$debug "$@"
;;
esac
if [ $? -eq 0 ]
then
setStarted $1
else
# The script failed, do something!
fi
}
Where getDependencies is something that writes on the standard output
all the scripts needed by another script.
isStarted is something that asks to a daemon if a startup script was
started. It doesn't return until the script is started. The daemon must
be started before.
setStarted is something that tell to the daemon that this script is
started and all scripts waiting on isStarted can go on.
Another way to implement a parallelized boot could be replacing
/etc/init.d/rc with a c program that builds the Directed Acyclic Graph
of the startup scripts, then it can try to start them with the right
order. Could it be a better solution? Can we find other better solutions?
I'm going to begin a little project for my live distro (and perhaps
other distros), and I would call it "bootster". I hope to add this kind
of initscript, but I will try also to build a good initial ram disk that
can find hardware and boot the system as fast as possible.
Regards
Fabio
More information about the initscripts-ng-devel
mailing list