package/sudo: new config to add sudo group and rule
authorStephan Henningsen <stephan+buildroot@asklandd.dk>
Sun, 3 Nov 2019 21:41:52 +0000 (22:41 +0100)
committerYann E. MORIN <yann.morin.1998@free.fr>
Tue, 5 Nov 2019 18:50:05 +0000 (19:50 +0100)
Signed-off-by: Stephan Henningsen <stephan+buildroot@asklandd.dk>
[yann.morin.1998@free.fr:
  - drop the conditional creation
  - uid -is -'- when username is
  - leading TAB in user table, squeeze other spaces
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/sudo/sudo.mk

index ab58f308ec345c76fb5b06f5fce46f548813230a..7d52eb0b5770b2a61e50d81d5923e90013a75103 100644 (file)
@@ -70,4 +70,13 @@ define SUDO_REMOVE_DIST_EXAMPLES
 endef
 SUDO_POST_INSTALL_TARGET_HOOKS += SUDO_REMOVE_DIST_EXAMPLES
 
+define SUDO_USERS
+       - - sudo -1 - - - -
+endef
+
+define SUDO_ENABLE_SUDO_GROUP_RULE
+       $(SED) '/^# \%sudo\tALL=(ALL) ALL/s/^# //' $(TARGET_DIR)/etc/sudoers
+endef
+SUDO_POST_INSTALL_TARGET_HOOKS += SUDO_ENABLE_SUDO_GROUP_RULE
+
 $(eval $(autotools-package))