diff --git a/src/modules/usage-statistics/filesystem/root_lepotato/usr/bin/boot_report b/src/modules/usage-statistics/filesystem/root_lepotato/usr/bin/boot_report new file mode 100755 index 00000000..196277f3 --- /dev/null +++ b/src/modules/usage-statistics/filesystem/root_lepotato/usr/bin/boot_report @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +LEPOTATO_SERIAL=/sys/bus/platform/drivers/meson-sm/firmware:secure-monitor/serial +until $(curl --output /dev/null --silent --head --fail USAGE_STATISTICS_URL/boot?id=`cat "${LEPOTATO_SERIAL}" | grep -i '^Serial' | awk '{ print $3 }' | sha1sum | awk '{ print $1 }' `'&version='`cat USAGE_STATISTICS_VERSION_FILE | head -n 1`'&variant='`cat /etc/dist_variant | head -n 1` ); do + echo "$(date): try to connect and report boot" + sleep 5 +done diff --git a/src/modules/usage-statistics/start_chroot_script b/src/modules/usage-statistics/start_chroot_script index 34475484..c95590af 100755 --- a/src/modules/usage-statistics/start_chroot_script +++ b/src/modules/usage-statistics/start_chroot_script @@ -13,6 +13,9 @@ apt-get update --allow-releaseinfo-change apt-get -y install curl unpack /filesystem/root / +if [ "${BASE_BOARD}" == "debian_lepotato" ]; then + unpack /filesystem/root_lepotato / +fi # Set hotspot name and password sed -i s"@USAGE_STATISTICS_URL@$USAGE_STATISTICS_URL@g" /usr/bin/boot_report