From a65be367d953846718ad37901bb08bcc78f1a6c8 Mon Sep 17 00:00:00 2001 From: "Lance R. Vick" Date: Thu, 13 Apr 2023 14:20:55 -0700 Subject: [PATCH] sudo support --- scripts/host-env | 1 + scripts/packages-install | 2 ++ scripts/packages-update | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/host-env b/scripts/host-env index 760e90f..efa7e99 100755 --- a/scripts/host-env +++ b/scripts/host-env @@ -10,6 +10,7 @@ groupdel dialout groupadd -g "$gid" "${user}" useradd \ -g "$gid" \ + -G sudo \ -u "$uid" \ -d "/home/${user}" \ -s /bin/bash \ diff --git a/scripts/packages-install b/scripts/packages-install index 756ea05..f09a1cd 100755 --- a/scripts/packages-install +++ b/scripts/packages-install @@ -32,3 +32,5 @@ apt-get install \ --allow-downgrades \ -y $(cat /etc/apt/packages-${ARCH}.list) rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* /tmp/* /var/tmp/*; + +echo "%sudo ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers diff --git a/scripts/packages-update b/scripts/packages-update index c3e6ec4..fa0b4f4 100755 --- a/scripts/packages-update +++ b/scripts/packages-update @@ -25,7 +25,11 @@ apt-get install -y --download-only --reinstall $( \ | awk -F'\t' '/^ii/ {print $2}' \ | awk '{print $1}' \ ) -apt-get install -y --download-only $(cat /config/toolchain/packages-base.list) +apt-get install \ + -y \ + --download-only \ + sudo \ + $(cat /config/toolchain/packages-base.list) ( cd /var/cache/apt/archives \ && find . -type f \( -iname \*.deb \) -exec sha256sum {} \; \