# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.406 2005/11/29 20:47:25 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.407 2005/11/30 21:34:03 wolf31o2 Exp $
+
+ 30 Nov 2005; Chris Gianelloni <wolf31o2@gentoo.org> arch/ppc.py,
+ targets/embedded/embedded-controller.sh,
+ targets/embedded/embedded-fs-runscript.sh,
+ targets/livecd-stage2/livecd-stage2-controller.sh,
+ targets/netboot/netboot-combine.sh, targets/netboot/netboot-controller.sh,
+ targets/stage1/stage1-chroot.sh, targets/stage4/stage4-controller.sh,
+ targets/support/bootloader-setup.sh, targets/support/chroot-functions.sh,
+ targets/support/create-iso.sh, targets/support/filesystem-functions.sh,
+ targets/support/functions.sh, targets/support/kill-chroot-pids.sh,
+ targets/support/kmerge.sh, targets/support/livecdfs-update.sh,
+ targets/support/rc-update.sh:
+ Changed multiple spaces to tabs to satisfy my OCD.
29 Nov 2005; Eric Edgar <rocket@gentoo.org>
targets/support/chroot-functions.sh:
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/arch/ppc.py,v 1.14 2005/07/06 22:07:46 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/arch/ppc.py,v 1.15 2005/11/30 21:34:03 wolf31o2 Exp $
import os,builder
from catalyst_support import *
if not os.path.exists("/usr/bin/linux32"):
raise CatalystError,"required /usr/bin/linux32 executable not found."
self.settings["CHROOT"]="/usr/bin/linux32 chroot"
- else:
+ else:
self.settings["CHROOT"]="chroot"
class arch_power_ppc(generic_ppc):
#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-controller.sh,v 1.6 2005/10/17 19:01:06 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-controller.sh,v 1.7 2005/11/30 21:34:03 wolf31o2 Exp $
. ${clst_sharedir}/targets/support/functions.sh
. ${clst_sharedir}/targets/support/filesystem-functions.sh
# ;;
- pre-kmerge)
- # Sets up the build environment before any kernels are compiled
- exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh
- ;;
- post-kmerge)
- # Cleans up the build environment after the kernels are compiled
- exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh
- ;;
+ pre-kmerge)
+ # Sets up the build environment before any kernels are compiled
+ exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh
+ ;;
+ post-kmerge)
+ # Cleans up the build environment after the kernels are compiled
+ exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh
+ ;;
kernel)
shift
${clst_sharedir}/targets/support/target_image_setup.sh $1
;;
- livecd-update)
- # now, finalize and tweak the livecd fs (inside of the chroot)
+ livecd-update)
+ # now, finalize and tweak the livecd fs (inside of the chroot)
exec_in_chroot ${clst_sharedir}/targets/support/livecdfs-update.sh
;;
# 1 = mkfs path, 2 = fs name, 3 = pkg name
fs_check() {
- if [ ! -e ${1} ]; then
+ if [ ! -e ${1} ]; then
die "You must install ${3} in order to produce ${2} images"
- fi
+ fi
}
case $1 in
- jffs)
+ jffs)
fs_check /usr/sbin/mkfs.jffs jffs sys-fs/mtd
mkfs.jffs -d ${root_fs_path} -o ${clst_image_path}/root.img \
- ${clst_embedded_fs_ops} || die "Could not create a jffs filesystem"
+ ${clst_embedded_fs_ops} || die "Could not create a jffs filesystem"
;;
- jffs2)
+ jffs2)
fs_check /usr/sbin/mkfs.jffs2 jffs2 sys-fs/mtd
mkfs.jffs2 --root=${root_fs_path} --output=${clst_image_path}/root.img\
- ${clst_embedded_fs_ops} || die "Could not create a jffs2 filesystem"
+ ${clst_embedded_fs_ops} || die "Could not create a jffs2 filesystem"
;;
- cramfs)
+ cramfs)
fs_check /sbin/mkcramfs cramfs sys-fs/cramfs
mkcramfs ${clst_embedded_fs_ops} ${root_fs_path} \
- ${clst_image_path}/root.img || die "Could not create a cramfs filesystem"
+ ${clst_image_path}/root.img || die "Could not create a cramfs filesystem"
;;
- squashfs)
+ squashfs)
fs_check /usr/bin/mksquashfs squashfs sys-fs/squashfs-tools
mksquashfs ${root_fs_path} ${clst_image_path}/root.img \
- ${clst_embedded_fs_ops} || die "Could not create a squashfs filesystem"
+ ${clst_embedded_fs_ops} || die "Could not create a squashfs filesystem"
;;
- *)
+ *)
;;
esac
# Copyright 1999-2005 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.15 2005/11/14 19:20:30 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/livecd-stage2-controller.sh,v 1.16 2005/11/30 21:34:03 wolf31o2 Exp $
. ${clst_sharedir}/targets/support/functions.sh
. ${clst_sharedir}/targets/support/filesystem-functions.sh
# execute copy gamecd.conf if we're a gamecd
if [ "${clst_livecd_type}" = "gentoo-gamecd" ]
then
- 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
+ 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
;;
livecd-update)
#!/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/netboot/netboot-combine.sh,v 1.4 2005/07/05 21:53:41 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/netboot/netboot-combine.sh,v 1.5 2005/11/30 21:34:03 wolf31o2 Exp $
. ${clst_sharedir}/targets/support/chroot-functions.sh
. ${clst_sharedir}/targets/support/functions.sh
for kname in ${clst_boot_kernel}
do
- mkdir -p ${clst_chroot_path}/tmp/staging/initrd-${kname}
- cp -r ${clst_chroot_path}/tmp/image ${clst_chroot_path}/tmp/staging/initrd-${kname}
- extract_modules ${clst_chroot_path}/tmp/staging/initrd-${kname} ${kname}
- create_normal_loop ${clst_chroot_path}/tmp/staging/initrd-${kname} ${clst_target_path} initrd-${kname}.igz
- rm -r ${clst_chroot_path}/tmp/staging/initrd-${kname}
+ mkdir -p ${clst_chroot_path}/tmp/staging/initrd-${kname}
+ cp -r ${clst_chroot_path}/tmp/image ${clst_chroot_path}/tmp/staging/initrd-${kname}
+ extract_modules ${clst_chroot_path}/tmp/staging/initrd-${kname} ${kname}
+ create_normal_loop ${clst_chroot_path}/tmp/staging/initrd-${kname} ${clst_target_path} initrd-${kname}.igz
+ rm -r ${clst_chroot_path}/tmp/staging/initrd-${kname}
- case ${clst_mainarch} in
- alpha)
+ case ${clst_mainarch} in
+ alpha)
# Until aboot is patched this is broken currently.
- # please use catalyst 1.1.5 or older
+ # please use catalyst 1.1.5 or older
- #TEST TEST TEST TEST
- #http://lists.debian.org/debian-alpha/2004/07/msg00094.html
- #make \
- # -C /usr/src/linux \
- # INITRD=/initrd.gz \
- # HPATH="/usr/src/linux/include" \
- # vmlinux bootpfile \
- # || exit 1
- #cp /usr/src/linux/arch/alpha/boot/bootpfile /netboot.alpha || exit 1
- ;;
- arm)
- #TEST TEST TEST TEST
- cp /${clst_chroot_path}/tmp/${kname} /netboot-${kname}.arm || exit 1
- cat /${clst_target_path}/initrd-${kname}.igz >> /${clst_target_path}/netboot-${kname}.arm || exit 1
- #make \
- # -C /usr/src/linux \
- # INITRD=/initrd.gz \
- # bootpImage \
- # || exit 1
- ;;
- hppa)
- # We have to remove the previous image because the file is considered
- # as a tape by palo and then not truncated but rewritten.
- #TEST TEST TEST TEST
- rm -f /netboot-${kname}.hppa
+ #TEST TEST TEST TEST
+ #http://lists.debian.org/debian-alpha/2004/07/msg00094.html
+ #make \
+ # -C /usr/src/linux \
+ # INITRD=/initrd.gz \
+ # HPATH="/usr/src/linux/include" \
+ # vmlinux bootpfile \
+ # || exit 1
+ #cp /usr/src/linux/arch/alpha/boot/bootpfile /netboot.alpha || exit 1
+ ;;
+ arm)
+ #TEST TEST TEST TEST
+ cp /${clst_chroot_path}/tmp/${kname} /netboot-${kname}.arm || exit 1
+ cat /${clst_target_path}/initrd-${kname}.igz >> /${clst_target_path}/netboot-${kname}.arm || exit 1
+ #make \
+ # -C /usr/src/linux \
+ # INITRD=/initrd.gz \
+ # bootpImage \
+ # || exit 1
+ ;;
+ hppa)
+ # We have to remove the previous image because the file is considered
+ # as a tape by palo and then not truncated but rewritten.
+ #TEST TEST TEST TEST
+ rm -f /netboot-${kname}.hppa
- palo \
- -k /${clst_chroot_path}/tmp/${kname} \
- -r /${clst_target_path}/initrd-${kname}.igz \
- -s /${clst_target_path}/netboot-${kname}.hppa \
- -f foo \
- -b /usr/share/palo/iplboot \
- -c "0/vmlinux root=/dev/ram0 ${cmdline_opts}" \
- || exit 1
- ;;
- sparc*)
- #TEST TEST TEST TEST
- #elftoaout -o /netboot-${kname}.${clst_mainarch} /usr/src/linux/vmlinux
- #elftoaout -o /netboot-${kname}.${clst_mainarch} /${kname}
- #piggy=${clst_mainarch/sparc/piggyback}
- #${piggy} /netboot-${kname}.${clst_mainarch} /usr/src/linux/System.map /initrd-${kname}.igz
- ;;
- x86)
-
- mknbi-linux \
- -k /${clst_chroot_path}/tmp/${kname} \
- -r /${clst_target_path}/initrd-${kname}.igz \
- -o /${clst_target_path}/netboot-${kname}.x86 \
- -x \
- -a "root=/dev/ram0 ${cmdline_opts}" \
- || exit 1
- ;;
- *) exit 1;;
- esac
+ palo \
+ -k /${clst_chroot_path}/tmp/${kname} \
+ -r /${clst_target_path}/initrd-${kname}.igz \
+ -s /${clst_target_path}/netboot-${kname}.hppa \
+ -f foo \
+ -b /usr/share/palo/iplboot \
+ -c "0/vmlinux root=/dev/ram0 ${cmdline_opts}" \
+ || exit 1
+ ;;
+ sparc*)
+ #TEST TEST TEST TEST
+ #elftoaout -o /netboot-${kname}.${clst_mainarch} /usr/src/linux/vmlinux
+ #elftoaout -o /netboot-${kname}.${clst_mainarch} /${kname}
+ #piggy=${clst_mainarch/sparc/piggyback}
+ #${piggy} /netboot-${kname}.${clst_mainarch} /usr/src/linux/System.map /initrd-${kname}.igz
+ ;;
+ x86)
+
+ mknbi-linux \
+ -k /${clst_chroot_path}/tmp/${kname} \
+ -r /${clst_target_path}/initrd-${kname}.igz \
+ -o /${clst_target_path}/netboot-${kname}.x86 \
+ -x \
+ -a "root=/dev/ram0 ${cmdline_opts}" \
+ || exit 1
+ ;;
+ *) exit 1;;
+ esac
done
#!/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/netboot/netboot-controller.sh,v 1.6 2005/11/29 20:30:42 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/netboot/netboot-controller.sh,v 1.7 2005/11/30 21:34:03 wolf31o2 Exp $
. ${clst_sharedir}/targets/support/functions.sh
. ${clst_sharedir}/targets/support/filesystem-functions.sh
exec_in_chroot ${clst_sharedir}/targets/${clst_target}/${clst_target}-chroot.sh
;;
- pre-kmerge)
- # Sets up the build environment before any kernels are compiled
- #exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh
- ;;
- post-kmerge)
- # Cleans up the build environment after the kernels are compiled
- #exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh
- ;;
+ pre-kmerge)
+ # Sets up the build environment before any kernels are compiled
+ #exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh
+ ;;
+ post-kmerge)
+ # Cleans up the build environment after the kernels are compiled
+ #exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh
+ ;;
kernel)
shift
- export clst_kname="$1"
+ export clst_kname="$1"
export clst_root_path="/"
- #exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh
- #exec_in_chroot ${clst_sharedir}/targets/support/kmerge.sh
- #exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh
+ #exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh
+ #exec_in_chroot ${clst_sharedir}/targets/support/kmerge.sh
+ #exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh
#extract_kernels kernels
;;
#!/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/stage1/stage1-chroot.sh,v 1.36 2005/08/09 19:02:31 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.37 2005/11/30 21:34:03 wolf31o2 Exp $
. /tmp/chroot-functions.sh
## Sanity check profile
if [ -z "${clst_buildpkgs}" ]
then
- echo "Your profile seems to be broken."
- echo "Could not build a list of build packages."
- echo "Double check your /etc/make.profile link and the 'packages' files."
- exit 1
+ echo "Your profile seems to be broken."
+ echo "Could not build a list of build packages."
+ echo "Double check your /etc/make.profile link and the 'packages' files."
+ exit 1
fi
#!/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/stage4/stage4-controller.sh,v 1.9 2005/10/17 19:01:06 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage4/stage4-controller.sh,v 1.10 2005/11/30 21:34:03 wolf31o2 Exp $
. ${clst_sharedir}/targets/support/functions.sh
enter)
${clst_CHROOT} ${clst_chroot_path}
;;
- pre-kmerge)
- # Sets up the build environment before any kernels are compiled
- exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh
- ;;
- post-kmerge)
- # Cleans up the build environment after the kernels are compiled
- exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh
- ;;
+ pre-kmerge)
+ # Sets up the build environment before any kernels are compiled
+ exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh
+ ;;
+ post-kmerge)
+ # Cleans up the build environment after the kernels are compiled
+ exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh
+ ;;
kernel)
shift
export clst_kname="$1"
exec_in_chroot ${clst_sharedir}/targets/support/livecdfs-update.sh
;;
- bootloader)
+ bootloader)
exit 0
;;
#!/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/bootloader-setup.sh,v 1.19 2005/11/21 17:14:32 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/bootloader-setup.sh,v 1.20 2005/11/30 21:34:03 wolf31o2 Exp $
. ${clst_sharedir}/targets/support/functions.sh
. ${clst_sharedir}/targets/support/filesystem-functions.sh
# For now we supply a prebuilt file, prebuilt configuration
# and prebuilt boot message. This can be enhanced later on
# but the following suffices for now:
-
+
# this sets up the config file for yaboot
icfg=$1/boot/yaboot.conf
kmsg=$1/boot/boot.msg
echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
echo >> ${icfg}
echo "image=/boot/${x}" >> ${icfg}
-
+
if [ -e "/boot/${x}.igz" ]
then
- echo "initrd=/boot/${x}.igz" >> ${icfg}
+ echo "initrd=/boot/${x}.igz" >> ${icfg}
fi
-
+
echo "label=${x}" >> ${icfg}
echo "read-write" >> ${icfg}
if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
then
- echo "append=\"${default_append_line} splash=silent,theme:${clst_livecd_splash_theme}\"" >> ${icfg}
+ echo "append=\"${default_append_line} splash=silent,theme:${clst_livecd_splash_theme}\"" >> ${icfg}
else
- echo "append=\"${default_append_line} splash=silent\"" >> ${icfg}
+ echo "append=\"${default_append_line} splash=silent\"" >> ${icfg}
fi
done
;;
else
echo " append ${default_append_line} initrd=${x}.igz vga=791 splash=silent" >> ${icfg}
fi
-
+
echo >> ${icfg}
echo " ${x}" >> ${kmsg}
echo "label ${x}-nofb" >> ${icfg}
echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
echo >> ${icfg}
echo "title ${x}" >> ${icfg}
-
+
if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
then
echo "kernel /boot/${x} ${default_append_line} vga=791 splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet" >> ${icfg}
then
echo "initrd /boot/${x}.igz" >> ${icfg}
fi
-
+
echo >> ${icfg}
echo "title ${x} [ No FrameBuffer ]" >> ${icfg}
echo "kernel ${x} /boot/${x} ${default_append_line}" >> ${icfg}
trap "echo SIGHUP signal recieved killing $0 with pid $$;kill -9 $$" SIGHUP
trap "echo SIGKILL signal recieved killing $0 with pid $$;kill -9 $$" SIGKILL
-#SIGINT interrupt character (usually Ctrl-C)
+#SIGINT interrupt character (usually Ctrl-C)
# * example: high-level sequence of events
# * my process (call it "P") is running
# * user types ctrl-c
# * kernel recognizes this and generates SIGINT signal
trap "echo SIGINT signal recieved killing $0 with pid $$;kill -9 $$" SIGINT
-
-
check_portage_version(){
portage_version=`/usr/lib/portage/bin/portageq best_version / sys-apps/portage \
| cut -d/ -f2 | cut -d- -f2,3`
}
check_genkernel_version(){
- if [ -x /usr/bin/genkernel ]
- then
- genkernel_version=$(genkernel --version)
- genkernel_version_major=${genkernel_version%%.*}
- genkernel_version_minor_sub=${genkernel_version#${genkernel_version_major}.}
- genkernel_version_minor=${genkernel_version_minor_sub%%.*}
- genkernel_version_sub=${genkernel_version##*.}
- if [ -n "${genkernel_version}" -a "${genkernel_version_major}" -eq '3' -a "${genkernel_version_minor}" -ge '3' ]
- then
- echo "Genkernel version ${genkernel_version} found ... continuing"
- else
- echo "ERROR: Your genkernel version is too low in your seed stage. genkernel version 3.3.0"
- echo "or greater is required."
- exit 1
- fi
- else
- exit 1
- fi
+ if [ -x /usr/bin/genkernel ]
+ then
+ genkernel_version=$(genkernel --version)
+ genkernel_version_major=${genkernel_version%%.*}
+ genkernel_version_minor_sub=${genkernel_version#${genkernel_version_major}.}
+ genkernel_version_minor=${genkernel_version_minor_sub%%.*}
+ genkernel_version_sub=${genkernel_version##*.}
+ if [ -n "${genkernel_version}" -a "${genkernel_version_major}" -eq '3' -a "${genkernel_version_minor}" -ge '3' ]
+ then
+ echo "Genkernel version ${genkernel_version} found ... continuing"
+ else
+ echo "ERROR: Your genkernel version is too low in your seed stage. genkernel version 3.3.0"
+ echo "or greater is required."
+ exit 1
+ fi
+ else
+ exit 1
+ fi
}
-
+
setup_myfeatures(){
if [ -n "${clst_CCACHE}" ]
export clst_myfeatures="${clst_myfeatures} ccache"
#if [ "${clst_AUTORESUME}" = "1" -a -e /tmp/.clst_ccache ]
#then
- # echo "CCACHE Autoresume point found not emerging ccache"
+ # echo "CCACHE Autoresume point found not emerging ccache"
#else
- emerge --oneshot --nodeps -b -k ccache || exit 1
- # touch /tmp/.clst_ccache
+ emerge --oneshot --nodeps -b -k ccache || exit 1
+ # touch /tmp/.clst_ccache
#fi
fi
export DISTCC_HOSTS="${clst_distcc_hosts}"
#if [ "${clst_AUTORESUME}" = "1" -a -e /tmp/.clst_distcc ]
#then
- # echo "DISTCC Autoresume point found not emerging distcc"
+ # echo "DISTCC Autoresume point found not emerging distcc"
#else
- USE="-gtk -gnome" emerge --oneshot --nodeps -b -k distcc || exit 1
- #touch /tmp/.clst_distcc
+ USE="-gtk -gnome" emerge --oneshot --nodeps -b -k distcc || exit 1
+ #touch /tmp/.clst_distcc
#fi
mkdir -p /etc/distcc
echo "${clst_distcc_hosts}" > /etc/distcc/hosts
-
fi
}
if [ -n "${clst_PKGCACHE}" ]
then
export clst_myemergeopts="--usepkg --buildpkg --newuse"
- export bootstrap_opts="-r"
+ export bootstrap_opts="-r"
fi
}
setup_portage(){
- # portage needs to be merged manually with USE="build" set to avoid frying our
- # make.conf. emerge system could merge it otherwise.
+ # portage needs to be merged manually with USE="build" set to avoid frying our
+ # make.conf. emerge system could merge it otherwise.
- if [ "${clst_AUTORESUME}" = "1" -a -e /tmp/.clst_portage ]
- then
+ if [ "${clst_AUTORESUME}" = "1" -a -e /tmp/.clst_portage ]
+ then
echo "Portage Autoresume point found not emerging portage"
- else
+ else
USE="build" emerge --oneshot --nodeps portage
touch /tmp/.clst_portage || exit 1
- fi
+ fi
}
setup_gcc(){
}
update_env_settings(){
- /usr/sbin/env-update
- source /etc/profile
- [ -f /tmp/envscript ] && source /tmp/envscript
+ /usr/sbin/env-update
+ source /etc/profile
+ [ -f /tmp/envscript ] && source /tmp/envscript
}
die() {
- echo "$1"
- exit 1
+ echo "$1"
+ exit 1
}
make_destpath() {
export ROOT=${1}
if [ ! -d ${ROOT} ]
then
- install -d ${ROOT}
+ install -d ${ROOT}
fi
fi
}
run_emerge() {
- # Sets up the ROOT= parameter
- # with no options ROOT=/
- make_destpath ${clst_root_path}
+ # Sets up the ROOT= parameter
+ # with no options ROOT=/
+ make_destpath ${clst_root_path}
- if [ -n "${clst_VERBOSE}" ]
+ if [ -n "${clst_VERBOSE}" ]
then
echo "ROOT=${ROOT} emerge ${clst_myemergeopts} -vpt $@" || exit 1
emerge ${clst_myemergeopts} -vpt $@ || exit 3
fi
echo "emerge ${clst_myemergeopts} $@" || exit 1
-
+
if [ -n "${clst_FETCH}" ]
then
- export bootstrap_opts="-f"
+ export bootstrap_opts="-f"
emerge ${clst_myemergeopts} -f $@ || exit 1
fi
-
+
emerge ${clst_myemergeopts} $@ || exit 1
}
# Check if it's a dynamix exec
ldd ${1} > /dev/null 2>&1 || return
-
+
for lib in `ldd ${1} | awk '{ print $3 }'`
do
echo ${lib}
echo "WARNING : Some library was not found for ${lib} !"
fi
done
-
}
function copy_symlink() {
else
copy_file ${TARGET}
fi
- }
+ }
function copy_file() {
copy_symlink ${f}
fi
}
-
-
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/create-iso.sh,v 1.17 2005/11/22 15:37:03 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/create-iso.sh,v 1.18 2005/11/30 21:34:03 wolf31o2 Exp $
. ${clst_sharedir}/targets/support/functions.sh
. ${clst_sharedir}/targets/support/filesystem-functions.sh
# Check for our CD ISO creation tools
case ${clst_mainarch} in
- mips) cdmaker="sgibootcd"; cdmakerpkg="sys-boot/sgibootcd" ;;
+ mips) cdmaker="sgibootcd"; cdmakerpkg="sys-boot/sgibootcd" ;;
*) cdmaker="mkisofs"; cdmakerpkg="app-cdr/cdrtools" ;;
esac
# when booting from CD (current as of silo 1.4.8)
mv ${clst_target_path}/boot/mkisofs.sparc.fu /tmp
case ${clst_livecd_cdfstype} in
- zisofs)
+ zisofs)
echo "Running mkisofs.sparc.fu to create iso image...."
echo "/tmp/mkisofs.sparc.fu -z -o ${1} -D -r -pad -quiet -S 'boot/cd.b' -B '/boot/second.b' -s '/boot/silo.conf'"
echo "-V \"${clst_iso_volume_id}\" ${clst_target_path}"
/tmp/mkisofs.sparc.fu -z -o ${1} -D -r -pad -quiet -S 'boot/cd.b' -B '/boot/second.b' -s '/boot/silo.conf'\
-V "${clst_iso_volume_id}" ${clst_target_path} || die "Cannot make ISO image"
- ;;
- *)
+ ;;
+ *)
echo "Running mkisofs.sparc.fu to create iso image...."
echo "/tmp/mkisofs.sparc.fu -o ${1} -D -r -pad -quiet -S 'boot/cd.b' -B '/boot/second.b' -s '/boot/silo.conf'"
echo "-V \"${clst_iso_volume_id}\" ${clst_target_path}"
/tmp/mkisofs.sparc.fu -o ${1} -D -r -pad -quiet -S 'boot/cd.b' -B '/boot/second.b' -s '/boot/silo.conf'\
-V "${clst_iso_volume_id}" ${clst_target_path} || die "Cannot make ISO image"
- ;;
+ ;;
esac
rm /tmp/mkisofs.sparc.fu
# $1 is the target directory for the filesystem
create_normal_loop() {
- export source_path="${clst_destpath}"
- export destination_path="$1"
- export loopname="image.loop"
+ export source_path="${clst_destpath}"
+ export destination_path="$1"
+ export loopname="image.loop"
- #We get genkernel-built kernels and initrds in place, create the loopback fs on
- #$clst_target_path, mount it, copy our bootable filesystem over, umount it, and
- #we then have a ready-to-burn ISO tree at $clst_target_path.
+ #We get genkernel-built kernels and initrds in place, create the loopback fs on
+ #$clst_target_path, mount it, copy our bootable filesystem over, umount it, and
+ #we then have a ready-to-burn ISO tree at $clst_target_path.
- echo "Calculating size of loopback filesystem..."
- loopsize=`du -ks ${source_path} | cut -f1`
- [ "${loopsize}" = "0" ] && loopsize=1
- # Add 4MB for filesystem slop
- loopsize=`expr ${loopsize} + 4096`
- echo "Creating loopback file..."
- dd if=/dev/zero of=${destination_path}/${loopname} bs=1k count=${loopsize} || die "${loopname} creation failure"
- mke2fs -m 0 -F -q ${destination_path}/${loopname} || die "Couldn't create ext2 filesystem"
- install -d ${destination_path}/loopmount
- sync; sync; sleep 3 #try to work around 2.6.0+ loopback bug
- mount -t ext2 -o loop ${destination_path}/${loopname} ${destination_path}/loopmount || die "Couldn't mount loopback ext2 filesystem"
- sync; sync; sleep 3 #try to work around 2.6.0+ loopback bug
- echo "cp -a ${source_path}/* ${destination_path}/loopmount"
- cp -a ${source_path}/* ${destination_path}/loopmount
- [ $? -ne 0 ] && { umount ${destination_path}/${loopname}; die "Couldn't copy files to loopback ext2 filesystem"; }
- umount ${destination_path}/loopmount || die "Couldn't unmount loopback ext2 filesystem"
- rm -rf ${destination_path}/loopmount
- #now, $clst_target_path should contain a proper bootable image for our iso, including
- #boot loader and loopback filesystem.
+ echo "Calculating size of loopback filesystem..."
+ loopsize=`du -ks ${source_path} | cut -f1`
+ [ "${loopsize}" = "0" ] && loopsize=1
+ # Add 4MB for filesystem slop
+ loopsize=`expr ${loopsize} + 4096`
+ echo "Creating loopback file..."
+ dd if=/dev/zero of=${destination_path}/${loopname} bs=1k count=${loopsize} || die "${loopname} creation failure"
+ mke2fs -m 0 -F -q ${destination_path}/${loopname} || die "Couldn't create ext2 filesystem"
+ install -d ${destination_path}/loopmount
+ sync; sync; sleep 3 #try to work around 2.6.0+ loopback bug
+ mount -t ext2 -o loop ${destination_path}/${loopname} ${destination_path}/loopmount || die "Couldn't mount loopback ext2 filesystem"
+ sync; sync; sleep 3 #try to work around 2.6.0+ loopback bug
+ echo "cp -a ${source_path}/* ${destination_path}/loopmount"
+ cp -a ${source_path}/* ${destination_path}/loopmount
+ [ $? -ne 0 ] && { umount ${destination_path}/${loopname}; die "Couldn't copy files to loopback ext2 filesystem"; }
+ umount ${destination_path}/loopmount || die "Couldn't unmount loopback ext2 filesystem"
+ rm -rf ${destination_path}/loopmount
+ #now, $clst_target_path should contain a proper bootable image for our iso, including
+ #boot loader and loopback filesystem.
}
delete_from_chroot(){
if [ -e ${clst_chroot_path}${1} ]
then
- echo "removing ${clst_chroot_path}${1} from the chroot"
- rm -f ${clst_chroot_path}${1}
+ echo "removing ${clst_chroot_path}${1} from the chroot"
+ rm -f ${clst_chroot_path}${1}
fi
}
extract_cdtar() {
# Create a filesystem tree for the ISO at
- # $clst_target_path. We extract the "cdtar" to this directory,
+ # $clst_target_path. We extract the "cdtar" to this directory,
# which will normally contains a pre-built binary
# boot-loader/filesystem skeleton for the ISO.
# Takes the relative desination dir for the kernel as an arguement
# i.e boot or isolinux
- [ -z "$clst_boot_kernel" ] && die "Required key boot/kernel not defined, exiting"
+ [ -z "$clst_boot_kernel" ] && die "Required key boot/kernel not defined, exiting"
# install the kernels built in kmerge.sh
for x in ${clst_boot_kernel}
do
# change kernel name from "kernel" to "gentoo", for example
if [ -e ${1}/kernel-* ]
then
- mv ${1}/kernel-* ${1}/${x}
+ mv ${1}/kernel-* ${1}/${x}
fi
# change kernel name from "kernelz" to "gentoo", for example
if [ -e ${1}/kernelz-* ]
then
- mv ${1}/kernelz-* ${1}/${x}
+ mv ${1}/kernelz-* ${1}/${x}
fi
# change initrd name from "initrd" to "gentoo.igz", for example
if [ -f "${kmodules}" ]
then
- mkdir -p ${1}/
- tar xjf ${kmodules} -C ${1} lib
+ mkdir -p ${1}/
+ tar xjf ${kmodules} -C ${1} lib
else
- echo "Can't find kernel modules tarball at ${kmodules}. Skipping...."
+ echo "Can't find kernel modules tarball at ${kmodules}. Skipping...."
fi
}
extract_kernel() {
# change initramfs name from "initramfs" to "gentoo.igz", for example
if [ -e ${1}/initramfs-* ]
then
- mv ${1}/initramfs-* ${1}/${2}.igz
+ mv ${1}/initramfs-* ${1}/${2}.igz
fi
}
check_filesystem_type(){
case ${clst_fstype} in
- normal)
+ normal)
cmdline_opts="${cmdline_opts} looptype=normal loop=/image.loop"
- ;;
+ ;;
zisofs)
cmdline_opts="${cmdline_opts} looptype=zisofs loop=/zisofs"
;;
if [ "${clst_chroot_path}" == "/" ]
then
- echo "Aborting .... clst_chroot_path is set to /"
- echo "This is very dangerous"
- exit 1
+ echo "Aborting .... clst_chroot_path is set to /"
+ echo "This is very dangerous"
+ exit 1
fi
if [ "${clst_chroot_path}" == "" ]
then
- echo "Aborting .... clst_chroot_path is NOT set"
- echo "This is very dangerous"
- exit 1
+ echo "Aborting .... clst_chroot_path is NOT set"
+ echo "This is very dangerous"
+ exit 1
fi
j=0
# get files and dirs in /proc
for i in `ls /proc`
do
- # Test for directories
- if [ -d /proc/$i ]
- then
+ # Test for directories
+ if [ -d /proc/$i ]
+ then
# Search for exe containing string inside ${clst_chroot_path}
ls -la --color=never /proc/$i 2>&1 |grep exe|grep ${clst_chroot_path} > /dev/null
# If found
if [ $? == 0 ]
then
- # Assign the pid into the pids array
- pids[$j]=$i
- j=$(($j+1))
+ # Assign the pid into the pids array
+ pids[$j]=$i
+ j=$(($j+1))
+ fi
fi
- fi
done
if [ ${j} -gt 0 ]
then
- echo
- echo "Killing process(es)"
- echo "pid: process name"
- for pid in ${pids[@]}
- do
- P_NAME=$(ls -la --color=never /proc/${pid} 2>&1 |grep exe|grep ${clst_chroot_path}|awk '{print $11}')
- echo ${pid}: ${P_NAME}
- done
- echo
- echo "Press Ctrl-C within 10 seconds to abort"
-
- sleep 10
+ echo
+ echo "Killing process(es)"
+ echo "pid: process name"
+ for pid in ${pids[@]}
+ do
+ P_NAME=$(ls -la --color=never /proc/${pid} 2>&1 |grep exe|grep ${clst_chroot_path}|awk '{print $11}')
+ echo ${pid}: ${P_NAME}
+ done
+ echo
+ echo "Press Ctrl-C within 10 seconds to abort"
+
+ sleep 10
- for pid in ${pids[@]}
- do
- kill -9 ${pid}
- done
+ for pid in ${pids[@]}
+ do
+ kill -9 ${pid}
+ done
fi
#echo "USE Flags match"
USE_MATCH=1
else
- if [ -n "${clst_KERNCACHE}" ]
- then
+ if [ -n "${clst_KERNCACHE}" ]
+ then
[ -d /usr/portage/packages/gk_binaries/${clst_kname}/ebuilds ] && \
rm -r /usr/portage/packages/gk_binaries/${clst_kname}/ebuilds
[ -e /usr/portage/packages/gk_binaries/${clst_kname}/usr/src/linux/.config ] && \
rm /usr/portage/packages/gk_binaries/${clst_kname}/usr/src/linux/.config
- fi
+ fi
fi
fi
echo "${KERNELVERSION}" >> /etc/portage/profile/package.provided
fi
fi
- [ -d /usr/src/linux ] && rm /usr/src/linux
+ [ -d /usr/src/linux ] && rm /usr/src/linux
ln -s /usr/portage/packages/gk_binaries/${clst_kname}/usr/src/linux /usr/src/linux
else
- USE="${USE} symlink build" emerge "${clst_ksource}" || exit 1
+ 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 [ "${EXTRAVERSION_MATCH}" != "1" ]
then
- if [ "${clst_kextraversion}" != "" ]
- then
+ if [ "${clst_kextraversion}" != "" ]
+ then
echo "Setting extraversion to ${clst_kextraversion}"
sed -i -e "s:EXTRAVERSION \(=.*\):EXTRAVERSION \1-${clst_kextraversion}:" /usr/src/linux/Makefile
- echo ${clst_kextraversion} > /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
- else
- touch /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
- fi
+ echo ${clst_kextraversion} > /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
+ else
+ touch /usr/portage/packages/gk_binaries/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
+ fi
fi
#!/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.23 2005/11/17 22:27:13 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/livecdfs-update.sh,v 1.24 2005/11/30 21:34:03 wolf31o2 Exp $
. /tmp/chroot-functions.sh
update_env_settings
# http://bugs.gentoo.org/show_bug.cgi?id=60887
mv /etc/fstab /etc/fstab.old
echo "####################################################" >> /etc/fstab
-echo "## ATTENTION: THIS IS THE FSTAB ON THE LIVECD ##" >> /etc/fstab
-echo "## PLEASE EDIT THE FSTAB at /mnt/gentoo/etc/fstab ##" >> /etc/fstab
+echo "## ATTENTION: THIS IS THE FSTAB ON THE LIVECD ##" >> /etc/fstab
+echo "## PLEASE EDIT THE FSTAB at /mnt/gentoo/etc/fstab ##" >> /etc/fstab
echo "####################################################" >> /etc/fstab
cat /etc/fstab.old >> /etc/fstab
rm /etc/fstab.old
# Clear out locales
case ${clst_livecd_type} in
- gentoo-release-minimal|gentoo-release-universal|gentoo-gamecd)
- rm -rf /usr/lib/locale/{a,b,c,d,e{l,n_{A,B,C,D,G,H,I,N,P,S,US.,Z},s,t,u},f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,w,x,y,z}*
- ;;
+ gentoo-release-minimal|gentoo-release-universal|gentoo-gamecd)
+ rm -rf /usr/lib/locale/{a,b,c,d,e{l,n_{A,B,C,D,G,H,I,N,P,S,US.,Z},s,t,u},f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,w,x,y,z}*
+ ;;
esac
# Post configuration
if [ -e /tmp/gamecd.conf ]
then
- source /tmp/gamecd.conf || exit 1
- rm /tmp/gamecd.conf
+ 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 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
+ # here we setup our xinitrc
+ echo "exec ${GAME_EXECUTABLE}" > /etc/X11/xinit/xinitrc
fi
# This is my hack to reduce tmpfs usage
if [ "${clst_spec_prefix}" == "livecd" ]
then
- # default programs that we always want to start
- rc-update del iptables default
- rc-update del netmount default
- rc-update add autoconfig default
- rc-update del keymaps
- rc-update del serial
- rc-update del consolefont
- 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
+ # default programs that we always want to start
+ rc-update del iptables default
+ rc-update del netmount default
+ rc-update add autoconfig default
+ rc-update del keymaps
+ rc-update del serial
+ rc-update del consolefont
+ 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
- # Do some livecd_type specific rc-update changes
- case ${clst_livecd_type} in
- gentoo-gamecd )
+ # Do some livecd_type specific rc-update changes
+ case ${clst_livecd_type} in
+ gentoo-gamecd )
rc-update add spind default
rc-update add x-setup default
- ;;
+ ;;
gentoo-release-livecd )
rc-update add spind default
rc-update add x-setup default
rc-update add spind default
rc-update add x-setup default
;;
- *)
- ;;
- esac
+ *)
+ ;;
+ esac
fi
# perform any rcadd then any rcdel
if [ -n "${clst_rcadd}" ] || [ -n "${clst_rcdel}" ]
then
- if [ -n "${clst_rcadd}" ]
- then
+ if [ -n "${clst_rcadd}" ]
+ then
for x in ${clst_rcadd}
do
- echo "Adding ${x%%|*} to ${x##*|}"
- if [ ! -d /etc/runlevels/${x%%|*} ]
- then
+ 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##*|}"
+ fi
+ rc-update add "${x%%|*}" "${x##*|}"
done
- fi
+ fi
- if [ -n "${clst_rcdel}" ]
- then
+ if [ -n "${clst_rcdel}" ]
+ then
for x in ${clst_rcdel}
do
- rc-update del "${x%%|*}" "${x##*|}"
+ 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"
+ CONTENTS=$(find /etc/runlevels/${x} -type f)
+ if [ -z "${CONTENTS}" ]
+ then
+ echo "${x}: Empty runlevel found.... deleting"
rmdir "/etc/runlevels/${x}"
- fi
+ fi
done
-
- fi
+
+ fi
fi