USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "-g ${afm_name} -d ${afm_datadir} -r ${afm_name}"
-GROUPADD_PARAM_${PN} = "-r ${afm_name}"
+USERADD_PARAM_${PN} = "--system --gid ${afm_name} --home-dir ${afm_datadir} ${afm_name}"
+GROUPADD_PARAM_${PN} = "--system ${afm_name}"
FILES_${PN} += "\
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/afm-user-daemon.service', '', d)} \
do_install_append_class-target() {
install -d ${D}${bindir}
install -d -m 0775 ${D}${systemd_units_root}/system
+ install -d -m 0775 "${D}${systemd_units_root}/system/multi-user.target.wants"
install -d -m 0775 "${D}${systemd_units_root}/system/afm-user-session@.target.wants"
install -d -m 0775 ${D}${systemd_units_root}/user
install -d -m 0775 ${D}${systemd_units_root}/user/default.target.wants