From: Quentin Schulz <quentin.schulz@bootlin.com>
To: dedekind1@gmail.com, richard@nod.at, dwmw2@infradead.org,
computersforpeace@gmail.com, boris.brezillon@bootlin.com,
marek.vasut@gmail.com
Cc: linux-mtd@lists.infradead.org, thomas.petazzoni@bootlin.com,
david.oberhollenzer@sigma-star.at,
Quentin Schulz <quentin.schulz@bootlin.com>
Subject: [PATCH v2 4/4] ubi-utils: ubinize: add support for skipping CRC check of a static volume when opening
Date: Thu, 28 Jun 2018 09:43:44 +0200 [thread overview]
Message-ID: <20180628074344.10249-5-quentin.schulz@bootlin.com> (raw)
In-Reply-To: <20180628074344.10249-1-quentin.schulz@bootlin.com>
Let's let the user configure static UBI volume with CRC checking at
opening disabled if desired.
Introduce the skip-check setting for vol_flags configuration of a
volume.
There is no point in having both autoresize and skip-check set as
skip-check is reserved for static volumes only and it's useless to have
a static volume's size set to autoresize.
Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
---
ubi-utils/ubinize.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/ubi-utils/ubinize.c b/ubi-utils/ubinize.c
index c85ff9b..b603638 100644
--- a/ubi-utils/ubinize.c
+++ b/ubi-utils/ubinize.c
@@ -385,9 +385,21 @@ static int read_section(const struct ubigen_info *ui, const char *sname,
sprintf(buf, "%s:vol_flags", sname);
p = iniparser_getstring(args.dict, buf, NULL);
if (p) {
+ /*
+ * For now, the flag can be either autoresize or skip-check, as
+ * skip-check is reserved for static volumes and autoresize for
+ * such a volume makes no sense.
+ * Once we add another flag that isn't incompatible with each
+ * and every existing flag, we'll have to implement a solution
+ * that allows multiple flags to be set at the same time in
+ * vol_flags setting of the section.
+ */
if (!strcmp(p, "autoresize")) {
verbose(args.verbose, "autoresize flags found");
vi->flags |= UBI_VTBL_AUTORESIZE_FLG;
+ } else if (!strcmp(p, "skip-check")) {
+ verbose(args.verbose, "skip-check flag found");
+ vi->flags |= UBI_VTBL_SKIP_CRC_CHECK_FLG;
} else {
return errmsg("unknown flags \"%s\" in section \"%s\"",
p, sname);
@@ -523,6 +535,10 @@ int main(int argc, char * const argv[])
}
}
+ if (vi[i].flags & UBI_VTBL_SKIP_CRC_CHECK_FLG &&
+ vi[i].type != UBI_VID_STATIC)
+ return errmsg("skip-check is only valid for static volumes");
+
if (vi[i].flags & UBI_VTBL_AUTORESIZE_FLG) {
if (autoresize_was_already)
return errmsg("only one volume is allowed "
--
2.14.1
next prev parent reply other threads:[~2018-06-28 7:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 7:43 [PATCH v2 0/4] ubi-utils: add possibility to flag a static volume to skip CRC check when opening Quentin Schulz
2018-06-28 7:43 ` [PATCH v2 1/4] UBI: update ubi-user.h and ubi-media.h Quentin Schulz
2018-06-28 7:50 ` Boris Brezillon
2018-06-28 7:43 ` [PATCH v2 2/4] libubi: add volume flags to ubi_mkvol_request Quentin Schulz
2018-06-28 7:50 ` Boris Brezillon
2018-06-28 7:43 ` [PATCH v2 3/4] ubi-utils: ubimkvol: add support for skipping CRC check of a static volume when opening Quentin Schulz
2018-06-28 7:50 ` Boris Brezillon
2018-06-28 7:43 ` Quentin Schulz [this message]
2018-06-28 7:50 ` [PATCH v2 4/4] ubi-utils: ubinize: " Boris Brezillon
2018-06-28 11:48 ` [PATCH v2 0/4] ubi-utils: add possibility to flag a static volume to skip CRC check " David Oberhollenzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180628074344.10249-5-quentin.schulz@bootlin.com \
--to=quentin.schulz@bootlin.com \
--cc=boris.brezillon@bootlin.com \
--cc=computersforpeace@gmail.com \
--cc=david.oberhollenzer@sigma-star.at \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).