petitboot: Enable user separation

Turn on support for unprivileged user accounts in the Petitboot
environment, including setting up a basic non-root user and group.
The implementation also requires using the agetty package rather than
the busybox getty utility, calling the initial pb-console helper on
login rather than directly, and moving some shell init logic from
Petitboot and into a .shrc script.

If no root password is configured in NVRAM or at runtime then this has
no effect aside from some nicer shell behaviour. Once a password is
configured then most actions in Petitboot will require this password and
the shell runs as a normal user.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
diff --git a/openpower/configs/openpower_mambo_defconfig b/openpower/configs/openpower_mambo_defconfig
index 3a9309c..c618849 100644
--- a/openpower/configs/openpower_mambo_defconfig
+++ b/openpower/configs/openpower_mambo_defconfig
@@ -7,6 +7,7 @@
 BR2_ROOTFS_DEVICE_TABLE="../openpower/device_table.txt"
 BR2_TARGET_GENERIC_GETTY_PORT="hvc0"
 BR2_GENERATE_LOCALE="en_US.UTF-8"
+BR2_ROOTFS_USERS_TABLES="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/users-table"
 BR2_ROOTFS_OVERLAY="../openpower/overlay"
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
@@ -32,6 +33,8 @@
 BR2_PACKAGE_LRZSZ=y
 BR2_PACKAGE_NETCAT=y
 BR2_PACKAGE_RSYNC=y
+BR2_PACKAGE_SUDO=y
+BR2_PACKAGE_UTIL_LINUX_AGETTY=y
 BR2_TARGET_ROOTFS_CPIO_XZ=y
 BR2_TARGET_ROOTFS_INITRAMFS=y
 BR2_OPENPOWER_PLATFORM=y