Yocto 2.5

Move OpenBMC to Yocto 2.5(sumo)

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5c5ad6904a16e14c1c397f0baf10c9d465594a78
diff --git a/import-layers/yocto-poky/meta-selftest/conf/layer.conf b/import-layers/yocto-poky/meta-selftest/conf/layer.conf
index 2a71895..f574a50 100644
--- a/import-layers/yocto-poky/meta-selftest/conf/layer.conf
+++ b/import-layers/yocto-poky/meta-selftest/conf/layer.conf
@@ -9,4 +9,4 @@
 BBFILE_PATTERN_selftest = "^${LAYERDIR}/"
 BBFILE_PRIORITY_selftest = "5"
 
-LAYERSERIES_COMPAT_selftest = "rocko"
+LAYERSERIES_COMPAT_selftest = "sumo"
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-local/file1 b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-local/file1
new file mode 100644
index 0000000..f4bdcfc
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-local/file1
@@ -0,0 +1 @@
+The first file
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-local/file2 b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-local/file2
new file mode 100644
index 0000000..a7e2414
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-local/file2
@@ -0,0 +1 @@
+The second file
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb
new file mode 100644
index 0000000..b377cb7
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb
@@ -0,0 +1,16 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/syslinux-${PV}.tar.xz \
+           file://file1 \
+           file://file2"
+
+SRC_URI[md5sum] = "92a253df9211e9c20172796ecf388f13"
+SRC_URI[sha256sum] = "26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e"
+UPSTREAM_VERSION_UNKNOWN = "1"
+
+S = "${WORKDIR}/syslinux-${PV}"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.wks b/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.wks
index 9410b68..ae69cb6 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.wks
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.wks
@@ -4,6 +4,7 @@
 
 part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
 part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+part /media --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label uuid-test --align 1024 --use-uuid --fsuuid 2c71ef06-a81d-4735-9d3a-379b69c6bdba
 part /mnt --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label core --align 1024
 
 bootloader --ptable gpt --timeout=0  --append="rootwait console=tty0"
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch b/import-layers/yocto-poky/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch
new file mode 100644
index 0000000..b1d5eab
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch
@@ -0,0 +1,22 @@
+From efc8831f33106e6b48de8e612c2d816fe7d1ae68 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 9 Feb 2018 17:37:48 +0200
+Subject: [PATCH] Test patch here!
+
+This is an invalid patch used by oe-selftest
+---
+ README | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/README b/README
+index 48fff57..26d1234 100644
+--- a/README
++++ b/README
+@@ -1,3 +1,4 @@
++This is a test patch for purposes of oe-selftest
+ THIS LINE MAKES THIS PATCH INVALID README for the man-db manual pager suite
+ ========================================
+ 
+-- 
+2.15.1
+
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/man/man_1.6g.bbappend b/import-layers/yocto-poky/meta-selftest/recipes-test/man-db/man-db_%.bbappend
similarity index 100%
rename from import-layers/yocto-poky/meta-selftest/recipes-test/man/man_1.6g.bbappend
rename to import-layers/yocto-poky/meta-selftest/recipes-test/man-db/man-db_%.bbappend
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/man/man/man-1.5h1-make.patch b/import-layers/yocto-poky/meta-selftest/recipes-test/man/man/man-1.5h1-make.patch
deleted file mode 100644
index a0d59b7..0000000
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/man/man/man-1.5h1-make.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Test patch here!
-This is invalid patch used by tests in scripts/lib/selftests.
-
---- man-1.5g/man/Makefile.in.mike	Fri Apr  9 13:35:54 1999
-+++ man-1.5g/man/Makefile.in	Fri Apr  9 13:36:45 1999
-@@ -1,8 +1,8 @@
- #MAKE THIS PATCH INVALID
- MAN1 = man whatis apropos
--MAN5 = man.conf
-+MAN5 = man.config
- MAN8 = makewhatis
--ALL = man.1 whatis.1 apropos.1 man.conf.5
-+ALL = man.1 whatis.1 apropos.1 man.config.5
- MAYBE8 = makewhatis
- 
- .SUFFIXES: .man .1 .5 .8
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/postinst/postinst_1.0.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/postinst/postinst_1.0.bb
index 6d49734..913bfab 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/postinst/postinst_1.0.bb
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/postinst/postinst_1.0.bb
@@ -1,126 +1,72 @@
+SUMMARY = "Packages to exercise postinstall functions"
 LICENSE = "MIT"
-ALLOW_EMPTY_${PN}-at-rootfs = "1"
+
+inherit allarch
+
+PACKAGES = "${PN}-rootfs ${PN}-delayed-a ${PN}-delayed-b ${PN}-rootfs-failing"
+
+ALLOW_EMPTY_${PN}-rootfs = "1"
 ALLOW_EMPTY_${PN}-delayed-a = "1"
 ALLOW_EMPTY_${PN}-delayed-b = "1"
-ALLOW_EMPTY_${PN}-delayed-d = "1"
-ALLOW_EMPTY_${PN}-delayed-p = "1"
-ALLOW_EMPTY_${PN}-delayed-t = "1"
+ALLOW_EMPTY_${PN}-rootfs-failing = "1"
 
-PACKAGES += "${PN}-at-rootfs ${PN}-delayed-a ${PN}-delayed-b ${PN}-delayed-d ${PN}-delayed-p ${PN}-delayed-t"
-PROVIDES += "${PN}-at-rootfs ${PN}-delayed-a ${PN}-delayed-b ${PN}-delayed-d ${PN}-delayed-p ${PN}-delayed-t"
-FILES_${PN}-delayed-a = ""
-FILES_${PN}-delayed-b = ""
-FILES_${PN}-delayed-d = ""
-FILES_${PN}-delayed-p = ""
-FILES_${PN}-delayed-t = ""
-
-# Runtime dependencies
-RDEPENDS_${PN}-delayed-a = "${PN}-at-rootfs"
+RDEPENDS_${PN}-delayed-a = "${PN}-rootfs"
 RDEPENDS_${PN}-delayed-b = "${PN}-delayed-a"
-RDEPENDS_${PN}-delayed-d = "${PN}-delayed-b"
-RDEPENDS_${PN}-delayed-p = "${PN}-delayed-d"
-RDEPENDS_${PN}-delayed-t = "${PN}-delayed-p"
 
-# Main recipe post-install
-pkg_postinst_${PN}-at-rootfs () {
-    tfile="/etc/postinsta-test"
-    touch "$D"/this-was-created-at-rootfstime
-    if test "x$D" != "x" then
-        # Need to run on first boot
+TESTDIR = "${sysconfdir}/postinst-test"
+
+# At rootfs time touch $TESTDIR/rootfs.  Errors if the file already exists, or
+# if the function runs on first boot.
+pkg_postinst_${PN}-rootfs () {
+    set -e
+
+    if [ -z "$D" ]; then
+        echo "${PN}-rootfs should have finished at rootfs time"
         exit 1
-    else
-        echo "lets write postinst" > $tfile
     fi
-}
 
-# Dependency recipes post-installs
-pkg_postinst_${PN}-delayed-a () {
-    efile="/etc/postinst-test"
-    tfile="/etc/postinsta-test"
-    rdeps="postinst"
-
-    if test "x$D" != "x"; then
-      # Need to run on first boot
-      exit 1
-    else
-      touch /etc/this-was-created-at-first-boot
-      if test -e $efile ; then
-        echo 'success' > $tfile
-      else
-        echo 'fail to install $rdeps first!' >&2
+    if [ -e $D${TESTDIR}/rootfs ]; then
+        echo "$D${TESTDIR}/rootfs exists, but should not"
         exit 1
-      fi
-   fi
+    fi
+
+    mkdir -p $D${TESTDIR}
+    touch $D${TESTDIR}/rootfs
 }
 
-pkg_postinst_${PN}-delayed-b () {
-    efile="/etc/postinsta-test"
-    tfile="/etc/postinstb-test"
-    rdeps="postinsta"
+# Depends on rootfs, delays until first boot, verifies that the rootfs file was
+# written.
+pkg_postinst_ontarget_${PN}-delayed-a () {
+    set -e
 
-    if test "x$D" != "x"; then
-      # Need to run on first boot
-      exit 1
-    else
-      if test -e $efile ; then
-        echo 'success' > $tfile
-      else
-        echo 'fail to install $rdeps first!' >&2
+    if [ ! -e ${TESTDIR}/rootfs ]; then
+        echo "${PN}-delayed-a: ${TESTDIR}/rootfs not found"
         exit 1
-      fi
-   fi
+    fi
+
+    touch ${TESTDIR}/delayed-a
 }
 
-pkg_postinst_${PN}-delayed-d () {
-    efile="/etc/postinstb-test"
-    tfile="/etc/postinstd-test"
-    rdeps="postinstb"
+# Depends on delayed-a, delays until first boot, verifies that the delayed-a file was
+# written. This verifies the ordering between delayed postinsts.
+pkg_postinst_ontarget_${PN}-delayed-b () {
+    set -e
 
-    if test "x$D" != "x"; then
-      # Need to run on first boot
-      exit 1
-    else
-      if test -e $efile ; then
-        echo 'success' > $tfile
-      else
-        echo 'fail to install $rdeps first!' >&2
+    if [ ! -e ${TESTDIR}/delayed-a ]; then
+        echo "${PN}-delayed-b: ${TESTDIR}/delayed-a not found"
         exit 1
-      fi
-   fi
+    fi
+
+    touch ${TESTDIR}/delayed-b
 }
 
-pkg_postinst_${PN}-delayed-p () {
-    efile="/etc/postinstd-test"
-    tfile="/etc/postinstp-test"
-    rdeps="postinstd"
-
-    if test "x$D" != "x"; then
-      # Need to run on first boot
-      exit 1
-    else
-      if test -e $efile ; then
-        echo 'success' > $tfile
-      else
-        echo 'fail to install $rdeps first!' >&2
-        exit 1
-      fi
-   fi
-}
-
-pkg_postinst_${PN}-delayed-t () {
-    efile="/etc/postinstp-test"
-    tfile="/etc/postinstt-test"
-    rdeps="postinstp"
-
-    if test "x$D" != "x"; then
-      # Need to run on first boot
-      exit 1
-    else
-      if test -e $efile ; then
-          echo 'success' > $tfile
-      else
-          echo 'fail to install $rdeps first!' >&2
-          exit 1
-      fi
-   fi
+# This scriptlet intentionally includes a bogus command in the middle to test 
+# that we catch and report such errors properly.
+pkg_postinst_${PN}-rootfs-failing () {
+    mkdir -p $D${TESTDIR}
+    touch $D${TESTDIR}/rootfs-before-failure
+    run_a_really_broken_command
+    # Scriptlet execution should stop here; the following commands are NOT supposed to run.
+    # (oe-selftest checks for it).
+    touch $D${TESTDIR}/rootfs-after-failure
 }
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb
index 62931c4..8a2b565c 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb
@@ -12,6 +12,7 @@
 bindir = "${base_bindir}"
 
 SRC_URI = "${GNU_MIRROR}/ed/ed-${PV}.tar.lz"
+RECIPE_NO_UPDATE_REASON = "This recipe is used in selftest and shouldn't be updated otherwise"
 
 SRC_URI[md5sum] = "7f4a54fa7f366479f03654b8af645fd0"
 SRC_URI[sha256sum] = "ffb97eb8f2a2b5a71a9b97e3872adce953aa1b8958e04c5b7bf11d556f32552a"