Yocto 2.4

Move OpenBMC to Yocto 2.4(rocko)

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0001-comment-out-selinux.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0001-comment-out-selinux.patch
new file mode 100644
index 0000000..0ee3205
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0001-comment-out-selinux.patch
@@ -0,0 +1,70 @@
+From 7d483c27ac0a23ca3bba7f320918afc40013bd8e Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 8 May 2017 14:25:52 +0800
+Subject: [PATCH 01/13] comment out selinux
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/flags.py | 5 +++--
+ blivet/util.py  | 6 +++++-
+ 2 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/blivet/flags.py b/blivet/flags.py
+index 06822db..b55a93f 100644
+--- a/blivet/flags.py
++++ b/blivet/flags.py
+@@ -20,7 +20,7 @@
+ #
+ 
+ import shlex
+-import selinux
++#import selinux
+ 
+ 
+ class Flags(object):
+@@ -49,7 +49,8 @@ class Flags(object):
+         #
+         # enable/disable functionality
+         #
+-        self.selinux = selinux.is_selinux_enabled()
++        #self.selinux = selinux.is_selinux_enabled()
++        self.selinux = False
+         self.multipath = True
+         self.dmraid = True
+         self.ibft = True
+diff --git a/blivet/util.py b/blivet/util.py
+index e3e71ce..0cf5188 100644
+--- a/blivet/util.py
++++ b/blivet/util.py
+@@ -4,7 +4,7 @@ import glob
+ import itertools
+ import os
+ import shutil
+-import selinux
++#import selinux
+ import subprocess
+ import re
+ import sys
+@@ -431,6 +431,8 @@ def get_cow_sysfs_path(dev_path, dev_sysfsPath):
+ def match_path_context(path):
+     """ Return the default SELinux context for the given path. """
+     context = None
++    return context
++
+     try:
+         context = selinux.matchpathcon(os.path.normpath(path), 0)[1]
+     except OSError as e:
+@@ -455,6 +457,8 @@ def set_file_context(path, context, root=None):
+ 
+             True if successful, False if not.
+     """
++    return False
++
+     if root is None:
+         root = '/'
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch
new file mode 100644
index 0000000..01e71be
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0002-run_program-support-timeout.patch
@@ -0,0 +1,102 @@
+From 86744d408b91acdcb086a03d7779fcda152f2ac3 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 8 May 2017 14:39:56 +0800
+Subject: [PATCH 02/13] run_program support timeout
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/util.py | 68 +++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 39 insertions(+), 29 deletions(-)
+
+diff --git a/blivet/util.py b/blivet/util.py
+index 0cf5188..d4bd9bb 100644
+--- a/blivet/util.py
++++ b/blivet/util.py
+@@ -158,6 +158,30 @@ class Path(str):
+     def __hash__(self):
+         return self._path.__hash__()
+ 
++def timeout_command(argv, timeout, *args, **kwargs):
++    """call shell-command and either return its output or kill it
++    if it doesn't normally exit within timeout seconds and return None"""
++    import subprocess, datetime, os, time, signal
++    start = datetime.datetime.now()
++
++    try:
++        proc = subprocess.Popen(argv, *args, **kwargs)
++        while proc.poll() is None:
++            time.sleep(0.1)
++            now = datetime.datetime.now()
++            if (now - start).seconds> timeout:
++                os.kill(proc.pid, signal.SIGKILL)
++                os.waitpid(-1, os.WNOHANG)
++                program_log.debug("%d seconds timeout" % timeout)
++                return (-1, None)
++
++
++    except OSError as e:
++        program_log.error("Error running %s: %s", argv[0], e.strerror)
++        raise
++
++    program_log.debug("Return code: %d", proc.returncode)
++    return (proc.returncode, proc.stdout.read())
+ 
+ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=False, binary_output=False):
+     if env_prune is None:
+@@ -180,36 +204,22 @@ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=Fa
+             stderr_dir = subprocess.STDOUT
+         else:
+             stderr_dir = subprocess.PIPE
+-        try:
+-            proc = subprocess.Popen(argv,
+-                                    stdin=stdin,
+-                                    stdout=subprocess.PIPE,
+-                                    stderr=stderr_dir,
+-                                    close_fds=True,
+-                                    preexec_fn=chroot, cwd=root, env=env)
+-
+-            out, err = proc.communicate()
+-            if not binary_output and six.PY3:
+-                out = out.decode("utf-8")
+-            if out:
+-                if not stderr_to_stdout:
+-                    program_log.info("stdout:")
+-                for line in out.splitlines():
+-                    program_log.info("%s", line)
+-
+-            if not stderr_to_stdout and err:
+-                program_log.info("stderr:")
+-                for line in err.splitlines():
+-                    program_log.info("%s", line)
+-
+-        except OSError as e:
+-            program_log.error("Error running %s: %s", argv[0], e.strerror)
+-            raise
+-
+-        program_log.debug("Return code: %d", proc.returncode)
+-
+-    return (proc.returncode, out)
+ 
++        res, out = timeout_command(argv, 10,
++                                   stdin=stdin,
++                                   stdout=subprocess.PIPE,
++                                   stderr=stderr_dir,
++                                   close_fds=True,
++                                   preexec_fn=chroot, cwd=root, env=env)
++        if not binary_output and six.PY3:
++            out = out.decode("utf-8")
++        if out:
++            if not stderr_to_stdout:
++                program_log.info("stdout:")
++            for line in out.splitlines():
++                program_log.info("%s", line)
++
++    return (res, out)
+ 
+ def run_program(*args, **kwargs):
+     return _run_program(*args, **kwargs)[0]
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0003-support-infinit-timeout.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0003-support-infinit-timeout.patch
new file mode 100644
index 0000000..489fb56
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0003-support-infinit-timeout.patch
@@ -0,0 +1,66 @@
+From 923265e04df5920fc99393aa05f584032aa1b383 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 8 May 2017 16:18:02 +0800
+Subject: [PATCH 03/13] support infinit timeout
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/util.py | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/blivet/util.py b/blivet/util.py
+index d4bd9bb..44a2da5 100644
+--- a/blivet/util.py
++++ b/blivet/util.py
+@@ -158,6 +158,7 @@ class Path(str):
+     def __hash__(self):
+         return self._path.__hash__()
+ 
++# timeout = -1 means infinite timeout, always wait.
+ def timeout_command(argv, timeout, *args, **kwargs):
+     """call shell-command and either return its output or kill it
+     if it doesn't normally exit within timeout seconds and return None"""
+@@ -169,7 +170,7 @@ def timeout_command(argv, timeout, *args, **kwargs):
+         while proc.poll() is None:
+             time.sleep(0.1)
+             now = datetime.datetime.now()
+-            if (now - start).seconds> timeout:
++            if timeout != -1 and (now - start).seconds> timeout:
+                 os.kill(proc.pid, signal.SIGKILL)
+                 os.waitpid(-1, os.WNOHANG)
+                 program_log.debug("%d seconds timeout" % timeout)
+@@ -183,7 +184,7 @@ def timeout_command(argv, timeout, *args, **kwargs):
+     program_log.debug("Return code: %d", proc.returncode)
+     return (proc.returncode, proc.stdout.read())
+ 
+-def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=False, binary_output=False):
++def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=False, binary_output=False, timeout=10):
+     if env_prune is None:
+         env_prune = []
+ 
+@@ -192,7 +193,10 @@ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=Fa
+             os.chroot(root)
+ 
+     with program_log_lock:  # pylint: disable=not-context-manager
+-        program_log.info("Running... %s", " ".join(argv))
++        if timeout != -1:
++            program_log.info("Running... %s", " ".join(argv))
++        else:
++            program_log.info("Running... %s ...infinite timeout", " ".join(argv))
+ 
+         env = os.environ.copy()
+         env.update({"LC_ALL": "C",
+@@ -205,7 +209,7 @@ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=Fa
+         else:
+             stderr_dir = subprocess.PIPE
+ 
+-        res, out = timeout_command(argv, 10,
++        res, out = timeout_command(argv, timeout,
+                                    stdin=stdin,
+                                    stdout=subprocess.PIPE,
+                                    stderr=stderr_dir,
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0004-Mount-var-volatile-during-install.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0004-Mount-var-volatile-during-install.patch
new file mode 100644
index 0000000..cb837e2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0004-Mount-var-volatile-during-install.patch
@@ -0,0 +1,59 @@
+From c3959bd00665e24a955bbdbea1ef555e76372f12 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 8 May 2017 16:25:16 +0800
+Subject: [PATCH 04/13] Mount /var/volatile during install
+
+The installed system needs /var/volatile clean, otherwise it
+caused systemd's journalctl failed to record boot log.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/osinstall.py | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/blivet/osinstall.py b/blivet/osinstall.py
+index a4f9535..61819c2 100644
+--- a/blivet/osinstall.py
++++ b/blivet/osinstall.py
+@@ -294,6 +294,7 @@ class FSSet(object):
+         self._sysfs = None
+         self._proc = None
+         self._devshm = None
++        self._volatile = None
+         self._usb = None
+         self._selinux = None
+         self._run = None
+@@ -335,6 +336,12 @@ class FSSet(object):
+         return self._devshm
+ 
+     @property
++    def volatile(self):
++        if not self._volatile:
++            self._volatile = NoDevice(fmt=get_format("tmpfs", device="tmpfs", mountpoint="/var/volatile"))
++        return self._volatile
++
++    @property
+     def usb(self):
+         if not self._usb:
+             self._usb = NoDevice(fmt=get_format("usbfs", device="usbfs", mountpoint="/proc/bus/usb"))
+@@ -591,6 +598,7 @@ class FSSet(object):
+ 
+         devices = list(self.mountpoints.values()) + self.swap_devices
+         devices.extend([self.dev, self.devshm, self.devpts, self.sysfs,
++                        self.volatile,
+                         self.proc, self.selinux, self.usb, self.run])
+         if isinstance(_platform, EFI):
+             devices.append(self.efivars)
+@@ -650,6 +658,7 @@ class FSSet(object):
+         """ unmount filesystems, except swap if swapoff == False """
+         devices = list(self.mountpoints.values()) + self.swap_devices
+         devices.extend([self.dev, self.devshm, self.devpts, self.sysfs,
++                        self.volatile,
+                         self.proc, self.usb, self.selinux, self.run])
+         if isinstance(_platform, EFI):
+             devices.append(self.efivars)
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0005-update-fstab-by-appending.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0005-update-fstab-by-appending.patch
new file mode 100644
index 0000000..4f343b7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0005-update-fstab-by-appending.patch
@@ -0,0 +1,32 @@
+From 386ff899763f8473eb93a7a1578fb7cc4f86f66d Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 8 May 2017 16:28:12 +0800
+Subject: [PATCH 05/13] update fstab by appending
+
+The 'storage.write()' has updated fstab by overwriting
+the original one, we should update fstab by appending
+to keep original tmpfs partitions.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/osinstall.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/blivet/osinstall.py b/blivet/osinstall.py
+index 61819c2..afa82db 100644
+--- a/blivet/osinstall.py
++++ b/blivet/osinstall.py
+@@ -728,7 +728,7 @@ class FSSet(object):
+         # /etc/fstab
+         fstab_path = os.path.normpath("%s/etc/fstab" % get_sysroot())
+         fstab = self.fstab()
+-        open(fstab_path, "w").write(fstab)
++        open(fstab_path, "a").write(fstab)
+ 
+         # /etc/crypttab
+         crypttab_path = os.path.normpath("%s/etc/crypttab" % get_sysroot())
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0006-fix-new.roots-object-is-not-iterable.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0006-fix-new.roots-object-is-not-iterable.patch
new file mode 100644
index 0000000..f5ff754
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0006-fix-new.roots-object-is-not-iterable.patch
@@ -0,0 +1,28 @@
+From cd92eea8fab37ba6b0c7f03daa5255343dc75716 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 8 May 2017 16:30:20 +0800
+Subject: [PATCH 06/13] fix new.roots object is not iterable
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/blivet.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/blivet/blivet.py b/blivet/blivet.py
+index 6a33e9c..79ae91a 100644
+--- a/blivet/blivet.py
++++ b/blivet/blivet.py
+@@ -1761,7 +1761,7 @@ class Blivet(object):
+             p = partition.disk.format.parted_disk.getPartitionByPath(partition.path)
+             partition.parted_partition = p
+ 
+-        for root in new.roots:
++        for root in new.roots or []:
+             root.swaps = [new.devicetree.get_device_by_id(d.id, hidden=True) for d in root.swaps]
+             root.swaps = [s for s in root.swaps if s]
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0007-fix-incorrect-timeout-while-system-time-changed.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0007-fix-incorrect-timeout-while-system-time-changed.patch
new file mode 100644
index 0000000..6512d86
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0007-fix-incorrect-timeout-while-system-time-changed.patch
@@ -0,0 +1,48 @@
+From 78ee2b9090f9400ccc4f730e674f5ae972740ccb Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 26 Aug 2016 02:02:49 -0400
+Subject: [PATCH 07/13] fix incorrect timeout while system time changed
+
+While system time changed by NTP, invoking timeout_command
+breaks with incorrect timeout.
+--------
+|05:40:55,872 INFO program: Running... mount -t ext2 -o
+  defaults,ro /dev/sda2 /mnt/sysimage
+|01:40:55,086 DEBUG program: 10 seconds timeout
+--------
+
+Use numbert count to replace current time count could workaround
+the issue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/util.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/blivet/util.py b/blivet/util.py
+index 44a2da5..b3c45ac 100644
+--- a/blivet/util.py
++++ b/blivet/util.py
+@@ -163,14 +163,14 @@ def timeout_command(argv, timeout, *args, **kwargs):
+     """call shell-command and either return its output or kill it
+     if it doesn't normally exit within timeout seconds and return None"""
+     import subprocess, datetime, os, time, signal
+-    start = datetime.datetime.now()
++    count = 0
+ 
+     try:
+         proc = subprocess.Popen(argv, *args, **kwargs)
+         while proc.poll() is None:
+             time.sleep(0.1)
+-            now = datetime.datetime.now()
+-            if timeout != -1 and (now - start).seconds> timeout:
++            count += 1
++            if timeout != -1 and count > timeout*10:
+                 os.kill(proc.pid, signal.SIGKILL)
+                 os.waitpid(-1, os.WNOHANG)
+                 program_log.debug("%d seconds timeout" % timeout)
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0008-tweak-btrfs-packages.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0008-tweak-btrfs-packages.patch
new file mode 100644
index 0000000..121336e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0008-tweak-btrfs-packages.patch
@@ -0,0 +1,45 @@
+From 6f661a511eea096c073888c7adb836a9a880b476 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 8 May 2017 16:33:15 +0800
+Subject: [PATCH 08/13] tweak btrfs packages
+
+In oe-cre/yocto, we name btrfs package with btrfs-tools,
+rather than btrfs-progs.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/devices/btrfs.py | 2 +-
+ blivet/formats/fs.py    | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py
+index c5cb21f..9d417b2 100644
+--- a/blivet/devices/btrfs.py
++++ b/blivet/devices/btrfs.py
+@@ -55,7 +55,7 @@ class BTRFSDevice(StorageDevice):
+ 
+     """ Base class for BTRFS volume and sub-volume devices. """
+     _type = "btrfs"
+-    _packages = ["btrfs-progs"]
++    _packages = ["btrfs-tools"]
+     _external_dependencies = [availability.BLOCKDEV_BTRFS_PLUGIN]
+ 
+     def __init__(self, *args, **kwargs):
+diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
+index a49826f..e8f216d 100644
+--- a/blivet/formats/fs.py
++++ b/blivet/formats/fs.py
+@@ -918,7 +918,7 @@ class BTRFS(FS):
+     _formattable = True
+     _linux_native = True
+     _supported = True
+-    _packages = ["btrfs-progs"]
++    _packages = ["btrfs-tools"]
+     _min_size = Size("256 MiB")
+     _max_size = Size("16 EiB")
+     _mkfs_class = fsmkfs.BTRFSMkfs
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0009-invoking-mount-with-infinite-timeout.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0009-invoking-mount-with-infinite-timeout.patch
new file mode 100644
index 0000000..fc084b1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0009-invoking-mount-with-infinite-timeout.patch
@@ -0,0 +1,31 @@
+From a6ac2157ee6793302e23ddbc5e3b249fa7da5b7e Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 31 Aug 2016 21:30:32 -0400
+Subject: [PATCH 09/13] invoking mount with infinite timeout
+
+This large timeout is needed when running on machines with
+lots of disks, or with slow disks.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/util.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/blivet/util.py b/blivet/util.py
+index b3c45ac..9f02b18 100644
+--- a/blivet/util.py
++++ b/blivet/util.py
+@@ -257,7 +257,7 @@ def mount(device, mountpoint, fstype, options=None):
+ 
+     argv = ["mount", "-t", fstype, "-o", options, device, mountpoint]
+     try:
+-        rc = run_program(argv)
++        rc = run_program(argv, timeout=-1)
+     except OSError:
+         raise
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0010-use-oe-variable-to-replace-hardcoded-dir.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0010-use-oe-variable-to-replace-hardcoded-dir.patch
new file mode 100644
index 0000000..45d8fab
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0010-use-oe-variable-to-replace-hardcoded-dir.patch
@@ -0,0 +1,34 @@
+From e07133dbcf3c52e1ddd2f12797dcd16145269273 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 8 May 2017 03:54:12 -0400
+Subject: [PATCH 10/13] use oe variable to replace hardcoded dir
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ setup.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 4d06a33..a994d06 100644
+--- a/setup.py
++++ b/setup.py
+@@ -61,10 +61,10 @@ class blivet_sdist(sdist):
+ 
+ 
+ data_files = [
+-    ('/etc/dbus-1/system.d', ['dbus/blivet.conf']),
+-    ('/usr/share/dbus-1/system-services', ['dbus/com.redhat.Blivet1.service']),
+-    ('/usr/libexec', ['dbus/blivetd']),
+-    ('/usr/lib/systemd/system', ['dbus/blivet.service'])
++    (os.environ.get('sysconfdir')+'/dbus-1/system.d', ['dbus/blivet.conf']),
++    (os.environ.get('datadir')+'/dbus-1/system-services', ['dbus/com.redhat.Blivet1.service']),
++    (os.environ.get('libexecdir'), ['dbus/blivetd']),
++    (os.environ.get('systemd_system_unitdir'), ['dbus/blivet.service'])
+ ]
+ 
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0011-invoking-fsck-with-infinite-timeout.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0011-invoking-fsck-with-infinite-timeout.patch
new file mode 100644
index 0000000..c61fe01
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0011-invoking-fsck-with-infinite-timeout.patch
@@ -0,0 +1,31 @@
+From e9ab4376a18cc1bd413c000b036320833eec80d7 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 1 Jun 2017 16:05:27 +0800
+Subject: [PATCH 11/13] invoking fsck with infinite timeout
+
+This large timeout is needed when running on machines with
+lots of disks, or with slow disks.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/tasks/fsck.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/blivet/tasks/fsck.py b/blivet/tasks/fsck.py
+index c4214dc..e13ac6b 100644
+--- a/blivet/tasks/fsck.py
++++ b/blivet/tasks/fsck.py
+@@ -77,7 +77,7 @@ class FSCK(task.BasicApplication, fstask.FSTask):
+             raise FSError("\n".join(error_msgs))
+ 
+         try:
+-            rc = util.run_program(self._fsck_command)
++            rc = util.run_program(self._fsck_command, timeout=-1)
+         except OSError as e:
+             raise FSError("filesystem check failed: %s" % e)
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0012-invoking-mkfs-with-infinite-timeout.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0012-invoking-mkfs-with-infinite-timeout.patch
new file mode 100644
index 0000000..33bdbe8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0012-invoking-mkfs-with-infinite-timeout.patch
@@ -0,0 +1,31 @@
+From 9f5a048181cf29d241d96814e736b8235b3d42b1 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 16 Jun 2017 15:43:00 +0800
+Subject: [PATCH 12/13] invoking mkfs with infinite timeout
+
+This large timeout is needed when running on machines with
+lots of disks, or with slow disks.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/tasks/fsmkfs.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/blivet/tasks/fsmkfs.py b/blivet/tasks/fsmkfs.py
+index ad166aa..7bf5075 100644
+--- a/blivet/tasks/fsmkfs.py
++++ b/blivet/tasks/fsmkfs.py
+@@ -170,7 +170,7 @@ class FSMkfs(task.BasicApplication, FSMkfsTask):
+         options = options or []
+         cmd = self._mkfs_command(options, label, set_uuid)
+         try:
+-            ret = util.run_program(cmd)
++            ret = util.run_program(cmd, timeout=-1)
+         except OSError as e:
+             raise FSError(e)
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0013-Revert-Adapt-to-logging-module-name-change.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0013-Revert-Adapt-to-logging-module-name-change.patch
new file mode 100644
index 0000000..6bdf4ce
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0013-Revert-Adapt-to-logging-module-name-change.patch
@@ -0,0 +1,30 @@
+From bfdaf79a2109ac6aed408f0c94f69766991e60e2 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 27 Jul 2017 14:34:30 +0800
+Subject: [PATCH 13/13] Revert "Adapt to logging module name change"
+
+Upstream-Status: Inappropriate [oe specific, sync with anaconda f26-release]
+
+This reverts commit c367d62a516e541ad28636c8259321f1c53417ce.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ blivet/__init__.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/blivet/__init__.py b/blivet/__init__.py
+index 49277cb..a01e487 100644
+--- a/blivet/__init__.py
++++ b/blivet/__init__.py
+@@ -124,7 +124,7 @@ def enable_installer_mode():
+         from pyanaconda.constants import ROOT_PATH  # pylint: disable=redefined-outer-name,no-name-in-module
+         _storage_root = _sysroot = ROOT_PATH
+ 
+-    from pyanaconda.anaconda_logging import program_log_lock
++    from pyanaconda.anaconda_log import program_log_lock
+     util.program_log_lock = program_log_lock
+ 
+     flags.installer_mode = True
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet_2.2.0.bb b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet_2.2.0.bb
new file mode 100644
index 0000000..cacca67
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet_2.2.0.bb
@@ -0,0 +1,46 @@
+DESCRIPTION = "A python module for system storage configuration"
+HOMEPAGE = "http://fedoraproject.org/wiki/blivet"
+LICENSE = "LGPLv2+"
+SECTION = "devel/python"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+S = "${WORKDIR}/git"
+B = "${S}"
+
+SRCREV = "39db82f20d8d4904c0c4dc8912e595177c59e091"
+SRC_URI = "git://github.com/rhinstaller/blivet;branch=2.2-devel \
+           file://0001-comment-out-selinux.patch \
+           file://0002-run_program-support-timeout.patch\
+           file://0003-support-infinit-timeout.patch \
+           file://0004-Mount-var-volatile-during-install.patch \
+           file://0005-update-fstab-by-appending.patch \
+           file://0006-fix-new.roots-object-is-not-iterable.patch \
+           file://0007-fix-incorrect-timeout-while-system-time-changed.patch \
+           file://0008-tweak-btrfs-packages.patch \
+           file://0009-invoking-mount-with-infinite-timeout.patch \
+           file://0010-use-oe-variable-to-replace-hardcoded-dir.patch \
+           file://0011-invoking-fsck-with-infinite-timeout.patch \
+           file://0012-invoking-mkfs-with-infinite-timeout.patch \
+           file://0013-Revert-Adapt-to-logging-module-name-change.patch \
+"
+
+inherit distro_features_check
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+inherit setuptools3 python3native
+
+RDEPENDS_${PN} = "python3-pykickstart python3-pyudev \
+                  parted python3-pyparted multipath-tools \
+                  lsof cryptsetup libblockdev \
+                  libbytesize \
+"
+
+FILES_${PN} += " \
+    ${datadir}/dbus-1/system-services \
+"
+
+inherit systemd
+
+SYSTEMD_AUTO_ENABLE = "disable"
+SYSTEMD_SERVICE_${PN} = "blivet.service"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivetgui_2.1.5.bb b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivetgui_2.1.5.bb
new file mode 100644
index 0000000..ac507ca
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivetgui_2.1.5.bb
@@ -0,0 +1,27 @@
+DESCRIPTION = "GUI tool for storage configuration using blivet library"
+HOMEPAGE = "https://github.com/rhinstaller/blivet-gui"
+LICENSE = "GPLv2+"
+SECTION = "devel/python"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+S = "${WORKDIR}/git"
+B = "${S}"
+
+SRCREV = "52ae8c000843c05abd1d8749f44bbe2e5d891d3d"
+SRC_URI = "git://github.com/rhinstaller/blivet-gui;branch=master \
+"
+
+inherit distro_features_check
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+inherit setuptools3 python3native
+
+RDEPENDS_${PN} = "python3-pygobject python3 \
+                  python3-blivet gtk+3  \
+                  python3-pid libreport \
+"
+
+FILES_${PN} += " \
+    ${datadir}/* \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-meh/python3-meh_0.45.bb b/import-layers/meta-openembedded/meta-python/recipes-extended/python-meh/python3-meh_0.45.bb
new file mode 100644
index 0000000..6ace497
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-meh/python3-meh_0.45.bb
@@ -0,0 +1,17 @@
+SUMMARY = "A python library for handling exceptions"
+DESCRIPTION = "The python-meh package is a python library for handling, saving, and reporting \
+exceptions."
+HOMEPAGE = "http://git.fedorahosted.org/git/?p=python-meh.git"
+LICENSE = "GPLv2+"
+
+inherit setuptools3
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://github.com/rhinstaller/python-meh.git;protocol=https;branch=master \
+"
+SRCREV = "2bfc751fd680515d44f7096945a1e282a1f7d6aa"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+FILES_${PN} += "${datadir}/*"
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch
new file mode 100644
index 0000000..617699d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0001-support-authentication-for-kickstart.patch
@@ -0,0 +1,151 @@
+From d0d8890b5ef74c315381c9e1cff4b1d32892116b Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 1 Jun 2017 15:07:36 +0800
+Subject: [PATCH 1/4] support authentication for kickstart
+
+While download kickstart file from web server,
+we support basic/digest authentication.
+
+Add KickstartAuthError to report authentication failure,
+which the invoker could parse this specific error.
+
+Upstream-Status: inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ pykickstart/errors.py | 19 +++++++++++++++++++
+ pykickstart/load.py   | 32 +++++++++++++++++++++++++++-----
+ pykickstart/parser.py |  4 ++--
+ 3 files changed, 48 insertions(+), 7 deletions(-)
+
+diff --git a/pykickstart/errors.py b/pykickstart/errors.py
+index b76e84c..fd81bc8 100644
+--- a/pykickstart/errors.py
++++ b/pykickstart/errors.py
+@@ -35,6 +35,10 @@ It also exports several exception classes:
+ 
+     KickstartVersionError - An exception for errors relating to unsupported
+                             syntax versions.
++
++    KickstartAuthError - An exception for errors relating to authentication
++                         failed while downloading kickstart from web server
++
+ """
+ import warnings
+ 
+@@ -103,3 +107,18 @@ class KickstartVersionError(KickstartError):
+ 
+     def __str__ (self):
+         return self.value
++
++class KickstartAuthError(KickstartError):
++    """An exception for errors relating to authentication failed while
++       downloading kickstart from web server
++    """
++    def __init__(self, msg):
++        """Create a new KickstartAuthError exception instance with the
++           descriptive message val.  val should be the return value of
++           formatErrorMsg.
++        """
++        KickstartError.__init__(self, msg)
++
++    def __str__(self):
++        return self.value
++
+diff --git a/pykickstart/load.py b/pykickstart/load.py
+index 1f69b9c..0f5741b 100644
+--- a/pykickstart/load.py
++++ b/pykickstart/load.py
+@@ -18,10 +18,13 @@
+ # with the express permission of Red Hat, Inc.
+ #
+ import requests
++from requests.auth import HTTPDigestAuth
++from requests.auth import HTTPBasicAuth
++
+ import shutil
+ import six
+ 
+-from pykickstart.errors import KickstartError
++from pykickstart.errors import KickstartError, KickstartAuthError
+ from pykickstart.i18n import _
+ from requests.exceptions import SSLError, RequestException
+ 
+@@ -29,7 +32,7 @@ _is_url = lambda location: '://' in location # RFC 3986
+ 
+ SSL_VERIFY = True
+ 
+-def load_to_str(location):
++def load_to_str(location, user=None, passwd=None):
+     '''Load a destination URL or file into a string.
+     Type of input is inferred automatically.
+ 
+@@ -40,7 +43,7 @@ def load_to_str(location):
+     Raises: KickstartError on error reading'''
+ 
+     if _is_url(location):
+-        return _load_url(location)
++        return _load_url(location, user=user, passwd=passwd)
+     else:
+         return _load_file(location)
+ 
+@@ -71,13 +74,32 @@ def load_to_file(location, destination):
+         _copy_file(location, destination)
+         return destination
+ 
++def _get_auth(location, user=None, passwd=None):
++
++    auth = None
++    request = requests.get(location, verify=SSL_VERIFY)
++    if request.status_code == requests.codes.unauthorized:
++        if user is None or passwd is None:
++            log.info("Require Authentication")
++            raise KickstartAuthError("Require Authentication.\nAppend 'ksuser=<username> kspasswd=<password>' to boot command")
+ 
++        reasons = request.headers.get("WWW-Authenticate", "").split()
++        if reasons:
++            auth_type = reasons[0]
++        if auth_type == "Basic":
++            auth = HTTPBasicAuth(user, passwd)
++        elif auth_type == "Digest":
++            auth=HTTPDigestAuth(user, passwd)
+ 
+-def _load_url(location):
++    return auth
++
++def _load_url(location, user=None, passwd=None):
+     '''Load a location (URL or filename) and return contents as string'''
+ 
++    auth = _get_auth(location, user=user, passwd=passwd)
++
+     try:
+-        request = requests.get(location, verify=SSL_VERIFY)
++        request = requests.get(location, verify=SSL_VERIFY, auth=auth)
+     except SSLError as e:
+         raise KickstartError(_('Error securely accessing URL "%s"') % location + ': {e}'.format(e=str(e)))
+     except RequestException as e:
+diff --git a/pykickstart/parser.py b/pykickstart/parser.py
+index d2b0fbe..26b5de9 100644
+--- a/pykickstart/parser.py
++++ b/pykickstart/parser.py
+@@ -773,7 +773,7 @@ class KickstartParser(object):
+         i = PutBackIterator(s.splitlines(True) + [""])
+         self._stateMachine (i)
+ 
+-    def readKickstart(self, f, reset=True):
++    def readKickstart(self, f, reset=True, username=None, password=None):
+         """Process a kickstart file, given by the filename f."""
+         if reset:
+             self._reset()
+@@ -794,7 +794,7 @@ class KickstartParser(object):
+         self.currentdir[self._includeDepth] = cd
+ 
+         try:
+-            s = load_to_str(f)
++            s = load_to_str(f, user=username, passwd=password)
+         except KickstartError as e:
+             raise KickstartError(formatErrorMsg(0, msg=_("Unable to open input kickstart file: %s") % str(e)))
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch
new file mode 100644
index 0000000..cb21235
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch
@@ -0,0 +1,76 @@
+From e6e747b883114bfad51ad93f823e65f5a4d6438a Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 1 Jun 2017 15:12:29 +0800
+Subject: [PATCH 2/4] pykickstart/parser.py: add lock for readKickstart and
+ support https without certification
+
+- Add lock for readKickstart to fix race issue
+
+- Support to download kickstart file through https without certification
+
+Upstream-Status: Inappropriate[oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ pykickstart/load.py   |  2 +-
+ pykickstart/parser.py | 24 ++++++++++++++++++++++++
+ 2 files changed, 25 insertions(+), 1 deletion(-)
+
+diff --git a/pykickstart/load.py b/pykickstart/load.py
+index 0f5741b..48c8276 100644
+--- a/pykickstart/load.py
++++ b/pykickstart/load.py
+@@ -30,7 +30,7 @@ from requests.exceptions import SSLError, RequestException
+ 
+ _is_url = lambda location: '://' in location # RFC 3986
+ 
+-SSL_VERIFY = True
++SSL_VERIFY = False
+ 
+ def load_to_str(location, user=None, passwd=None):
+     '''Load a destination URL or file into a string.
+diff --git a/pykickstart/parser.py b/pykickstart/parser.py
+index 26b5de9..264ba05 100644
+--- a/pykickstart/parser.py
++++ b/pykickstart/parser.py
+@@ -57,6 +57,26 @@ STATE_COMMANDS = "commands"
+ 
+ ver = version.DEVEL
+ 
++import logging
++log = logging.getLogger("anaconda")
++
++import inspect
++import threading
++_private_ks_lock = threading.RLock()
++
++class KsLock(object):
++    def __enter__(self):
++        log.info("%s %s" % (self.__class__.__name__, inspect.stack()[0][3]))
++        _private_ks_lock.acquire()
++        return _private_ks_lock
++
++    def __exit__(self, exc_type, exc_val, exc_tb):
++        log.info("%s %s" % (self.__class__.__name__, inspect.stack()[0][3]))
++        _private_ks_lock.release()
++
++
++_ks_lock = KsLock()
++
+ def _preprocessStateMachine (lineIter):
+     l = None
+     lineno = 0
+@@ -774,6 +794,10 @@ class KickstartParser(object):
+         self._stateMachine (i)
+ 
+     def readKickstart(self, f, reset=True, username=None, password=None):
++        with _ks_lock:
++            self._readKickstart(f, reset=reset, username=username, password=password)
++
++    def _readKickstart(self, f, reset=True, username=None, password=None):
+         """Process a kickstart file, given by the filename f."""
+         if reset:
+             self._reset()
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0003-comment-out-sections-shutdown-and-environment-in-gen.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0003-comment-out-sections-shutdown-and-environment-in-gen.patch
new file mode 100644
index 0000000..9fb25fb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0003-comment-out-sections-shutdown-and-environment-in-gen.patch
@@ -0,0 +1,48 @@
+From be6012a5dd49ae5e8ac035654ab1c6f37f0dc8f4 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 1 Jun 2017 15:15:15 +0800
+Subject: [PATCH 3/4] comment out sections shutdown and environment in
+ generated kickstart file
+
+Both of them is disabled by default.
+
+Upstream-Status: Inappropriate[oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+fixup! add comments of shutdown for user
+---
+ pykickstart/commands/reboot.py | 3 +++
+ pykickstart/parser.py          | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/pykickstart/commands/reboot.py b/pykickstart/commands/reboot.py
+index 88799ba..2d0cea9 100644
+--- a/pykickstart/commands/reboot.py
++++ b/pykickstart/commands/reboot.py
+@@ -41,6 +41,9 @@ class FC3_Reboot(KickstartCommand):
+         elif self.action == KS_SHUTDOWN:
+             retval += "# Shutdown after installation\nshutdown"
+             retval += self._getArgsAsStr() + "\n"
++        else:
++            retval += "# Shutdown after installation\n#shutdown"
++            retval += self._getArgsAsStr() + "\n"
+ 
+         return retval
+ 
+diff --git a/pykickstart/parser.py b/pykickstart/parser.py
+index 264ba05..b3f33d7 100644
+--- a/pykickstart/parser.py
++++ b/pykickstart/parser.py
+@@ -383,7 +383,7 @@ class Packages(KickstartObject):
+ 
+         if not self.default:
+             if self.environment:
+-                pkgs += "@^%s\n" % self.environment
++                pkgs += "#@^%s\n" % self.environment
+ 
+             grps = self.groupList
+             grps.sort()
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch
new file mode 100644
index 0000000..70254f6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0004-load.py-retry-to-invoke-request-with-timeout.patch
@@ -0,0 +1,82 @@
+From c0e63f0d3c09bdabb0ad2c88b7cc73e7618dd86a Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 15 Jun 2017 17:35:33 +0800
+Subject: [PATCH 4/4] load.py: retry to invoke request with timeout
+
+While networkless, use request to fetch kickstart file from
+network, it failed and wait 300s to break, we should retry
+to invoke request with timeout explicitly. So if it the
+network is up, the fetch works.
+
+Upstream-Status: inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ pykickstart/load.py | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+
+diff --git a/pykickstart/load.py b/pykickstart/load.py
+index 48c8276..74b266b 100644
+--- a/pykickstart/load.py
++++ b/pykickstart/load.py
+@@ -21,6 +21,7 @@ import requests
+ from requests.auth import HTTPDigestAuth
+ from requests.auth import HTTPBasicAuth
+ 
++import time
+ import shutil
+ import six
+ 
+@@ -28,6 +29,9 @@ from pykickstart.errors import KickstartError, KickstartAuthError
+ from pykickstart.i18n import _
+ from requests.exceptions import SSLError, RequestException
+ 
++import logging
++log = logging.getLogger("anaconda")
++
+ _is_url = lambda location: '://' in location # RFC 3986
+ 
+ SSL_VERIFY = False
+@@ -74,6 +78,29 @@ def load_to_file(location, destination):
+         _copy_file(location, destination)
+         return destination
+ 
++def _access_url(location):
++    status = False
++
++    # Retry 45 times, wait 45s~135s
++    i = 0
++    while i < 45:
++
++        try:
++            request = requests.get(location, verify=SSL_VERIFY, timeout=2)
++        except RequestException as e:
++            log.info("Try '%s' %d times, %s" % (location, i, str(e)))
++            status = False
++            i += 1
++            time.sleep(1)
++            continue
++
++        else:
++            status = True
++            return status
++
++    return status
++
++
+ def _get_auth(location, user=None, passwd=None):
+ 
+     auth = None
+@@ -96,6 +123,9 @@ def _get_auth(location, user=None, passwd=None):
+ def _load_url(location, user=None, passwd=None):
+     '''Load a location (URL or filename) and return contents as string'''
+ 
++    if not _access_url(location):
++        raise KickstartError(_("Connection %s failed" % location))
++
+     auth = _get_auth(location, user=user, passwd=passwd)
+ 
+     try:
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0005-tweak-shebang-to-python3.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0005-tweak-shebang-to-python3.patch
new file mode 100644
index 0000000..3d61495
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/files/0005-tweak-shebang-to-python3.patch
@@ -0,0 +1,25 @@
+From 8a1f598223bd4cbcc877eb2aba3f5586c75c9d14 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 21 Aug 2017 10:05:06 +0800
+Subject: [PATCH] tweak shebang to python3
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tools/ksvalidator.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/ksvalidator.py b/tools/ksvalidator.py
+index d6051d5..c3682e8 100755
+--- a/tools/ksvalidator.py
++++ b/tools/ksvalidator.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python3
+ #
+ # Chris Lumens <clumens@redhat.com>
+ #
+-- 
+1.8.3.1
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_2.35.bb b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_2.35.bb
new file mode 100644
index 0000000..7fe603b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pykickstart/python3-pykickstart_2.35.bb
@@ -0,0 +1,24 @@
+DESCRIPTION = "A python library for manipulating kickstart files"
+HOMEPAGE = "http://fedoraproject.org/wiki/pykickstart"
+LICENSE = "GPLv2+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+DEPENDS = "python3"
+RDEPENDS_${PN} = "python3 \
+                  python3-requests \
+                  python3-six \
+"
+
+S = "${WORKDIR}/git"
+SRC_URI = "git://github.com/rhinstaller/pykickstart.git;protocol=https;branch=pykickstart-2 \
+           file://0001-support-authentication-for-kickstart.patch \
+           file://0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch \
+           file://0003-comment-out-sections-shutdown-and-environment-in-gen.patch \
+           file://0004-load.py-retry-to-invoke-request-with-timeout.patch \
+           file://0005-tweak-shebang-to-python3.patch \
+           "
+SRCREV = "b2787a818540e678c2f9c5dca0c6bbd65b8b55e5"
+
+inherit setuptools3
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python-pyparted.inc b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python-pyparted.inc
new file mode 100644
index 0000000..65f8ca1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python-pyparted.inc
@@ -0,0 +1,21 @@
+DESCRIPTION = "pyparted is a set of Python modules that provide Python programmers \
+an interface to libparted, the GNU parted library for disk partitioning and \
+filesystem manipulation."
+SUMMARY = "Python bindings for libparted"
+HOMEPAGE = "https://github.com/rhinstaller/pyparted"
+LICENSE = "GPL-2.0+"
+LIC_FILES_CHKSUM = "\
+    file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+    file://src/_pedmodule.c;startline=10;endline=22;md5=ebcb25dde1ac9c46e986dec79b404e7e \
+"
+DEPENDS += "parted"
+
+# upstream only publishes releases in github archives which are discouraged
+SRCREV = "69c4a478e43d3eff6ae3a0116fa38da06776d5f5"
+SRC_URI = "git://github.com/rhinstaller/pyparted.git;protocol=https \
+           file://0001-fix-version-float-check.patch \
+"
+S = "${WORKDIR}/git"
+
+RDEPENDS_${PN} += "parted (>= 2.3)"
+RDEPENDS_${PN}_class-native = ""
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python-pyparted_3.10.7.bb b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python-pyparted_3.10.7.bb
index 8335d08..8a15a89 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python-pyparted_3.10.7.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python-pyparted_3.10.7.bb
@@ -1,27 +1,12 @@
-DESCRIPTION = "pyparted is a set of Python modules that provide Python programmers \
-an interface to libparted, the GNU parted library for disk partitioning and \
-filesystem manipulation."
-SUMMARY = "Python bindings for libparted"
-HOMEPAGE = "https://github.com/rhinstaller/pyparted"
-LICENSE = "GPL-2.0+"
-LIC_FILES_CHKSUM = "\
-    file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
-    file://src/_pedmodule.c;startline=10;endline=22;md5=ebcb25dde1ac9c46e986dec79b404e7e \
-"
-DEPENDS += "parted python-re"
+require python-pyparted.inc
+
+DEPENDS += "python-re"
 
 PV = "3.10.7+git${SRCPV}"
 
-# upstream only publishes releases in github archives which are discouraged
-SRCREV = "69c4a478e43d3eff6ae3a0116fa38da06776d5f5"
-SRC_URI = "git://github.com/rhinstaller/pyparted.git;protocol=https \
-           file://0001-fix-version-float-check.patch \
-"
-S = "${WORKDIR}/git"
-
 inherit distutils
 
-RDEPENDS_${PN} += "python-stringold python-codecs python-math parted (>= 2.3)"
+RDEPENDS_${PN} += "python-stringold python-codecs python-math"
 RDEPENDS_${PN}_class-native = ""
 
 BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python3-pyparted/0001-fix-version-float-check.patch b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python3-pyparted/0001-fix-version-float-check.patch
new file mode 100644
index 0000000..14fb0bb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python3-pyparted/0001-fix-version-float-check.patch
@@ -0,0 +1,26 @@
+check_mod_version breaks if module version is of x.y.z form
+use a regex to help cast x.y.z version to a float
+
+Upstream-Status: Pending
+
+Index: git/setup.py
+===================================================================
+--- git.orig/setup.py
++++ git/setup.py
+@@ -25,6 +25,7 @@ import glob
+ import os
+ import platform
+ import sys
++import re
+ from distutils.ccompiler import new_compiler
+ from distutils.errors import CompileError
+ from distutils.errors import LinkError
+@@ -51,6 +52,8 @@ def pkgconfig(*packages, **kwargs):
+ 
+ def check_mod_version(module, version):
+     modversion = subprocess.check_output(["pkg-config", "--modversion", module])
++    match = re.search(b'([0-9]+\.[0-9]+)', modversion)
++    modversion = match.group(0)
+     if not float(modversion) >= float(version):
+         sys.stderr.write("*** Minimum required %s version: %s, found: %s\n" % (module, version, modversion,))
+         sys.exit(1)
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python3-pyparted_3.10.7.bb b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python3-pyparted_3.10.7.bb
new file mode 100644
index 0000000..ff72c2a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python3-pyparted_3.10.7.bb
@@ -0,0 +1,12 @@
+require python-pyparted.inc
+
+DEPENDS += "python3-re"
+
+PV = "3.10.7+git${SRCPV}"
+
+inherit distutils3
+
+RDEPENDS_${PN} += "python3-stringold python3-codecs python3-math"
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/pywbem/pywbem_0.8.0.bb b/import-layers/meta-openembedded/meta-python/recipes-extended/pywbem/pywbem_0.8.0.bb
new file mode 100644
index 0000000..7f1986e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/pywbem/pywbem_0.8.0.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Python WBEM Client and Provider Interface"
+DESCRIPTION = "\
+A Python library for making CIM (Common Information Model) operations over \
+HTTP using the WBEM CIM-XML protocol. It is based on the idea that a good \
+WBEM client should be easy to use and not necessarily require a large amount \
+of programming knowledge. It is suitable for a large range of tasks from \
+simply poking around to writing web and GUI applications. \
+\
+WBEM, or Web Based Enterprise Management is a manageability protocol, like \
+SNMP, standardised by the Distributed Management Task Force (DMTF) available \
+at http://www.dmtf.org/standards/wbem. \
+\
+It also provides a Python provider interface, and is the fastest and easiest \
+way to write providers on the planet."
+HOMEPAGE = "http://pywbem.sf.net/"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://pywbem/LICENSE.txt;md5=fbc093901857fcd118f065f900982c24"
+SECTION = "Development/Libraries"
+DEPENDS = "python-m2crypto-native python-typing-native"
+SRC_URI = "http://jaist.dl.sourceforge.net/project/${BPN}/${BPN}/${BP}/${BP}-dev.r704.zip"
+SRC_URI[md5sum] = "84072451dcdd1aa9ee82363848faf7ad"
+SRC_URI[sha256sum] = "898035866d3cc741bbcd62c4ac26e633ad07b7c11d89db2472b9f923f3fd3ed8"
+
+S = "${WORKDIR}/${BP}-dev"
+
+inherit setuptools python-dir
+
+do_install_append() {
+    mv ${D}${bindir}/wbemcli.py ${D}${bindir}/pywbemcli
+    mv ${D}${bindir}/mof_compiler.py ${D}${bindir}/mofcomp
+
+    rm ${D}${libdir}/python2.7/site-packages/${BPN}/wbemcli.py*
+    rm ${D}${libdir}/python2.7/site-packages/${BPN}/mof_compiler.py*
+}
+
+BBCLASSEXTEND = "native"