diff options
| author | Serge Schneider <serge@raspberrypi.com> | 2026-02-10 10:06:37 +0000 |
|---|---|---|
| committer | Serge Schneider <serge@raspberrypi.com> | 2026-03-02 16:05:33 +0000 |
| commit | c020178c01c882cc827d42132ca436edf7985031 (patch) | |
| tree | 57edf5c77b84087cbd9fef3a9a0ed203725b0af7 /stage2 | |
| parent | 164ddbb39de3f9efde1869108343fbede4f6fbf6 (diff) | |
Add PASSWORDLESS_SUDO option
raspberrypi-sys-mods no longer ships 010_pi-nopasswd. This adds an option to re-enable passwordless sudo.
Diffstat (limited to 'stage2')
| -rwxr-xr-x | stage2/01-sys-tweaks/01-run.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 6da2876..a3d8729 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -38,8 +38,10 @@ on_chroot <<- EOF done EOF -if [ -f "${ROOTFS_DIR}/etc/sudoers.d/010_pi-nopasswd" ]; then - sed -i "s/^pi /$FIRST_USER_NAME /" "${ROOTFS_DIR}/etc/sudoers.d/010_pi-nopasswd" +if [ "${PASSWORDLESS_SUDO}" = "1" ]; then + on_chroot <<- EOF + SUDO_USER="${FIRST_USER_NAME}" raspi-config do_sudo_pass 0 + EOF fi on_chroot << EOF |
