change the code to use more case statements. Fix gcc issue in stage1.
authorEric Edgar <rocket@gentoo.org>
Wed, 6 Apr 2005 23:23:57 +0000 (23:23 +0000)
committerEric Edgar <rocket@gentoo.org>
Wed, 6 Apr 2005 23:23:57 +0000 (23:23 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@588 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
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

index ce183c3f2c35b08cb36b113ec86391ab42f32896..cb9a3efcaa529c0d211df1ff778d4c916ff6a5db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
 # 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,
index 0eed99a0212efae066f29f64ddb1c2949aa21edc..d5bc653007b21b39b45c412231eafe6c8bc414f0 100755 (executable)
@@ -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/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
 
@@ -39,16 +39,6 @@ case $1 in
                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
@@ -59,10 +49,11 @@ case $1 in
                                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
index 1bdf9eb1abb95f1e933921872940e581b9b51c31..fa6bedfbb5d613ebcb69e74decfbe02c690e6948 100755 (executable)
@@ -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/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
 
@@ -51,23 +51,22 @@ case $1 in
                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
index 87a068b862c36165a58fe64d0ff18d102ab54a6d..b1fdc6ecc4ce4f600b62a5f0eef8e863847b0f48 100755 (executable)
@@ -1,19 +1,19 @@
 #!/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
index 6a3201ae9fbc5f1483b21e6bc95c045dd2e8d4f9..bf83a2c64e175a1c092ee757da4985e2df6bf9ec 100755 (executable)
@@ -6,10 +6,13 @@ copy_to_chroot(){
        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(){
@@ -23,8 +26,7 @@ exec_in_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
@@ -38,7 +40,7 @@ exec_in_chroot(){
        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
index df96cabfffc2cf8fc9f1bef8a4902f0301f66c3e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100755 (executable)
@@ -1,17 +0,0 @@
-#!/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
index b8c98e88bcf9896919b0184d4c429d82cf6ba957..3f0678250a5dbc5f6bb3d9a4d29a937c8d6e21e8 100755 (executable)
@@ -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/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
@@ -15,6 +15,7 @@ fi
 # 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
@@ -32,14 +33,16 @@ rc-update add pwgen 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}" ]
@@ -61,15 +64,39 @@ then
        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
@@ -137,31 +164,29 @@ mkdir -p /etc/opengl
 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
 
@@ -207,3 +232,28 @@ then
        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
+
index 2a435332d1f8f340a38794a2dc19184e738f9b31..06be88f68e5d33442287d8a555b42730ef5930d3 100755 (executable)
@@ -5,23 +5,16 @@
 /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
+