ports/93218: New port: sysutils/bsd-splash-changer Boot Splash Image Changer

martinko gamato at pobox.sk
Sun Feb 12 02:10:09 UTC 2006


>Number:         93218
>Category:       ports
>Synopsis:       New port: sysutils/bsd-splash-changer Boot Splash Image Changer
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 12 02:10:07 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     martinko
>Release:        FreeBSD 6.0-STABLE
>Organization:
>Environment:
FreeBSD mb-aw1n-bsd 6.0-STABLE FreeBSD 6.0-STABLE #1: Wed Feb  1 08:55:03 CET 2006     root at mb-aw1n-bsd:/usr/obj/usr/src/sys/MB-AW1N  i386
>Description:
              This is a new port of boot splash image changer for FreeBSD.
>How-To-Repeat:
              N/A
>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	bsd-splash-changer
#	bsd-splash-changer/files
#	bsd-splash-changer/files/change_splash.sh.in
#	bsd-splash-changer/pkg-plist
#	bsd-splash-changer/pkg-descr
#	bsd-splash-changer/Makefile
#
echo c - bsd-splash-changer
mkdir -p bsd-splash-changer > /dev/null 2>&1
echo c - bsd-splash-changer/files
mkdir -p bsd-splash-changer/files > /dev/null 2>&1
echo x - bsd-splash-changer/files/change_splash.sh.in
sed 's/^X//' >bsd-splash-changer/files/change_splash.sh.in << 'END-of-bsd-splash-changer/files/change_splash.sh.in'
X#!/bin/sh
X#
X# /usr/local/etc/rc.d/change_splash.sh * mato [11-feb-2006]
X#
X# PROVIDE: change_splash
X# REQUIRE: mountcritremote
X# KEYWORD: FreeBSD
X#
X# Boot Splash Image Changer * martinko [09-feb-2006]
X#
X# Add the following to /etc/rc.conf[.local] to enable this service:
X#
X# splash_changer_enable="YES"
X# splash_changer_dir (string):		Defaults to "/boot/splashes".
X#					Splash image file is randomly picked up from this directory.
X# splash_changer_file (string):		Defaults to "/boot/splash".
X#					This symbolic link points to recently chosen splash image file.
X#
X
X. %%RC_SUBR%%
X
Xname=change_splash
Xrcvar=`set_rcvar splash_changer`
X
Xstart_cmd=${name}_start
X
X: ${splash_changer_enable="NO"}
X: ${splash_changer_file="/boot/splash"}
X: ${splash_changer_dir="/boot/splashes"}
X
Xchange_splash_start()
X{
X	echo "Changing splash image."
X
X	local splash_file splash_dir
X	local fcount random choice select filename
X
X	splash_file="${splash_changer_file-"/boot/splashes/current"}"
X	splash_dir="${splash_changer_dir-"/boot/splashes"}"
X
X	[ -L "$splash_file" -o ! -e "$splash_file" ] || err 1 "$splash_file is not a symbolic link"
X	[ -d "$splash_dir" ] || err 2 "$splash_dir is not a directory"
X
X	if [ "$splash_dir" = "${splash_file%/*}" ]
X	then
X		fcount="`ls -1 "$splash_dir" | grep -v "^${splash_file##*/}$" | wc -l`"
X	else
X		fcount="`ls -1 "$splash_dir" | wc -l`"
X	fi
X	random="`od -A n -D -N 1 < /dev/random`"
X	choice="`expr $random % $fcount`"
X	select=0
X
X	[ -z "$choice" ] && err 3 "choice failed"
X
X	for filename in "$splash_dir"/*
X	do
X		[ "$filename" = "$splash_file" ] && continue
X		if [ $select -eq $choice ]
X		then
X			ln -fs "$filename" "$splash_file"
X			break
X		fi
X		select="`expr $select + 1`"
X	done
X
X	debug "Boot splash image changed to $filename"
X}
X
Xload_rc_config $name
Xrun_rc_command "$1"
X
X# done
END-of-bsd-splash-changer/files/change_splash.sh.in
echo x - bsd-splash-changer/pkg-plist
sed 's/^X//' >bsd-splash-changer/pkg-plist << 'END-of-bsd-splash-changer/pkg-plist'
X at exec mkdir -p /boot/splashes
X at unexec rmdir /boot/splashes 2> /dev/null || true
END-of-bsd-splash-changer/pkg-plist
echo x - bsd-splash-changer/pkg-descr
sed 's/^X//' >bsd-splash-changer/pkg-descr << 'END-of-bsd-splash-changer/pkg-descr'
XThis is a boot splash image changer for FreeBSD.
X
XAfter installation place your image files to /boot/splashes directory
Xand add the following to /etc/rc.conf[.local] to enable this service:
Xsplash_changer_enable="YES"
XAlso, you need to enable boot splash screen as described in splash(4)
Xand set the following in /boot/loader.conf[.local]:
Xbitmap_name="/boot/splash"
X
XWWW: http://mato.gamato.org/freebsd/
END-of-bsd-splash-changer/pkg-descr
echo x - bsd-splash-changer/Makefile
sed 's/^X//' >bsd-splash-changer/Makefile << 'END-of-bsd-splash-changer/Makefile'
X# New ports collection makefile for:	bsd-splash-changer
X# Date created:		11 Feb 2006
X# Whom:			Martin Otto
X#
X# $FreeBSD$
X#
X# This port is self contained in the src directory.
X#
X
XPORTNAME=	bsd-splash-changer
XPORTVERSION=	060211
XCATEGORIES=	sysutils
XMASTER_SITES=	# none
XDISTFILES=	# none
X
XMAINTAINER=	gamato at pobox.sk
XCOMMENT=	Boot Splash Image Changer
X
XUSE_RC_SUBR=	change_splash.sh
X
XNO_BUILD=	yes
X
Xdo-fetch:
X	@${DO_NADA}
X
Xdo-install:
X	${MKDIR} /boot/splashes
X
X.include <bsd.port.mk>
END-of-bsd-splash-changer/Makefile
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list