Accepting request 900396 from Base:System

- unsafe fallback also for ENOSYS on renameat2 as seen on WSL (forwarded request 900395 from lnussel)

OBS-URL: https://build.opensuse.org/request/show/900396
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/compat-usrmerge?expand=0&rev=3
This commit is contained in:
Dominique Leuenberger 2021-06-20 17:37:43 +00:00 committed by Git OBS Bridge
commit 0a54184e17
3 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jun 15 15:27:41 UTC 2021 - Ludwig Nussel <lnussel@suse.de>
- another fix for split /usr to avoid running out of space (boo#1186781)
- unsafe fallback also for ENOSYS on renameat2 as seen on WSL
-------------------------------------------------------------------
Tue Jun 8 12:03:52 UTC 2021 - Ludwig Nussel <lnussel@suse.de>

View File

@ -78,7 +78,7 @@ for dir in bin sbin lib lib64; do
echo "Merge the copy with \`$ROOT/usr/$dir'."
[[ -d "$ROOT/usr/${dir}.usrmerge" ]] \
|| mkdir -p "$ROOT/usr/${dir}.usrmerge"
cp -axT $CP_HARDLINK --backup --suffix=.usrmerge~ "$ROOT/usr/$dir" "$ROOT/usr/${dir}.usrmerge"
cp -axT -l --backup --suffix=.usrmerge~ "$ROOT/usr/$dir" "$ROOT/usr/${dir}.usrmerge"
echo "Clean up duplicates in \`$ROOT/usr/$dir'."
# delete all symlinks that have been backed up. /usr versions
# override / ones

4
xmv.c
View File

@ -70,7 +70,9 @@ int main(int argc, char** argv)
const char *source = argv[optind], *target = argv[optind+1];
r = syscall (SYS_renameat2, AT_FDCWD, source, AT_FDCWD, target, RENAME_EXCHANGE);
if (r < 0) {
if (errno != EINVAL) {
// FS not supporting RENAME_EXCHANGE -> EINVAL
// No renameat2 syscall -> ENOSYS (eg WSL)
if (errno != EINVAL && errno != ENOSYS) {
perror("renameat2");
return 1;
}