File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,12 @@ try_extract() {
29
29
# cpio can do strange things when given garbage, so do a basic check.
30
30
[[ $( head -c6 " $1 " ) == 070701 ]] || return 0
31
31
32
- # There may be multiple concatenated archives so try cpio till it fails.
33
- while cpio --quiet --extract --make-directories --directory=" ${out} /rootfs-${ROOTFS_IDX} " --nonmatching ' dev/*' 2> /dev/null; do
32
+ while {
33
+ # cpio needs the directory to exist first. Fail if it's already there.
34
+ { mkdir " ${out} /rootfs-${ROOTFS_IDX} " || return $? ; } &&
35
+ # There may be multiple concatenated archives so try cpio till it fails.
36
+ cpio --quiet --extract --make-directories --directory=" ${out} /rootfs-${ROOTFS_IDX} " --nonmatching ' dev/*' 2> /dev/null
37
+ }; do
34
38
ROOTFS_IDX=$(( ROOTFS_IDX + 1 ))
35
39
done < " $1 "
36
40
@@ -49,7 +53,7 @@ if [[ ! -s "${image}" ]]; then
49
53
fi
50
54
mkdir -p " ${out} "
51
55
52
- tmp=$( mktemp --directory eifv-XXXXXX)
56
+ tmp=$( mktemp --directory -t eifv-XXXXXX)
53
57
trap ' rm -rf -- "${tmp}"' EXIT
54
58
ROOTFS_IDX=0
55
59
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ write_contents() {
33
33
# %l - symlink target (empty if not a symlink)
34
34
sudo TZ=UTC find -printf \
35
35
' %M %2n %-7u %-7g %7s %TY-%Tm-%Td %TH:%TM ./%P -> %l\n' \
36
+ | sort --key=8 \
36
37
| sed -e ' s/ -> $//' > " ${output} "
37
38
popd > /dev/null
38
39
}
@@ -57,7 +58,8 @@ write_contents_with_technical_details() {
57
58
# %s - size in bytes
58
59
# %P - file's path
59
60
sudo find -printf \
60
- ' %M %D %i %n %s ./%P\n' > " ${output} "
61
+ ' %M %D %i %n %s ./%P\n' \
62
+ | sort --key=6 > " ${output} "
61
63
popd > /dev/null
62
64
}
63
65
You can’t perform that action at this time.
0 commit comments