Skip to content
Commit 26f215d1 authored by Andrew Parlane's avatar Andrew Parlane Committed by Thomas Petazzoni
Browse files

target-finalize: Use NULL deliminators when stripping the target directory.



Special characters in files or directories in the rootfs can cause
problems when stripping files.  For example "target/some song.mp3"
gets treated as two entries. "target/some" and "song.mp3" are both
passed to $(STRIPCMD). This then errors saying files don't exist.

Additionally a ' and possibly other special characters in a file path
causes xargs to give the error: "xargs: unmatched single quote; by
default quotes are special to xargs unless you use the -0
option". This also has the effect of removing this entry and further
entries from the list of files to strip.  This can be demonstrated by
having a test directory with the files: "cat" "rabbit's"
"elephant". then running the command: "find -name "*" -print | xargs"

To fix this we pass -print0 to find which seperates entries with a
NULL character, and we pass -0 to xargs to tell it to only use NULL
characters as the deliminator.

Signed-off-by: default avatarAndrew Parlane <andrewp@carallon.com>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 3503386a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment