From 6b0a7a14c9bac5cac7a536c9cdfe9f2400d19770 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Thu, 16 Dec 2004 17:51:23 +0000 Subject: [PATCH] Added gamecd/conf option to livecd_stage2_target.py, added gamecd.conf.example to /examples, cleaned up game-specific code in gamecdfs-update.sh to make it more generic, added more fundtionality to livecdfs-update.sh and default-runscript.sh for gentoo-release-environmental and gentoo-gamecd to make spec files simpler and to remove the need for specifying a gamecd/environmental fsscript in livecd/fsscript, allowing the user to still use a custom fsscript of their own. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@497 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 16 ++++++- examples/gamecd.conf.example | 9 ++++ livecd/files/gamecd-xinitrc | 2 - livecd/runscript-support/gamecdfs-update.sh | 53 ++++----------------- livecd/runscript-support/livecdfs-update.sh | 16 ++++++- livecd/runscript/default-runscript.sh | 17 ++++++- modules/livecd_stage2_target.py | 5 +- 7 files changed, 66 insertions(+), 52 deletions(-) create mode 100644 examples/gamecd.conf.example delete mode 100644 livecd/files/gamecd-xinitrc diff --git a/ChangeLog b/ChangeLog index 0523d388..d9c21770 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,20 @@ # ChangeLog for gentoo/src/catalyst # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.124 2004/12/16 15:26:22 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.125 2004/12/16 17:51:22 wolf31o2 Exp $ + + 16 Dec 2004; Chris Gianelloni + +examples/gamecd.conf.example, -livecd/files/gamecd-xinitrc, + livecd/runscript/default-runscript.sh, + livecd/runscript-support/gamecdfs-update.sh, + livecd/runscript-support/livecdfs-update.sh, + modules/livecd_stage2_target.py: + Added gamecd/conf option to livecd_stage2_target.py, added + gamecd.conf.example to /examples, cleaned up game-specific code in + gamecdfs-update.sh to make it more generic, added more fundtionality to + livecdfs-update.sh and default-runscript.sh for gentoo-release-environmental + and gentoo-gamecd to make spec files simpler and to remove the need for + specifying a gamecd/environmental fsscript in livecd/fsscript, allowing the + user to still use a custom fsscript of their own. 16 Dec 2004; Chris Gianelloni +livecd/files/environmental.motd.txt, diff --git a/examples/gamecd.conf.example b/examples/gamecd.conf.example new file mode 100644 index 00000000..e7c8ef98 --- /dev/null +++ b/examples/gamecd.conf.example @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo/src/catalyst/examples/gamecd.conf.example,v 1.1 2004/12/16 17:51:23 wolf31o2 Exp $ + +# these variables are to be used for creating the menu entry and also to tell +# the CD what to execute +GAME_NAME="Unreal Tournament 2004 Demo" +GAME_EXECUTABLE="/usr/games/bin/ut2004demo" diff --git a/livecd/files/gamecd-xinitrc b/livecd/files/gamecd-xinitrc deleted file mode 100644 index 92c0814d..00000000 --- a/livecd/files/gamecd-xinitrc +++ /dev/null @@ -1,2 +0,0 @@ -##GAME_EXECUTABLE & -exec fluxbox diff --git a/livecd/runscript-support/gamecdfs-update.sh b/livecd/runscript-support/gamecdfs-update.sh index b88744df..39f106e6 100644 --- a/livecd/runscript-support/gamecdfs-update.sh +++ b/livecd/runscript-support/gamecdfs-update.sh @@ -1,52 +1,17 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/gamecdfs-update.sh,v 1.5 2004/11/19 18:19:23 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/gamecdfs-update.sh,v 1.6 2004/12/16 17:51:23 wolf31o2 Exp $ -# These variables are to be used for creating the menu entry and also to tell -# the CD what to execute -GAME_NAME="Unreal Tournament 2004 Demo" -GAME_SHORT_NAME="UT2004 Demo" -GAME_EXECUTABLE="/usr/games/bin/ut2004demo" +# we grab our configuration +source "${clst_gamecd_conf}" || exit 1 -sed -i -e "s:localhost:gamecd.gentoo localhost:" /etc/hosts +# here we replace out game information into several files +sed -i -e "s:livecd:gamecd:" /etc/hosts sed -i -e "s:##GAME_NAME:${GAME_NAME}:" /etc/motd -sed -i -e "s:##GAME_EXECUTABLE:${GAME_EXECUTABLE}:" /etc/X11/xinit/xinitrc -[ -x /usr/sbin/openglify ] && /usr/sbin/openglify -touch /etc/asound.state /etc/startx +# here we setup our xinitrc +echo "exec ${GAME_EXECUTABLE}" > /etc/X11/xinit/xinitrc -cat > /usr/share/fluxbox/menu << EOF - -[begin] (Gentoo) - [exec] (GAME_SHORT_NAME) {GAME_EXECUTABLE} - [exec] (Mozilla Firefox) {firefox http://www.gentoo.org} - [exec] (Volume) {xterm -e "alsamixer"} - -[submenu] (Setup Network) - [exec] (net-setup eth0) {xterm -e "net-setup eth0"} - [exec] (net-setup eth1) {xterm -e "net-setup eth1"} - -[end] - -[submenu] (Terminals) - [exec] (xterm) {xterm -fg white -bg black} -[end] - -[submenu] (Settings) - [workspaces] (Workspace List) -[submenu] (Styles) {Choose a style...} - [stylesdir] (/usr/share/fluxbox/styles) -[end] - - [config] (Configure) - [reconfig] (Reload config) -[end] - - [restart] (Restart) -[end] -EOF - -sed -i -e 's:GAME_SHORT_NAME:${GAME_SHORT_NAME}:' \ - -i -e 's:GAME_EXECUTABLE:${GAME_EXECUTABLE}:' \ - /usr/share/fluxbox/menu +# we add spind to default here since we don't want the CD to spin down +rc-update add spind default diff --git a/livecd/runscript-support/livecdfs-update.sh b/livecd/runscript-support/livecdfs-update.sh index 79c21724..39daaa7c 100755 --- a/livecd/runscript-support/livecdfs-update.sh +++ b/livecd/runscript-support/livecdfs-update.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/livecdfs-update.sh,v 1.23 2004/12/16 03:49:49 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/livecdfs-update.sh,v 1.24 2004/12/16 17:51:23 wolf31o2 Exp $ /usr/sbin/env-update source /etc/profile @@ -20,11 +20,17 @@ rc-update del netmount default rc-update add autoconfig default rc-update del keymaps rc-update del consolefont -rc-update add metalog default rc-update add modules default rc-update add pwgen default [ -e /etc/init.d/bootsplash ] && rc-update add bootsplash default [ -e /etc/init.d/splash ] && rc-update add splash default +[ -e /etc/init.d/sysklogd ] && rc-update add sysklogd default +[ -e /etc/init.d/metalog ] && rc-update add metalog default +[ -e /etc/init.d/syslog-ng ] && rc-update add syslog-ng default +[ -e /etc/init.d/alsasound ] && rc-update add alsasound default +[ -e /etc/init.d/hdparm ] && rc-update add hdparm default + +[ -e /etc/startx ] && rc-update add mkxf86config default # perform any rcadd then any rcdel if [ -n "${clst_livecd_rcadd}" ] || [ -n "${clst_livecd_rcdel}" ] @@ -97,6 +103,12 @@ then ln -s /usr/share/hwdata/usb.ids /usr/share/misc/usb.ids fi +# setup opengl in /etc (if configured) +[ -x /usr/sbin/openglify ] && /usr/sbin/openglify + +# touch /etc/asound.state if alsa is configured +[ -d /proc/asound/card0 ] && touch /etc/asound.state + # tweak the motd for gentoo releases if [ "${clst_livecd_type}" = "gentoo-release-universal" ] then diff --git a/livecd/runscript/default-runscript.sh b/livecd/runscript/default-runscript.sh index 549a4600..c918371c 100644 --- a/livecd/runscript/default-runscript.sh +++ b/livecd/runscript/default-runscript.sh @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript/Attic/default-runscript.sh,v 1.19 2004/12/16 03:49:49 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript/Attic/default-runscript.sh,v 1.20 2004/12/16 17:51:23 wolf31o2 Exp $ #return codes to be used by archscript die() { @@ -145,11 +145,26 @@ case $1 in ${clst_chroot_path}/root/.bash_profile cp -a ${clst_sharedir}/livecd/files/livecd-local.start \ ${clst_chroot_path}/etc/conf.d/local.start + + # touch /etc/startx if our livecd/type requires it + if [ "${clst_livecd_type}" = "gentoo-release-environmental" ] \ + || [ "${clst_livecd_type}" = "gentoo-gamecd" ] + then + touch ${clst_chroot_path}/etc/startx + fi # now, finalize and tweak the livecd fs (inside of the chroot) cp ${clst_sharedir}/livecd/runscript-support/livecdfs-update.sh ${clst_chroot_path}/tmp ${clst_CHROOT} ${clst_chroot_path} /tmp/livecdfs-update.sh || exit 1 rm -f ${clst_chroot_path}/tmp/livecdfs-update.sh + + # execute gamecdfs-update.sh if we're a gamecd + if [ "${clst_livecd_type}" = "gentoo-gamecd" ] + then + cp ${clst_sharedir}/livecd/runscript-support/gamecdfs-update.sh ${clst_chroot_path}/tmp + ${clst_CHROOT} ${clst_chroot_path} /tmp/gamecdfs-update.sh || exit 1 + rm -f ${clst_chroot_path}/tmp/gamecdfs-update.sh + fi # if the user has their own fs update script, execute it if [ -n "${clst_livecd_fsscript}" ] diff --git a/modules/livecd_stage2_target.py b/modules/livecd_stage2_target.py index 872b4ac9..72a77e1f 100644 --- a/modules/livecd_stage2_target.py +++ b/modules/livecd_stage2_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.23 2004/10/16 13:38:09 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.24 2004/12/16 17:51:23 wolf31o2 Exp $ """ Builder class for a LiveCD stage2 build. @@ -39,7 +39,8 @@ class livecd_stage2_target(generic_stage_target): "livecd/unmerge","livecd/iso","livecd/gk_mainargs","livecd/type",\ "livecd/motd","livecd/overlay","livecd/modblacklist","livecd/splash_theme",\ "livecd/rcadd","livecd/rcdel","livecd/fsscript","livecd/xinitrc",\ - "livecd/root_overlay","livecd/devmanager","livecd/splash_type"]) + "livecd/root_overlay","livecd/devmanager","livecd/splash_type",\ + "gamecd/conf"]) generic_stage_target.__init__(self,spec,addlargs) file_locate(self.settings, ["livecd/cdtar","livecd/archscript","livecd/runscript"]) -- 2.26.2