the red text is moved from bottom of original script. This to run /root/Startup BEFORE showing welcome message which pauses the script.
What else than delayedrun is executed at first boot
after X-server?
#!/bin/sh
#(c) copyright 2007 Barry Kauler
#2007 Lesser GPL licence v2 (
http://www.fsf.org/licensing/licenses/lgpl.html)
#launched from ~/.xinitrc, so X is running.
#note, see also /usr/sbin/savepuppyd, launched from /etc/rc.d/rc.local0.
#v3.91 BK oct,nov 2007, upated for Dingo.
#v3.94 BK 15 dec 2007, updated.
#v4.01 BK 19may2008: don't think loading usb-storage reqd here anymore.
#v4.01 BK 19may2008: note the new pup_eventd also launched from .xinitrc.
#variables created at bootup by /initrd/usr/sbin/init...
. /etc/rc.d/PUPSTATE
BAREVIEW="bareview"
[ "`which bareview`" = "" ] && BAREVIEW="defaulthtmlviewer"
sleep 2 #let the dust settle first.
#v2.17 suggested by andrei...
if [ -d /root/Startup ];then
for a in /root/Startup/*
do
[ -x "$a" ] && $a &
sleep 1
done
fi
#v2.0.0 v4.01 removed...
##have avoided loading usb-storage module unless really needed. partly because it
##slows down bootup. well, load it now... not in rc.local0, too soon...
##not sure, but may be conflict if X accesses
## usb keyboard/mouse while usb-storage is loading. so, doing this in ~/.xinitrc,
## which calls /usr/sbin/delayedrun
#if [ "`lsmod | grep '^usb_storage'`" = "" ];then
# modprobe usb-storage &
#fi
#offer to popup a getting-started html page...
#the test for /etc/videomode is for when Xvesa has finished choosing a resolution...
if [ "`readlink /usr/X11R7/bin/X`" = "Xorg" -o -e /etc/videomode ];then
if [ $PUPMODE -eq 5 ];then
#thistle is a very light purple...
yaf-splash -display :0 -margin 2 -bg thistle -bw 0 -placement top -font "9x15B" -outline 0 -text "Welcome! Click here for getting-started information" &
RETVALs=$?
YAFPIDs=$!
LOOPCNT=0
while [ $RETVALs -eq 0 ];do #only do this if X running.
usleep 500000 #sleep 1
LOOPCNT=`expr $LOOPCNT + 1`
[ $LOOPCNT -gt 110 ] && break #55 second timeout.
[ "`pidof yaf-splash`" != "" ] && continue
#bark and put up the getting started message...
if [ ! "`grep 'alias snd\-card\-0' /etc/modprobe.conf`" = "" ];then
aplay /usr/share/audio/2barks.au &
#wavplay /usr/share/audio/2barks.wav &
#run menu-fix to add spacer to menu items - once only.
menu-fix
RETAPLAY=$?
PIDAPLAY=$!
fi
$BAREVIEW file:///usr/share/doc/welcome1stboot.htm
#[ $RETAPLAY -eq 0 ] && kill $PIDAPLAY 2> /dev/null
[ "`pidof aplay`" != "" ] && killall aplay
break
done
[ $RETVALs -eq 0 ] && kill $YAFPIDs 2>/dev/null
fi
fi
#v2.16 popup the BootManager if an extra SFS file added (once only)...
if [ ! $PUPMODE -eq 5 ];then
if [ -d /initrd ];then #test it isn't full hd installation.
. /etc/rc.d/BOOTCONFIG
#if EXTRASFSLIST variable not there, then auto-load of SFS files (meaning, user
# has probably never run the BootManager)...
if [ "`grep '^EXTRASFSLIST' /etc/rc.d/BOOTCONFIG`" = "" ];then
#see /initrd/init which writes these to BOOTCONFIG..
if [ "$LASTUNIONRECORD" != "" ];then
if [ "$LASTUNIONRECORD" != "$PREVUNIONRECORD" ];then
bootmanager extrasfs quiet
fi
fi
fi
fi
fi
#v2.16 popup a warning if booting from usb flash...
if [ "$PMEDIA" = "usbflash" ];then
yaf-splash -font "8x16" -outline 0 -margin 4 -bg yellow -text "WARNING! Do not unplug USB Flash drive!" &
X1PID=$!
X1RET=$?
sleep 3
[ $X1RET -eq 0 ] && kill $X1PID
fi
###END###