mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Juergen Borleis <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/3] envfs: provide an intentional way to ignore an existing external environment
Date: Wed, 30 Jul 2014 12:20:04 +0200	[thread overview]
Message-ID: <1406715606-6821-2-git-send-email-jbe@pengutronix.de> (raw)
In-Reply-To: <1406715606-6821-1-git-send-email-jbe@pengutronix.de>

Add a simple flag to envfs to be able to mark an external environment as
"not to be used".
This change should not affect existing systems, because the current envfs
implementation ensures the 'flags' member in the envfs master block is always
zeroed.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
 common/environment.c | 5 +++++
 include/envfs.h      | 1 +
 2 files changed, 6 insertions(+)

diff --git a/common/environment.c b/common/environment.c
index 2d1edf8..a38e966 100644
--- a/common/environment.c
+++ b/common/environment.c
@@ -272,6 +272,11 @@ static int envfs_check_super(struct envfs_super *super, size_t *size)
 		return -EIO;
 	}
 
+	if (super->flags & ENVFS_FLAGS_PLACEHOLDER) {
+		printf("envfs: content is to be ignored\n");
+		return -EIO;
+	}
+
 	if (super->major < ENVFS_MAJOR)
 		printf("envfs version %d.%d loaded into %d.%d\n",
 			super->major, super->minor,
diff --git a/include/envfs.h b/include/envfs.h
index 9b86398..edb559f 100644
--- a/include/envfs.h
+++ b/include/envfs.h
@@ -43,6 +43,7 @@ struct envfs_super {
 	uint8_t minor;			/* minor */
 	uint16_t future;		/* reserved for future use */
 	uint32_t flags;			/* feature flags */
+#define ENVFS_FLAGS_PLACEHOLDER	(1 << 0)
 	uint32_t sb_crc;		/* crc for the superblock */
 };
 
-- 
2.0.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-07-30 10:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30 10:20 Juergen Borleis
2014-07-30 10:20 ` Juergen Borleis [this message]
2014-07-30 10:20 ` [PATCH 2/3] saveenv: change API to be able to forward special flags into the envfs superblock Juergen Borleis
2014-07-30 10:20 ` [PATCH 3/3] saveenv: provide a zeroed/empty/ignore environment Juergen Borleis
2014-07-30 15:28 ` envfs: provide an intentional way to ignore an existing external environment Jan Lübbe
2014-07-30 21:09   ` Sascha Hauer
2014-07-31  7:14 ` Uwe Kleine-König
2014-07-31  7:33   ` Juergen Borleis
2014-07-31  7:44     ` Uwe Kleine-König
2014-07-31  8:03       ` Juergen Borleis
2014-08-06  3:56       ` Jean-Christophe PLAGNIOL-VILLARD
2014-08-06  7:04       ` Michael Olbrich
2014-08-06  7:28         ` Uwe Kleine-König
2014-08-06 10:41           ` Michael Olbrich

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=1406715606-6821-2-git-send-email-jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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