1
0
mirror of https://github.com/lxsang/meta-rpi-diya.git synced 2024-12-28 03:18:21 +01:00
meta-rpi-diya/recipes-extended/sudo/sudo_%.bbappend

9 lines
410 B
Plaintext
Raw Normal View History

2023-07-10 09:32:40 +02:00
do_install:append() {
# grant all permission to sudo group
sed -i 's/^#\s*\(%sudo\s*ALL=(ALL:ALL)\s*ALL\)/\1/' ${D}/${sysconfdir}/sudoers
2023-07-10 19:36:12 +02:00
# allow sudo group to power off/reboot system without password
cat << EOF >> ${D}/${sysconfdir}/sudoers
## sudo user group is allowed to execute halt and reboot
2023-07-26 15:30:52 +02:00
%sudo ALL=NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff, /usr/bin/swaylock
2023-07-10 19:36:12 +02:00
EOF
2023-07-10 09:32:40 +02:00
}