# Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
# Distributed under the GPL v2
+ 11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
+ targets/embedded/embedded-chroot.sh,
+ targets/embedded/embedded-controller.sh, targets/grp/grp-controller.sh,
+ targets/livecd-stage2/livecd-stage2-controller.sh,
+ targets/netboot/netboot-combine.sh, targets/netboot/netboot-controller.sh,
+ targets/netboot/netboot-image.sh, targets/netboot2/netboot2-copyfile.sh,
+ targets/stage1/stage1-controller.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/mips-arcload_conf.sh,
+ targets/tinderbox/tinderbox-chroot.sh:
+ More trailing whitespace cleanups
+
11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
modules/catalyst/arch/arm.py, modules/catalyst/arch/mips.py,
modules/catalyst/arch/x86.py, modules/catalyst/config.py,
run_merge -o "${clst_embedded_packages}"
export clst_root_path="${DESTROOT}"
-export INSTALL_MASK="${clst_install_mask}"
+export INSTALL_MASK="${clst_install_mask}"
run_merge -1 -O "${clst_embedded_packages}"
# package)
# export root_fs_path="${clst_chroot_path}/tmp/mergeroot"
# install -d ${clst_image_path}
-
+
# ${clst_sharedir}/targets/embedded/embedded-fs-runscript.sh \
# ${clst_embedded_fs_type} || exit 1
# imagesize=`du -sk ${clst_image_path}/root.img | cut -f1`
${clst_sharedir}/targets/support/bootloader-setup.sh ${1}
;;
-
+
iso)
shift
${clst_sharedir}/targets/support/create-iso.sh ${1}
clean)
exit 0
;;
-
+
*)
exit 1
;;
fi
;;
esac
-
+
# move over the environment
cp -f ${clst_sharedir}/livecd/files/livecd-bashrc \
${clst_chroot_path}/root/.bashrc
${clst_chroot_path}/root/.bash_profile
cp -f ${clst_sharedir}/livecd/files/livecd-local.start \
${clst_chroot_path}/etc/conf.d/local.start
-
+
# execute copy gamecd.conf if we're a gamecd
if [ "${clst_livecd_type}" = "gentoo-gamecd" ]
then
alpha)
# Until aboot is patched this is broken currently.
# please use catalyst 1.1.5 or older
-
+
#TEST TEST TEST TEST
#http://lists.debian.org/debian-alpha/2004/07/msg00094.html
#make \
mkdir -p ${clst_chroot_path}/etc/busybox/${clst_CHOST}
cp -v ${clst_netboot_busybox_config} \
${clst_chroot_path}/etc/busybox/${clst_CHOST}/busybox.config
- clst_use="savedconfig"
+ clst_use="savedconfig"
fi
# Main Busybox emerge
echo "Copying files to ${clst_root_path}"
clst_files="/bin/busybox ${clst_files} "
for f in ${clst_files}
-do
+do
copy_file ${f}
done
echo "Done copying files"
echo ">>> Copying initramfs files to ${clst_merge_path} (in chroot) ..."
[ ! -d "${clst_merge_path}" ] && mkdir -p ${clst_merge_path}
for f in ${clst_files}
-do
+do
# copy it to the merge path
cp -pPRf --parents $(eval echo ${f}) ${clst_merge_path}
;;
run)
cp ${clst_sharedir}/targets/stage1/build.py ${clst_chroot_path}/tmp
-
+
# Setup "ROOT in chroot" dir
install -d ${clst_chroot_path}/${clst_root_path}/etc
-
+
# Setup make.conf and make.profile link in "ROOT in chroot":
copy_to_chroot ${clst_chroot_path}/etc/make.conf /${clst_root_path}/etc
copy_to_chroot ${clst_chroot_path}/etc/make.profile \
unmerge)
shift
export clst_packages="$*"
- exec_in_chroot ${clst_sharedir}/targets/support/unmerge.sh
+ exec_in_chroot ${clst_sharedir}/targets/support/unmerge.sh
;;
iso)
shift
echo "fgcolor=white" >> ${icfg}
echo "bgcolor=black" >> ${icfg}
echo "message=/boot/boot.msg" >> ${icfg}
-
+
# Here is where I fix up the boot.msg file.
sed -e 's/ARCH/PowerPC/' \
-e 's/HARDWARE/Apple and IBM hardware/' \
-i $kmsg
- # Setup the IBM yaboot.conf
+ # Setup the IBM yaboot.conf
etc_icfg=$1/etc/yaboot.conf
- mkdir -p $1/etc
+ mkdir -p $1/etc
IBM_YABOOT="FALSE"
echo "root=/dev/ram" >> ${etc_icfg}
echo "fgcolor=white" >> ${etc_icfg}
echo "bgcolor=black" >> ${etc_icfg}
echo "message=/boot/boot.msg" >> ${etc_icfg}
-
+
for x in ${clst_boot_kernel}
- do
+ do
eval "clst_kernel_console=\$clst_boot_kernel_${x}_console"
eval "clst_kernel_machine_type=\$clst_boot_kernel_${x}_machine_type"
eval custom_kopts=\$${x}_kernelopts
-
+
echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
if [ "${clst_kernel_machine_type}" == "ibm" ]
then
echo "label=${x}" >> ${icfg}
echo "read-write" >> ${icfg}
echo "append=\"${default_append_line}\"" >> ${icfg}
-
+
for y in ${clst_kernel_console}
do
echo >> ${icfg}
done
if [ "${IBM_YABOOT}" == "FALSE" ]
- then
+ then
rm ${etc_kmsg}
rmdir $1/etc
if [ -d $1/ppc ]
eval custom_kopts=\$${x}_kernelopts
echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
echo >> ${icfg}
-
+
eval "clst_kernel_softlevel=\$clst_boot_kernel_${x}_softlevel"
if [ -n "${clst_kernel_softlevel}" ]
eval custom_kopts=\$${x}_kernelopts
echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
echo >> ${icfg}
-
+
eval "clst_kernel_softlevel=\$clst_boot_kernel_${x}_softlevel"
-
+
if [ -n "${clst_kernel_softlevel}" ]
then
for y in ${clst_kernel_softlevel}
# ROOT is / by default, so remove any ROOT= settings from make.conf
sed -i '/ROOT=/d' /etc/make.conf
export ROOT=/
- if [ "${1}" != "/" -a -n "${1}" ]
+ if [ "${1}" != "/" -a -n "${1}" ]
then
echo "ROOT=\"${1}\"" >> /etc/make.conf
export ROOT=${1}
# Sets up the ROOT= parameter
# with no options ROOT=/
make_destpath ${clst_root_path}
-
- export EMERGE_WARNING_DELAY=0
+
+ export EMERGE_WARNING_DELAY=0
export CLEAN_DELAY=0
export EBEEP_IGNORE=0
export EPAUSE_IGNORE=0
STACK=${2}
[ "${STACK}" = "" ] && STACK=16 || STACK=$((${STACK} - 1 ))
- if [ ${STACK} -le 0 ]
+ if [ ${STACK} -le 0 ]
then
echo "WARNING : ${TARGET} : too many levels of symbolic links !"
return
mkdir -p ${clst_root_path}/`dirname ${1}`
[ ! -e ${clst_root_path}/${1} ] && \
cp -vfdp ${1} ${clst_root_path}/${1}
-
+
if [[ -n $(type -p realpath) ]]; then
TARGET=`realpath ${1}`
else
# should be in the cdtar, otherwise use the new style.
if [ -x ${clst_target_path}/boot/mkisofs.sparc.fu ]
then
- mv ${clst_target_path}/boot/mkisofs.sparc.fu /tmp
+ mv ${clst_target_path}/boot/mkisofs.sparc.fu /tmp
echo "Running mkisofs.sparc.fu to create iso image...."
echo "/tmp/mkisofs.sparc.fu ${mkisofs_zisofs_opts} -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}"
/tmp/mkisofs.sparc.fu ${mkisofs_zisofs_opts} -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"
elif [ -e ${clst_target_path}/gentoo.efimg ]
then
echo 'Creating ISO using EFI bootloader'
- echo "mkisofs -J -R -l ${mkisofs_zisofs_opts} -V \"${clst_iso_volume_id}\" -o ${1} -b gentoo.efimg -c boot.cat -no-emul-boot ${clst_target_path}"
- mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} -b gentoo.efimg -c boot.cat -no-emul-boot ${clst_target_path} || die "Cannot make ISO image"
- else
+ echo "mkisofs -J -R -l ${mkisofs_zisofs_opts} -V \"${clst_iso_volume_id}\" -o ${1} -b gentoo.efimg -c boot.cat -no-emul-boot ${clst_target_path}"
+ mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} -b gentoo.efimg -c boot.cat -no-emul-boot ${clst_target_path} || die "Cannot make ISO image"
+ else
echo "mkisofs -J -R -l ${mkisofs_zisofs_opts} -V \"${clst_iso_volume_id}\" -o ${1} ${clst_target_path}"
mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} ${clst_target_path} || die "Cannot make ISO image"
fi
|| die "Couldn't mount loopback ext2 filesystem"
sync; sync; sleep 3 # Try to work around 2.6.0+ loopback bug
echo "cp -pPR ${source_path}/* ${destination_path}/loopmount"
- cp -pPR ${source_path}/* ${destination_path}/loopmount
+ cp -pPR ${source_path}/* ${destination_path}/loopmount
[ $? -ne 0 ] && { umount ${destination_path}/${loopname}; \
die "Couldn't copy files to loopback ext2 filesystem"; }
umount ${destination_path}/loopmount \
chroot_path=${clst_chroot_path}${subdir}
copy_to_chroot ${clst_sharedir}/targets/support/chroot-functions.sh \
${subdir}/tmp/
- echo "Running ${file_name} in chroot ${chroot_path}"
+ echo "Running ${file_name} in chroot ${chroot_path}"
${clst_CHROOT} ${chroot_path} /tmp/${file_name} || exit 1
else
copy_to_chroot ${1} tmp/
chroot_path=${clst_chroot_path}
copy_to_chroot ${clst_sharedir}/targets/support/chroot-functions.sh \
tmp/
- echo "Running ${file_name} in chroot ${chroot_path}"
+ echo "Running ${file_name} in chroot ${chroot_path}"
${clst_CHROOT} ${chroot_path}/ /tmp/${file_name} || exit 1
fi
[ ! -e "${kbinary}" ] && die "Can't find kernel tarball at ${kbinary}"
mkdir -p ${1}/
- tar xjf ${kbinary} -C ${1}/
+ tar xjf ${kbinary} -C ${1}/
# change config name from "config-*" to "gentoo", for example
#mv ${1}/config-* ${1}/${x}-config
- rm ${1}/config-*
-
+ rm ${1}/config-*
+
# change kernel name from "kernel" to "gentoo", for example
if [ -e ${1}/kernel-* ]
then
# change initrd name from "initrd" to "gentoo.igz", for example
if [ -e ${1}/initrd-* ]
- then
+ then
mv ${1}/initrd-* ${1}/${x}.igz
fi
if [ -e ${1}/initramfs-* ]
- then
+ then
mv ${1}/initramfs-* ${1}/${x}.igz
fi
extract_modules() {
# $1 = Destination
- # $2 = kname
+ # $2 = kname
kmodules="${clst_chroot_path}/tmp/kerncache/${2}-modules-${clst_version_stamp}.tar.bz2"
if [ -f "${kmodules}" ]
cmdline_opts="${cmdline_opts} looptype=cramfs loop=/image.cramfs"
;;
esac
-}
+}
run_crossdev() {
crossdev ${clst_CHOST}
echo
echo "Killing process(es)"
echo "pid: process name"
- for pid in ${pids[@]}
- do
+ 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
echo "Press Ctrl-C within 10 seconds to abort"
-
+
sleep 10
- for pid in ${pids[@]}
+ for pid in ${pids[@]}
do
kill -9 ${pid}
done
then
GK_ARGS="${GK_ARGS} --kernel-cc=/usr/lib/ccache/bin/gcc --utils-cc=/usr/lib/ccache/bin/gcc"
fi
-
+
if [ -n "${clst_linuxrc}" ]
then
GK_ARGS="${GK_ARGS} --linuxrc=/tmp/linuxrc"
setup_gk_args
#echo "The GK_ARGS are"
- #echo ${GK_ARGS}
+ #echo ${GK_ARGS}
export clst_kernel_merge
export clst_initramfs_overlay
# Build our list of kernel packages
# 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
+USE_MATCH=0
if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE ]
then
STR1=$(for i in `cat /tmp/kerncache/${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}" ]
- then
+ then
#echo "USE Flags match"
- USE_MATCH=1
+ USE_MATCH=1
else
if [ -n "${clst_KERNCACHE}" ]
then
STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION`
STR2=${clst_kextraversion}
if [ "${STR1}" = "${STR2}" ]
- then
+ then
if [ -n "${clst_KERNCACHE}" ]
then
#echo "EXTRAVERSION match"
STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG`
STR2=`md5sum /var/tmp/${clst_kname}.config|awk '{print $1}'`
if [ "${STR1}" = "${STR2}" ]
- then
+ then
if [ -n "${clst_KERNCACHE}" ]
then
#echo "CONFIG match"
mkdir -p /etc/portage/profile
echo "${KERNELVERSION}" > /etc/portage/profile/package.provided
else
- if ( ! grep -q "^${KERNELVERSION}\$" /etc/portage/profile/package.provided )
+ if ( ! grep -q "^${KERNELVERSION}\$" /etc/portage/profile/package.provided )
then
echo "${KERNELVERSION}" >> /etc/portage/profile/package.provided
fi
echo "Setting extraversion to ${clst_kextraversion}"
sed -i -e "s:EXTRAVERSION \(=.*\):EXTRAVERSION \1-${clst_kextraversion}:" /usr/src/linux/Makefile
echo ${clst_kextraversion} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
- else
+ else
touch /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
fi
fi
# 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 \
dbg="debug {\n\
\tdescription\t\"Debug Shell\";\n\
\timage\t\t\"\";\n\
-\tappend\t\t\"real_root=shell\" \"nox\";\n}\n\n"
+\tappend\t\t\"real_root=shell\" \"nox\";\n}\n\n"
cmt1="comment\t\t\"\\\n\\\n\";\n\
comment\t\t\"Bootable Images & Options:\\\n\\\r\\\n\\\r\";\n"
# Backup pristine system
rsync -avx --exclude "/root/" --exclude "/tmp/" --exclude "/usr/portage/" / \
- /tmp/rsync-bak/
+ /tmp/rsync-bak/
for x in ${clst_tinderbox_packages}
do
if [ "$?" != "0" ]
then
- echo "! $x" >> /tmp/tinderbox.log
+ echo "! $x" >> /tmp/tinderbox.log
else
echo "$x" >> /tmp/tinderbox.log
fi