Yocto 2.5

Move OpenBMC to Yocto 2.5(sumo)

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5c5ad6904a16e14c1c397f0baf10c9d465594a78
diff --git a/common/recipes-core/busybox/busybox/0001-umount-ignore--c.patch b/common/recipes-core/busybox/busybox/0001-umount-ignore--c.patch
deleted file mode 100644
index 1bf53f4..0000000
--- a/common/recipes-core/busybox/busybox/0001-umount-ignore--c.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-[PATCH] umount: ignore -c option
-
-systemd uses -c.
-       -c, --no-canonicalize
-              Do  not canonicalize paths.  The paths canonicalization is based
-              on stat(2) and readlink(2) system calls. These system calls  may
-              hang  in  some cases (for example on NFS if server is not availā€
-              able). The option has to be used  with  canonical  path  to  the
-              mount point.
-
-              For  more  details  about this option see the mount(8) man page.
-              Note  that  umount  does   not   pass   this   option   to   the
-              /sbin/umount.type helpers.
-As busybox doesn't canonicalize paths in the first place it is safe to ignore this
-option.
-
-See https://github.com/systemd/systemd/issues/7786
-
-Signed-off-by: Shawn Landden <slandden at gmail.com>
----
- util-linux/umount.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/util-linux/umount.c b/util-linux/umount.c
-index a6405dfcc..b45cd8a6b 100644
---- a/util-linux/umount.c
-+++ b/util-linux/umount.c
-@@ -44,7 +44,7 @@ static struct mntent *getmntent_r(FILE*
- }
- #endif
- 
--/* Ignored: -v -t -i
-+/* Ignored: -c -v -t -i
-  * bbox always acts as if -d is present.
-  * -D can be used to suppress it (bbox extension).
-  * Rationale:
-@@ -52,7 +52,7 @@ static struct mntent *getmntent_r(FILE*
-  * thus, on many systems, bare umount _does_ drop loop devices.
-  * (2) many users request this feature.
-  */
--#define OPTION_STRING           "fldDnra" "vt:i"
-+#define OPTION_STRING           "fldDnra" "cvt:i"
- #define OPT_FORCE               (1 << 0) // Same as MNT_FORCE
- #define OPT_LAZY                (1 << 1) // Same as MNT_DETACH
- //#define OPT_FREE_LOOP           (1 << 2) // -d is assumed always present
diff --git a/common/recipes-core/busybox/busybox_%.bbappend b/common/recipes-core/busybox/busybox_%.bbappend
index 5acaf3c..e6678fc 100644
--- a/common/recipes-core/busybox/busybox_%.bbappend
+++ b/common/recipes-core/busybox/busybox_%.bbappend
@@ -3,4 +3,3 @@
 SRC_URI += "file://flash.cfg"
 SRC_URI += "file://mountpoint.cfg"
 SRC_URI += "file://0001-Stop-watchdog-first-on-startup.patch"
-SRC_URI += "file://0001-umount-ignore--c.patch"
diff --git a/common/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/common/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
index f98e5c5..96236ca 100644
--- a/common/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
+++ b/common/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
@@ -1,5 +1,5 @@
 RDEPENDS_${PN}_append = " \
-        nativesdk-autoconf-archive-dev \
+        nativesdk-autoconf-archive \
         nativesdk-phosphor-dbus-interfaces-yaml \
         nativesdk-sdbus++ \
         nativesdk-phosphor-logging-elog \
diff --git a/common/recipes-core/systemd/systemd/0001-Export-message_append_cmdline.patch b/common/recipes-core/systemd/systemd/0001-Export-message_append_cmdline.patch
deleted file mode 100644
index afb2a48..0000000
--- a/common/recipes-core/systemd/systemd/0001-Export-message_append_cmdline.patch
+++ /dev/null
@@ -1,323 +0,0 @@
-From 5dfdd9973fe6437985d535fd530cec83a2774113 Mon Sep 17 00:00:00 2001
-From: Brad Bishop <bradleyb@us.ibm.com>
-Date: Tue, 16 Aug 2016 15:07:34 -0400
-Subject: [PATCH] Export message_append_cmdline
-
-Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
----
- Makefile.am                         |  43 ++++--
- src/libsystemd/libsystemd.sym       |   1 +
- src/libsystemd/sd-bus/bus-message.c | 254 ++++++++++++++++++++++++++++++++++++
- src/systemd/sd-bus.h                |   1 +
- 4 files changed, 285 insertions(+), 14 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 03341fc..0dbf4b7 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -3032,7 +3033,10 @@ libsystemd_internal_la_SOURCES = \
- 	src/libsystemd/sd-device/sd-device.c \
- 	src/libsystemd/sd-device/device-private.c \
- 	src/libsystemd/sd-device/device-private.h \
--	src/libsystemd/sd-resolve/sd-resolve.c
-+	src/libsystemd/sd-resolve/sd-resolve.c \
-+	src/shared/bus-util.c \
-+	src/shared/bus-util.h
-+
- 
- libsystemd_internal_la_LIBADD = \
- 	libbasic.la \
-diff --git a/src/libsystemd/libsystemd.sym b/src/libsystemd/libsystemd.sym
-index 4ab637b..f0c06c7 100644
---- a/src/libsystemd/libsystemd.sym
-+++ b/src/libsystemd/libsystemd.sym
-@@ -488,4 +488,5 @@ global:
-         sd_journal_has_persistent_files;
-         sd_journal_enumerate_fields;
-         sd_journal_restart_fields;
-+        sd_bus_message_append_cmdline;
- } LIBSYSTEMD_227;
-diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
-index c2e913f..d8d3ec8 100644
---- a/src/libsystemd/sd-bus/bus-message.c
-+++ b/src/libsystemd/sd-bus/bus-message.c
-@@ -38,6 +38,7 @@
- #include "time-util.h"
- #include "utf8.h"
- #include "util.h"
-+#include "parse-util.h"
- 
- static int message_append_basic(sd_bus_message *m, char type, const void *p, const void **stored);
- 
-@@ -5946,3 +5947,256 @@ _public_ int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority) {
-         m->priority = priority;
-         return 0;
- }
-+
-+_public_ int sd_bus_message_append_cmdline(sd_bus_message *m, const char *signature, char ***x) {
-+        char **p;
-+        int r;
-+
-+        assert(m);
-+        assert(signature);
-+        assert(x);
-+
-+        p = *x;
-+
-+        for (;;) {
-+                const char *v;
-+                char t;
-+
-+                t = *signature;
-+                v = *p;
-+
-+                if (t == 0)
-+                        break;
-+                if (!v) {
-+                        log_error("Too few parameters for signature.");
-+                        return -EINVAL;
-+                }
-+
-+                signature++;
-+                p++;
-+
-+                switch (t) {
-+
-+                case SD_BUS_TYPE_BOOLEAN:
-+
-+                        r = parse_boolean(v);
-+                        if (r < 0) {
-+                                log_error("Failed to parse as boolean: %s", v);
-+                                return r;
-+                        }
-+
-+                        r = sd_bus_message_append_basic(m, t, &r);
-+                        break;
-+
-+                case SD_BUS_TYPE_BYTE: {
-+                        uint8_t z;
-+
-+                        r = safe_atou8(v, &z);
-+                        if (r < 0) {
-+                                log_error("Failed to parse as byte (unsigned 8bit integer): %s", v);
-+                                return r;
-+                        }
-+
-+                        r = sd_bus_message_append_basic(m, t, &z);
-+                        break;
-+                }
-+
-+                case SD_BUS_TYPE_INT16: {
-+                        int16_t z;
-+
-+                        r = safe_atoi16(v, &z);
-+                        if (r < 0) {
-+                                log_error("Failed to parse as signed 16bit integer: %s", v);
-+                                return r;
-+                        }
-+
-+                        r = sd_bus_message_append_basic(m, t, &z);
-+                        break;
-+                }
-+
-+                case SD_BUS_TYPE_UINT16: {
-+                        uint16_t z;
-+
-+                        r = safe_atou16(v, &z);
-+                        if (r < 0) {
-+                                log_error("Failed to parse as unsigned 16bit integer: %s", v);
-+                                return r;
-+                        }
-+
-+                        r = sd_bus_message_append_basic(m, t, &z);
-+                        break;
-+                }
-+
-+                case SD_BUS_TYPE_INT32: {
-+                        int32_t z;
-+
-+                        r = safe_atoi32(v, &z);
-+                        if (r < 0) {
-+                                log_error("Failed to parse as signed 32bit integer: %s", v);
-+                                return r;
-+                        }
-+
-+                        r = sd_bus_message_append_basic(m, t, &z);
-+                        break;
-+                }
-+
-+                case SD_BUS_TYPE_UINT32: {
-+                        uint32_t z;
-+
-+                        r = safe_atou32(v, &z);
-+                        if (r < 0) {
-+                                log_error("Failed to parse as unsigned 32bit integer: %s", v);
-+                                return r;
-+                        }
-+
-+                        r = sd_bus_message_append_basic(m, t, &z);
-+                        break;
-+                }
-+
-+                case SD_BUS_TYPE_INT64: {
-+                        int64_t z;
-+
-+                        r = safe_atoi64(v, &z);
-+                        if (r < 0) {
-+                                log_error("Failed to parse as signed 64bit integer: %s", v);
-+                                return r;
-+                        }
-+
-+                        r = sd_bus_message_append_basic(m, t, &z);
-+                        break;
-+                }
-+
-+                case SD_BUS_TYPE_UINT64: {
-+                        uint64_t z;
-+
-+                        r = safe_atou64(v, &z);
-+                        if (r < 0) {
-+                                log_error("Failed to parse as unsigned 64bit integer: %s", v);
-+                                return r;
-+                        }
-+
-+                        r = sd_bus_message_append_basic(m, t, &z);
-+                        break;
-+                }
-+
-+
-+                case SD_BUS_TYPE_DOUBLE: {
-+                        double z;
-+
-+                        r = safe_atod(v, &z);
-+                        if (r < 0) {
-+                                log_error("Failed to parse as double precision floating point: %s", v);
-+                                return r;
-+                        }
-+
-+                        r = sd_bus_message_append_basic(m, t, &z);
-+                        break;
-+                }
-+
-+                case SD_BUS_TYPE_STRING:
-+                case SD_BUS_TYPE_OBJECT_PATH:
-+                case SD_BUS_TYPE_SIGNATURE:
-+
-+                        r = sd_bus_message_append_basic(m, t, v);
-+                        break;
-+
-+                case SD_BUS_TYPE_ARRAY: {
-+                        uint32_t n;
-+                        size_t k;
-+
-+                        r = safe_atou32(v, &n);
-+                        if (r < 0) {
-+                                log_error("Failed to parse number of array entries: %s", v);
-+                                return r;
-+                        }
-+
-+                        r = signature_element_length(signature, &k);
-+                        if (r < 0) {
-+                                log_error("Invalid array signature.");
-+                                return r;
-+                        }
-+
-+                        {
-+                                unsigned i;
-+                                char s[k + 1];
-+                                memcpy(s, signature, k);
-+                                s[k] = 0;
-+
-+                                r = sd_bus_message_open_container(m, SD_BUS_TYPE_ARRAY, s);
-+                                if (r < 0)
-+                                        return bus_log_create_error(r);
-+
-+                                for (i = 0; i < n; i++) {
-+                                        r = sd_bus_message_append_cmdline(m, s, &p);
-+                                        if (r < 0)
-+                                                return r;
-+                                }
-+                        }
-+
-+                        signature += k;
-+
-+                        r = sd_bus_message_close_container(m);
-+                        break;
-+                }
-+
-+                case SD_BUS_TYPE_VARIANT:
-+                        r = sd_bus_message_open_container(m, SD_BUS_TYPE_VARIANT, v);
-+                        if (r < 0)
-+                                return bus_log_create_error(r);
-+
-+                        r = sd_bus_message_append_cmdline(m, v, &p);
-+                        if (r < 0)
-+                                return r;
-+
-+                        r = sd_bus_message_close_container(m);
-+                        break;
-+
-+                case SD_BUS_TYPE_STRUCT_BEGIN:
-+                case SD_BUS_TYPE_DICT_ENTRY_BEGIN: {
-+                        size_t k;
-+
-+                        signature--;
-+                        p--;
-+
-+                        r = signature_element_length(signature, &k);
-+                        if (r < 0) {
-+                                log_error("Invalid struct/dict entry signature.");
-+                                return r;
-+                        }
-+
-+                        {
-+                                char s[k-1];
-+                                memcpy(s, signature + 1, k - 2);
-+                                s[k - 2] = 0;
-+
-+                                r = sd_bus_message_open_container(m, t == SD_BUS_TYPE_STRUCT_BEGIN ? SD_BUS_TYPE_STRUCT : SD_BUS_TYPE_DICT_ENTRY, s);
-+                                if (r < 0)
-+                                        return bus_log_create_error(r);
-+
-+                                r = sd_bus_message_append_cmdline(m, s, &p);
-+                                if (r < 0)
-+                                        return r;
-+                        }
-+
-+                        signature += k;
-+
-+                        r = sd_bus_message_close_container(m);
-+                        break;
-+                }
-+
-+                case SD_BUS_TYPE_UNIX_FD:
-+                        log_error("UNIX file descriptor not supported as type.");
-+                        return -EINVAL;
-+
-+                default:
-+                        log_error("Unknown signature type %c.", t);
-+                        return -EINVAL;
-+                }
-+
-+                if (r < 0)
-+                        return bus_log_create_error(r);
-+        }
-+
-+        *x = p;
-+        return 0;
-+}
-diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h
-index 2a2ef0e..a6a21a4 100644
---- a/src/systemd/sd-bus.h
-+++ b/src/systemd/sd-bus.h
-@@ -233,6 +233,7 @@ int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority);
- int sd_bus_message_get_expect_reply(sd_bus_message *m);
- int sd_bus_message_get_auto_start(sd_bus_message *m);
- int sd_bus_message_get_allow_interactive_authorization(sd_bus_message *m);
-+int sd_bus_message_append_cmdline(sd_bus_message *m, const char *signature, char ***x);
- 
- const char *sd_bus_message_get_signature(sd_bus_message *m, int complete);
- const char *sd_bus_message_get_path(sd_bus_message *m);
--- 
-1.8.3.1
-
diff --git a/common/recipes-core/systemd/systemd/0001-watchdog-allow-a-device-path-to-be-specified.patch b/common/recipes-core/systemd/systemd/0001-watchdog-allow-a-device-path-to-be-specified.patch
deleted file mode 100644
index 7dddd61..0000000
--- a/common/recipes-core/systemd/systemd/0001-watchdog-allow-a-device-path-to-be-specified.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From 9d1f2858cd2ba49066ca319164b4e3e2769fc0fb Mon Sep 17 00:00:00 2001
-From: "Edward A. James" <eajames@us.ibm.com>
-Date: Fri, 8 Dec 2017 11:26:30 -0600
-Subject: [PATCH 1/3] watchdog: allow a device path to be specified
-
-Currently systemd hardcodes the use of /dev/watchdog. This is a legacy
-chardev that points to watchdog0 in the system.
-
-Modify the watchdog API to allow a different device path to be passed
-and stored. Opening the watchdog defaults to /dev/watchdog, maintaining
-existing behavior.
----
- src/shared/watchdog.c | 9 ++++++++-
- src/shared/watchdog.h | 5 +++++
- 2 files changed, 13 insertions(+), 1 deletion(-)
-
-diff --git a/src/shared/watchdog.c b/src/shared/watchdog.c
-index 4f3e012..8068e95 100644
---- a/src/shared/watchdog.c
-+++ b/src/shared/watchdog.c
-@@ -26,10 +26,12 @@
- 
- #include "fd-util.h"
- #include "log.h"
-+#include "string-util.h"
- #include "time-util.h"
- #include "watchdog.h"
- 
- static int watchdog_fd = -1;
-+static char *watchdog_device = NULL;
- static usec_t watchdog_timeout = USEC_INFINITY;
- 
- static int update_timeout(void) {
-@@ -83,7 +85,8 @@ static int open_watchdog(void) {
-         if (watchdog_fd >= 0)
-                 return 0;
- 
--        watchdog_fd = open("/dev/watchdog", O_WRONLY|O_CLOEXEC);
-+        watchdog_fd = open(watchdog_device ?: "/dev/watchdog",
-+                           O_WRONLY|O_CLOEXEC);
-         if (watchdog_fd < 0)
-                 return -errno;
- 
-@@ -95,6 +98,10 @@ static int open_watchdog(void) {
-         return update_timeout();
- }
- 
-+int watchdog_set_device(char *path) {
-+        return free_and_strdup(&watchdog_device, path);
-+}
-+
- int watchdog_set_timeout(usec_t *usec) {
-         int r;
- 
-diff --git a/src/shared/watchdog.h b/src/shared/watchdog.h
-index f6ec178..90a075a 100644
---- a/src/shared/watchdog.h
-+++ b/src/shared/watchdog.h
-@@ -24,6 +24,11 @@
- #include "time-util.h"
- #include "util.h"
- 
-+int watchdog_set_device(char *path);
- int watchdog_set_timeout(usec_t *usec);
- int watchdog_ping(void);
- void watchdog_close(bool disarm);
-+
-+static inline void watchdog_free_device(void) {
-+        (void) watchdog_set_device(NULL);
-+}
--- 
-1.8.3.1
-
diff --git a/common/recipes-core/systemd/systemd/0002-core-Add-WatchdogDevice-config-option-and-implement-.patch b/common/recipes-core/systemd/systemd/0002-core-Add-WatchdogDevice-config-option-and-implement-.patch
deleted file mode 100644
index 4e10065..0000000
--- a/common/recipes-core/systemd/systemd/0002-core-Add-WatchdogDevice-config-option-and-implement-.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-From 9a7b66daa24ed5c6a994323b308c3c3a0a10bf6a Mon Sep 17 00:00:00 2001
-From: Eddie James <eajames@us.ibm.com>
-Date: Thu, 5 Apr 2018 12:31:15 -0500
-Subject: [PATCH 2/3] core: Add WatchdogDevice config option and implement it
-
-This option allows a device path to be specified for the systemd
-watchdog (both runtime and shutdown).
-
-If a system requires a watchdog other than /dev/watchdog (pointing to
-/dev/watchdog0) to be used to reboot the system, this setting should be
-changed to the relevant watchdog device path (e.g. /dev/watchdog1).
----
- src/core/main.c     | 32 ++++++++++++++++++++++++++++++--
- src/core/shutdown.c | 11 +++++++++++
- 2 files changed, 41 insertions(+), 2 deletions(-)
-
-diff --git a/src/core/main.c b/src/core/main.c
-index 07e3e97..d4673bf 100644
---- a/src/core/main.c
-+++ b/src/core/main.c
-@@ -119,6 +119,7 @@ static usec_t arg_default_start_limit_interval = DEFAULT_START_LIMIT_INTERVAL;
- static unsigned arg_default_start_limit_burst = DEFAULT_START_LIMIT_BURST;
- static usec_t arg_runtime_watchdog = 0;
- static usec_t arg_shutdown_watchdog = 10 * USEC_PER_MINUTE;
-+static char *arg_watchdog_device = NULL;
- static char **arg_default_environment = NULL;
- static struct rlimit *arg_default_rlimit[_RLIMIT_MAX] = {};
- static uint64_t arg_capability_bounding_set = CAP_ALL;
-@@ -459,6 +460,13 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
-                 if (arg_default_timeout_start_usec <= 0)
-                         arg_default_timeout_start_usec = USEC_INFINITY;
- 
-+        } else if (proc_cmdline_key_streq(key, "systemd.watchdog_device")) {
-+
-+                if (proc_cmdline_value_missing(key, value))
-+                        return 0;
-+
-+                parse_path_argument_and_warn(value, false, &arg_watchdog_device);
-+
-         } else if (streq(key, "quiet") && !value) {
- 
-                 if (arg_show_status == _SHOW_STATUS_UNSET)
-@@ -715,6 +723,7 @@ static int parse_config_file(void) {
-                 { "Manager", "JoinControllers",           config_parse_join_controllers, 0, &arg_join_controllers                  },
-                 { "Manager", "RuntimeWatchdogSec",        config_parse_sec,              0, &arg_runtime_watchdog                  },
-                 { "Manager", "ShutdownWatchdogSec",       config_parse_sec,              0, &arg_shutdown_watchdog                 },
-+                { "Manager", "WatchdogDevice",            config_parse_path,             0, &arg_watchdog_device                   },
-                 { "Manager", "CapabilityBoundingSet",     config_parse_capability_set,   0, &arg_capability_bounding_set           },
- #ifdef HAVE_SECCOMP
-                 { "Manager", "SystemCallArchitectures",   config_parse_syscall_archs,    0, &arg_syscall_archs                     },
-@@ -1776,6 +1785,13 @@ int main(int argc, char *argv[]) {
-                         test_usr();
-                 }
- 
-+                if (arg_system && arg_watchdog_device) {
-+                        r = watchdog_set_device(arg_watchdog_device);
-+                        if (r < 0)
-+                                log_warning_errno(r, "Failed to set watchdog device to %s, ignoring: %m",
-+                                                  arg_watchdog_device);
-+                }
-+
-                 if (arg_system && arg_runtime_watchdog > 0 && arg_runtime_watchdog != USEC_INFINITY)
-                         watchdog_set_timeout(&arg_runtime_watchdog);
- 
-@@ -2147,8 +2163,13 @@ finish:
-          * here explicitly. valgrind will only generate nice output on
-          * exit(), not on exec(), hence let's do the former not the
-          * latter here. */
--        if (getpid() == 1 && RUNNING_ON_VALGRIND)
-+        if (getpid() == 1 && RUNNING_ON_VALGRIND) {
-+                /* Cleanup watchdog_device strings for valgrind. We need them
-+                 * in become_shutdown() so normally we cannot free them yet. */
-+                watchdog_free_device();
-+                arg_watchdog_device = mfree(arg_watchdog_device);
-                 return 0;
-+        }
- #endif
- 
-         if (shutdown_verb) {
-@@ -2211,7 +2232,11 @@ finish:
- 
-                         /* Tell the binary how often to ping, ignore failure */
-                         if (asprintf(&e, "WATCHDOG_USEC="USEC_FMT, arg_shutdown_watchdog) > 0)
--                                (void) strv_push(&env_block, e);
-+                                (void) strv_consume(&env_block, e);
-+
-+                        if (arg_watchdog_device &&
-+                            asprintf(&e, "WATCHDOG_DEVICE=%s", arg_watchdog_device) > 0)
-+                                (void) strv_consume(&env_block, e);
-                 } else
-                         watchdog_close(true);
- 
-@@ -2226,6 +2251,9 @@ finish:
-                           getpid() == 1 ? "freezing" : "quitting");
-         }
- 
-+        watchdog_free_device();
-+        arg_watchdog_device = mfree(arg_watchdog_device);
-+
-         if (getpid() == 1) {
-                 if (error_message)
-                         manager_status_printf(NULL, STATUS_TYPE_EMERGENCY,
-diff --git a/src/core/shutdown.c b/src/core/shutdown.c
-index a7d5e57..5f0d961 100644
---- a/src/core/shutdown.c
-+++ b/src/core/shutdown.c
-@@ -166,6 +166,7 @@ int main(int argc, char *argv[]) {
-         unsigned retries;
-         int cmd, r;
-         static const char* const dirs[] = {SYSTEM_SHUTDOWN_PATH, NULL};
-+        char *watchdog_device;
- 
-         log_parse_environment();
-         r = parse_argv(argc, argv);
-@@ -206,6 +207,13 @@ int main(int argc, char *argv[]) {
-         in_container = detect_container() > 0;
- 
-         use_watchdog = !!getenv("WATCHDOG_USEC");
-+        watchdog_device = getenv("WATCHDOG_DEVICE");
-+        if (watchdog_device) {
-+                r = watchdog_set_device(watchdog_device);
-+                if (r < 0)
-+                        log_warning_errno(r, "Failed to set watchdog device to %s, ignoring: %m",
-+                                          watchdog_device);
-+        }
- 
-         /* Lock us into memory */
-         mlockall(MCL_CURRENT|MCL_FUTURE);
-@@ -319,6 +327,9 @@ int main(int argc, char *argv[]) {
- 
-  initrd_jump:
- 
-+        /* We're done with the watchdog. */
-+        watchdog_free_device();
-+
-         arguments[0] = NULL;
-         arguments[1] = arg_verb;
-         arguments[2] = NULL;
--- 
-1.8.3.1
-
diff --git a/common/recipes-core/systemd/systemd/0002-systemd-Make-pam-compile-shared-library.patch b/common/recipes-core/systemd/systemd/0002-systemd-Make-pam-compile-shared-library.patch
deleted file mode 100644
index 977f565..0000000
--- a/common/recipes-core/systemd/systemd/0002-systemd-Make-pam-compile-shared-library.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From f6d311978915cc1e3eba8a118716a6864309d731 Mon Sep 17 00:00:00 2001
-From: "Edward A. James" <eajames@us.ibm.com>
-Date: Fri, 14 Oct 2016 15:33:40 -0500
-Subject: [PATCH] systemd: Make pam compile shared library
-
-- make pam independant of logind
-- remove bus-util.c from libshared as it's already in libsystemd-internal
-
-Signed-off-by: Edward A. James <eajames@us.ibm.com>
----
- Makefile.am | 60 ++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 28 insertions(+), 32 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index afb6b31..6dd92e7 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1025,7 +1025,6 @@ libshared_la_SOURCES = \
- 	src/shared/import-util.h \
- 	src/shared/sysctl-util.c \
- 	src/shared/sysctl-util.h \
--	src/shared/bus-util.c \
- 	src/shared/bus-util.h \
- 	src/shared/logs-show.c \
- 	src/shared/logs-show.h \
-@@ -5579,39 +5578,6 @@ tests += \
- 	test-login-tables \
- 	test-login-shared
- 
--if HAVE_PAM
--pam_systemd_la_SOURCES = \
--	src/login/pam_systemd.sym \
--	src/login/pam_systemd.c
--
--pam_systemd_la_CFLAGS = \
--	$(AM_CFLAGS) \
--	$(PAM_CFLAGS)
--
--pam_systemd_la_LDFLAGS = \
--	$(AM_LDFLAGS) \
--	-module \
--	-export-dynamic \
--	-avoid-version \
--	-shared \
--	-Wl,--version-script=$(top_srcdir)/src/login/pam_systemd.sym
--
--pam_systemd_la_LIBADD = \
--	libshared.la \
--	$(PAM_LIBS)
--
--pamlib_LTLIBRARIES = \
--	pam_systemd.la
--
--if ENABLE_PAM_CONFIG
--dist_pamconf_DATA = \
--	src/login/systemd-user
--endif
--
--EXTRA_DIST += \
--	src/login/systemd-user.m4
--endif
--
- nodist_systemunit_DATA += \
- 	units/systemd-logind.service
- 
-@@ -5666,6 +5634,34 @@ EXTRA_DIST += \
- 
- # ------------------------------------------------------------------------------
- if HAVE_PAM
-+pam_systemd_la_SOURCES = \
-+	src/login/pam_systemd.sym \
-+	src/login/pam_systemd.c
-+
-+pam_systemd_la_CFLAGS = \
-+	$(AM_CFLAGS) \
-+	$(PAM_CFLAGS)
-+
-+pam_systemd_la_LDFLAGS = \
-+	$(AM_LDFLAGS) \
-+	-module \
-+	-export-dynamic \
-+	-avoid-version \
-+	-shared \
-+	-Wl,--version-script=$(top_srcdir)/src/login/pam_systemd.sym
-+
-+pam_systemd_la_LIBADD = \
-+	libshared.la \
-+	$(PAM_LIBS)
-+
-+pamlib_LTLIBRARIES = \
-+	pam_systemd.la
-+
-+dist_pamconf_DATA = \
-+	src/login/systemd-user
-+
-+EXTRA_DIST += \
-+	src/login/systemd-user.m4
- 
- systemd_user_sessions_SOURCES = \
- 	src/user-sessions/user-sessions.c
--- 
-1.9.1
-
diff --git a/common/recipes-core/systemd/systemd_%.bbappend b/common/recipes-core/systemd/systemd_%.bbappend
index d7cad5f..07b3038 100644
--- a/common/recipes-core/systemd/systemd_%.bbappend
+++ b/common/recipes-core/systemd/systemd_%.bbappend
@@ -9,23 +9,16 @@
 SRC_URI += "file://default.network"
 SRC_URI += "file://service-restart-policy.conf"
 SRC_URI += "file://0001-sd-bus-Don-t-automatically-add-ObjectManager.patch"
-SRC_URI += "file://0001-Export-message_append_cmdline.patch"
-SRC_URI += "file://0002-systemd-Make-pam-compile-shared-library.patch"
 SRC_URI += "file://0003-basic-Factor-out-string-checking-from-name_to_prefix.patch"
 SRC_URI += "file://0004-basic-Use-path-escaping-when-mangling-path-instances.patch"
 #TODO upstream the below patch via below issue
 #https://github.com/openbmc/openbmc/issues/2016
 SRC_URI += "file://0005-dont-return-error-if-unable-to-create-network-namespace.patch"
 
-SRC_URI += "file://0001-watchdog-allow-a-device-path-to-be-specified.patch"
-SRC_URI += "file://0002-core-Add-WatchdogDevice-config-option-and-implement-.patch"
-
 RRECOMMENDS_${PN} += "obmc-targets"
 FILES_${PN} += "${systemd_unitdir}/network/default.network"
 FILES_${PN} += "${systemd_unitdir}/system.conf.d/service-restart-policy.conf"
 
-EXTRA_OECONF += " --disable-hwdb"
-
 do_install_append() {
         install -m 644 ${WORKDIR}/default.network ${D}${systemd_unitdir}/network/
         install -m 644 -D ${WORKDIR}/service-restart-policy.conf ${D}${systemd_unitdir}/system.conf.d/service-restart-policy.conf