Skip to content

Instantly share code, notes, and snippets.

@maffblaster
Created January 11, 2017 06:12
Show Gist options
  • Select an option

  • Save maffblaster/2598614302342d2f50700cc83db473f0 to your computer and use it in GitHub Desktop.

Select an option

Save maffblaster/2598614302342d2f50700cc83db473f0 to your computer and use it in GitHub Desktop.
Add documentation and setup script for Catalyst
README
#####
This file has been created to aid in the setup of Catalyst build boxes.
First, make sure Catalyst has been emerged:
# emerge --ask dev-util/catalyst
Note: Building stages with Catalyst will consume a lot of disk space. Mounting
the /releases directory on a separate drive may be wise.
Create the following directory as root and clone the releng.git repository:
# mkdir /release
# git clone --depth 1 https://anongit.gentoo.org/git/proj/releng.git /release/releng
Run the following script from the newly cloned repository as root:
# /release/releng/scripts/buildbox_setup.sh
This will create the necessary build directories for supported Catalyst
architectures.
#!/bin/bash
# This script creates the required directories for catalyst to run
# Dependencies sys-apps/coreutils dev-vcs/git
SUPPORTED_ARCHES="amd64 x86"
if [[ "$(whoami)" != "root" ]]; then
echo "This script must be ran as root!"
exit 1
fi
# Two important system wide symlinks
ln -s /release/releng/config /etc/catalyst/release
ln -s /release/releng/scripts /release/bin
mkdir -p /etc/catalyst/local
mkdir -p /release/distfiles/tmp/buildsync
mkdir -p /release/tmp/{catalyst,distfiles,run,snapshots}
mkdir -p /release/weekly/builds
# Clone the main Gentoo repository
mkdir -p /release/trees
git clone --depth 1 https://anongit.gentoo.org/git/repo/gentoo.git /release/trees/portage-auto
for ARCH in ${SUPPORTED_ARCHES}
do
mkdir -p /release/buildroot/"${ARCH}"-dev/{builds,kerncache,packages,snapshots,tmp}
mkdir -p /release/distfiles/weekly/"${ARCH}"
done
if [[ -d /var/tmp/catalyst ]]; then
echo -e "\nIt looks like /var/tmp/catalyst exists."
while true
do
echo "Would you like to move the content to /release/tmp/catalyst"
echo -n "and then replace it with symlink? (y/n)? "
read ANSWER
case ${ANSWER} in
[yY]* )
echo -e "\nMoving content and creating symlink...\n"
mv -v /var/tmp/catalyst /release/tmp
rm -vrf /var/tmp/catalyst
ln -s /release/tmp/catalyst /var/tmp/catalyst
break;;
[nN]* )
echo -e "\nNOT moving content or creating symlink..."
break;;
* ) echo -e "\nSorry, I didn't understand that input.\n"
esac
done
else
ln -s /release/tmp/catalyst /var/tmp/catalyst
fi
echo -e "\nSetup is complete!\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment