summaryrefslogtreecommitdiff
path: root/packages/slugos-init/files/functions
diff options
context:
space:
mode:
Diffstat (limited to 'packages/slugos-init/files/functions')
-rw-r--r--packages/slugos-init/files/functions14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/slugos-init/files/functions b/packages/slugos-init/files/functions
index d631579966..ef10d65fb2 100644
--- a/packages/slugos-init/files/functions
+++ b/packages/slugos-init/files/functions
@@ -372,3 +372,17 @@ umountflash(){
return 0
}
+
+#
+# uuid_by_partition
+# output a list of partitions and their UUIDs
+uuid_by_partition() {
+ blkid -c /dev/null -s UUID | sed -n 's/^\([^:]*\): .*UUID="\([^"]*\)".*$/\1 \2/p'
+}
+
+#
+# partition_of uuid
+# return the partition corresponding to the UUID
+partition_of() {
+ sed -n 's/^\([^ ]*\) '"$1"'$/\1/p'
+}