Add Gentoo support to nodepool
This commit adds Gentoo support to elements needed to build a Gentoo nodepool image. The previous version of this commit had the default section of the pkg-map in the wrong area, specifically in the following file. nodepool/elements/infra-package-needs/pkg-map Change-Id: Ic686c325bc06564585a2e3ac50cadd7556612333
This commit is contained in:
parent
6acc7bc4cc
commit
9231f9b57d
|
@ -46,6 +46,10 @@ until $BINDEP -b -f $PACKAGES test; do
|
||||||
sudo PATH=/usr/sbin:/sbin:$PATH DEBIAN_FRONTEND=noninteractive \
|
sudo PATH=/usr/sbin:/sbin:$PATH DEBIAN_FRONTEND=noninteractive \
|
||||||
apt-get -q --option "Dpkg::Options::=--force-confold" \
|
apt-get -q --option "Dpkg::Options::=--force-confold" \
|
||||||
--assume-yes install `$BINDEP -b -f $PACKAGES test`
|
--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
|
else
|
||||||
sudo PATH=/usr/sbin:/sbin:$PATH $YUM install -y \
|
sudo PATH=/usr/sbin:/sbin:$PATH $YUM install -y \
|
||||||
`$BINDEP -b -f $PACKAGES test`
|
`$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
|
if [ -f /usr/bin/apt-get ] ; then
|
||||||
# --ignore-missing conflicts with set -e, so force it to be ok
|
# --ignore-missing conflicts with set -e, so force it to be ok
|
||||||
apt-get -y --ignore-missing -d install $PACKAGELIST || true
|
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
|
else
|
||||||
${YUM:-yum} install -y --downloadonly $PACKAGELIST
|
${YUM:-yum} install -y --downloadonly $PACKAGELIST
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -161,6 +161,16 @@ def local_prep(distribution):
|
||||||
tokenize(fn, rpms, distribution, comment='#')
|
tokenize(fn, rpms, distribution, comment='#')
|
||||||
branch_data['rpms'] = rpms
|
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)
|
images = _find_images(DEVSTACK)
|
||||||
if not images:
|
if not images:
|
||||||
images = _legacy_find_images(DEVSTACK)
|
images = _legacy_find_images(DEVSTACK)
|
||||||
|
@ -180,6 +190,8 @@ def main():
|
||||||
pkgs.write(" ".join(branch_data['debs']) + "\n")
|
pkgs.write(" ".join(branch_data['debs']) + "\n")
|
||||||
elif branch_data.get('rpms'):
|
elif branch_data.get('rpms'):
|
||||||
pkgs.write(" ".join(branch_data['rpms']) + "\n")
|
pkgs.write(" ".join(branch_data['rpms']) + "\n")
|
||||||
|
elif branch_data.get('ebuilds'):
|
||||||
|
pkgs.write(" ".join(branch_data['ebuilds']) + "\n")
|
||||||
else:
|
else:
|
||||||
sys.exit('No supported package data found.')
|
sys.exit('No supported package data found.')
|
||||||
|
|
||||||
|
|
|
@ -8,3 +8,4 @@ python3-dev:
|
||||||
uuid-runtime:
|
uuid-runtime:
|
||||||
traceroute:
|
traceroute:
|
||||||
ntpdate:
|
ntpdate:
|
||||||
|
gentoolkit:
|
||||||
|
|
|
@ -2,6 +2,15 @@
|
||||||
"distro": {
|
"distro": {
|
||||||
"fedora": {
|
"fedora": {
|
||||||
"python3-dev": "python3-devel"
|
"python3-dev": "python3-devel"
|
||||||
|
},
|
||||||
|
"gentoo": {
|
||||||
|
"build-essential": "",
|
||||||
|
"cron": "sys-process/cronie",
|
||||||
|
"python-dev": "",
|
||||||
|
"python3-dev": "",
|
||||||
|
"openssh-server": "openssh",
|
||||||
|
"traceroute": "net-analyzer/traceroute",
|
||||||
|
"uuid-runtime": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"family": {
|
"family": {
|
||||||
|
@ -12,5 +21,8 @@
|
||||||
"python3-dev": "",
|
"python3-dev": "",
|
||||||
"uuid-runtime": ""
|
"uuid-runtime": ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"gentoolkit": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,13 @@ if [ -f /etc/default/grub ] ; then
|
||||||
if which update-grub &> /dev/null ; then
|
if which update-grub &> /dev/null ; then
|
||||||
update-grub
|
update-grub
|
||||||
else
|
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
|
# 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
|
fi
|
||||||
elif [ -f /boot/grub/grub.conf ] ; then
|
elif [ -f /boot/grub/grub.conf ] ; then
|
||||||
sed -i -e 's/^timeout=[0-9]\+/timeout=0/' /boot/grub/grub.conf
|
sed -i -e 's/^timeout=[0-9]\+/timeout=0/' /boot/grub/grub.conf
|
||||||
|
|
|
@ -39,6 +39,12 @@ case $OS_FAMILY in
|
||||||
# time updating.
|
# time updating.
|
||||||
update=""
|
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!"
|
die "Don't know how to cleanup!"
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
"family": {
|
"family": {
|
||||||
"debian": {
|
"debian": {
|
||||||
"libselinux-python": ""
|
"libselinux-python": ""
|
||||||
|
},
|
||||||
|
"gentoo": {
|
||||||
|
"libselinux-python": "sys-libs/libselinux"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue