# ChangeLog for gentoo/src/catalyst
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.208 2005/04/06 14:07:11 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.209 2005/04/06 23:23:57 rocket Exp $
+
+ 06 Apr 2005; Eric Edgar <rocket@gentoo.org>
+ targets/livecd-stage1/livecd-stage1-controller.sh,
+ targets/livecd-stage2/livecd-stage2-controller.sh,
+ targets/stage1/stage1-preclean-chroot.sh, targets/support/functions.sh,
+ targets/support/gamecdfs-update.sh, targets/support/livecdfs-update.sh,
+ targets/support/pre-kmerge.sh:
+ change the code to use more case statements. Fix gcc issue in stage1.
06 Apr 2005; Chris Gianelloni <wolf31o2@gentoo.org>
targets/livecd-stage1/livecd-stage1-controller.sh,
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-controller.sh,v 1.2 2005/04/06 14:07:11 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-controller.sh,v 1.3 2005/04/06 23:23:57 rocket Exp $
. ${clst_sharedir}/targets/support/functions.sh
cp ${clst_sharedir}/livecd/files/gentoo.png \
${clst_chroot_path}/usr/share/faces
- # 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)
- exec_in_chroot ${clst_sharedir}/targets/support/livecdfs-update.sh
-
# execute gamecdfs-update.sh if we're a gamecd
if [ "${clst_livecd_type}" = "gentoo-gamecd" ]
then
echo "gamecd/conf is required for a gamecd!"
exit 1
fi
- exec_in_chroot ${clst_sharedir}/targets/support/gamecdfs-update.sh
- rm -f ${clst_chroot_path}/tmp/gamecd.conf
fi
+ # now, finalize and tweak the livecd fs (inside of the chroot)
+ exec_in_chroot ${clst_sharedir}/targets/support/livecdfs-update.sh
+
# if the user has their own fs update script, execute it
if [ -n "${clst_livecd_fsscript}" ]
then
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/livecd-stage2-controller.sh,v 1.2 2005/04/05 21:42:20 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/livecd-stage2-controller.sh,v 1.3 2005/04/06 23:23:57 rocket Exp $
. ${clst_sharedir}/targets/support/functions.sh
. ${clst_sharedir}/targets/support/filesystem-functions.sh
mkdir -p /usr/share/faces
cp ${clst_sharedir}/livecd/files/gentoo.png \
${clst_chroot_path}/usr/share/faces
-
- # touch /etc/startx if our livecd/type requires it
- if [ "${clst_livecd_type}" = "gentoo-release-environmental" ] \
- || [ "${clst_livecd_type}" = "gentoo-gamecd" ]
+
+ # execute copy gamecd.conf if we're a gamecd
+ if [ "${clst_livecd_type}" = "gentoo-gamecd" ]
then
- touch ${clst_chroot_path}/etc/startx
+ if [ -n "${clst_gamecd_conf}" ]
+ then
+ cp ${clst_gamecd_conf} ${clst_chroot_path}/tmp/gamecd.conf
+ else
+ echo "gamecd/conf is required for a gamecd!"
+ exit 1
+ fi
fi
-
+
# now, finalize and tweak the livecd fs (inside of the chroot)
exec_in_chroot ${clst_sharedir}/targets/support/livecdfs-update.sh
- # execute gamecdfs-update.sh if we're a gamecd
- if [ "${clst_livecd_type}" = "gentoo-gamecd" ]
- then
- exec_in_chroot ${clst_sharedir}/targets/support/gamecdfs-update.sh
- fi
-
# if the user has their own fs update script, execute it
if [ -n "${clst_livecd_fsscript}" ]
then
#!/bin/bash
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-preclean-chroot.sh,v 1.2 2005/04/06 03:02:06 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-preclean-chroot.sh,v 1.3 2005/04/06 23:23:57 rocket Exp $
. /tmp/chroot-functions.sh
# now, some finishing touches to initialize gcc-config....
unset ROOT
-#if [ -x /usr/bin/gcc-config ]
-#then
-# mythang=$( cd /etc/env.d/gcc; ls ${clst_CHOST}-* | head -n 1 )
-# gcc-config ${mythang}; update_env_settings
-#fi
-
+if [ -x /usr/bin/gcc-config ]
+then
+ mythang=$( cd /etc/env.d/gcc; ls ${clst_CHOST}-* | head -n 1 )
+ gcc-config ${mythang}; update_env_settings
+fi
+
# stage1 is not going to have anything in zoneinfo, so save our Factory timezone
if [ -d /usr/share/zoneinfo ] ; then
rm -f /etc/localtime
then
echo "copying ${file_name} to ${clst_chroot_path}/${2}"
cp -a ${1} ${clst_chroot_path}/${2}
+ chmod 755 ${clst_chroot_path}/${2}/${file_name}
else
echo "copying ${file_name} to ${clst_chroot_path}/tmp"
cp -a ${1} ${clst_chroot_path}/tmp
+ chmod 755 ${clst_chroot_path}/tmp/${file_name}
fi
+
}
delete_from_chroot(){
# and executes it.
local file_name=$(basename ${1})
- cp -a ${1} ${clst_chroot_path}/tmp
- chmod 755 ${clst_chroot_path}/tmp/${file_name}
+ copy_to_chroot ${1} ${2}/tmp
if [ "${2}" != "" ]
then
chmod 755 ${chroot_path}/tmp/${file_name}
copy_to_chroot ${clst_sharedir}/targets/support/chroot-functions.sh /${2}/tmp
echo "Running ${file_name} in chroot ${chroot_path}"
- ${clst_CHROOT} ${chroot_path} /tmp/${file_name} || exit 1
+ ${clst_CHROOT} ${chroot_path}/ /tmp/${file_name} || exit 1
rm -f ${chroot_path}/tmp/${file_name}
delete_from_chroot /${2}/tmp/chroot-functions.sh
-#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-# we grab our configuration
-source /tmp/gamecd.conf || exit 1
-
-# 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
-
-# here we setup our xinitrc
-echo "exec ${GAME_EXECUTABLE}" > /etc/X11/xinit/xinitrc
-
-# we add spind to default here since we don't want the CD to spin down
-rc-update add spind default
-rc-update add x-setup default
#!/bin/bash
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/livecdfs-update.sh,v 1.3 2005/04/06 14:07:11 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/livecdfs-update.sh,v 1.4 2005/04/06 23:23:57 rocket Exp $
/usr/sbin/env-update
source /etc/profile
# turn off udev tarball
sed -i 's:RC_DEVICE_TARBALL="yes":RC_DEVICE_TARBALL="no":' /etc/conf.d/rc
+
# default programs that we always want to start
rc-update del iptables default
rc-update del netmount default
[ -e /etc/init.d/alsasound ] && rc-update add alsasound default
[ -e /etc/init.d/hdparm ] && rc-update add hdparm default
-# Comment out current getty settings
-sed -i -e '/^c[0-9]/ s/^/#/' /etc/inittab
-
-# Add our own getty settings
-for x in 1 2 3 4 5 6
-do
- echo "c${x}:12345:respawn:/sbin/agetty -nl /bin/bashlogin 38400 tty${x} linux" >> /etc/inittab
-done
+# Do some livecd_type specific rc-update changes
+case ${clst_livecd_type} in
+ gentoo-gamecd )
+ # we add spind to default here since we don't want the CD to spin down
+ rc-update add spind default
+ rc-update add x-setup default
+ ;;
+ *)
+ ;;
+esac
# perform any rcadd then any rcdel
if [ -n "${clst_livecd_rcadd}" ] || [ -n "${clst_livecd_rcdel}" ]
fi
fi
+# Comment out current getty settings
+sed -i -e '/^c[0-9]/ s/^/#/' /etc/inittab
+
+# Add our own getty settings
+for x in 1 2 3 4 5 6
+do
+ echo "c${x}:12345:respawn:/sbin/agetty -nl /bin/bashlogin 38400 tty${x} linux" >> /etc/inittab
+done
+
+# Do some livecd_type specific inittab changes
+case ${clst_livecd_type} in
+ gnap)
+ sed -i "s/^#c1:/c1:/" /etc/inittab
+ sed -i "/^.*bashlogin.*$/ d" /etc/inittab
+ ;;
+esac
+
# clean up the time and set to UTC
rm -rf /etc/localtime
cp /usr/share/zoneinfo/UTC /etc/localtime
# setup the hostname
-echo "livecd" > /etc/hostname
-echo "gentoo" > /etc/dnsdomainname
-#sed -i 's:localhost:livecd.gentoo localhost:' /etc/hosts
-echo "127.0.0.1 livecd.gentoo livecd localhost" > /etc/hosts
+case ${clst_livecd_type} in
+ gnap)
+ echo "gentoo" > /etc/dnsdomainname
+ echo "127.0.0.1 livecd.gentoo livecd localhost" > /etc/hosts
+ ;;
+ *)
+ echo "livecd" > /etc/hostname
+ echo "gentoo" > /etc/dnsdomainname
+ echo "127.0.0.1 livecd.gentoo livecd localhost" > /etc/hosts
+ ;;
+esac
# setup sudoers
sed -i '/NOPASSWD: ALL/ s/^# //' /etc/sudoers
touch /etc/asound.state
# tweak the motd for gentoo releases
-if [ "${clst_livecd_type}" = "gentoo-release-universal" ]
-then
- cat /etc/generic.motd.txt /etc/universal.motd.txt \
- /etc/minimal.motd.txt > /etc/motd
- sed -i 's:^##GREETING:Welcome to the Gentoo Linux Universal Installation CD!:' /etc/motd
-fi
-
-if [ "${clst_livecd_type}" = "gentoo-release-minimal" ]
-then
- cat /etc/generic.motd.txt /etc/minimal.motd.txt > /etc/motd
- sed -i 's:^##GREETING:Welcome to the Gentoo Linux Minimal Installation CD!:' /etc/motd
-fi
-
-if [ "${clst_livecd_type}" = "gentoo-release-environmental" ]
-then
- cat /etc/generic.motd.txt /etc/universal.motd.txt \
- /etc/minimal.motd.txt /etc/environmental.motd.txt > /etc/motd
- sed -i 's:^##GREETING:Welcome to the Gentoo Linux LiveCD Environment!:' /etc/motd
-fi
-
-if [ "${clst_livecd_type}" = "gentoo-gamecd" ]
-then
- cat /etc/generic.motd.txt /etc/gamecd.motd.txt > /etc/motd
- sed -i 's:^##GREETING:Welcome to the Gentoo Linux ##GAME_NAME GameCD!:' /etc/motd
-fi
+case ${clst_livecd_type} in
+ gentoo-release-universal )
+ cat /etc/generic.motd.txt /etc/universal.motd.txt \
+ /etc/minimal.motd.txt > /etc/motd
+ sed -i 's:^##GREETING:Welcome to the Gentoo Linux Universal Installation CD!:' /etc/motd
+ ;;
+ gentoo-release-minimal )
+ cat /etc/generic.motd.txt /etc/minimal.motd.txt > /etc/motd
+ sed -i 's:^##GREETING:Welcome to the Gentoo Linux Minimal Installation CD!:' /etc/motd
+ ;;
+ gentoo-release-environmental )
+ cat /etc/generic.motd.txt /etc/universal.motd.txt \
+ /etc/minimal.motd.txt /etc/environmental.motd.txt > /etc/motd
+ sed -i 's:^##GREETING:Welcome to the Gentoo Linux LiveCD Environment!:' /etc/motd
+ ;;
+ gentoo-gamecd )
+ cat /etc/generic.motd.txt /etc/gamecd.motd.txt > /etc/motd
+ sed -i 's:^##GREETING:Welcome to the Gentoo Linux ##GAME_NAME GameCD!:' /etc/motd
+ ;;
+ * )
+ cat /etc/generic.motd.txt /etc/minimal.motd.txt > /etc/motd
+ sed -i 's:^##GREETING:Welcome to the Gentoo Linux LiveCD!:' /etc/motd
+case
rm -f /etc/generic.motd.txt /etc/universal.motd.txt /etc/minimal.motd.txt /etc/environmental.motd.txt /etc/gamecd.motd.txt
mkdir -p /usr/lib/hotplug
ln -sf /lib/firmware /usr/lib/hotplug/firmware
fi
+
+# Post configuration
+case ${clst_livecd_type} in
+ gentoo-gamecd )
+ # we grab our configuration
+ if [ -e /tmp/gamecd.conf ]
+ then
+
+ source /tmp/gamecd.conf || exit 1
+ rm /tmp/gamecd.conf
+
+ # here we replace out game information into several files
+ sed -i -e "s:##GAME_NAME:${GAME_NAME}:" /etc/motd
+
+ # here we setup our xinitrc
+ echo "exec ${GAME_EXECUTABLE}" > /etc/X11/xinit/xinitrc
+ fi
+
+ touch /etc/startx
+ ;;
+ gentoo-release-environmental )
+ touch /etc/startx
+ ;;
+esac
+
/usr/sbin/env-update
source /etc/profile
-
-
-#if [ "${clst_AUTORESUME}" = "1" -a -e /tmp/.clst_genkernel -a -e "/usr/bin/genkernel" ]
-#then
-# echo "Autoresume point found not emerging genkernel"
-#else
-# emerge --oneshot --nodeps -b -k genkernel && touch /tmp/.clst_genkernel || exit 1
-#fi
-
CONFIG_PROTECT="-*" USE="livecd" emerge --oneshot --nodeps -u genkernel
install -d /usr/portage/packages/gk_binaries
sed -i 's/uchi-hcd/uhci-hcd/' /usr/share/genkernel/x86/modules_load
-if [ "${clst_livecd_type}" = "gentoo-release-minimal" -o \
- "${clst_livecd_type}" = "gentoo-release-universal" ]; then
- sed -i 's/initramfs_data.cpio.gz /initramfs_data.cpio.gz -r 1024x768 /'\
- /usr/share/genkernel/genkernel
-fi
+# Setup case structure for livecd_type
+case ${clst_livecd_type} in
+ gentoo-release-minimal | gentoo-release-universal)
+ sed -i 's/initramfs_data.cpio.gz /initramfs_data.cpio.gz -r 1024x768 /' /usr/share/genkernel/genkernel
+ ;;
+esac
+