Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usability improvements #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions 01-get-stage3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ if [[ ${STATUS} != 0 ]]; then
fi

SHA512=$(grep -A1 SHA512 "${OUTDIR}/${STAGE3_REAL_NAME}.DIGESTS.asc" | grep stage3 | grep -v CONTENTS | awk '{ print $1 }')
SHA512_REAL=$(sha512sum "${OUTDIR}/${STAGE3_NAME}" | awk '{ print $1 }')
SHA512_REAL=
[ -e "${OUTDIR}/${STAGE3_NAME}" ] && SHA512_REAL=$(sha512sum "${OUTDIR}/${STAGE3_NAME}" | awk '{ print $1 }')
if [[ "${SHA512}" != "${SHA512_REAL}" ]]; then
echo "Downloading new image - ${STAGE3_REAL_NAME}"
curl -s "${STAGE3_URL}" -o "${OUTDIR}/${STAGE3_REAL_NAME}"
Expand All @@ -79,7 +80,8 @@ fi

# get the latest portage
PORTAGE_LIVE_MD5=$(curl -s "${MIRROR}/snapshots/portage-latest.tar.bz2.md5sum" | awk '/portage-latest/ {print $1}')
OUR_MD5=$(md5sum "${PORTAGE_DIR}/portage-latest.tar.bz2" | awk {'print $1'})
OUR_MD5=
[ -e "${PORTAGE_DIR}/portage-latest.tar.bz2" ] && OUR_MD5=$(md5sum "${PORTAGE_DIR}/portage-latest.tar.bz2" | awk {'print $1'})
if [[ "${PORTAGE_LIVE_MD5}" != "${OUR_MD5}" ]]; then
echo 'downloading new portage tarball'
if [[ ! -d "${PORTAGE_DIR}" ]]; then
Expand Down
8 changes: 5 additions & 3 deletions 02-catalyst-that-shit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ set -e -u -x -o pipefail

# Vars
export DATE=${DATE:-"$(date +%Y%m%d)"}
export OUTDIR=${OUTDIR:-"/root/tmp/catalyst/gentoo"}
export WORKDIR=${WORKDIR:-"/root/tmp/catalyst"}
export CATALYST=${CATALYST:-catalyst}
export OUTDIR=${OUTDIR:-"${WORKDIR}/gentoo"}
export GIT_BASE_DIR=${GIT_BASE_DIR:-$( cd "$( dirname ${BASH_SOURCE[0]} )" && pwd )}
# profiles supported are as follows
# default/linux/amd64/13.0
Expand Down Expand Up @@ -45,7 +47,7 @@ else
exit 1
fi
export OUTFILE=${OUTFILE:-"${OUTDIR}/stage4-${PROFILE_SHORTNAME}-${DATE}.tar.bz2"}
export SPECFILE=${SPECFILE:-"/root/tmp/catalyst/stage4-${PROFILE_SHORTNAME}.spec"}
export SPECFILE=${SPECFILE:-"${WORKDIR}/stage4-${PROFILE_SHORTNAME}.spec"}
mkdir -p "${OUTDIR}"

# Build the spec file, first
Expand Down Expand Up @@ -110,7 +112,7 @@ stage4/rm:
EOF

# Run catalyst
catalyst -f "${SPECFILE}"
$CATALYST -f "${SPECFILE}"

# Clean up the spec file
rm "${SPECFILE}"
Expand Down
5 changes: 3 additions & 2 deletions 03-prep-that-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
set -e -u -x -o pipefail

# Vars
export TEMP_DIR=${TEMP_DIR:-'/root/tmp/catalyst/gentoo'}
export WORKDIR=${WORKDIR:-"/root/tmp/catalyst"}
export TEMP_DIR=${TEMP_DIR:-"${WORKDIR}/gentoo"}
export MOUNT_DIR=${MOUNT_DIR:-'/mnt'}
export DATE=${DATE:-"$(date +%Y%m%d)"}
export PORTAGE_DIR=${PORTAGE_DIR:-"/var/tmp/catalyst/snapshots"}
Expand All @@ -31,7 +32,7 @@ else
echo 'invalid profile, exiting'
exit 1
fi
export TARBALL=${TARBALL:-"/root/tmp/catalyst/gentoo/stage4-${PROFILE_SHORTNAME}-${DATE}.tar.bz2"}
export TARBALL=${TARBALL:-"${WORKDIR}/gentoo/stage4-${PROFILE_SHORTNAME}-${DATE}.tar.bz2"}
export TEMP_IMAGE=${TEMP_IMAGE:-"gentoo-${PROFILE_SHORTNAME}.img"}
export TARGET_IMAGE=${TARGET_IMAGE:-"/root/openstack-${PROFILE_SHORTNAME}-${DATE}.qcow2"}

Expand Down