From 70b82ae359a5538711e103b0e8dfb92654296644 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 27 Oct 2018 12:48:57 +0100 Subject: gentoo resync : 27.10.2018 --- .../cloud-init/files/cloud-init-0.7.6-gentoo.patch | 51 ------------ .../files/cloud-init-0.7.6_p1212-gentoo.patch | 33 -------- .../files/cloud-init-0.7.7-gentooinit.patch | 42 ---------- .../files/cloud-init-0.7.8-gentooinit.patch | 38 --------- .../cloud-init-18.4-fix-packages-module.patch | 25 ++++++ ...it-18.4-gentoo-support-upstream-templates.patch | 91 ++++++++++++++++++++++ 6 files changed, 116 insertions(+), 164 deletions(-) delete mode 100644 app-emulation/cloud-init/files/cloud-init-0.7.6-gentoo.patch delete mode 100644 app-emulation/cloud-init/files/cloud-init-0.7.6_p1212-gentoo.patch delete mode 100644 app-emulation/cloud-init/files/cloud-init-0.7.7-gentooinit.patch delete mode 100644 app-emulation/cloud-init/files/cloud-init-0.7.8-gentooinit.patch create mode 100644 app-emulation/cloud-init/files/cloud-init-18.4-fix-packages-module.patch create mode 100644 app-emulation/cloud-init/files/cloud-init-18.4-gentoo-support-upstream-templates.patch (limited to 'app-emulation/cloud-init/files') diff --git a/app-emulation/cloud-init/files/cloud-init-0.7.6-gentoo.patch b/app-emulation/cloud-init/files/cloud-init-0.7.6-gentoo.patch deleted file mode 100644 index 27abd3812ab4..000000000000 --- a/app-emulation/cloud-init/files/cloud-init-0.7.6-gentoo.patch +++ /dev/null @@ -1,51 +0,0 @@ -# Note: Gentoo places ip in /sbin/ not /bin/ -diff -Nuar cloud-init-0.7.6.orig/cloudinit/sources/DataSourceOpenNebula.py cloud-init-0.7.6/cloudinit/sources/DataSourceOpenNebula.py ---- cloud-init-0.7.6.orig/cloudinit/sources/DataSourceOpenNebula.py 2014-10-10 08:26:25.000000000 -0700 -+++ cloud-init-0.7.6/cloudinit/sources/DataSourceOpenNebula.py 2016-04-25 15:24:51.483130933 -0700 -@@ -435,7 +435,7 @@ - # http://opennebula.org/documentation:rel3.8:cong#network_configuration - for k in context.keys(): - if re.match(r'^ETH\d+_IP$', k): -- (out, _) = util.subp(['/sbin/ip', 'link']) -+ (out, _) = util.subp(['/bin/ip', 'link']) - net = OpenNebulaNetwork(out, context) - results['network-interfaces'] = net.gen_conf() - break - -# Note Gentoo installs its own RC files -diff -Nuar cloud-init-0.7.6.orig/setup.py cloud-init-0.7.6/setup.py ---- cloud-init-0.7.6.orig/setup.py 2014-10-10 08:26:25.000000000 -0700 -+++ cloud-init-0.7.6/setup.py 2016-04-25 15:24:51.488131027 -0700 -@@ -141,7 +141,7 @@ - author='Scott Moser', - author_email='scott.moser@canonical.com', - url='http://launchpad.net/cloud-init/', -- packages=setuptools.find_packages(exclude=['tests']), -+ packages=setuptools.find_packages(exclude=['tests.*', 'tests']), - scripts=['bin/cloud-init', - 'tools/cloud-init-per', - ], -@@ -160,9 +160,4 @@ - [f for f in glob('doc/examples/seed/*') if is_f(f)]), - ], - install_requires=read_requires(), -- cmdclass={ -- # Use a subclass for install that handles -- # adding on the right init system configuration files -- 'install': InitsysInstallData, -- }, - ) - -# https://bugs.launchpad.net/cloud-init/+bug/1380424 -diff -Nuar cloud-init-0.7.6.orig/tests/unittests/test_distros/test_netconfig.py cloud-init-0.7.6/tests/unittests/test_distros/test_netconfig.py ---- cloud-init-0.7.6.orig/tests/unittests/test_distros/test_netconfig.py 2014-10-10 08:26:25.000000000 -0700 -+++ cloud-init-0.7.6/tests/unittests/test_distros/test_netconfig.py 2016-04-25 15:24:51.485130971 -0700 -@@ -174,7 +174,7 @@ - self.assertCfgEquals(expected_buf, str(write_buf)) - self.assertEquals(write_buf.mode, 0644) - -- def test_simple_write_freebsd(self): -+ def _test_simple_write_freebsd(self): - fbsd_distro = self._get_distro('freebsd') - util_mock = self.mocker.replace(util.write_file, - spec=False, passthrough=False) diff --git a/app-emulation/cloud-init/files/cloud-init-0.7.6_p1212-gentoo.patch b/app-emulation/cloud-init/files/cloud-init-0.7.6_p1212-gentoo.patch deleted file mode 100644 index ef5d950842fe..000000000000 --- a/app-emulation/cloud-init/files/cloud-init-0.7.6_p1212-gentoo.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -Nuar --exclude '*~' trunk.orig/setup.py trunk/setup.py ---- trunk.orig/setup.py 2016-04-25 14:44:43.000000000 -0700 -+++ trunk/setup.py 2016-04-25 15:44:45.254496814 -0700 -@@ -1,3 +1,4 @@ -+#!/usr/bin/python2 - # vi: ts=4 expandtab - # - # Distutils magic for ec2-init -@@ -74,6 +75,7 @@ - 'sysvinit': [f for f in glob('sysvinit/redhat/*') if is_f(f)], - 'sysvinit_freebsd': [f for f in glob('sysvinit/freebsd/*') if is_f(f)], - 'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)], -+ 'sysvinit_openrc': [f for f in glob('sysvinit/gentoo/*') if is_f(f)], - 'systemd': [f for f in (glob('systemd/*.service') + - glob('systemd/*.target')) if is_f(f)], - 'systemd.generators': [f for f in glob('systemd/*-generator') if is_f(f)], -@@ -83,6 +85,7 @@ - 'sysvinit': '/etc/rc.d/init.d', - 'sysvinit_freebsd': '/usr/local/etc/rc.d', - 'sysvinit_deb': '/etc/init.d', -+ 'sysvinit_openrc': '/etc/init.d', - 'systemd': pkg_config_read('systemd', 'systemdsystemunitdir'), - 'systemd.generators': pkg_config_read('systemd', - 'systemdsystemgeneratordir'), -@@ -205,7 +208,7 @@ - author='Scott Moser', - author_email='scott.moser@canonical.com', - url='http://launchpad.net/cloud-init/', -- packages=setuptools.find_packages(exclude=['tests']), -+ packages=setuptools.find_packages(exclude=['tests.*', 'tests']), - scripts=['bin/cloud-init', - 'tools/cloud-init-per'], - license='GPLv3', diff --git a/app-emulation/cloud-init/files/cloud-init-0.7.7-gentooinit.patch b/app-emulation/cloud-init/files/cloud-init-0.7.7-gentooinit.patch deleted file mode 100644 index ddb4f38201cc..000000000000 --- a/app-emulation/cloud-init/files/cloud-init-0.7.7-gentooinit.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/cloudinit/sources/DataSourceOpenNebula.py b/cloudinit/sources/DataSourceOpenNebula.py -index 7b3a76b..635a836 100644 ---- a/cloudinit/sources/DataSourceOpenNebula.py -+++ b/cloudinit/sources/DataSourceOpenNebula.py -@@ -407,7 +407,7 @@ def read_context_disk_dir(source_dir, asuser=None): - # http://opennebula.org/documentation:rel3.8:cong#network_configuration - for k in context: - if re.match(r'^ETH\d+_IP$', k): -- (out, _) = util.subp(['/sbin/ip', 'link']) -+ (out, _) = util.subp(['ip', 'link']) - net = OpenNebulaNetwork(out, context) - results['network-interfaces'] = net.gen_conf() - break -diff --git a/setup.py b/setup.py -index bbadd7b..1578a3d 100755 ---- a/setup.py -+++ b/setup.py -@@ -74,6 +74,7 @@ INITSYS_FILES = { - 'sysvinit': [f for f in glob('sysvinit/redhat/*') if is_f(f)], - 'sysvinit_freebsd': [f for f in glob('sysvinit/freebsd/*') if is_f(f)], - 'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)], -+ 'sysvinit_openrc': [f for f in glob('sysvinit/gentoo/*') if is_f(f)], - 'systemd': [f for f in (glob('systemd/*.service') + - glob('systemd/*.target')) if is_f(f)], - 'systemd.generators': [f for f in glob('systemd/*-generator') if is_f(f)], -@@ -83,6 +84,7 @@ INITSYS_ROOTS = { - 'sysvinit': '/etc/rc.d/init.d', - 'sysvinit_freebsd': '/usr/local/etc/rc.d', - 'sysvinit_deb': '/etc/init.d', -+ 'sysvinit_openrc': '/etc/init.d', - 'systemd': pkg_config_read('systemd', 'systemdsystemunitdir'), - 'systemd.generators': pkg_config_read('systemd', - 'systemdsystemgeneratordir'), -@@ -205,7 +207,7 @@ setuptools.setup( - author='Scott Moser', - author_email='scott.moser@canonical.com', - url='http://launchpad.net/cloud-init/', -- packages=setuptools.find_packages(exclude=['tests']), -+ packages=setuptools.find_packages(exclude=['tests.*', 'tests']), - scripts=['tools/cloud-init-per'], - license='GPLv3', - data_files=data_files, diff --git a/app-emulation/cloud-init/files/cloud-init-0.7.8-gentooinit.patch b/app-emulation/cloud-init/files/cloud-init-0.7.8-gentooinit.patch deleted file mode 100644 index ff0e0149fa3b..000000000000 --- a/app-emulation/cloud-init/files/cloud-init-0.7.8-gentooinit.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/setup.py b/setup.py -index bbadd7b..1578a3d 100755 ---- a/setup.py -+++ b/setup.py -@@ -205,7 +207,7 @@ setuptools.setup( - author='Scott Moser', - author_email='scott.moser@canonical.com', - url='http://launchpad.net/cloud-init/', -- packages=setuptools.find_packages(exclude=['tests']), -+ packages=setuptools.find_packages(exclude=['tests.*', 'tests']), - scripts=['tools/cloud-init-per'], - license='GPLv3', - data_files=data_files, -diff --git a/sysvinit/gentoo/cloud-init b/sysvinit/gentoo/cloud-init -index 5afc0f2..531a715 100644 ---- a/sysvinit/gentoo/cloud-init -+++ b/sysvinit/gentoo/cloud-init -@@ -2,6 +2,7 @@ - # add depends for network, dns, fs etc - depend() { - after cloud-init-local -+ after net - before cloud-config - provide cloud-init - } -diff --git a/sysvinit/gentoo/cloud-init-local b/sysvinit/gentoo/cloud-init-local -index 9bd0b56..0f8cf65 100644 ---- a/sysvinit/gentoo/cloud-init-local -+++ b/sysvinit/gentoo/cloud-init-local -@@ -2,7 +2,7 @@ - - depend() { - after localmount -- after netmount -+ before net - before cloud-init - provide cloud-init-local - } diff --git a/app-emulation/cloud-init/files/cloud-init-18.4-fix-packages-module.patch b/app-emulation/cloud-init/files/cloud-init-18.4-fix-packages-module.patch new file mode 100644 index 000000000000..4a42cbb7d9e1 --- /dev/null +++ b/app-emulation/cloud-init/files/cloud-init-18.4-fix-packages-module.patch @@ -0,0 +1,25 @@ +From e894c6f57b88305cdf6e4e2b1543475b2e02f436 Mon Sep 17 00:00:00 2001 +From: Gilles Dartiguelongue +Date: Tue, 23 Oct 2018 18:59:58 +0200 +Subject: [PATCH 1/2] Fix Gentoo package installation command + +--- + cloudinit/distros/gentoo.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py +index dc57717d..98ac41ca 100644 +--- a/cloudinit/distros/gentoo.py ++++ b/cloudinit/distros/gentoo.py +@@ -192,7 +192,7 @@ class Distro(distros.Distro): + if pkgs is None: + pkgs = [] + +- cmd = list('emerge') ++ cmd = ['emerge'] + # Redirect output + cmd.append("--quiet") + +-- +2.19.0 + diff --git a/app-emulation/cloud-init/files/cloud-init-18.4-gentoo-support-upstream-templates.patch b/app-emulation/cloud-init/files/cloud-init-18.4-gentoo-support-upstream-templates.patch new file mode 100644 index 000000000000..60d9da600557 --- /dev/null +++ b/app-emulation/cloud-init/files/cloud-init-18.4-gentoo-support-upstream-templates.patch @@ -0,0 +1,91 @@ +From 946ce2b005a71e9922654af79bce51fefa16c3d4 Mon Sep 17 00:00:00 2001 +From: Gilles Dartiguelongue +Date: Wed, 24 Oct 2018 10:52:46 +0200 +Subject: [PATCH 2/2] Add support for gentoo in cloud.cfg and templates + +--- + config/cloud.cfg.tmpl | 8 ++++++-- + templates/hosts.gentoo.tmpl | 24 ++++++++++++++++++++++++ + tools/render-cloudcfg | 2 +- + 3 files changed, 31 insertions(+), 3 deletions(-) + create mode 100644 templates/hosts.gentoo.tmpl + +diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl +index 1fef133a..f66b5f7e 100644 +--- a/config/cloud.cfg.tmpl ++++ b/config/cloud.cfg.tmpl +@@ -134,7 +134,7 @@ cloud_final_modules: + # (not accessible to handlers/transforms) + system_info: + # This will affect which distro class gets used +-{% if variant in ["centos", "debian", "fedora", "rhel", "suse", "ubuntu", "freebsd"] %} ++{% if variant in ["centos", "debian", "fedora", "rhel", "suse", "ubuntu", "freebsd", "gentoo"] %} + distro: {{ variant }} + {% else %} + # Unknown/fallback distro. +@@ -172,7 +172,7 @@ system_info: + primary: http://ports.ubuntu.com/ubuntu-ports + security: http://ports.ubuntu.com/ubuntu-ports + ssh_svcname: ssh +-{% elif variant in ["centos", "rhel", "fedora", "suse"] %} ++{% elif variant in ["centos", "rhel", "fedora", "suse", "gentoo"] %} + # Default user name + that default users groups (if added/used) + default_user: + name: {{ variant }} +@@ -180,6 +180,10 @@ system_info: + gecos: {{ variant }} Cloud User + {% if variant == "suse" %} + groups: [cdrom, users] ++{% elif variant == "gentoo" %} ++ groups: [users, wheel] ++ primary_group: users ++ no-user-group: true + {% else %} + groups: [wheel, adm, systemd-journal] + {% endif %} +diff --git a/templates/hosts.gentoo.tmpl b/templates/hosts.gentoo.tmpl +new file mode 100644 +index 00000000..cd045fa6 +--- /dev/null ++++ b/templates/hosts.gentoo.tmpl +@@ -0,0 +1,24 @@ ++## template:jinja ++{# ++This file /etc/cloud/templates/hosts.gentoo.tmpl is only utilized ++if enabled in cloud-config. Specifically, in order to enable it ++you need to add the following to config: ++ manage_etc_hosts: True ++-#} ++# Your system has configured 'manage_etc_hosts' as True. ++# As a result, if you wish for changes to this file to persist ++# then you will need to either ++# a.) make changes to the master file in /etc/cloud/templates/hosts.gentoo.tmpl ++# b.) change or remove the value of 'manage_etc_hosts' in ++# /etc/cloud/cloud.cfg or cloud-config from user-data ++# ++# The following lines are desirable for IPv4 capable hosts ++127.0.0.1 {{fqdn}} {{hostname}} ++127.0.0.1 localhost.localdomain localhost ++127.0.0.1 localhost4.localdomain4 localhost4 ++ ++# The following lines are desirable for IPv6 capable hosts ++::1 {{fqdn}} {{hostname}} ++::1 localhost.localdomain localhost ++::1 localhost6.localdomain6 localhost6 ++ +diff --git a/tools/render-cloudcfg b/tools/render-cloudcfg +index 8b7cb875..d109044e 100755 +--- a/tools/render-cloudcfg ++++ b/tools/render-cloudcfg +@@ -4,7 +4,7 @@ import argparse + import os + import sys + +-VARIANTS = ["bsd", "centos", "fedora", "rhel", "suse", "ubuntu", "unknown"] ++VARIANTS = ["bsd", "centos", "fedora", "gentoo", "rhel", "suse", "ubuntu", "unknown"] + + if "avoid-pep8-E402-import-not-top-of-file": + _tdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) +-- +2.19.0 + -- cgit v1.2.3