Merge pull request #143 from causten/reststuff
Enable authentication over REST
diff --git a/classes/image-overlay.bbclass b/classes/image-overlay.bbclass
new file mode 100644
index 0000000..1c6137d
--- /dev/null
+++ b/classes/image-overlay.bbclass
@@ -0,0 +1,18 @@
+
+INITRD_IMAGE ?= "core-image-minimal-initramfs"
+INITRD ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}-${MACHINE}.cpio.${INITRD_CTYPE}${uboot}"
+
+IMAGE_BASETYPE ?= "squashfs-xz"
+OVERLAY_BASETYPE ?= "ext4"
+
+IMAGE_TYPES_${PN} += "${IMAGE_BASETYPE}"
+
+IMAGE_TYPEDEP_overlay = "${IMAGE_BASETYPE} ${OVERLAY_BASETYPE}"
+IMAGE_TYPES_MASKED += "overlay"
+
+ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.${IMAGE_BASETYPE}"
+
+do_generate_flash[depends] += "${INITRD_IMAGE}:do_rootfs"
+do_generate_flash[depends] += "${PN}:do_rootfs"
+
+addtask generate_flash after do_rootfs before do_build
diff --git a/classes/obmc-phosphor-image.bbclass b/classes/obmc-phosphor-image.bbclass
index 9a13f7f..7d468ff 100644
--- a/classes/obmc-phosphor-image.bbclass
+++ b/classes/obmc-phosphor-image.bbclass
@@ -8,6 +8,7 @@
# - obmc-phosphor-flash-mgmt - Phosphor OpenBMC flash management
# - obmc-phosphor-event-mgmt - Phosphor OpenBMC event management
# - obmc-phosphor-policy-mgmt - Phosphor OpenBMC policy management
+# - obmc-phosphor-user-mgmt - Phosphor OpenBMC user management
# - obmc-phosphor-system-mgmt - Phosphor OpenBMC system management
inherit core-image
@@ -19,6 +20,7 @@
FEATURE_PACKAGES_obmc-phosphor-flash-mgmt ?= "packagegroup-obmc-phosphor-apps-flash-mgmt"
FEATURE_PACKAGES_obmc-phosphor-event-mgmt ?= "packagegroup-obmc-phosphor-apps-event-mgmt"
FEATURE_PACKAGES_obmc-phosphor-policy-mgmt ?= "packagegroup-obmc-phosphor-apps-policy-mgmt"
+FEATURE_PACKAGES_obmc-phosphor-user-mgmt ?= "packagegroup-obmc-phosphor-apps-user-mgmt"
FEATURE_PACKAGES_obmc-phosphor-system-mgmt ?= "packagegroup-obmc-phosphor-apps-system-mgmt"
# Install entire Phosphor application stack by default
@@ -29,6 +31,7 @@
obmc-phosphor-flash-mgmt \
obmc-phosphor-event-mgmt \
obmc-phosphor-policy-mgmt \
+ obmc-phosphor-user-mgmt \
obmc-phosphor-system-mgmt \
ssh-server-dropbear \
"
diff --git a/classes/obmc-phosphor-image_types_uboot.bbclass b/classes/obmc-phosphor-image_types_uboot.bbclass
index 835e890..c390c36 100644
--- a/classes/obmc-phosphor-image_types_uboot.bbclass
+++ b/classes/obmc-phosphor-image_types_uboot.bbclass
@@ -4,44 +4,75 @@
# the image load address and entry point. Override it here.
oe_mkimage () {
- mkimage -A ${UBOOT_ARCH} -O linux -T ramdisk -C $2 -n ${IMAGE_NAME} \
+ mkimage -A ${UBOOT_ARCH} -O linux -T ramdisk -C $2 -n ${IMAGE_BASENAME} \
-a ${INITRD_IMAGE_LOADADDRESS} -e ${INITRD_IMAGE_ENTRYPOINT} \
-d ${DEPLOY_DIR_IMAGE}/$1 ${DEPLOY_DIR_IMAGE}/$1.u-boot
}
INITRD_IMAGE_ENTRYPOINT ?= "0x40800000"
INITRD_IMAGE_LOADADDRESS ?= "${INITRD_IMAGE_ENTRYPOINT}"
+INITRD_LINK_NAME = "${INITRD_IMAGE}-${MACHINE}${INITRAMFS_FSTYPE}"
FLASH_IMAGE_NAME ?= "flash-${MACHINE}-${DATETIME}"
FLASH_IMAGE_LINK ?= "flash-${MACHINE}"
FLASH_UBOOT_OFFSET ?= "0"
FLASH_KERNEL_OFFSET ?= "512"
-FLASH_ROOTFS_OFFSET ?= "3072"
+FLASH_INITRD_OFFSET ?= "3072"
+FLASH_ROFS_OFFSET ?= "4864"
+FLASH_RWFS_OFFSET ?= "28672"
+RWFS_SIZE ?= "4096"
-IMAGE_POSTPROCESS_COMMAND += "do_generate_flash"
+# $(( ${FLASH_SIZE} - ${FLASH_RWFS_OFFSET} ))
+
+# IMAGE_POSTPROCESS_COMMAND += "do_generate_flash"
do_generate_flash() {
- kernel="${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}"
- uboot="${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX}"
- rootfs="${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.cpio.${IMAGE_CTYPE}.u-boot"
- if [ ! -f $kernel ]; then
- bbfatal "Kernel file ${kernel} does not exist"
+ INITRD_CTYPE=${INITRAMFS_CTYPE}
+ ddir="${DEPLOY_DIR_IMAGE}"
+ kernel="${KERNEL_IMAGETYPE}"
+ uboot="u-boot.${UBOOT_SUFFIX}"
+ initrd="${INITRD_LINK_NAME}.cpio.${INITRD_CTYPE}"
+ uinitrd="${initrd}.u-boot"
+ rootfs="${IMAGE_LINK_NAME}.${IMAGE_BASETYPE}"
+ rwfs="rwfs.${OVERLAY_BASETYPE}"
+
+ if [ ! -f $ddir/$kernel ]; then
+ bbfatal "Kernel file ${ddir}/${kernel} does not exist"
fi
- if [ ! -f $uboot ]; then
- bbfatal "U-boot file ${uboot} does not exist"
+ if [ ! -f $ddir/$uboot ]; then
+ bbfatal "U-boot file ${ddir}/${uboot} does not exist"
fi
- if [ ! -f $rootfs ]; then
- bbfatal "Rootfs file ${rootfs} does not exist"
+ if [ ! -f $ddir/$initrd ]; then
+ bbfatal "initrd file ${ddir}/${initrd} does not exist"
+ fi
+ if [ ! -f $ddir/$rootfs ]; then
+ bbfatal "Rootfs file ${ddir}/${rootfs} does not exist"
fi
- dst="${DEPLOY_DIR_IMAGE}/${FLASH_IMAGE_NAME}"
+ oe_mkimage "${initrd}" "${INITRD_CTYPE}" || bbfatal "oe_mkimage initrd"
+ dd if=/dev/zero of=${ddir}/${rwfs} bs=1k count=${RWFS_SIZE}
+ mkfs.${OVERLAY_BASETYPE} -b 4096 -F -O^huge_file ${ddir}/${rwfs} || bbfatal "mkfs rwfs"
+
+ dst="${ddir}/${FLASH_IMAGE_NAME}"
rm -rf $dst
dd if=/dev/zero of=${dst} bs=1k count=${FLASH_SIZE}
- dd if=${uboot} of=${dst} bs=1k seek=${FLASH_UBOOT_OFFSET}
- dd if=${kernel} of=${dst} bs=1k seek=${FLASH_KERNEL_OFFSET}
- dd if=${rootfs} of=${dst} bs=1k seek=${FLASH_ROOTFS_OFFSET}
- dstlink="${DEPLOY_DIR_IMAGE}/${FLASH_IMAGE_LINK}"
+ dd if=${ddir}/${uboot} of=${dst} bs=1k seek=${FLASH_UBOOT_OFFSET}
+ dd if=${ddir}/${kernel} of=${dst} bs=1k seek=${FLASH_KERNEL_OFFSET}
+ dd if=${ddir}/${uinitrd} of=${dst} bs=1k seek=${FLASH_INITRD_OFFSET}
+ dd if=${ddir}/${rootfs} of=${dst} bs=1k seek=${FLASH_ROFS_OFFSET}
+ dd if=${ddir}/${rwfs} of=${dst} bs=1k seek=${FLASH_RWFS_OFFSET}
+ dstlink="${ddir}/${FLASH_IMAGE_LINK}"
rm -rf $dstlink
ln -sf ${FLASH_IMAGE_NAME} $dstlink
+
+ ln -sf ${FLASH_IMAGE_NAME} ${ddir}/image-bmc
+ ln -sf ${uboot} ${ddir}/image-u-boot
+ ln -sf ${kernel} ${ddir}/image-kernel
+ ln -sf ${uinitrd} ${ddir}/image-initramfs
+ ln -sf ${rootfs} ${ddir}/image-rofs
+ ln -sf ${rwfs} ${ddir}/image-rwfs
+
+ tar -h -cvf ${ddir}/${MACHINE}-${DATETIME}.all.tar -C ${ddir} image-bmc
+ tar -h -cvf ${ddir}/${MACHINE}-${DATETIME}.tar -C ${ddir} image-u-boot image-kernel image-initramfs image-rofs image-rwfs
}
diff --git a/classes/obmc-phosphor-initfs.bbclass b/classes/obmc-phosphor-initfs.bbclass
new file mode 100644
index 0000000..de7923e
--- /dev/null
+++ b/classes/obmc-phosphor-initfs.bbclass
@@ -0,0 +1,4 @@
+# Common code for recipes that implement Phosphor OpenBMC filesystem
+
+RPROVIDES_${PN} += "obmc-phosphor-initfs"
+PROVIDES += "obmc-phosphor-initfs"
diff --git a/classes/obmc-phosphor-user-mgmt.bbclass b/classes/obmc-phosphor-user-mgmt.bbclass
new file mode 100644
index 0000000..4b82f60
--- /dev/null
+++ b/classes/obmc-phosphor-user-mgmt.bbclass
@@ -0,0 +1,4 @@
+# Common code for recipes that implement Phosphor OpenBMC user management.
+
+RPROVIDES_${PN} += "virtual/obmc-phosphor-user-mgmt"
+PROVIDES += "virtual/obmc-phosphor-user-mgmt"
diff --git a/common/recipes-bsp/u-boot/files/0001-am335x_evm.h-Add-use-DEFAULT_LINUX_BOOT_ENV-environm.patch b/common/recipes-bsp/u-boot/files/0001-am335x_evm.h-Add-use-DEFAULT_LINUX_BOOT_ENV-environm.patch
deleted file mode 100644
index 77e35bb..0000000
--- a/common/recipes-bsp/u-boot/files/0001-am335x_evm.h-Add-use-DEFAULT_LINUX_BOOT_ENV-environm.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 5701384cea4a829b772bf7a96a74825b58c22385 Mon Sep 17 00:00:00 2001
-From: Denys Dmytriyenko <denys@ti.com>
-Date: Thu, 17 Apr 2014 12:25:40 -0400
-Subject: [PATCH] am335x_evm.h: Add, use DEFAULT_LINUX_BOOT_ENV environment
- string
-
-Modified version of the patch currently being reviewed for mainline:
-http://patchwork.ozlabs.org/patch/334861/
-
-To deal with a reoccurring problem properly we need to specify addresses
-for the Linux kernel, Flatted Device Tree and ramdisk that obey the
-constraints within the kernel's Documentation/arm/Booting file but also
-make sure that we relocate things within a valid address range.
-
-Signed-off-by: Denys Dmytriyenko <denys@ti.com>
-Signed-off-by: Tom Rini <trini@ti.com>
-
-Upstream-Status: Pending
----
- include/configs/am335x_evm.h | 31 ++++++++++++++++++++++++++-----
- 1 file changed, 26 insertions(+), 5 deletions(-)
-
-diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
-index c5a6d4b..01e32b3 100644
---- a/include/configs/am335x_evm.h
-+++ b/include/configs/am335x_evm.h
-@@ -54,10 +54,7 @@
- #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
- #ifndef CONFIG_SPL_BUILD
- #define CONFIG_EXTRA_ENV_SETTINGS \
-- "loadaddr=0x80200000\0" \
-- "fdtaddr=0x80F80000\0" \
-- "fdt_high=0xffffffff\0" \
-- "rdaddr=0x81000000\0" \
-+ DEFAULT_LINUX_BOOT_ENV \
- "bootdir=/boot\0" \
- "bootfile=uImage\0" \
- "fdtfile=undefined\0" \
-@@ -197,7 +194,31 @@
- #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START \
- + (8 * 1024 * 1024))
-
--#define CONFIG_SYS_LOAD_ADDR 0x81000000 /* Default load address */
-+/*
-+ * Our DDR memory always starts at 0x80000000 and U-Boot shall have
-+ * relocated itself to higher in memory by the time this value is used.
-+ * However, set this to a 32MB offset to allow for easier Linux kernel
-+ * booting as the default is often used as the kernel load address.
-+ */
-+#define CONFIG_SYS_LOAD_ADDR 0x82000000 /* Default load address */
-+
-+/*
-+ * We setup defaults based on constraints from the Linux kernel, which should
-+ * also be safe elsewhere. We have the default load at 32MB into DDR (for
-+ * the kernel), FDT above 128MB (the maximum location for the end of the
-+ * kernel), and the ramdisk 512KB above that (allowing for hopefully never
-+ * seen large trees). We say all of this must be within the first 256MB
-+ * as that will normally be within the kernel lowmem and thus visible via
-+ * bootm_size and we only run on platforms with 256MB or more of memory.
-+ */
-+#define DEFAULT_LINUX_BOOT_ENV \
-+ "loadaddr=0x82000000\0" \
-+ "kernel_addr_r=0x82000000\0" \
-+ "fdtaddr=0x88000000\0" \
-+ "fdt_addr_r=0x88000000\0" \
-+ "rdaddr=0x88080000\0" \
-+ "ramdisk_addr_r=0x88080000\0" \
-+ "bootm_size=0x10000000\0"
-
- #define CONFIG_MMC
- #define CONFIG_GENERIC_MMC
---
-1.9.2
-
diff --git a/common/recipes-bsp/u-boot/u-boot-fw-utils_2013.07.bb b/common/recipes-bsp/u-boot/u-boot-fw-utils_2013.07.bb
new file mode 100644
index 0000000..c8ae846
--- /dev/null
+++ b/common/recipes-bsp/u-boot/u-boot-fw-utils_2013.07.bb
@@ -0,0 +1,55 @@
+#require recipes-bsp/u-boot/u-boot.inc
+
+SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
+SECTION = "bootloader"
+DEPENDS = "mtd-utils"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1707d6db1d42237583f50183a5651ecb \
+ file://README;beginline=1;endline=22;md5=78b195c11cb6ef63e6985140db7d7bab"
+
+# This revision corresponds to the tag "v2013.07"
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+# SRCREV = "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c"
+SRCREV="${AUTOREV}"
+
+PV = "v2013.07+git${SRCPV}"
+
+UBRANCH = "v2013.07-aspeed-openbmc"
+SRC_URI = "git://git@github.com/openbmc/u-boot.git;branch=${UBRANCH};protocol=https"
+S = "${WORKDIR}/git"
+
+#INSANE_SKIP_${PN} = "already-stripped"
+#EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
+#EXTRA_OEMAKE_class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
+EXTRA_OEMAKE = 'HOSTCC="${CC}" CC="${CC}" HOSTSTRIP="true"'
+
+inherit uboot-config
+
+do_compile () {
+ oe_runmake ${UBOOT_MACHINE}
+ oe_runmake env
+}
+
+do_install () {
+ install -d ${D}${base_sbindir}
+ install -d ${D}${sysconfdir}
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
+ ln -sf fw_printenv ${D}${base_sbindir}/fw_setenv
+ install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
+}
+
+#do_install_class-cross () {
+# install -d ${D}${bindir_cross}
+# install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
+# install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
+#}
+
+#SYSROOT_PREPROCESS_FUNCS_class-cross = "uboot_fw_utils_cross"
+#uboot_fw_utils_cross() {
+# sysroot_stage_dir ${D}${bindir_cross} ${SYSROOT_DESTDIR}${bindir_cross}
+#}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+#BBCLASSEXTEND = "cross native"
diff --git a/common/recipes-bsp/u-boot/u-boot_2013.07.bb b/common/recipes-bsp/u-boot/u-boot_2013.07.bb
index f3e2f56..80715e7 100644
--- a/common/recipes-bsp/u-boot/u-boot_2013.07.bb
+++ b/common/recipes-bsp/u-boot/u-boot_2013.07.bb
@@ -12,13 +12,12 @@
# This revision corresponds to the tag "v2013.07"
# We use the revision in order to avoid having to fetch it from the repo during parse
-SRCREV = "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c"
+SRCREV = "${AUTOREV}"
PV = "v2013.07+git${SRCPV}"
-SRC_URI = "git://git.denx.de/u-boot.git;branch=master \
- file://0001-am335x_evm.h-Add-use-DEFAULT_LINUX_BOOT_ENV-environm.patch \
- "
+UBRANCH = "v2013.07-aspeed-openbmc"
+SRC_URI = "git://git@github.com/openbmc/u-boot.git;branch=${UBRANCH};protocol=https"
S = "${WORKDIR}/git"
diff --git a/common/recipes-core/images/core-image-minimal-initramfs.bbappend b/common/recipes-core/images/core-image-minimal-initramfs.bbappend
new file mode 100644
index 0000000..90a1c3f
--- /dev/null
+++ b/common/recipes-core/images/core-image-minimal-initramfs.bbappend
@@ -0,0 +1,3 @@
+PACKAGE_INSTALL_remove = "initramfs-live-boot initramfs-live-install initramfs-live-install-efi"
+PACKAGE_INSTALL += "obmc-phosphor-initfs"
+INITRAMFS_FSTYPES = "cpio.${INITRAMFS_CTYPE}"
diff --git a/common/recipes-core/systemd/systemd_%.bbappend b/common/recipes-core/systemd/systemd_%.bbappend
index 680595c..8b3b25d 100644
--- a/common/recipes-core/systemd/systemd_%.bbappend
+++ b/common/recipes-core/systemd/systemd_%.bbappend
@@ -6,4 +6,8 @@
do_install_append() {
install -m 644 ${WORKDIR}/default.network ${D}${libdir}/systemd/network/
+
+ #TODO Remove after this issue is resolved
+ #https://github.com/openbmc/openbmc/issues/152
+ ln -s /dev/null ${D}/etc/systemd/system/systemd-hwdb-update.service
}
diff --git a/common/recipes-kernel/linux/linux-obmc_4.3.bb b/common/recipes-kernel/linux/linux-obmc_4.3.bb
index b2acc1c..cd20762 100644
--- a/common/recipes-kernel/linux/linux-obmc_4.3.bb
+++ b/common/recipes-kernel/linux/linux-obmc_4.3.bb
@@ -10,7 +10,7 @@
LINUX_VERSION ?= "4.3"
LINUX_VERSION_EXTENSION ?= "-${SRCREV}"
-SRCREV="openbmc-20160120-1"
+SRCREV="openbmc-20160212-1"
PV = "${LINUX_VERSION}+git${SRCPV}"
diff --git a/common/recipes-phosphor/dbus/obmc-mapper.bb b/common/recipes-phosphor/dbus/obmc-mapper.bb
index b9df28a..ab6dc98 100644
--- a/common/recipes-phosphor/dbus/obmc-mapper.bb
+++ b/common/recipes-phosphor/dbus/obmc-mapper.bb
@@ -18,6 +18,6 @@
"
SRC_URI += "git://github.com/openbmc/phosphor-objmgr"
-SRCREV = "3f7aa329568d8f191baeeefa4a63dbb19cf26338"
+SRCREV = "956dd44fe5c8377ec90cef393f65033d59e082b0"
S = "${WORKDIR}/git"
diff --git a/common/recipes-phosphor/host-ipmid/host-ipmid-fru.bb b/common/recipes-phosphor/host-ipmid/host-ipmid-fru.bb
index 72d847d..06ee00e 100644
--- a/common/recipes-phosphor/host-ipmid/host-ipmid-fru.bb
+++ b/common/recipes-phosphor/host-ipmid/host-ipmid-fru.bb
@@ -14,11 +14,11 @@
RDEPENDS_${PN} += "libsystemd"
-TARGET_CFLAGS += "-std=gnu++14"
+TARGET_CFLAGS += " -fpic -std=gnu++14"
SRC_URI += "git://github.com/openbmc/ipmi-fru-parser"
-SRCREV = "63696f4b23c9fd0a84ce539a6414ada406aaf229"
+SRCREV = "a14239a201443222906864273449a39cfa84118e"
FILES_${PN} += "${libdir}/host-ipmid/*.so"
FILES_${PN}-dbg += "${libdir}/host-ipmid/.debug"
diff --git a/common/recipes-phosphor/host-ipmid/host-ipmid-oem.bb b/common/recipes-phosphor/host-ipmid/host-ipmid-oem.bb
index fa3e1bf..f7c0394 100644
--- a/common/recipes-phosphor/host-ipmid/host-ipmid-oem.bb
+++ b/common/recipes-phosphor/host-ipmid/host-ipmid-oem.bb
@@ -10,6 +10,7 @@
DEPENDS += "systemd \
host-ipmid \
"
+TARGET_CFLAGS += "-fpic"
RDEPENDS_${PN} += "libsystemd"
diff --git a/common/recipes-phosphor/host-ipmid/host-ipmid.bb b/common/recipes-phosphor/host-ipmid/host-ipmid.bb
index aecbbbd..68bd38b 100644
--- a/common/recipes-phosphor/host-ipmid/host-ipmid.bb
+++ b/common/recipes-phosphor/host-ipmid/host-ipmid.bb
@@ -12,10 +12,13 @@
inherit obmc-phosphor-sdbus-service
inherit obmc-phosphor-c-daemon
+TARGET_CFLAGS += "-fpic"
+
+RDEPENDS_${PN} += "settings"
+RDEPENDS_${PN} += "network"
SRC_URI += "git://github.com/openbmc/phosphor-host-ipmid"
-SRCREV = "24274bc02a046e12d50f81bc8a598ae934f72c3f"
-
+SRCREV = "5d8c424a5c125b3cc5dcf67238e174b9dcaf22e6"
S = "${WORKDIR}/git"
INSTALL_NAME = "ipmid"
diff --git a/common/recipes-phosphor/network/network.bb b/common/recipes-phosphor/network/network.bb
new file mode 100644
index 0000000..55bc627
--- /dev/null
+++ b/common/recipes-phosphor/network/network.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Network DBUS object"
+DESCRIPTION = "Network DBUS object"
+HOMEPAGE = "http://github.com/openbmc/phosphor-networkd"
+PR = "r1"
+
+inherit obmc-phosphor-license
+inherit obmc-phosphor-systemd
+
+RDEPENDS_${PN} += "python-dbus python-pygobject"
+
+SRC_URI += "git://github.com/openbmc/phosphor-networkd"
+
+SRCREV = "9f804290dd0bf200a1ba28e107eae55bdb4076da"
+
+S = "${WORKDIR}/git"
+
+do_install() {
+ install -d ${D}/${sbindir}
+ install ${S}/netman.py ${D}/${sbindir}
+}
+
diff --git a/common/recipes-phosphor/network/network/network.service b/common/recipes-phosphor/network/network/network.service
new file mode 100644
index 0000000..85a44bb
--- /dev/null
+++ b/common/recipes-phosphor/network/network/network.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Network DBUS object
+Requires=skeleton.service
+After=skeleton.service
+
+[Service]
+ExecStart=/usr/sbin/netman.py
+
+[Install]
+WantedBy=multi-user.target
diff --git a/common/recipes-phosphor/obmc-phosphor-event/obmc-phosphor-event.bb b/common/recipes-phosphor/obmc-phosphor-event/obmc-phosphor-event.bb
index 6cdf398..4f59e99 100644
--- a/common/recipes-phosphor/obmc-phosphor-event/obmc-phosphor-event.bb
+++ b/common/recipes-phosphor/obmc-phosphor-event/obmc-phosphor-event.bb
@@ -9,10 +9,11 @@
inherit obmc-phosphor-sdbus-service
inherit obmc-phosphor-c-daemon
+TARGET_CPPFLAGS += "-std=c++11 -fpic"
SRC_URI += "git://github.com/openbmc/phosphor-event"
-SRCREV = "aa9ec3aa2cc59fc7e2437041d89b19f4a8f1d7f0"
+SRCREV = "01ac3503dc97fb99bee9c25c23fe73a5f4ea0475"
RDEPENDS_${PN} += "libsystemd"
DEPENDS += "systemd"
@@ -22,6 +23,7 @@
INSTALL_NAME = "event_messaged"
do_install() {
+ install -d ${D}/var/lib/obmc/events/
install -m 0755 -d ${D}${sbindir}
install -m 0755 ${S}/${INSTALL_NAME} ${D}/${sbindir}/obmc-phosphor-eventd
}
diff --git a/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh b/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
new file mode 100644
index 0000000..6750de3
--- /dev/null
+++ b/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
@@ -0,0 +1,147 @@
+#!/bin/sh
+
+fslist="proc sys dev run"
+rodir=run/initramfs/ro
+rwdir=run/initramfs/rw
+upper=$rwdir/cow
+work=$rwdir/work
+
+cd /
+mkdir -p $fslist
+mount dev dev -tdevtmpfs
+mount sys sys -tsysfs
+mount proc proc -tproc
+if ! grep run proc/mounts
+then
+ mount tmpfs run -t tmpfs -o mode=755,nodev
+fi
+
+mkdir -p $rodir $rwdir
+
+cp -rp init shutdown update whitelist bin sbin usr lib etc var run/initramfs
+
+# To start a interactive shell with job control at this point, run
+# getty 38400 ttyS4
+
+findmtd() {
+ m=$(grep -xl "$1" /sys/class/mtd/*/name)
+ m=${m%/name}
+ m=${m##*/}
+ echo $m
+}
+
+debug_takeover() {
+ echo "$@"
+ test -n "$@" && echo Enter password to try to manually fix.
+ cat << HERE
+After fixing run exit to continue this script, or reboot -f to retry, or
+touch /takeover and exit to become PID 1 allowing editing of this script.
+HERE
+
+ while ! sulogin && ! test -f /takeover
+ do
+ echo getty failed, retrying
+ done
+
+ # Touch /takeover in the above getty to become pid 1
+ if test -e /takeover
+ then
+ cat << HERE
+
+Takeover of init requested. Executing /bin/sh as PID 1.
+When finished exec new init or cleanup and run reboot -f.
+
+Warning: No job control! Shell exit will panic the system!
+HERE
+ export PS1=init#\
+ exec /bin/sh
+ fi
+}
+
+env=$(findmtd u-boot-env)
+if test -n $env
+then
+ ln -s /dev/$env /run/mtd:u-boot-env
+ cp /run/mtd:u-boot-env /run/fw_env
+fi
+
+rofs=$(findmtd rofs)
+rwfs=$(findmtd rwfs)
+
+rodev=/dev/mtdblock${rofs#mtd}
+rwdev=/dev/mtdblock${rwfs#mtd}
+
+rofst=squashfs
+rwfst=ext4
+roopts=ro
+rwopts=rw
+
+init=/sbin/init
+fsck=/sbin/fsck.$rwfst
+fsckopts=-a
+
+echo rofs = $rofs $rofst rwfs = $rwfs $rwfst
+
+if grep -w debug-init-sh /proc/cmdline
+then
+ debug_takeover "Debug initial shell requested by command line."
+fi
+
+mount $rodev $rodir -t $rofst -o $roopts
+
+if test -x $rodir$fsck
+then
+ for fs in $fslist
+ do
+ mount --bind $fs $rodir/$fs
+ done
+ chroot $rodir $fsck $fsckopts $rwdev
+ rc=$?
+ for fs in $fslist
+ do
+ umount $rodir/$fs
+ done
+ if test $rc -gt 1
+ then
+ debug_takeover "fsck of read-write fs on $rwdev failed (rc=$rc)"
+ fi
+else
+ echo "No '$fsck' in read only fs, skipping fsck."
+fi
+
+if ! mount $rwdev $rwdir -t $rwfst -o $rwopts
+then
+ msg="$(cat)" << HERE
+
+Mounting read-write $rwdev filesystem failed. Please fix and run
+ mount $rwdev $rwdir -t $rwfs -o $rwopts
+to to continue, or do change nothing to run from RAM for this boot.
+HERE
+ debug_takeover "$msg"
+fi
+
+rm -rf $work
+mkdir -p $upper $work
+
+mount -t overlay -o lowerdir=$rodir,upperdir=$upper,workdir=$work cow /root
+
+while ! chroot /root /bin/sh -c "test -x '$init' -a -s '$init'"
+do
+ msg="$(cat)" << HERE
+
+Unable to confirm /sbin/init is an executable non-empty file
+in merged file system mounted at /root.
+
+Change Root test failed! Invoking emergency shell.
+HERE
+ debug_takeover "$msg"
+done
+
+for f in $fslist
+do
+ mount --move $f root/$f
+done
+
+# switch_root /root $init
+exec chroot /root $init
+
diff --git a/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh b/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh
new file mode 100644
index 0000000..3eff1ea
--- /dev/null
+++ b/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+echo shutdown: "$@"
+
+export PS1=shutdown-sh#\
+# exec bin/sh
+
+cd /
+if [ ! -e /proc/mounts ]
+then
+ mkdir -p /proc
+ mount proc /proc -tproc
+ umount_proc=1
+else
+ umount_proc=
+fi
+
+# Remove an empty oldroot, that means we are not invoked from systemd-shutdown
+rmdir /oldroot 2>/dev/null
+
+# Move /oldroot/run to /mnt in case it has the underlying rofs loop mounted.
+# Ordered before /oldroot the overlay is unmounted before the loop mount
+mkdir -p /mnt
+mount --move /oldroot/run /mnt
+
+set -x
+for f in $( awk '/oldroot|mnt/ { print $2 }' < /proc/mounts | sort -r )
+do
+ umount $f
+done
+set +x
+
+image=/run/initramfs/image-
+if test -s /run/fw_env -a -c /run/mtd:u-boot-env -a ! -e ${image}u-boot-env &&
+ ! cmp /run/mtd:u-boot-env /run/fw_env
+then
+ ln -sn /run/fw_env ${image}u-boot-env
+fi
+
+if test -x /update && ls $image* > /dev/null 2>&1
+then
+ /update ${1+"$@"}
+fi
+
+echo Remaining mounts:
+cat /proc/mounts
+
+test "umount_proc" && umount /proc && rmdir /proc
+
+
+# Execute the command systemd told us to ...
+if test -d /oldroot && test "$1"
+then
+ if test "$1" == kexec
+ then
+ $1 -f -e
+ else
+ $1 -f
+ fi
+fi
+
+
+echo "Execute ${1-reboot} -f if all unounted ok, or exec /init"
+
+export PS1=shutdown-sh#\
+exec /bin/sh
diff --git a/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh b/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
new file mode 100755
index 0000000..face06d
--- /dev/null
+++ b/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
@@ -0,0 +1,103 @@
+#!/bin/sh
+
+echo update: "$@"
+
+export PS1=update-sh#\
+# exec /bin/sh
+
+cd /
+if ! test -r /proc/mounts || ! test -f /proc/mounts
+then
+ mkdir -p /proc
+ mount -t proc proc proc
+fi
+if ! test -d /sys/class
+then
+ mkdir -p /sys
+ mount -t sysfs sys sys
+fi
+if ! test -c /dev/null
+then
+ mkdir -p /dev
+ mount -t devtmpfs dev dev
+fi
+while grep mtd /proc/mounts
+do
+ echo 1>&2 "Error: A mtd device is mounted."
+ sulogin
+ # exec /bin/sh
+done
+
+findmtd() {
+ m=$(grep -xl "$1" /sys/class/mtd/*/name)
+ m=${m%/name}
+ m=${m##*/}
+ echo $m
+}
+
+rwfs=$(findmtd rwfs)
+
+rwdev=/dev/mtdblock${rwfs#mtd}
+rwfst=ext4
+rwopts=rw
+rorwopts=ro${rwopts#rw}
+
+rwdir=rw
+upper=$rwdir/cow
+save=save/${upper##*/}
+
+if test -n "$rwfs" && test -s whitelist
+then
+
+ mkdir -p $rwdir
+ mount $rwdev $rwdir -t $rwfst -o $rorwopts
+
+ while read f
+ do
+ if ! test -e $upper/$f
+ then
+ continue
+ fi
+ d="$save/$f"
+ mkdir -p "${d%/*}"
+ cp -rp $upper/$f "${d%/*}/"
+ done < whitelist
+
+ umount $rwdir
+fi
+
+image=/run/initramfs/image-
+for f in $image*
+do
+ m=$(findmtd ${f#$image})
+ if test -z "$m"
+ then
+ echo 1>&2 "Unable to find mtd partiton for ${f##*/}."
+ exec /bin/sh
+ fi
+done
+
+for f in $image*
+do
+ m=$(findmtd ${f#$image})
+ echo "Updating ${f#$image}..."
+ # flasheraseall /dev/$m && dd if=$f of=/dev/$m
+ flashcp -v $f /dev/$m
+done
+
+if test -d $save
+then
+ mount $rwdev $rwdir -t $rwfst -o $rwopts
+ cp -rp $save/. $upper/
+ umount $rwdir
+fi
+
+exit
+
+# NOT REACHED without edit
+# NOT REACHED without edit
+
+echo "Flash completed. Inspect, cleanup and reboot -f to continue."
+
+export PS1=update-sh#\
+exec /bin/sh
diff --git a/common/recipes-phosphor/obmc-phosphor-initfs/files/whitelist b/common/recipes-phosphor/obmc-phosphor-initfs/files/whitelist
new file mode 100644
index 0000000..603cec7
--- /dev/null
+++ b/common/recipes-phosphor/obmc-phosphor-initfs/files/whitelist
@@ -0,0 +1,9 @@
+/etc/dropbear/dropbear_rsa_host_key
+/etc/systemd/network
+/etc/resolv.conf
+/etc/machine-id
+/etc/passwd
+/etc/group
+/etc/shadow
+/etc/gshadow
+/var/lib/obmc/events/
diff --git a/common/recipes-phosphor/obmc-phosphor-initfs/obmc-phosphor-init.bb b/common/recipes-phosphor/obmc-phosphor-initfs/obmc-phosphor-init.bb
new file mode 100644
index 0000000..68ee00d
--- /dev/null
+++ b/common/recipes-phosphor/obmc-phosphor-initfs/obmc-phosphor-init.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Phosphor OpenBMC pre-init scripts"
+DESCRIPTION = "Phosphor OpenBMC filesytem mount reference implementation."
+PR = "r1"
+
+inherit obmc-phosphor-license
+inherit obmc-phosphor-initfs
+
+S = "${WORKDIR}"
+SRC_URI += "file://obmc-init.sh"
+SRC_URI += "file://obmc-shutdown.sh"
+SRC_URI += "file://obmc-update.sh"
+SRC_URI += "file://whitelist"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/obmc-init.sh ${D}/init
+ install -m 0755 ${WORKDIR}/obmc-shutdown.sh ${D}/shutdown
+ install -m 0755 ${WORKDIR}/obmc-update.sh ${D}/update
+ install -m 0644 ${WORKDIR}/whitelist ${D}/whitelist
+ install -d ${D}/dev
+ mknod -m 622 ${D}/dev/console c 5 1
+}
+
+FILES_${PN} += " /init /shutdown /update /whitelist /dev "
diff --git a/common/recipes-phosphor/obmc-phosphor-user/files/obmc-phosphor-user.service b/common/recipes-phosphor/obmc-phosphor-user/files/obmc-phosphor-user.service
new file mode 100644
index 0000000..fecf835
--- /dev/null
+++ b/common/recipes-phosphor/obmc-phosphor-user/files/obmc-phosphor-user.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Phosphor OpenBMC user management daemon
+
+[Service]
+ExecStart=/usr/sbin/obmc-phosphor-userd
+
+[Install]
+WantedBy=multi-user.target
diff --git a/common/recipes-phosphor/obmc-phosphor-user/obmc-phosphor-user.bb b/common/recipes-phosphor/obmc-phosphor-user/obmc-phosphor-user.bb
new file mode 100644
index 0000000..d1e7637
--- /dev/null
+++ b/common/recipes-phosphor/obmc-phosphor-user/obmc-phosphor-user.bb
@@ -0,0 +1,24 @@
+SUMMARY = "User DBUS object"
+DESCRIPTION = "User DBUS object"
+HOMEPAGE = "http://github.com/openbmc/phosphor-networkd"
+PR = "r1"
+
+inherit obmc-phosphor-license
+inherit obmc-phosphor-user-mgmt
+inherit obmc-phosphor-systemd
+
+RDEPENDS_${PN} += "python-dbus python-pygobject python-pexpect"
+
+SRC_URI += "git://github.com/openbmc/phosphor-networkd"
+
+SRCREV = "cb3613575fd6fb18a7d2f7e7d86e7b6fd75f4269"
+
+S = "${WORKDIR}/git"
+INSTALL_NAME = "userman.py"
+
+do_install() {
+echo "***installing $INSTALL_NAME"
+ install -d ${D}/${sbindir}
+ install ${S}/${INSTALL_NAME} ${D}/${sbindir}/obmc-phosphor-userd
+}
+
diff --git a/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-apps.bb b/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-apps.bb
index cac7b1b..21b4a2d 100644
--- a/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-apps.bb
+++ b/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-apps.bb
@@ -19,6 +19,7 @@
${@mf_enabled("obmc-phosphor-flash-mgmt", "packagegroup-obmc-phosphor-apps-flash-mgmt", d)} \
${@df_enabled("obmc-phosphor-event-mgmt", "packagegroup-obmc-phosphor-apps-event-mgmt", d)} \
${@df_enabled("obmc-phosphor-policy-mgmt", "packagegroup-obmc-phosphor-apps-policy-mgmt", d)} \
+ ${@df_enabled("obmc-phosphor-user-mgmt", "packagegroup-obmc-phosphor-apps-user-mgmt", d)} \
${@df_enabled("obmc-phosphor-system-mgmt", "packagegroup-obmc-phosphor-apps-system-mgmt", d)} \
"
@@ -69,6 +70,12 @@
virtual/obmc-phosphor-policy-mgmt \
", d)}"
+SUMMARY_packagegroup-obmc-phosphor-apps-user-mgmt = "User management support"
+RDEPENDS_packagegroup-obmc-phosphor-apps-user-mgmt = " \
+ ${@df_enabled("obmc-phosphor-user-mgmt", " \
+ virtual/obmc-phosphor-user-mgmt \
+ ", d)}"
+
SUMMARY_packagegroup-obmc-phosphor-apps-system-mgmt = "System management support"
RDEPENDS_packagegroup-obmc-phosphor-apps-system-mgmt = " \
${@df_enabled("obmc-phosphor-system-mgmt", " \
diff --git a/common/recipes-phosphor/settings/settings.bb b/common/recipes-phosphor/settings/settings.bb
new file mode 100644
index 0000000..d1fa639
--- /dev/null
+++ b/common/recipes-phosphor/settings/settings.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Settings DBUS object"
+DESCRIPTION = "Settings DBUS object"
+HOMEPAGE = "http://github.com/openbmc/phosphor-settingsd"
+PR = "r1"
+
+inherit obmc-phosphor-license
+inherit obmc-phosphor-systemd
+
+RDEPENDS_${PN} += "python-dbus python-pygobject"
+
+SRC_URI += "git://github.com/openbmc/phosphor-settingsd"
+
+SRCREV = "3bda531d94f4c93473bbedd7d7e5c44d4d9da93b"
+
+S = "${WORKDIR}/git"
+
+do_install() {
+ install -d ${D}/${sbindir}
+ install ${S}/settings_file.py ${D}/${sbindir}
+ install ${S}/settings_manager.py ${D}/${sbindir}
+}
+
diff --git a/common/recipes-phosphor/settings/settings/settings.service b/common/recipes-phosphor/settings/settings/settings.service
new file mode 100755
index 0000000..24c4a5a
--- /dev/null
+++ b/common/recipes-phosphor/settings/settings/settings.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Settings DBUS Object
+Requires=skeleton.service
+After=skeleton.service
+
+[Service]
+ExecStart=/usr/sbin/settings_manager.py
+
+[Install]
+WantedBy=multi-user.target
diff --git a/common/recipes-phosphor/skeleton/skeleton.bb b/common/recipes-phosphor/skeleton/skeleton.bb
index fab50ea..ba873aa 100644
--- a/common/recipes-phosphor/skeleton/skeleton.bb
+++ b/common/recipes-phosphor/skeleton/skeleton.bb
@@ -12,11 +12,11 @@
inherit obmc-phosphor-sensor-mgmt
inherit obmc-phosphor-system-mgmt
-DEPENDS += "glib-2.0"
-RDEPENDS_${PN} += "python-subprocess python-tftpy"
+DEPENDS += "glib-2.0 systemd"
+RDEPENDS_${PN} += "python-subprocess python-compression libsystemd"
SRC_URI += "git://github.com/openbmc/skeleton"
-SRCREV = "abe4953f941f63b4a3f531af15f6dba68870f3a9"
+SRCREV = "ad8c3d3b7be6cc5cda80a2f215b40eae16381b09"
S = "${WORKDIR}"
diff --git a/conf/distro/openbmc-phosphor.conf b/conf/distro/openbmc-phosphor.conf
index b59715d..4af4a4b 100644
--- a/conf/distro/openbmc-phosphor.conf
+++ b/conf/distro/openbmc-phosphor.conf
@@ -7,6 +7,7 @@
GCCVERSION ?= "4.9.3"
IMAGE_FSTYPES += "cpio.gz"
+IMAGE_FSTYPES += "squashfs-xz"
IMAGE_LINGUAS = "en-us"
VIRTUAL-RUNTIME_keymaps = ""
@@ -25,6 +26,7 @@
obmc-phosphor-flash-mgmt \
obmc-phosphor-event-mgmt \
obmc-phosphor-policy-mgmt \
+ obmc-phosphor-user-mgmt \
obmc-phosphor-system-mgmt \
${DISTRO_FEATURES_LIBC} \
"
diff --git a/conf/machine/include/obmc-bsp-common.inc b/conf/machine/include/obmc-bsp-common.inc
index d7a681c..fb6cc8c 100644
--- a/conf/machine/include/obmc-bsp-common.inc
+++ b/conf/machine/include/obmc-bsp-common.inc
@@ -13,6 +13,13 @@
MACHINEOVERRIDES =. "openbmc:"
+IMAGE_FSTYPES += "overlay"
+IMAGE_INSTALL += "u-boot-fw-utils"
+
IMAGE_CLASSES += "obmc-phosphor-image_types_uboot"
-IMAGE_CTYPE = "lzma"
-IMAGE_FSTYPES += "cpio.${IMAGE_CTYPE}.u-boot"
+IMAGE_CLASSES += "image-overlay"
+
+INITRAMFS_CTYPE ?= "lzma"
+INITRAMFS_FSTYPES += "cpio.${INITRAMFS_CTYPE}"
+
+
diff --git a/conf/machine/include/sample.inc b/conf/machine/include/sample.inc
index f6fe46d..e66dc77 100644
--- a/conf/machine/include/sample.inc
+++ b/conf/machine/include/sample.inc
@@ -30,3 +30,4 @@
PREFERRED_PROVIDER_virtual/obmc-phosphor-policy-mgmt = "obmc-phosphor-policyd"
PREFERRED_PROVIDER_virtual/obmc-phosphor-sensor-mgmt = "obmc-phosphor-sensord"
PREFERRED_PROVIDER_virtual/obmc-phosphor-system-mgmt = "obmc-phosphor-sysd"
+PREFERRED_PROVIDER_virtual/obmc-phosphor-user-mgmt = "obmc-phosphor-userd"