AUTHORIZED_USER_NAME ?= "user1"

do_install_append () {
   # Add sudo accesses for user.
	install -d -m 0710 "${D}/etc/sudoers.d"
	echo "${AUTHORIZED_USER_NAME} ALL=(ALL) NOPASSWD: /sbin/shutdown" > "${D}/etc/sudoers.d/0001_${AUTHORIZED_USER_NAME}"
	chmod 0644 "${D}/etc/sudoers.d/0001_${AUTHORIZED_USER_NAME}"
}

FILES_${PN} +=  "/etc/sudoers.d \
			   /etc/sudoers.d/0001_${AUTHORIZED_USER_NAME}"