From: Petr Vorel <petr.vorel@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC PATCH v3 1/2] makedevs: only warn when xattr support disabled
Date: Tue, 30 Jul 2019 22:31:46 +0200 [thread overview]
Message-ID: <20190730203147.21113-1-petr.vorel@gmail.com> (raw)
Previously makedevs failed when xattr configuration defined while
disabled BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES.
Therefore check for this configuration would be required
in each use. Therefore only print warning with number of discharged lines.
No package is using this feature so far (it's used only in tests),
thus no need to change any package config.
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
Changes v2->v3:
* print warning only once at the end, print number of discharged lines
* put into single line (feel free to add new line)
package/makedevs/makedevs.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/package/makedevs/makedevs.c b/package/makedevs/makedevs.c
index c57b964f5c..aa0b4b4cba 100644
--- a/package/makedevs/makedevs.c
+++ b/package/makedevs/makedevs.c
@@ -493,6 +493,7 @@ int main(int argc, char **argv)
printf("table=<stdin>\n");
}
+ unsigned int xattr_warned = 0;
while ((line = bb_get_chomped_line_from_file(table))) {
char type;
unsigned int mode = 0755;
@@ -518,9 +519,7 @@ int main(int argc, char **argv)
if (bb_set_xattr(full_name, xattr) < 0)
bb_error_msg_and_die("can't set cap %s on file %s\n", xattr, full_name);
#else
- bb_error_msg_and_die("line %d not supported: '%s'\nDid you forget to enable "
- "BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES?\n",
- linenum, line);
+ xattr_warned++;
#endif /* EXTENDED_ATTRIBUTES */
continue;
}
@@ -641,6 +640,15 @@ int main(int argc, char **argv)
loop:
free(line);
}
+
+ if (xattr_warned) {
+ bb_error_msg("%u lines with xattr configuration discharged, enable "
+ "BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES "
+ "to get xattr support\n",
+ xattr_warned);
+ ret = EXIT_FAILURE;
+ }
+
fclose(table);
return ret;
--
2.22.0
next reply other threads:[~2019-07-30 20:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-30 20:31 Petr Vorel [this message]
2019-07-30 20:31 ` [Buildroot] [RFC PATCH v3 2/2] iputils: add capability for clockdiff, ping, traceroute6 Petr Vorel
2019-07-30 20:57 ` [Buildroot] [RFC PATCH v3 1/2] makedevs: only warn when xattr support disabled Yann E. MORIN
2019-07-30 21:42 ` Petr Vorel
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=20190730203147.21113-1-petr.vorel@gmail.com \
--to=petr.vorel@gmail.com \
--cc=buildroot@busybox.net \
/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