Skip to content

fix(build): skip the sudo password prompt where sudo runs unprompted - #158

Merged
dakejahl merged 1 commit into
mainfrom
dakejahl/sudo-prime-unprompted
Nov 10, 2026
Merged

dakejahl merged 1 commit into
mainfrom
dakejahl/sudo-prime-unprompted

Conversation

@dakejahl

Copy link
Copy Markdown
Collaborator

Summary

setup.sh, build.sh, flash.sh and generate_flash_package.sh no longer stop for a sudo password on a host where sudo already runs without one.

Problem

The scripts prime sudo with sudo -v, which asks for a password unless every sudoers entry for the user is NOPASSWD. The test stations grant NOPASSWD: ALL beside a password-gated entry. Every command the scripts run there needs no password, but sudo -v still asks, so none of them can run unattended over SSH.

Solution

Run sudo -v only when sudo -n true fails.

The same commit is on #157, which needed it to build on a station.

`sudo -v` asks for a password unless every sudoers entry is NOPASSWD. The
test stations grant NOPASSWD: ALL beside a password-gated entry, so every
command the scripts run needs no password, yet setup, build and flash stopped
at `sudo -v` and could not run unattended over SSH.
@dakejahl
dakejahl merged commit ea5f23d into main Nov 10, 2026
1 check passed
@dakejahl
dakejahl deleted the dakejahl/sudo-prime-unprompted branch November 10, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant