SUMMARY = "Example recipe for using inherit useradd"
DESCRIPTION = "This recipe serves as an example for using features from useradd.bbclass"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

S = "${WORKDIR}"

EXCLUDE_FROM_WORLD = "1"

inherit useradd

USERADD_PACKAGES = "${PN}"

GROUPADD_PARAM:${PN} = "gpio; spi"

USERADD_PARAM:${PN} = "-d /home/user1 -G input,video,gpio,spi -r -s /bin/bash user1;"

do_install () {
	install -d -m 755 ${D}${datadir}/user1

	chown -R user1 ${D}${datadir}/user1
	
	install -d -m 711 ${D}/home/user1
	chown -R user1 ${D}/home/user1
	chgrp -R user1 ${D}/home/user1
}

FILES:${PN} = "${datadir}/user1/ /home/user1"

# Prevents do_package failures with:
# debugsources.list: No such file or directory:
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

