[arch-dev-public] [PATCH] Add boot probing hooks
Initscripts now export their state to an arbitrary boot logging/probing program. This opens up the possibility for advanced boot profiling, among other interesting uses. --- functions | 17 +++++++++++++++++ rc.conf | 1 - rc.multi | 6 ++++++ rc.shutdown | 2 ++ rc.sysinit | 10 ++++++++++ 5 files changed, 35 insertions(+), 1 deletions(-) diff --git a/functions b/functions index 8b5ecf1..ebde3ca 100644 --- a/functions +++ b/functions @@ -3,6 +3,19 @@ # functions # +# source boot monitoring functions and settings +if [ -x "${BOOT_PROBE}" ]; then + source /etc/`basename ${BOOT_PROBE}`.conf &>/dev/null + source /etc/rc.d/`basename ${BOOT_PROBE}`-functions + emit_state() { + ${BOOT_PROBE} $@ + } +else + emit_state() { + : + } +fi + # width: STAT_COL=$(stty size) @@ -81,6 +94,7 @@ stat_bkgd() { echo -ne "$C_OTHER$PREFIX_REG $C_MAIN$1$C_CLEAR " deltext echo -ne " $C_OTHER[${C_BKGD}BKGD$C_OTHER]$C_CLEAR " + emit_state bkgd } stat_busy() { @@ -88,6 +102,7 @@ stat_busy() { echo -ne "${SAVE_POSITION}" deltext echo -ne " $C_OTHER[${C_BUSY}BUSY$C_OTHER]$C_CLEAR " + emit_state busy } stat_append() { @@ -99,11 +114,13 @@ stat_append() { stat_done() { deltext echo -e " $C_OTHER[${C_DONE}DONE$C_OTHER]$C_CLEAR " + emit_state done } stat_fail() { deltext echo -e " $C_OTHER[${C_FAIL}FAIL$C_OTHER]$C_CLEAR " + emit_state fail } stat_die() { diff --git a/rc.conf b/rc.conf index 43a597e..167b65f 100644 --- a/rc.conf +++ b/rc.conf @@ -89,5 +89,4 @@ ROUTES=(!gateway) # DAEMONS=(syslog-ng network netfs crond) - # End of file diff --git a/rc.multi b/rc.multi index 8050e98..5c4a3b3 100755 --- a/rc.multi +++ b/rc.multi @@ -6,6 +6,8 @@ . /etc/rc.conf . /etc/rc.d/functions +emit_state multi_startup + # Load sysctl variables if sysctl.conf is present [ -r /etc/sysctl.conf ] && /sbin/sysctl -q -p &>/dev/null @@ -14,9 +16,11 @@ for daemon in "${DAEMONS[@]}"; do if [ "$daemon" = "${daemon#!}" ]; then if [ "$daemon" = "${daemon#@}" ]; then /etc/rc.d/$daemon start + emit_state multi_progress else stat_bkgd "Starting ${daemon:1}" (/etc/rc.d/${daemon:1} start) &>/dev/null & + emit_state multi_progress_bkgd fi fi done @@ -25,4 +29,6 @@ if [ -x /etc/rc.local ]; then /etc/rc.local fi +emit_state exit + # vim: set ts=2 noet: diff --git a/rc.shutdown b/rc.shutdown index 19cb00f..a1771a8 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -6,6 +6,8 @@ . /etc/rc.conf . /etc/rc.d/functions +emit_state shutdown + # avoid staircase effect /bin/stty onlcr diff --git a/rc.sysinit b/rc.sysinit index f4729bf..6559f3f 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -6,6 +6,8 @@ . /etc/rc.conf . /etc/rc.d/functions +emit_state boot + echo " " printhl "Arch Linux $C_OTHER(${C_H2}Core Dump$C_OTHER)\n" printhl "${C_H2}http://www.archlinux.org" @@ -88,6 +90,9 @@ if [ -d /sys/class/net/lo ]; then fi fi +# tell probing programs to get ready +emit_state init + # If using an encrypted root fs, we should find the root dev in the initrd # FIXME: obsoleted by initramfs and udev if [ -e /initrd/dev/mapper/root ]; then @@ -232,6 +237,8 @@ if [ -x /sbin/fsck ]; then fsckret=$? if [ ${fsckret} -gt 1 ]; then stat_fail + # oh crap. tell probers not to hide anything. + emit_state verbose if [ $((${fsckret}&2)) -eq 2 ]; then echo echo "********************** REBOOT REQUIRED *********************" @@ -399,5 +406,8 @@ fi # Screen blanks after 15 minutes idle time /usr/bin/setterm -blank 15 +# set things up for probing in rc.multi +emit_state multi + # End of file # vim: set ts=2 noet: -- 1.5.3.4
2007/11/5, Simo Leone <simo@archlinux.org>:
Initscripts now export their state to an arbitrary boot logging/probing program. This opens up the possibility for advanced boot profiling, among other interesting uses.
Hm, this looks very similar to the latest splash support as modified by Thomas. The hooks in both patches are placed at exactly same positions. This brings me to an idea of unification of both patces into one hook support with 2 hooks - splash and probe (adding other hooks will be deadly simple too). Simo, Thomas, do you like this idea? -- Roman Kyrylych (Роман Кирилич)
Roman Kyrylych schrieb:
2007/11/5, Simo Leone <simo@archlinux.org>:
Initscripts now export their state to an arbitrary boot logging/probing program. This opens up the possibility for advanced boot profiling, among other interesting uses.
Hm, this looks very similar to the latest splash support as modified by Thomas. The hooks in both patches are placed at exactly same positions. This brings me to an idea of unification of both patces into one hook support with 2 hooks - splash and probe (adding other hooks will be deadly simple too). Simo, Thomas, do you like this idea?
It is actually a copy of the splash patch with generalized naming. Simo, what is the intention here?
On 11/5/07, Thomas Bächler <thomas@archlinux.org> wrote:
Roman Kyrylych schrieb:
2007/11/5, Simo Leone <simo@archlinux.org>:
Initscripts now export their state to an arbitrary boot logging/probing program. This opens up the possibility for advanced boot profiling, among other interesting uses.
Hm, this looks very similar to the latest splash support as modified by Thomas. The hooks in both patches are placed at exactly same positions. This brings me to an idea of unification of both patces into one hook support with 2 hooks - splash and probe (adding other hooks will be deadly simple too). Simo, Thomas, do you like this idea?
It is actually a copy of the splash patch with generalized naming. Simo, what is the intention here?
His intent was to keep people from going "no way! I hate splash!". I think, more or less, he was proving a point 8)
On Nov 5, 2007 11:55 AM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On 11/5/07, Thomas Bächler <thomas@archlinux.org> wrote:
Roman Kyrylych schrieb:
2007/11/5, Simo Leone <simo@archlinux.org>:
Initscripts now export their state to an arbitrary boot logging/probing program. This opens up the possibility for advanced boot profiling, among other interesting uses.
Hm, this looks very similar to the latest splash support as modified by Thomas. The hooks in both patches are placed at exactly same positions. This brings me to an idea of unification of both patces into one hook support with 2 hooks - splash and probe (adding other hooks will be deadly simple too). Simo, Thomas, do you like this idea?
It is actually a copy of the splash patch with generalized naming. Simo, what is the intention here?
His intent was to keep people from going "no way! I hate splash!". I think, more or less, he was proving a point 8)
Thomas, any final word here? I know the splash people would like it. And, for the record, I do like the more generalized names without "splash", because in essence they're progress output and not splash specific.
On Nov 15, 2007 11:00 AM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On Nov 5, 2007 11:55 AM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On 11/5/07, Thomas Bächler <thomas@archlinux.org> wrote:
Roman Kyrylych schrieb:
2007/11/5, Simo Leone <simo@archlinux.org>:
Initscripts now export their state to an arbitrary boot logging/probing program. This opens up the possibility for advanced boot profiling, among other interesting uses.
Hm, this looks very similar to the latest splash support as modified by Thomas. The hooks in both patches are placed at exactly same positions. This brings me to an idea of unification of both patces into one hook support with 2 hooks - splash and probe (adding other hooks will be deadly simple too). Simo, Thomas, do you like this idea?
It is actually a copy of the splash patch with generalized naming. Simo, what is the intention here?
His intent was to keep people from going "no way! I hate splash!". I think, more or less, he was proving a point 8)
Thomas, any final word here? I know the splash people would like it. And, for the record, I do like the more generalized names without "splash", because in essence they're progress output and not splash specific.
Ping? Can we move this one forward here - this is the same patch as before with better, more generic names.
2007/11/28, Aaron Griffin <aaronmgriffin@gmail.com>:
On Nov 15, 2007 11:00 AM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On Nov 5, 2007 11:55 AM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On 11/5/07, Thomas Bächler <thomas@archlinux.org> wrote:
Roman Kyrylych schrieb:
2007/11/5, Simo Leone <simo@archlinux.org>:
Initscripts now export their state to an arbitrary boot logging/probing program. This opens up the possibility for advanced boot profiling, among other interesting uses.
Hm, this looks very similar to the latest splash support as modified by Thomas. The hooks in both patches are placed at exactly same positions. This brings me to an idea of unification of both patces into one hook support with 2 hooks - splash and probe (adding other hooks will be deadly simple too). Simo, Thomas, do you like this idea?
It is actually a copy of the splash patch with generalized naming. Simo, what is the intention here?
His intent was to keep people from going "no way! I hate splash!". I think, more or less, he was proving a point 8)
Thomas, any final word here? I know the splash people would like it. And, for the record, I do like the more generalized names without "splash", because in essence they're progress output and not splash specific.
Ping? Can we move this one forward here - this is the same patch as before with better, more generic names.
Pong! I've sent a patch against the splash branch to Thomas about a minute ago. BTW, I think http://bugs.archlinux.org/task/6989 is obsoleted now. -- Roman Kyrylych (Роман Кирилич)
On Dec 5, 2007 7:49 AM, Roman Kyrylych <roman.kyrylych@gmail.com> wrote:
Ping? Can we move this one forward here - this is the same patch as before with better, more generic names.
Pong! I've sent a patch against the splash branch to Thomas about a minute ago. BTW, I think http://bugs.archlinux.org/task/6989 is obsoleted now.
Roman, please resend this patch to me, Thomas is rather unavailable at this time, and I will handle all the current initscripts issues for the time being
2007/12/12, Aaron Griffin <aaronmgriffin@gmail.com>:
On Dec 5, 2007 7:49 AM, Roman Kyrylych <roman.kyrylych@gmail.com> wrote:
Ping? Can we move this one forward here - this is the same patch as before with better, more generic names.
Pong! I've sent a patch against the splash branch to Thomas about a minute ago. BTW, I think http://bugs.archlinux.org/task/6989 is obsoleted now.
Roman, please resend this patch to me, Thomas is rather unavailable at this time, and I will handle all the current initscripts issues for the time being
Done. Note that the patch is against the splash branch, not master. While you're on initscripts patching see also another patch attached here: http://bugs.archlinux.org/task/8843 It fixes an issue that appeared after these commits: 1) http://projects.archlinux.org/git/?p=initscripts.git;a=commit;h=cfab94bc71dc... 2) http://projects.archlinux.org/git/?p=initscripts.git;a=commit;h=c5cffb501763... It would be nice to get a confimation from someone with 'broken' terminal that my patch doesn't uncover their issues. -- Roman Kyrylych (Роман Кирилич)
On 05/11/2007, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
His intent was to keep people from going "no way! I hate splash!". I think, more or less, he was proving a point 8)
Ho-ho! I find the term "probing" a bit confusing though because hooks are for pulling stuff in/out and probes are for pushing in/out. Extracting vs Injecting? Semantics are often a petty matter I know but I find myself wondering what the hell a boot probe is. Maybe the obfuscation was part of the ruse though...
2007/12/5, Phil Dillon-Thiselton <dibblethewrecker@gmail.com>:
On 05/11/2007, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
His intent was to keep people from going "no way! I hate splash!". I think, more or less, he was proving a point 8)
Ho-ho!
I find the term "probing" a bit confusing though because hooks are for pulling stuff in/out and probes are for pushing in/out. Extracting vs Injecting?
Semantics are often a petty matter I know but I find myself wondering what the hell a boot probe is. Maybe the obfuscation was part of the ruse though...
Actually I used term hook in the patch I've sent. :-P -- Roman Kyrylych (Роман Кирилич)
On Wed, Dec 05, 2007 at 02:47:49PM +0000, Phil Dillon-Thiselton wrote:
On 05/11/2007, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
His intent was to keep people from going "no way! I hate splash!". I think, more or less, he was proving a point 8)
Ho-ho!
I find the term "probing" a bit confusing though because hooks are for pulling stuff in/out and probes are for pushing in/out. Extracting vs Injecting?
Semantics are often a petty matter I know but I find myself wondering what the hell a boot probe is. Maybe the obfuscation was part of the ruse though...
*shrug* hooks works, but probing's fine. kprobes is used to put bits into the kernel and get info from bits of the kernel, space probes probe the solar system an gain info. Guess the idea is you put a probe into the code somewhere -- that's the probey bit. semantics, yep :P
participants (6)
-
Aaron Griffin
-
James Rayner
-
Phil Dillon-Thiselton
-
Roman Kyrylych
-
Simo Leone
-
Thomas Bächler