Add Gentoo support to nodepool
This commit adds Gentoo support to elements needed to build a Gentoo nodepool image. Change-Id: I2ceeb915748a11d8e729069566e722a3fe30ba99 Signed-off-by: Matthew Thode <mthode@mthode.org>
This commit is contained in:
parent
2ec4d652d7
commit
4c515e2073
@ -46,6 +46,10 @@ until $BINDEP -b -f $PACKAGES test; do
|
||||
sudo PATH=/usr/sbin:/sbin:$PATH DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get -q --option "Dpkg::Options::=--force-confold" \
|
||||
--assume-yes install `$BINDEP -b -f $PACKAGES test`
|
||||
elif emerge --version >/dev/null 2>&1 ; then
|
||||
sudo emerge -uDNq --jobs=4 @world
|
||||
sudo PATH=/usr/sbin:/sbin:$PATH emerge -q --jobs=4 \
|
||||
`$BINDEP -b -f $PACKAGES`
|
||||
else
|
||||
sudo PATH=/usr/sbin:/sbin:$PATH $YUM install -y \
|
||||
`$BINDEP -b -f $PACKAGES test`
|
||||
|
@ -51,6 +51,17 @@ PACKAGELIST=`echo "$PACKAGES" | /usr/bindep-env/bin/bindep -b -f - || true`
|
||||
if [ -f /usr/bin/apt-get ] ; then
|
||||
# --ignore-missing conflicts with set -e, so force it to be ok
|
||||
apt-get -y --ignore-missing -d install $PACKAGELIST || true
|
||||
elif [ -f /usr/bin/emerge ] ; then
|
||||
# write out use config (won't install/fetch without it)
|
||||
# This lays down install / compile time options needed for bindep to
|
||||
# install / fetch the needed packages.
|
||||
USE_FILE=/etc/portage/package.use/bindep.use
|
||||
cat > $USE_FILE <<EOF
|
||||
x11-libs/cairo X
|
||||
x11-libs/gdk-pixbuf X
|
||||
media-libs/gd truetype png fontconfig jpeg
|
||||
EOF
|
||||
emerge -q --fetchonly $PACKAGELIST || true
|
||||
else
|
||||
${YUM:-yum} install -y --downloadonly $PACKAGELIST
|
||||
fi
|
||||
|
@ -161,6 +161,16 @@ def local_prep(distribution):
|
||||
tokenize(fn, rpms, distribution, comment='#')
|
||||
branch_data['rpms'] = rpms
|
||||
|
||||
if os.path.exists(os.path.join(TMP_MOUNT_PATH, 'usr/bin/emerge')):
|
||||
ebuilds = []
|
||||
ebuilddir = os.path.join(DEVSTACK, 'files', 'ebuilds')
|
||||
if not os.path.exists(ebuilddir):
|
||||
ebuilddir = os.path.join(DEVSTACK, 'files', 'ebuilds')
|
||||
for fn in os.listdir(ebuilddir):
|
||||
fn = os.path.join(ebuilddir, fn)
|
||||
tokenize(fn, ebuilds, distribution, comment='#')
|
||||
branch_data['ebuilds'] = ebuilds
|
||||
|
||||
images = _find_images(DEVSTACK)
|
||||
if not images:
|
||||
images = _legacy_find_images(DEVSTACK)
|
||||
@ -180,6 +190,8 @@ def main():
|
||||
pkgs.write(" ".join(branch_data['debs']) + "\n")
|
||||
elif branch_data.get('rpms'):
|
||||
pkgs.write(" ".join(branch_data['rpms']) + "\n")
|
||||
elif branch_data.get('ebuilds'):
|
||||
pkgs.write(" ".join(branch_data['ebuilds']) + "\n")
|
||||
else:
|
||||
sys.exit('No supported package data found.')
|
||||
|
||||
|
@ -8,3 +8,4 @@ python3-dev:
|
||||
uuid-runtime:
|
||||
traceroute:
|
||||
ntpdate:
|
||||
gentoolkit:
|
||||
|
@ -2,6 +2,18 @@
|
||||
"distro": {
|
||||
"fedora": {
|
||||
"python3-dev": "python3-devel"
|
||||
},
|
||||
"gentoo": {
|
||||
"build-essential": "",
|
||||
"cron": "sys-process/cronie",
|
||||
"python-dev": "",
|
||||
"python3-dev": "",
|
||||
"openssh-server": "openssh",
|
||||
"traceroute": "net-analyzer/traceroute",
|
||||
"uuid-runtime": ""
|
||||
},
|
||||
"default": {
|
||||
"gentoolkit": ""
|
||||
}
|
||||
},
|
||||
"family": {
|
||||
|
@ -31,8 +31,13 @@ if [ -f /etc/default/grub ] ; then
|
||||
if which update-grub &> /dev/null ; then
|
||||
update-grub
|
||||
else
|
||||
if [[ $DISTRO_NAME == gentoo ]]; then
|
||||
GRUB_CFG=/boot/grub/grub.cfg
|
||||
else
|
||||
GRUB_CFG=/boot/grub2/grub.cfg
|
||||
fi
|
||||
# If update-grub isn't available, use grub2-mkconfig directly
|
||||
/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||
/usr/sbin/grub2-mkconfig -o "${GRUB_CFG}"
|
||||
fi
|
||||
elif [ -f /boot/grub/grub.conf ] ; then
|
||||
sed -i -e 's/^timeout=[0-9]\+/timeout=0/' /boot/grub/grub.conf
|
||||
|
@ -39,6 +39,12 @@ case $OS_FAMILY in
|
||||
# time updating.
|
||||
update=""
|
||||
;;
|
||||
"Gentoo")
|
||||
# make a fake repo to satisfy the removal below
|
||||
touch /tmp/fakerepo
|
||||
repo=/tmp/fakerepo
|
||||
update=""
|
||||
;;
|
||||
*)
|
||||
die "Don't know how to cleanup!"
|
||||
;;
|
||||
|
@ -2,6 +2,9 @@
|
||||
"family": {
|
||||
"debian": {
|
||||
"libselinux-python": ""
|
||||
},
|
||||
"gentoo": {
|
||||
"libselinux-python": "sys-libs/libselinux"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user