diff options
-rw-r--r-- | sysutils/Makefile | 1 | ||||
-rw-r--r-- | sysutils/bsd-splash-changer/Makefile | 32 | ||||
-rw-r--r-- | sysutils/bsd-splash-changer/files/change_splash.sh.in | 72 | ||||
-rw-r--r-- | sysutils/bsd-splash-changer/files/pkg-message.in | 15 | ||||
-rw-r--r-- | sysutils/bsd-splash-changer/pkg-descr | 5 | ||||
-rw-r--r-- | sysutils/bsd-splash-changer/pkg-plist | 2 |
6 files changed, 127 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile index 8ca8f946ab9a..7b7287c5a99d 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -50,6 +50,7 @@ SUBDIR += blimitd SUBDIR += boxbackup SUBDIR += bpm + SUBDIR += bsd-splash-changer SUBDIR += bsdadminscripts SUBDIR += bsdsar SUBDIR += bubblemon-dockapp diff --git a/sysutils/bsd-splash-changer/Makefile b/sysutils/bsd-splash-changer/Makefile new file mode 100644 index 000000000000..8f7eab2fa70f --- /dev/null +++ b/sysutils/bsd-splash-changer/Makefile @@ -0,0 +1,32 @@ +# New ports collection makefile for: bsd-splash-changer +# Date created: 11 Feb 2006 +# Whom: Martin Otto +# +# $FreeBSD$ +# +# This port is self contained. +# + +PORTNAME= bsd-splash-changer +PORTVERSION= 060211 +CATEGORIES= sysutils +MASTER_SITES= # none +DISTFILES= # none + +MAINTAINER= gamato@pobox.sk +COMMENT= Boot Splash Image Changer + +USE_RC_SUBR= change_splash.sh +NO_BUILD= yes +SUB_FILES= pkg-message + +do-fetch: + @${DO_NADA} + +do-install: + ${MKDIR} ${DATADIR} + +post-install: + @${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD} + +.include <bsd.port.mk> diff --git a/sysutils/bsd-splash-changer/files/change_splash.sh.in b/sysutils/bsd-splash-changer/files/change_splash.sh.in new file mode 100644 index 000000000000..9e78cda93734 --- /dev/null +++ b/sysutils/bsd-splash-changer/files/change_splash.sh.in @@ -0,0 +1,72 @@ +#!/bin/sh +# +# /usr/local/etc/rc.d/change_splash.sh * mato [11-feb-2006] +# +# PROVIDE: change_splash +# REQUIRE: mountcritremote +# KEYWORD: FreeBSD +# +# Boot Splash Image Changer * martinko [09-feb-2006] +# +# Add the following to /etc/rc.conf[.local] to enable this service: +# +# splash_changer_enable="YES" +# splash_changer_dir (string): Defaults to "%%DATADIR%%". +# Splash image file is randomly picked up from this directory. +# splash_changer_file (string): Defaults to "/boot/splash". +# This is where the image file is copied to. +# + +. %%RC_SUBR%% + +name=change_splash +rcvar=`set_rcvar splash_changer` + +start_cmd=${name}_start + +: ${splash_changer_enable="NO"} +: ${splash_changer_file="/boot/splash"} +: ${splash_changer_dir="%%DATADIR%%"} + +change_splash_start() +{ + echo "Changing splash image." + + local splash_file splash_dir + local fcount random choice select filename + + splash_file="${splash_changer_file-"/boot/splash"}" + splash_dir="${splash_changer_dir-"%%DATADIR%%"}" + + [ -f "$splash_file" -o ! -e "$splash_file" ] || err 1 "$splash_file is not a file" + [ -d "$splash_dir" ] || err 2 "$splash_dir is not a directory" + + if [ "$splash_dir" = "${splash_file%/*}" ] + then + fcount="`ls -1 "$splash_dir" | grep -v "^${splash_file##*/}$" | wc -l`" + else + fcount="`ls -1 "$splash_dir" | wc -l`" + fi + random="`od -A n -D -N 1 < /dev/random`" + choice="`expr $random % $fcount`" + select=0 + + [ -z "$choice" ] && err 3 "choice failed" + + for filename in "$splash_dir"/* + do + if [ $select -eq $choice ] + then + cp -f "$filename" "$splash_file" + break + fi + select="`expr $select + 1`" + done + + debug "Boot splash image changed to $filename" +} + +load_rc_config $name +run_rc_command "$1" + +# done diff --git a/sysutils/bsd-splash-changer/files/pkg-message.in b/sysutils/bsd-splash-changer/files/pkg-message.in new file mode 100644 index 000000000000..895a3b923891 --- /dev/null +++ b/sysutils/bsd-splash-changer/files/pkg-message.in @@ -0,0 +1,15 @@ +============================================================================== + +To use the port you need to perform the following steps: + +1) Place your image files into %%DATADIR%%. +2) Add the following to /etc/rc.conf[.local] to enable it: + + splash_changer_enable="YES" + +3) Enable the boot splash screen as described in splash(4) and set the + following in /boot/loader.conf[.local]: + + bitmap_name="/boot/splash" + +============================================================================== diff --git a/sysutils/bsd-splash-changer/pkg-descr b/sysutils/bsd-splash-changer/pkg-descr new file mode 100644 index 000000000000..f3ea115d5add --- /dev/null +++ b/sysutils/bsd-splash-changer/pkg-descr @@ -0,0 +1,5 @@ +This is a boot splash image changer for FreeBSD. + +See the post-installation message for instructions. + +WWW: http://mato.gamato.org/freebsd/ diff --git a/sysutils/bsd-splash-changer/pkg-plist b/sysutils/bsd-splash-changer/pkg-plist new file mode 100644 index 000000000000..3df163737370 --- /dev/null +++ b/sysutils/bsd-splash-changer/pkg-plist @@ -0,0 +1,2 @@ +@exec mkdir -p %D/%%DATADIR%% +@dirrmtry %%DATADIR%% |