-
Notifications
You must be signed in to change notification settings - Fork 0
/
rsync.patch
44 lines (42 loc) · 1.38 KB
/
rsync.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
diff --git a/kmodcache b/kmodcache
--- a/kmodcache
+++ b/kmodcache
@@ -26,27 +26,19 @@ eval 'pwhich () {
find '$(getconf PATH | tr -s ":" " ")' -name $1 | head -n 1
}'
-# Minor optimization if we have rsync installed
-if [ -x "$(pwhich rsync)" ]; then
- # Replace the whole files preserving the same inodes and delete on the destination the non-existing files of the source
- rsync -a \
- -S \
- -q \
- -L \
- --ignore-missing-args \
- --inplace \
- --whole-file \
- --compress-level=0 \
- --delete \
- --exclude="/${osrelease}/build/" \
- "${moddir}" \
- "${kmods}"
-else
- # Copy only the necessary files for modprobe to work
- rm -r -f "${kmods}/${osrelease}"
- mkdir -m 755 -p "${kmods}/${osrelease}"
- cp -r -p -L $(find "${moddir}" ! -name "${osrelease}" -prune ! -name build) "${kmods}/${osrelease}"
-fi
+# Replace the whole files preserving the same inodes and delete on the destination the non-existing files of the source
+rsync -a \
+ -S \
+ -q \
+ -L \
+ --ignore-missing-args \
+ --inplace \
+ --whole-file \
+ --compress-level=0 \
+ --delete \
+ --exclude="/${osrelease}/build/" \
+ "${moddir}" \
+ "${kmods}"
# Create the folder for our temporary kmod launchers if it doesn't exist
mkdir -m 755 -p "${binpath}"