}
genkernel_compile(){
-
eval "clst_initramfs_overlay=\$clst_boot_kernel_${clst_kname}_initramfs_overlay"
eval "clst_kernel_merge=\$clst_boot_kernel_${clst_kname}_packages"
-
+
setup_gk_args
#echo "The GK_ARGS are"
#echo ${GK_ARGS}
export clst_kernel_merge
export clst_initramfs_overlay
- # build with genkernel using the set options
+ # Build with genkernel using the set options
# callback is put here to avoid escaping issues
if [ -n "${clst_KERNCACHE}" ]
then
if [ "$clst_kernel_merge" != "" ]
then
- genkernel --callback="PKGDIR=${PKGDIR} emerge -kb ${clst_kernel_merge}" \
- ${GK_ARGS} || exit 1
+ genkernel --callback="PKGDIR=${PKGDIR} emerge -kb \
+ ${clst_kernel_merge}" ${GK_ARGS} || exit 1
else
genkernel ${GK_ARGS} || exit 1
fi
genkernel_compile
}
-
-
# Script to build each kernel, kernel-related packages
/usr/sbin/env-update
source /etc/profile
[ -n "${clst_ENVSCRIPT}" ] && source /tmp/envscript
export CONFIG_PROTECT="-*"
-#set the timezone for the kernel build
+# Set the timezone for the kernel build
rm /etc/localtime
ln -s /usr/share/zoneinfo/UTC /etc/localtime
eval "clst_kernel_gk_kernargs=\$clst_boot_kernel_${clst_kname}_gk_kernargs"
eval "clst_ksource=\$clst_boot_kernel_${clst_kname}_sources"
-
-
-# Don't use pkgcache here, as the kernel source may get emerge with different USE variables
-# (and thus different patches enabled/disabled.) Also, there's no real benefit in using the
-# pkgcache for kernel source ebuilds.
+# Don't use pkgcache here, as the kernel source may get emerged with different
+# USE variables (and thus different patches enabled/disabled.) Also, there's no
+# real benefit in using the pkgcache for kernel source ebuilds.
USE_MATCH=0
if [ -e /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE ]
then
-
STR1=$(for i in `cat /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE`; do echo $i; done|sort)
STR2=$(for i in ${clst_kernel_use}; do echo $i; done|sort)
if [ "${STR1}" = "${STR2}" ]
#echo "CONFIG match"
CONFIG_MATCH=1
fi
-
fi
fi
USE="${USE} symlink build" emerge "${clst_ksource}" || exit 1
fi
-#if catalyst has set to a empty string, extraversion wasn't specified so we skip this part
+# If catalyst has set to a empty string, extraversion wasn't specified so we
+# skip this part
if [ "${EXTRAVERSION_MATCH}" != "1" ]
then
if [ "${clst_kextraversion}" != "" ]
touch /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
fi
fi
-
build_kernel
# grep out the kernel version so that we can do our modules magic
#!/bin/bash
# Copyright 1999-2005 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.30 2005/12/09 19:03:07 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/livecdfs-update.sh,v 1.31 2005/12/19 16:52:01 wolf31o2 Exp $
. /tmp/chroot-functions.sh
+
update_env_settings
-# allow root logins to the livecd by default
+# Allow root logins to the livecd by default
if [ -e /etc/sshd/sshd_config ]
then
- sed -i 's:^#PermitRootLogin\ yes:PermitRootLogin\ yes:' /etc/ssh/sshd_config
+ sed -i 's:^#PermitRootLogin\ yes:PermitRootLogin\ yes:' \
+ /etc/ssh/sshd_config
fi
-# turn off udev tarball
+# Turn off udev tarball
sed -i 's:RC_DEVICE_TARBALL="yes":RC_DEVICE_TARBALL="no":' /etc/conf.d/rc
-# clean up the time and set to UTC
+# Clean up the time and set to UTC
rm -rf /etc/localtime
cp /usr/share/zoneinfo/UTC /etc/localtime
-# setup the hostname
+# Setup the hostname
if [ "${clst_livecd_type}" == "gentoo-gamecd" ]
then
echo 'HOSTNAME="gamecd"' > /etc/conf.d/hostname
then
for x in ${clst_livecd_users}
do
- useradd -G users,wheel,audio,games,cdrom,usb -c "Default LiveCD User" -m $x
+ useradd -G users,wheel,audio,games,cdrom,usb -c "Default LiveCD User" \
+ -m $x
if [ -n "${clst_livecd_xdm}" -a -n "${clst_livecd_xsession}" ]
then
echo "[Desktop]" > /home/$x/.dmrc
done
fi
-# setup sudoers
+# Setup sudoers
if [ -f /etc/sudoers ]
then
sed -i '/NOPASSWD: ALL/ s/^# //' /etc/sudoers
fi
-# we want the first user to be used when auto-starting X
+# We want the first user to be used when auto-starting X
if [ -n "${clst_livecd_users}" -a -e /etc/startx ]
then
first_user=$(echo ${clst_livecd_users} | cut -d' ' -f1)
sed -i "s/##STARTX/su - $first_user -c startx/" /root/.bashrc
fi
-# setup dhcp on all detected ethernet devices
+# Setup DHCP on all detected ethernet devices
echo "iface_eth0=\"dhcp\""> /etc/conf.d/net
echo "iface_eth1=\"dhcp\"" >> /etc/conf.d/net
echo "iface_eth2=\"dhcp\"" >> /etc/conf.d/net
echo "iface_eth3=\"dhcp\"" >> /etc/conf.d/net
echo "iface_eth4=\"dhcp\"" >> /etc/conf.d/net
-# setup links for ethernet devices
+# Setup links for ethernet devices
cd /etc/init.d
ln -sf net.eth0 net.eth1
ln -sf net.eth0 net.eth2
ln -sf net.eth0 net.eth3
ln -sf net.eth0 net.eth4
-# add this for hwsetup/mkx86config
+# Add this for hwsetup/mkx86config
mkdir -p /etc/sysconfig
# fstab tweaks
echo "tmpfs / tmpfs defaults 0 0" > /etc/fstab
echo "tmpfs /lib/firmware tmpfs defaults 0 0" >> /etc/fstab
echo "tmpfs /usr/portage tmpfs defaults 0 0" >> /etc/fstab
-# if /usr/lib/X11/xkb/compiled then make it tmpfs
+# If /usr/lib/X11/xkb/compiled then make it tmpfs
if [ -d /usr/lib/X11/xkb/compiled ]
then
- echo "tmpfs /usr/lib/X11/xkb/compiled tmpfs defaults 0 0" >> /etc/fstab
+ echo "tmpfs /usr/lib/X11/xkb/compiled tmpfs defaults 0 0" >> \
+ /etc/fstab
fi
# devfs tweaks
[ -e /etc/devfsd.conf ] && sed -i '/dev-state/ s:^:#:' /etc/devfsd.conf
-# tweak the livecd fstab so that users know not to edit it
+# Tweak the livecd fstab so that users know not to edit it
# http://bugs.gentoo.org/show_bug.cgi?id=60887
mv /etc/fstab /etc/fstab.old
echo "####################################################" >> /etc/fstab
cat /etc/fstab.old >> /etc/fstab
rm /etc/fstab.old
-# add some helpful aliases
+# Add some helpful aliases
echo "alias cp='cp -i'" >> /etc/profile
echo "alias mv='mv -i'" >> /etc/profile
echo "alias rm='rm -i'" >> /etc/profile
echo "alias ll='ls -l'" >> /etc/profile
echo "alias grep='grep --color=auto'" >> /etc/profile
-# make sure we have the latest pci,usb and hotplug ids
+# Make sure we have the latest pci,usb and hotplug ids
[ -x /sbin/update-pciids ] && /sbin/update-pciids
[ -x /sbin/update-usbids ] && /sbin/update-usbids
if [ -d /usr/share/hwdata ]
ln -s /usr/share/misc/usb.ids /usr/share/hwdata/usb.ids
fi
-# setup opengl in /etc (if configured)
+# Setup opengl in /etc (if configured)
[ -x /usr/sbin/openglify ] && /usr/sbin/openglify
# Setup configured display manager
# touch /etc/asound.state
touch /etc/asound.state
-# tweak the motd for gentoo releases
+# Tweak the MOTD for Gentoo releases
case ${clst_livecd_type} in
gentoo-release-universal )
cat /etc/generic.motd.txt /etc/universal.motd.txt \
rm -f /etc/generic.motd.txt /etc/universal.motd.txt /etc/minimal.motd.txt /etc/livecd.motd.txt /etc/gamecd.motd.txt
-# setup splash/bootsplash (if called for)
-if [ "${clst_livecd_splash_type}" == "bootsplash" -a -n "${clst_livecd_splash_theme}" ]
+# Setup splash/bootsplash (if called for)
+if [ "${clst_livecd_splash_type}" == "bootsplash" -a -n \
+ "${clst_livecd_splash_theme}" ]
then
if [ -d /etc/bootsplash/${clst_livecd_splash_theme} ]
then
sed -i 's:BOOTSPLASH_THEME=\"gentoo\":BOOTSPLASH_THEME=\"${clst_livecd_splash_theme}\":' /etc/conf.d/bootsplash
rm -f /etc/bootsplash/default
- ln -s "/etc/bootsplash/${clst_livecd_splash_theme}" /etc/bootsplash/default
+ ln -s "/etc/bootsplash/${clst_livecd_splash_theme}" \
+ /etc/bootsplash/default
else
echo "Error, cannot setup bootsplash theme ${clst_livecd_splash_theme}"
exit 1
fi
-
-elif [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
+elif [ "${clst_livecd_splash_type}" == "gensplash" -a -n \
+ "${clst_livecd_splash_theme}" ]
then
if [ -d /etc/splash/${clst_livecd_splash_theme} ]
then
ln -sf /lib/firmware /usr/lib/hotplug/firmware
fi
-
# Clear out locales
case ${clst_livecd_type} in
gentoo-release-minimal|gentoo-release-universal|gentoo-gamecd)
# Post configuration
case ${clst_livecd_type} in
gentoo-gamecd )
- # we grab our configuration
+ # 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
+ # Here we replace out game information into several files
sed -i -e "s:##GAME_NAME:${GAME_NAME}:" /etc/motd
- # here we setup our xinitrc
+ # Here we setup our xinitrc
echo "exec ${GAME_EXECUTABLE}" > /etc/X11/xinit/xinitrc
fi
touch /etc/startx
;;
gentoo-release-livecd )
- # first we setup the livecd-kernel package
+ # First we setup the livecd-kernel package
if [ -e /opt/installer/misc/mkvardb ]
then
chmod +x /opt/installer/misc/mkvardb
esac
fi
-# perform any rcadd then any rcdel
+# Perform any rcadd then any rcdel
if [ -n "${clst_rcadd}" ] || [ -n "${clst_rcdel}" ]
then
if [ -n "${clst_rcadd}" ]
then
- for x in ${clst_rcadd}
- do
- echo "Adding ${x%%|*} to ${x##*|}"
- if [ ! -d /etc/runlevels/${x%%|*} ]
- then
- echo "Runlevel ${x##*|} doesn't exist .... creating it"
- mkdir -p "/etc/runlevels/${x##*|}"
- fi
- rc-update add "${x%%|*}" "${x##*|}"
- done
+ for x in ${clst_rcadd}
+ do
+ echo "Adding ${x%%|*} to ${x##*|}"
+ if [ ! -d /etc/runlevels/${x%%|*} ]
+ then
+ echo "Runlevel ${x##*|} doesn't exist .... creating it"
+ mkdir -p "/etc/runlevels/${x##*|}"
+ fi
+ rc-update add "${x%%|*}" "${x##*|}"
+ done
fi
if [ -n "${clst_rcdel}" ]
then
- for x in ${clst_rcdel}
- do
- rc-update del "${x%%|*}" "${x##*|}"
- done
- for x in $(ls /etc/runlevels)
- do
- CONTENTS=$(find /etc/runlevels/${x} -type f)
- if [ -z "${CONTENTS}" ]
- then
- echo "${x}: Empty runlevel found.... deleting"
- rmdir "/etc/runlevels/${x}"
- fi
- done
-
+ for x in ${clst_rcdel}
+ do
+ rc-update del "${x%%|*}" "${x##*|}"
+ done
+ for x in $(ls /etc/runlevels)
+ do
+ CONTENTS=$(find /etc/runlevels/${x} -type f)
+ if [ -z "${CONTENTS}" ]
+ then
+ echo "${x}: Empty runlevel found.... deleting"
+ rmdir "/etc/runlevels/${x}"
+ fi
+ done
fi
fi