Add gentoo dist
and remove ${LOG}. It's a bit of a useless mechanism and, in fact a hindrance. Why not just let the user redirect stdout?master
parent
cb8b3e3df2
commit
00a4664d73
@ -0,0 +1,5 @@
|
||||
lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed
|
||||
|
||||
# Default console settings
|
||||
lxc.tty = 4
|
||||
lxc.pts = 1024
|
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
source /etc/profile
|
||||
|
||||
echo "Cleaning up"
|
||||
|
||||
rm /script.sh
|
||||
|
||||
echo 'Removing temporary files...'
|
||||
rm -rf /tmp/*
|
||||
|
||||
echo 'cleaning up distfiles'
|
||||
rm -f /usr/portage/distfiles/*
|
||||
|
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
source /etc/profile
|
||||
|
||||
echo 'Installing packages and upgrading'
|
||||
|
||||
PACKAGES=(net-misc/curl wget man-db openssh ca-certificates sudo)
|
||||
|
||||
echo "Installing additional packages: ${ADDPACKAGES}"
|
||||
PACKAGES+=" ${ADDPACKAGES}"
|
||||
|
||||
ANSIBLE=${ANSIBLE:-0}
|
||||
if [[ $ANSIBLE = 1 ]]; then
|
||||
PACKAGES+=' ansible'
|
||||
fi
|
||||
|
||||
CHEF=${CHEF:-0}
|
||||
if [[ $CHEF = 1 ]]; then
|
||||
echo "Chef installation isn't supported on Gentoo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PUPPET=${PUPPET:-0}
|
||||
if [[ $PUPPET = 1 ]]; then
|
||||
PACKAGES+=' puppet eix'
|
||||
fi
|
||||
|
||||
SALT=${SALT:-0}
|
||||
if [[ $SALT = 1 ]]; then
|
||||
PACKAGES+=' salt'
|
||||
fi
|
||||
|
||||
# trying to set capabilities on an unprivileged container fails.
|
||||
echo "*/* -filecaps" > /etc/portage/package.use/vagrant_overrides
|
||||
|
||||
emerge --sync
|
||||
emerge --noreplace ${PACKAGES[*]}
|
||||
emerge -uND @world
|
||||
|
||||
rc-config add sshd default
|
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
source common/ui.sh
|
||||
source common/utils.sh
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "You should run this script as root (sudo)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TODAY=$(date -u +"%Y-%m-%d")
|
||||
export DISTRIBUTION=gentoo
|
||||
export RELEASE=current
|
||||
export ARCH=$(uname -m | sed -e "s/68/38/" | sed -e "s/x86_64/amd64/")
|
||||
export CONTAINER="vagrant-base-${DISTRIBUTION}-${ARCH}"
|
||||
export PACKAGE="output/${TODAY}/${CONTAINER}.box"
|
||||
export NOW=$(date -u)
|
||||
|
||||
echo '############################################'
|
||||
echo "# Beginning build at $(date)"
|
||||
|
||||
if [ -f ${PACKAGE} ]; then
|
||||
warn "The box '${PACKAGE}' already exists, skipping..."
|
||||
echo
|
||||
exit
|
||||
fi
|
||||
|
||||
info "Building box to '${PACKAGE}'..."
|
||||
|
||||
./common/download.sh
|
||||
utils.lxc.start
|
||||
|
||||
SECS=15
|
||||
log "Sleeping for $SECS seconds..."
|
||||
sleep $SECS
|
||||
|
||||
utils.lxc.runscript gentoo/install-packages.sh
|
||||
./common/prepare-vagrant-user.sh
|
||||
utils.lxc.runscript gentoo/clean.sh
|
||||
utils.lxc.stop
|
||||
|
||||
./common/package.sh
|
||||
|
||||
info "Finished building '${PACKAGE}'!"
|
||||
log "Run \`lxc-destroy -n ${CONTAINER}\` or \`make clean\` to remove the container that was created along the way"
|
||||
echo
|
Loading…
Reference in New Issue