summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2017-03-24 17:27:09 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2017-03-24 17:35:58 +0100
commitb620db5ba87075031c96f4275afb63c02da70d6d (patch)
tree9d6bfcf72d71f68ec5094755e6f13800dda35a68 /scripts
parentfb713a684fe8c5a0f15ab3d1ab5e4895bfc70e7d (diff)
downloadptxdist-b620db5ba87075031c96f4275afb63c02da70d6d.tar.gz
ptxdist-b620db5ba87075031c96f4275afb63c02da70d6d.tar.xz
ptxd_lib_dopermissions: don't try to create device nodes twice
This happens when ptxd_make_image_extract_xpkg_files() calls ptxd_lib_dopermissions() to fix the directory permissions and for fifos if ptxd_make_nfsd() is called more than once. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/lib/ptxd_lib_dopermissions.awk8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/lib/ptxd_lib_dopermissions.awk b/scripts/lib/ptxd_lib_dopermissions.awk
index 3596121eb..b0aefe1b7 100755
--- a/scripts/lib/ptxd_lib_dopermissions.awk
+++ b/scripts/lib/ptxd_lib_dopermissions.awk
@@ -11,7 +11,9 @@ $1 ~ "f" {
}
$1 ~ "n" {
- printf("mknod -m %s '.%s' %s %s %s &&\n" \
- "chown %s.%s '.%s' &&\n", \
- $5, $2, $6, $7, $8, $3, $4, $2);
+ printf("if [ ! \\( -b '.%s' -o -c '.%s' -o -p '.%s' \\) ]; then " \
+ " mknod -m %s '.%s' %s %s %s &&\n" \
+ " chown %s.%s '.%s'\n" \
+ "fi &&\n", \
+ $2, $2, $2, $5, $2, $6, $7, $8, $3, $4, $2);
}