workbench: use sudo everywhere

that means adjusting fine the hostname, which right now is hardcoded
to workbench
This commit is contained in:
pedro 2024-09-19 12:40:04 -03:00
parent 6c781a0503
commit d3018abde9
2 changed files with 6 additions and 5 deletions

View File

@ -249,7 +249,7 @@ END2
################### ###################
# configure hosts # configure hosts
cat > /etc/hosts <<END2 cat > /etc/hosts <<END2
127.0.0.1 localhost \${hostname} 127.0.0.1 localhost workbench
::1 localhost ip6-localhost ip6-loopback ::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes ff02::1 ip6-allnodes
ff02::2 ip6-allrouters ff02::2 ip6-allrouters
@ -286,6 +286,7 @@ echo 'Install requirements'
# Install debian requirements # Install debian requirements
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
sudo \
python3 python3-dev python3-pip pipenv \ python3 python3-dev python3-pip pipenv \
dmidecode smartmontools hwinfo pciutils lshw < /dev/null dmidecode smartmontools hwinfo pciutils lshw < /dev/null
# Install python requirements using apt instead of pip # Install python requirements using apt instead of pip
@ -312,7 +313,7 @@ run_chroot() {
set -x set -x
set -e set -e
echo "${hostname}" > /etc/hostname echo workbench > /etc/hostname
# check what linux images are available on the system # check what linux images are available on the system
# Figure out which Linux Kernel you want in the live environment. # Figure out which Linux Kernel you want in the live environment.

View File

@ -228,9 +228,9 @@ def smartctl(all_disks, disk=None):
def get_data(all_disks): def get_data(all_disks):
lshw = 'lshw -json' lshw = 'sudo lshw -json'
hwinfo = 'hwinfo --reallyall' hwinfo = 'sudo hwinfo --reallyall'
dmidecode = 'dmidecode' dmidecode = 'sudo dmidecode'
data = { data = {
'lshw': exec_cmd(lshw), 'lshw': exec_cmd(lshw),
'disks': smartctl(all_disks), 'disks': smartctl(all_disks),