From 7678cee5beee9ab593d6388b5191d22724685967 Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Wed, 23 Feb 2022 18:19:17 -0700 Subject: [PATCH] fix NO_KEY initialization (#1262) * fix NO_KEY initialization * hex encode instead of shasum --- build/initialization.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build/initialization.sh b/build/initialization.sh index c29609e7e..32ed9aa03 100755 --- a/build/initialization.sh +++ b/build/initialization.sh @@ -43,7 +43,7 @@ apt-get install -y \ curl -fsSL https://get.docker.com | sh # TODO: commit this script into git instead of live fetching it apt-get purge openresolv dhcpcd5 -y -systemctl disable wpa_supplicant.service +systemctl disable wpa_supplicant.service apt-get autoremove -y apt-get upgrade -y @@ -74,7 +74,12 @@ ControlPort 9051 CookieAuthentication 1 EOF -cat /embassy-os/product_key.txt | tr -d '\n' | sha256sum | head -c 32 | sed 's/$/\n/' > /etc/machine-id +if [ -f /embassy-os/product_key.txt ] +then + cat /embassy-os/product_key.txt | tr -d '\n' | sha256sum | head -c 32 | sed 's/$/\n/' > /etc/machine-id +else + head -c 16 /dev/urandom | xxd -p | sed 's/$/\n/' > /etc/machine-id +fi raspi-config nonint enable_overlayfs