Remove need for get-device-serial to run as root

This commit is contained in:
Taylor Helsper 2022-10-08 12:33:46 -05:00
parent 418f89c5cc
commit 2aa404d4b5
2 changed files with 4 additions and 13 deletions

View File

@ -21,7 +21,8 @@ else
SERIAL_NUM=$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2)
if [[ "$SERIAL_NUM" == "" ]]; then
# Caution - dmidecode seem to cause issues on some platforms (used on VM)
SERIAL_NUM=$(sudo dmidecode | grep UUID | cut -d ' ' -f 2)
#SERIAL_NUM=$(sudo dmidecode | grep UUID | cut -d ' ' -f 2)
SERIAL_NUM=$(cat /tmp/dmidecode_serial)
if [[ "$SERIAL_NUM" == "03000200-0400-0500-0006-000700080009" ]]; then
# Some mini PCs return this hard coded value
SERIAL_NUM=$BACKUP_SERIAL

View File

@ -17,18 +17,8 @@ fi
# Set sticky bit on /tmp
chmod +t /tmp
# Make sure resolv.conf is a symlink to so resolvconf works
# if [ ! -h /etc/resolv.conf ]; then
# rm -f /etc/resolv.conf
# mkdir -p /etc/resolvconf/run/
# touch /etc/resolvconf/run/resolv.conf
# ln -s /etc/resolvconf/run/resolv.conf /etc/resolv.conf
# sync
# reboot
# sleep 10s
# exit 1
# fi
# Save dmidecode info
dmidecode | grep UUID | cut -d ' ' -f 2 > /tmp/dmidecode_serial
# Add some DNS servers to make domain lookup more likely
if settings_file_exists "skip_backup_dns_servers" ; then