summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2020-05-02 13:29:08 +0200
committerRafał Miłecki <rafal@milecki.pl>2020-05-02 13:31:16 +0200
commitd70774de24413f91087e9c3c873cf7a4ec3df813 (patch)
treec94620e8ccb0fdd7a65c660c659c1c3e17af3e54
parent32db27dc8b2b55da2de5e64b1548adc0fb475c13 (diff)
downloadfstools-d70774de24413f91087e9c3c873cf7a4ec3df813.tar.gz
block: add some basic extroot documentation
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-rw-r--r--block.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/block.c b/block.c
index dfee7fb..a7631c4 100644
--- a/block.c
+++ b/block.c
@@ -1374,6 +1374,15 @@ static int test_fs_support(const char *name)
return rv;
}
+/**
+ * Check if mounted partition is a valid extroot
+ *
+ * @path target mount point
+ *
+ * Valid extroot partition has to contain /etc/.extroot-uuid with UUID of root
+ * device. This function reads UUID and verifies it OR writes UUID to
+ * .extroot-uuid if it doesn't exist yet (first extroot usage).
+ */
static int check_extroot(char *path)
{
struct probe_info *pr = NULL;
@@ -1528,6 +1537,12 @@ static int mount_extroot(char *cfg)
return err;
}
+/**
+ * Look for extroot config and mount it if present
+ *
+ * Look for /etc/config/fstab on all supported partitions and use it for
+ * mounting extroot if specified.
+ */
static int main_extroot(int argc, char **argv)
{
struct probe_info *pr;
@@ -1601,6 +1616,7 @@ static int main_extroot(int argc, char **argv)
}
#endif
+ /* As a last resort look for /etc/config/fstab on "rootfs" partition */
return mount_extroot(NULL);
}