[PATCH 2/4] cmdlinepart: add option to set DEVFS_PARTITION_IN_PT flag
Michael Grzeschik
m.grzeschik at pengutronix.de
Mon Oct 17 06:29:21 PDT 2016
With this option it is possible to flag cdev partitions, which will also
be written to the partition table of its backing device.
Signed-off-by: Michael Grzeschik <m.grzeschik at pengutronix.de>
---
include/cmdlinepart.h | 1 +
lib/cmdlinepart.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/include/cmdlinepart.h b/include/cmdlinepart.h
index bf8cdfa..3363a74 100644
--- a/include/cmdlinepart.h
+++ b/include/cmdlinepart.h
@@ -2,6 +2,7 @@
#define __CMD_LINE_PART_H
#define CMDLINEPART_ADD_DEVNAME (1 << 0)
+#define CMDLINEPART_ADD_TO_PT (2 << 0)
int cmdlinepart_do_parse_one(const char *devname, const char *partstr,
const char **endp, loff_t *offset,
diff --git a/lib/cmdlinepart.c b/lib/cmdlinepart.c
index d7d4441..8633e82 100644
--- a/lib/cmdlinepart.c
+++ b/lib/cmdlinepart.c
@@ -81,6 +81,9 @@ int cmdlinepart_do_parse_one(const char *devname, const char *partstr,
end = (char *)(partstr + 2);
}
+ if (partition_flags & CMDLINEPART_ADD_TO_PT)
+ flags |= DEVFS_PARTITION_IN_PT;
+
if (endp)
*endp = end;
--
2.9.3
More information about the barebox
mailing list