diff options
author | Nathan Harris <nharris@eoimaging.com> | 2009-02-11 19:42:03 (GMT) |
---|---|---|
committer | Nathan Harris <nharris@eoimaging.com> | 2009-02-11 19:42:03 (GMT) |
commit | 9bbbabaae4af2dfeac1f9d00050e358b56ac5fa7 (patch) | |
tree | d73b42272daefa2b6971bf8763ed5568c1a173ea /abs/core-testing/initscripts-splashy | |
parent | 6f5e266635707da88c03920427347575383e0fc2 (diff) | |
parent | 09b14aa48e621e4263c095769bbd2697893eef8d (diff) | |
download | linhes_pkgbuild-9bbbabaae4af2dfeac1f9d00050e358b56ac5fa7.zip linhes_pkgbuild-9bbbabaae4af2dfeac1f9d00050e358b56ac5fa7.tar.gz linhes_pkgbuild-9bbbabaae4af2dfeac1f9d00050e358b56ac5fa7.tar.bz2 |
Merge branch 'master' of nharris@knoppmyth.net:LinHES-PKGBUILD
Diffstat (limited to 'abs/core-testing/initscripts-splashy')
-rw-r--r-- | abs/core-testing/initscripts-splashy/PKGBUILD | 31 | ||||
-rw-r--r-- | abs/core-testing/initscripts-splashy/initscripts-splash.install | 25 | ||||
-rw-r--r-- | abs/core-testing/initscripts-splashy/splash | 310 | ||||
-rw-r--r-- | abs/core-testing/initscripts-splashy/splash.conf | 4 |
4 files changed, 370 insertions, 0 deletions
diff --git a/abs/core-testing/initscripts-splashy/PKGBUILD b/abs/core-testing/initscripts-splashy/PKGBUILD new file mode 100644 index 0000000..1c8dbed --- /dev/null +++ b/abs/core-testing/initscripts-splashy/PKGBUILD @@ -0,0 +1,31 @@ +# Contributor: Lexiw <llexiw@gmail.com> +# Contributor: Jeremy Sands <cto@jeremysands.com> + +pkgname=initscripts-splashy +pkgver=2008.09 +pkgrel=2 +pkgdesc="System initialization/bootup scripts with splash support" +arch=('i686' 'x86_64') +url="http://www.archlinux.org" +license=('GPL') +groups=('base') +backup=(etc/inittab etc/rc.conf etc/rc.local etc/rc.local.shutdown) +depends=('glibc' 'bash' 'awk' 'grep' 'coreutils' 'sed' 'udev>=118' 'net-tools' 'ncurses' 'sysvinit-mod') +provides=('initscripts') +conflicts=('initscripts') +install=initscripts-splash.install +source=(ftp://ftp.archlinux.org/other/initscripts/initscripts-${pkgver}-${pkgrel}.tar.gz + splash.conf + splash) +md5sums=('c28214d35643570cde56dd1142348aa7' + 'fe6da7a9242aca91779e165979bb7e3d' + 'd3fffe7133e6096937195084d2746889') + +build() { + cd ${startdir}/src/initscripts-${pkgver}-${pkgrel}/ + + DESTDIR=$startdir/pkg ./install.sh + + install -D -m644 ${startdir}/splash ${startdir}/pkg/etc/rc.d/functions.d/splash + install -D -m644 ${startdir}/splash.conf ${startdir}/pkg/etc/splash.conf +} diff --git a/abs/core-testing/initscripts-splashy/initscripts-splash.install b/abs/core-testing/initscripts-splashy/initscripts-splash.install new file mode 100644 index 0000000..9fffa9b --- /dev/null +++ b/abs/core-testing/initscripts-splashy/initscripts-splash.install @@ -0,0 +1,25 @@ +post_upgrade() { + cat << "EOF" +----------------------------------------------------------- +IMPORTANT NOTICE FOR ENCRYPTION USERS + +The "password" column in /etc/crypttab has now +two special keywords: +- ASK ask for a passphrase on boot +- SWAP use a random key and create swapspace + This is particularly dangerous, as the + volume in question will be overwritten + If you use SWAP as your passphrase (which + is insecure anyway), be sure to remove it + from /etc/crypttab to avoid dataloss! + +See /etc/crypttab(.pacnew) for more information. +----------------------------------------------------------- +Attention netcfg users: netcfg is no longer included as +part of the initscripts package. +Be aware that rc.conf's NET_PROFILES has changed to +NETWORKS, and that netcfg must be installed separately. +For more info, see the netcfg man page. +----------------------------------------------------------- +EOF +} diff --git a/abs/core-testing/initscripts-splashy/splash b/abs/core-testing/initscripts-splashy/splash new file mode 100644 index 0000000..a3e49a4 --- /dev/null +++ b/abs/core-testing/initscripts-splashy/splash @@ -0,0 +1,310 @@ +# +# initscripts-splash functions +# + +. /etc/splash.conf + +if [ "$SPLASH_DEBUG" = "true" ]; then + if ! [ -d /var/log/splash ]; then + mkdir -p /var/log/splash + fi + if ! [ -f /var/log/splash/splash.log ]; then + mount -ns -t tmpfs -o size=1M tmpfs /var/log/splash + echo "Hello damned debugger" > /var/log/splash/splash.log + fi +fi + +debug_log() { + [ "$SPLASH_DEBUG" = "true" ] || return 1 + + echo "$1" >> /var/log/splash/splash.log +} + +splash_enabled_cmdline() { debug_log "$0 ${FUNCNAME}" + local ENABLE=false + local SINGLE=false + + for x in $CMDLINE; do + case $x in + single) + SINGLE=true + ;; + splash) + ENABLE=true + ;; + nosplash) + ENABLE=false + ;; + esac + done + + [ "${SINGLE}" = "false" ] || return 1 + [ "${ENABLE}" = "true" ] || return 1 + + return 0 +} + +splash_enabled_config() { debug_log "$0 ${FUNCNAME}" + if [[ -n ${SPLASH} && -f /etc/rc.d/${SPLASH}-functions ]]; then + return 0 + else + if [[ -f /etc/rc.d/splashy-functions ]]; then + SPLASH="splashy" + return 0 + else + return 1 + fi + fi +} + +if [ -z "$RUNLEVEL" ]; then + return 0 +fi + +if ! splash_enabled_cmdline; then + return 0 +fi + +if ! splash_enabled_config; then + return 0 +fi + +count_daemons() { + local COUNT=0 + for daemon in "${DAEMONS[@]}"; do + if [ "$daemon" = "${daemon#!}" ]; then + ((COUNT++)) + fi + done + + echo ${COUNT} +} + +count_stats() { + local COUNT=$(grep -e status -e stat_busy /etc/${1} | grep -c -v \#) + + if ! [ "$USELVM" = "yes" -o "$USELVM" = "YES" ]; then + ((COUNT--)) + fi + if ! [ -f /etc/crypttab -a -n "$(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$)" ]; then + ((COUNT--)) + fi + + echo ${COUNT} +} + +set_sysinit() { debug_log "$0 ${FUNCNAME}" + SPLASH_PROGRESS_STATS=$(count_stats rc.sysinit) + SPLASH_PROGRESS_DAEMONS=$(count_daemons) + SPLASH_PROGRESS_TOTAL=$(($SPLASH_PROGRESS_STATS+$SPLASH_PROGRESS_DAEMONS)) + SPLASH_PROGRESS_COUNT=0 + SPLASH_AUTORUN_COMMAND="splash_sysinit" + + debug_log "SPLASH_PROGRESS_TOTAL=$SPLASH_PROGRESS_TOTAL SPLASH_AUTORUN_COMMAND=$SPLASH_AUTORUN_COMMAND" +} + +set_multi() { debug_log "$0 ${FUNCNAME}" + SPLASH_PROGRESS_STATS=$(count_stats rc.sysinit) + SPLASH_PROGRESS_DAEMONS=$(count_daemons) + SPLASH_PROGRESS_TOTAL=$(($SPLASH_PROGRESS_STATS+$SPLASH_PROGRESS_DAEMONS)) + SPLASH_PROGRESS_COUNT=$(($SPLASH_PROGRESS_STATS-1)) + SPLASH_AUTORUN_COMMAND="splash_multi" + + debug_log "SPLASH_PROGRESS_TOTAL=$SPLASH_PROGRESS_TOTAL SPLASH_AUTORUN_COMMAND=$SPLASH_AUTORUN_COMMAND" +} + +set_shutdown() { debug_log "$0 ${FUNCNAME}" + SPLASH_PROGRESS_STATS=$(count_stats rc.shutdown) + SPLASH_RUNNING_DAEMONS=(`/bin/ls /var/run/daemons`) + SPLASH_PROGRESS_DAEMONS=${#SPLASH_RUNNING_DAEMONS[*]} + SPLASH_PROGRESS_TOTAL=$(($SPLASH_PROGRESS_STATS+$SPLASH_PROGRESS_DAEMONS)) + SPLASH_PROGRESS_COUNT=0 + SPLASH_AUTORUN_COMMAND="splash_shutdown" + + debug_log "SPLASH_PROGRESS_TOTAL=$SPLASH_PROGRESS_TOTAL SPLASH_AUTORUN_COMMAND=$SPLASH_AUTORUN_COMMAND" +} + +if [ -z "${SPLASH_INIT_DONE}" ]; then + export SPLASH_INIT_DONE="true" + + debug_log "$0 Running initscript..." + + case "$RUNLEVEL" in + S) + set_sysinit + SPLASH_STATUS_MESSAGE="Booting Arch Linux..." + ;; + 3) + set_multi + SPLASH_STATUS_MESSAGE="Loading daemons..." + ;; + 5) + set_multi + SPLASH_STATUS_MESSAGE="Loading daemons..." + ;; + 6) + set_shutdown + SPLASH_STATUS_MESSAGE="Rebooting Arch Linux..." + ;; + 0) + set_shutdown + SPLASH_STATUS_MESSAGE="Shutting down Arch Linux..." + ;; + esac +fi + +. /etc/rc.d/${SPLASH}-functions + +# splash functions: + +splash_progress() { debug_log "$0 ${FUNCNAME}" + if [ -n "$SPLASH_PROGRESS_COUNT" ]; then + ${SPLASH}_progress $SPLASH_PROGRESS_COUNT $SPLASH_PROGRESS_TOTAL + ((SPLASH_PROGRESS_COUNT++)) + fi +} + +splash_print() { debug_log "$0 ${FUNCNAME}" + ${SPLASH}_print "${1}" + + debug_log "$1" +} + +splash_exit() { debug_log "$0 ${FUNCNAME}" + ${SPLASH}_exit ${DEFAULT_TTY} ${SWITCH_TTY} +} + +splash_sysinit() { debug_log "$0 ${FUNCNAME}" + ${SPLASH}_sysinit ${DEFAULT_TTY} +} + +splash_multi() { debug_log "$0 ${FUNCNAME}" + ${SPLASH}_multi + + trap splash_exit 0 + splash_progress +} + +splash_shutdown() { debug_log "$0 ${FUNCNAME}" + ${SPLASH}_shutdown ${DEFAULT_TTY} + + if [ -n "`pidof $SPLASH`" ]; then + export KILLALL5_OPTS="-o `pidof $SPLASH`" + fi +} + +if [ -n "${SPLASH_AUTORUN_COMMAND}" ]; then + $SPLASH_AUTORUN_COMMAND + splash_print "${SPLASH_STATUS_MESSAGE}" + sleep 0.5 +fi + +# functions: + +deltext() { debug_log "$0 ${FUNCNAME}" + if [ "$CONSOLE_PRINT" == "true" ]; then + printf "${DEL_TEXT}" + else + return 0 + fi +} + +printhl() { debug_log "$0 ${FUNCNAME}" + if [ "$CONSOLE_PRINT" == "true" ]; then + printf "${C_OTHER}${PREFIX_HL} ${C_H1}${1}${C_CLEAR} \n" + else + return 0 + fi +} + +printsep() { debug_log "$0 ${FUNCNAME}" + if [ "$CONSOLE_PRINT" == "true" ]; then + printf "\n${C_SEPARATOR} ------------------------------\n" + else + return 0 + fi +} + +stat_bkgd() { debug_log "$0 ${FUNCNAME}" + if [ "$CONSOLE_PRINT" == "true" ]; then + printf "${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} " + deltext + printf " ${C_OTHER}[${C_BKGD}BKGD${C_OTHER}]${C_CLEAR} " + fi +} + +stat_busy() { debug_log "$0 ${FUNCNAME}" + if [ "$CONSOLE_PRINT" == "true" ]; then + printf "${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} " + printf "${SAVE_POSITION}" + deltext + printf " ${C_OTHER}[${C_BUSY}BUSY${C_OTHER}]${C_CLEAR} " + fi + splash_print "${1}" +} + +stat_append() { debug_log "$0 ${FUNCNAME}" + if [ "$CONSOLE_PRINT" == "true" ]; then + printf "${RESTORE_POSITION}" + printf "${C_MAIN}${1}${C_CLEAR}" + printf "${SAVE_POSITION}" + else + return 0 + fi +} + +stat_done() { debug_log "$0 ${FUNCNAME}" + if [ "$CONSOLE_PRINT" == "true" ]; then + deltext + printf " ${C_OTHER}[${C_DONE}DONE${C_OTHER}]${C_CLEAR} \n" + fi + splash_progress +} + +stat_fail() { debug_log "$0 ${FUNCNAME}" + if [ "$CONSOLE_PRINT" == "true" ]; then + printf " ${C_OTHER}[${C_FAIL}FAIL${C_OTHER}]${C_CLEAR} \n" + fi + splash_print "Something failed, killing splash..." + sleep 2 + splash_exit +} + +#daemons: + +log_daemon() { debug_log "$0 ${FUNCNAME}" + case $1 in + ?dm|slim) + splash_exit + ;; + esac +} + +start_daemon() { debug_log "$0 ${FUNCNAME}" + log_daemon $1 + splash_progress + /etc/rc.d/$1 start +} + +start_daemon_bkgd() { debug_log "$0 ${FUNCNAME}" + if [ "$CONSOLE_PRINT" == "true" ]; then + stat_bkgd "Starting $1" + fi + log_daemon $1 + (/etc/rc.d/$1 start) &>/dev/null & + splash_progress +} + +stop_daemon() { debug_log "$0 ${FUNCNAME}" + /etc/rc.d/$1 stop + + for daemon in ${SPLASH_RUNNING_DAEMONS[@]}; do + if [ "$daemon" = "$1" ]; then + splash_progress + break + fi + done +} + +# End of file +# vim: set ts=2 noet: diff --git a/abs/core-testing/initscripts-splashy/splash.conf b/abs/core-testing/initscripts-splashy/splash.conf new file mode 100644 index 0000000..3f82053 --- /dev/null +++ b/abs/core-testing/initscripts-splashy/splash.conf @@ -0,0 +1,4 @@ +DEFAULT_TTY=8 +SWITCH_TTY=1 +CONSOLE_PRINT=true +SPLASH_DEBUG=false |