Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v14 1/4] makedevs: support optional files
@ 2017-07-03 21:00 Arnout Vandecappelle
  2017-07-03 21:00 ` [Buildroot] [PATCH v14 2/4] busybox: applets as individual binaries Arnout Vandecappelle
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2017-07-03 21:00 UTC (permalink / raw)
  To: buildroot

Add the 'F' file type to makedevs, that allows a file to be optional.
With this option, the line is just silently skipped if the file doesn't
exist (or is not a regular file).

This is useful for _PERMISSIONS where the file can be configured out
by package-specific configuration that is not directly handled by
Buildroot, like busybox.

Cc: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Cc: Niranjan Reddy <niranjan.reddy@rockwellcollins.com>
Cc: Bryce Ferguson <bryce.ferguson@rockwellcollins.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
v14:
 - Split off the makedevs change in a separate patch.
 - Fix it - AFAICS, the original patch would just skip all F lines.
---
 package/makedevs/makedevs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/makedevs/makedevs.c b/package/makedevs/makedevs.c
index 7092b1475e..1ba5936342 100644
--- a/package/makedevs/makedevs.c
+++ b/package/makedevs/makedevs.c
@@ -570,9 +570,12 @@ int main(int argc, char **argv)
 				ret = EXIT_FAILURE;
 				goto loop;
 			}
-		} else if (type == 'f') {
+		} else if (type == 'f' || type == 'F') {
 			struct stat st;
 			if ((stat(full_name, &st) < 0 || !S_ISREG(st.st_mode))) {
+				if (type == 'F') {
+					continue; /*Ignore optional files*/
+				}
 				bb_perror_msg("line %d: regular file '%s' does not exist", linenum, full_name);
 				ret = EXIT_FAILURE;
 				goto loop;
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-07-03 22:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-03 21:00 [Buildroot] [PATCH v14 1/4] makedevs: support optional files Arnout Vandecappelle
2017-07-03 21:00 ` [Buildroot] [PATCH v14 2/4] busybox: applets as individual binaries Arnout Vandecappelle
2017-07-03 22:58   ` Thomas Petazzoni
2017-07-03 21:00 ` [Buildroot] [PATCH v14 3/4] qemu x86 selinux: added common selinux support files Arnout Vandecappelle
2017-07-03 21:00 ` [Buildroot] [PATCH v14 4/4] qemu x86 selinux: base br defconfig Arnout Vandecappelle
2017-07-03 22:58 ` [Buildroot] [PATCH v14 1/4] makedevs: support optional files Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox