summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2018-11-06 10:10:38 -0800
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-11-11 23:04:52 +0900
commit8ef14c2c41d962756d314f1d7dc972b0ea7a180f (patch)
treede0321f379aeaed486800dd3148da642427edb41 /scripts
parentbbcde0a7241261cd0ca8d8e6b94a4113a4b71443 (diff)
downloadlinux-8ef14c2c41d962756d314f1d7dc972b0ea7a180f.tar.bz2
Revert "scripts/setlocalversion: git: Make -dirty check more robust"
This reverts commit 6147b1cf19651c7de297e69108b141fb30aa2349. The reverted patch results in attempted write access to the source repository, even if that repository is mounted read-only. Output from "strace git status -uno --porcelain": getcwd("/tmp/linux-test", 129) = 16 open("/tmp/linux-test/.git/index.lock", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = -1 EROFS (Read-only file system) While git appears to be able to handle this situation, a monitored build environment (such as the one used for Chrome OS kernel builds) may detect it and bail out with an access violation error. On top of that, the attempted write access suggests that git _will_ write to the file even if a build output directory is specified. Users may have the reasonable expectation that the source repository remains untouched in that situation. Fixes: 6147b1cf19651 ("scripts/setlocalversion: git: Make -dirty check more robust" Cc: Genki Sky <sky@genki.is> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/setlocalversion2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 79f7dd57d571..71f39410691b 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -74,7 +74,7 @@ scm_version()
fi
# Check for uncommitted changes
- if git status -uno --porcelain | grep -qv '^.. scripts/package'; then
+ if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
printf '%s' -dirty
fi