summary refs log tree commit diff
path: root/host/initramfs/etc/getuuids
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-12-12 00:38:57 +0000
committerAlyssa Ross <hi@alyssa.is>2021-12-12 00:44:50 +0000
commit13901c129dea111960f410ac41105fb566c6673d (patch)
tree9c3632623a9f8f7acfca7296858ab26858d8abb0 /host/initramfs/etc/getuuids
parentfea2aa066633bed62f67514b7ef66fbf841b9e30 (diff)
downloadspectrum-13901c129dea111960f410ac41105fb566c6673d.tar
spectrum-13901c129dea111960f410ac41105fb566c6673d.tar.gz
spectrum-13901c129dea111960f410ac41105fb566c6673d.tar.bz2
spectrum-13901c129dea111960f410ac41105fb566c6673d.tar.lz
spectrum-13901c129dea111960f410ac41105fb566c6673d.tar.xz
spectrum-13901c129dea111960f410ac41105fb566c6673d.tar.zst
spectrum-13901c129dea111960f410ac41105fb566c6673d.zip
host/initramfs: move to monorepo path
Diffstat (limited to 'host/initramfs/etc/getuuids')
-rwxr-xr-xhost/initramfs/etc/getuuids13
1 files changed, 13 insertions, 0 deletions
diff --git a/host/initramfs/etc/getuuids b/host/initramfs/etc/getuuids
new file mode 100755
index 0000000..df36547
--- /dev/null
+++ b/host/initramfs/etc/getuuids
@@ -0,0 +1,13 @@
+#!/bin/awk -f
+# SPDX-License-Identifier: EUPL-1.2
+# SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is>
+
+function to_uuid(hex) {
+    return substr(hex, 1, 8) "-" substr(hex, 9, 4) "-" substr(hex, 13, 4) "-" \
+        substr(hex, 17, 4) "-" substr(hex, 21)
+}
+
+BEGIN {
+    print to_uuid(substr(ENVIRON["roothash"], 1, 32))
+    print to_uuid(substr(ENVIRON["roothash"], 33, 32))
+}