phosphor-image: Avoid CORE_IMAGE_EXTRA_INSTALL

CORE_IMAGE_EXTRA_INSTALL is a dumping ground.  Move packages to proper
packagroups (console/sol, rng) and create IMAGE_FEATURES for easy
opt-out.

Move the ffdc application to the debugging packagegroup.  Move the
pam-access plugin to the user management packagegroup.

(From meta-phosphor rev: 94bf53d44193b6c5d123c462333fdedf91613370)

Change-Id: If43af92f9bfcb6e0eef08adefbce077defd90b8d
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-phosphor/classes/obmc-phosphor-image.bbclass b/meta-phosphor/classes/obmc-phosphor-image.bbclass
index 6aec40f..d6ece7f 100644
--- a/meta-phosphor/classes/obmc-phosphor-image.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-image.bbclass
@@ -5,6 +5,7 @@
 # - obmc-bmc-state-mgmt               - OpenBMC BMC state management
 # - obmc-chassis-mgmt                 - OpenBMC chassis management
 # - obmc-chassis-state-mgmt           - OpenBMC chassis state management
+# - obmc-console                      - OpenBMC serial over LAN
 # - obmc-devtools                     - OpenBMC development and debugging tools
 # - obmc-fan-control                  - OpenBMC fan management
 # - obmc-fan-mgmt                     - Deprecated - use obmc-fan-control instead
@@ -16,6 +17,7 @@
 # - obmc-leds                         - OpenBMC LED support
 # - obmc-logging-mgmt                 - OpenBMC logging management
 # - obmc-remote-logging-mgmt          - OpenBMC remote logging management
+# - obmc-rng                          - OpenBMC random number generator
 # - obmc-sensors                      - OpenBMC sensor support
 # - obmc-settings-mgmt                - OpenBMC settings management
 # - obmc-software                     - OpenBMC software management
@@ -28,6 +30,7 @@
 FEATURE_PACKAGES_obmc-bmc-state-mgmt ?= "packagegroup-obmc-apps-bmc-state-mgmt"
 FEATURE_PACKAGES_obmc-chassis-mgmt ?= "${@bb.utils.contains('COMBINED_FEATURES', 'obmc-phosphor-chassis-mgmt', 'virtual-obmc-chassis-mgmt', '', d)}"
 FEATURE_PACKAGES_obmc-chassis-state-mgmt ?= "packagegroup-obmc-apps-chassis-state-mgmt"
+FEATURE_PACKAGES_obmc-console ?= "packagegroup-obmc-apps-console"
 FEATURE_PACKAGES_obmc-devtools ?= "packagegroup-obmc-apps-devtools"
 FEATURE_PACKAGES_obmc-fan-control ?= "packagegroup-obmc-apps-fan-control"
 FEATURE_PACKAGES_obmc-fan-mgmt ?= "${@bb.utils.contains('COMBINED_FEATURES', 'obmc-phosphor-fan-mgmt', 'virtual-obmc-fan-mgmt', '', d)}"
@@ -39,6 +42,7 @@
 FEATURE_PACKAGES_obmc-leds ?= "packagegroup-obmc-apps-leds"
 FEATURE_PACKAGES_obmc-logging-mgmt ?= "packagegroup-obmc-apps-logging"
 FEATURE_PACKAGES_obmc-remote-logging-mgmt ?= "packagegroup-obmc-apps-remote-logging"
+FEATURE_PACKAGES_obmc-rng ?= "packagegroup-obmc-apps-rng"
 FEATURE_PACKAGES_obmc-net-ipmi ?= "phosphor-ipmi-net"
 FEATURE_PACKAGES_obmc-sensors ?= "packagegroup-obmc-apps-sensors"
 FEATURE_PACKAGES_obmc-software ?= "packagegroup-obmc-apps-software"
@@ -53,17 +57,17 @@
 # tree under phosphor-ipmi-host
 FEATURE_PACKAGES_obmc-net-ipmi_qemuall = ""
 
-CORE_IMAGE_EXTRA_INSTALL_append = " \
+# Add new packages to be installed to a package group in
+# packagegroup-obmc-apps, not here.
+OBMC_IMAGE_BASE_INSTALL = " \
         packagegroup-obmc-apps-extras \
-        obmc-console \
-        pam-plugin-access \
         ${OBMC_IMAGE_EXTRA_INSTALL} \
-        ffdc \
-        rng-tools \
         "
 
 OBMC_IMAGE_EXTRA_INSTALL ?= ""
 
+CORE_IMAGE_EXTRA_INSTALL += "${OBMC_IMAGE_BASE_INSTALL}"
+
 remove_etc_version() {
         rm ${IMAGE_ROOTFS}${sysconfdir}/version
 }
diff --git a/meta-phosphor/recipes-phosphor/images/obmc-phosphor-image.bb b/meta-phosphor/recipes-phosphor/images/obmc-phosphor-image.bb
index c12b188..3d2b7b7 100644
--- a/meta-phosphor/recipes-phosphor/images/obmc-phosphor-image.bb
+++ b/meta-phosphor/recipes-phosphor/images/obmc-phosphor-image.bb
@@ -8,6 +8,7 @@
         obmc-bmc-state-mgmt \
         obmc-chassis-mgmt \
         obmc-chassis-state-mgmt \
+        obmc-console \
         obmc-devtools \
         obmc-fan-control \
         obmc-fan-mgmt \
@@ -19,6 +20,7 @@
         obmc-leds \
         obmc-logging-mgmt \
         obmc-remote-logging-mgmt \
+        obmc-rng \
         obmc-net-ipmi \
         obmc-sensors \
         obmc-software \
diff --git a/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb b/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
index 057509d..1da216c 100644
--- a/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
+++ b/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
@@ -7,6 +7,7 @@
 PACKAGES = " \
         ${PN}-bmc-state-mgmt \
         ${PN}-chassis-state-mgmt \
+        ${PN}-console \
         ${PN}-extras \
         ${PN}-devtools \
         ${PN}-fan-control \
@@ -15,6 +16,7 @@
         ${PN}-leds \
         ${PN}-logging \
         ${PN}-remote-logging \
+        ${PN}-rng \
         ${PN}-sensors \
         ${PN}-software \
         ${PN}-host-check-mgmt \
@@ -36,6 +38,11 @@
         obmc-phosphor-power \
         "
 
+SUMMARY_${PN}-console = "Serial over LAN support"
+RDEPENDS_${PN}-console = " \
+        obmc-console \
+        "
+
 SUMMARY_${PN}-extras = "Extra features"
 RDEPENDS_${PN}-extras = " \
         bmcweb \
@@ -49,6 +56,7 @@
 SUMMARY_${PN}-devtools = "Development tools"
 RDEPENDS_${PN}-devtools = " \
         bash \
+        ffdc \
         i2c-tools \
         libgpiod-tools \
         lrzsz \
@@ -95,6 +103,11 @@
         phosphor-rsyslog-config \
         "
 
+SUMMARY_${PN}-rng = "Random Number Generator support"
+RDEPENDS_${PN}-rng = " \
+        rng-tools \
+        "
+
 SUMMARY_${PN}-sensors = "Sensor applications"
 RDEPENDS_${PN}-sensors = " \
         ${VIRTUAL-RUNTIME_obmc-sensors-hwmon} \
@@ -142,3 +155,6 @@
         ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'nss-pam-ldapd', '', d)} \
         ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'phosphor-ldap', '', d)} \
         "
+RRECOMMENDS_${PN}-user-mgmt = " \
+        pam-plugin-access \
+        "