msys2-runtime: Add (unused) experimental revert-mounting.patch

This commit is contained in:
Ray Donnelly
2014-03-10 12:05:01 +00:00
parent c7f59426cd
commit c9bfd4318c
2 changed files with 128 additions and 2 deletions

View File

@@ -12,10 +12,13 @@ license=('GPL')
groups=('base')
depends=()
makedepends=('cocom' 'git' 'perl' 'gcc' 'mingw-w64-cross-gcc' 'mingw-w64-cross-zlib')
#options=('debug' '!strip')
source=('msys2-runtime'::'git+https://github.com/Alexpux/Cygwin.git#branch=develop'
'0001-Expand-CYGWIN-error_start-processing.patch')
'0001-Expand-CYGWIN-error_start-processing.patch'
'0002-revert-mounting.patch')
md5sums=('SKIP'
'85fabbc5d9cdb46cf73da9654f2c83bc')
'85fabbc5d9cdb46cf73da9654f2c83bc'
'ace414fde822ae633183fe94cbb0e1d9')
pkgver() {
cd "$srcdir/msys2-runtime"
@@ -26,6 +29,8 @@ pkgver() {
prepare() {
cd "$srcdir/msys2-runtime"
patch -p1 -i ${srcdir}/0001-Expand-CYGWIN-error_start-processing.patch
# Experimental!
# patch -p1 -i ${srcdir}/0002-revert-mounting.patch
}
build() {

View File

@@ -0,0 +1,121 @@
From 92177a96e1deb38b4c53fe1ddbede880557d4ecc Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Fri, 28 Feb 2014 21:02:07 +0400
Subject: [PATCH] Revert mounting /usr to /
---
winsup/cygwin/mount.cc | 54 +++++++++++++++++++++++++++-----------------------
winsup/cygwin/mount.h | 6 +++---
2 files changed, 32 insertions(+), 28 deletions(-)
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index cc291c1..df76bf2 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -41,8 +41,9 @@ details. */
#define isproc(path) \
(path_prefix_p (proc, (path), proc_len, false))
+bool NO_COPY mount_info::got_usr_bin;
+bool NO_COPY mount_info::got_usr_lib;
int NO_COPY mount_info::root_idx = -1;
-bool NO_COPY mount_info::root_mnt;
/* is_unc_share: Return non-zero if PATH begins with //server/share
or with one of the native prefixes //./ or //?/
@@ -478,18 +479,24 @@ mount_info::init ()
from_fstab (false, path, pathend);
from_fstab (true, path, pathend);
- /* map root to /usr on msys */
- if (!root_mnt)
+ if (!got_usr_bin || !got_usr_lib)
{
char native[PATH_MAX];
if (root_idx < 0)
- api_fatal ("root_idx %d, user_shared magic %y, nmounts %d", root_idx, user_shared->version, nmounts);
+ api_fatal ("root_idx %d, user_shared magic %p, nmounts %d", root_idx, user_shared->version, nmounts);
char *p = stpcpy (native, mount[root_idx].native_path);
- if (!root_mnt)
- {
- stpcpy (p, "\\");
- add_item (native, "/usr", MOUNT_SYSTEM | MOUNT_BINARY | MOUNT_AUTOMATIC | MOUNT_NOACL);
- }
+ if (!got_usr_bin)
+ {
+ stpcpy (p, "\\bin");
+ add_item (native, "/usr/bin",
+ MOUNT_SYSTEM | MOUNT_BINARY | MOUNT_AUTOMATIC | MOUNT_NOACL);
+ }
+ if (!got_usr_lib)
+ {
+ stpcpy (p, "\\lib");
+ add_item (native, "/usr/lib",
+ MOUNT_SYSTEM | MOUNT_BINARY | MOUNT_AUTOMATIC | MOUNT_NOACL);
+ }
}
}
@@ -1323,19 +1330,14 @@ sort_by_native_name (const void *a, const void *b)
res = strcmp (ap->native_path, bp->native_path);
if (res == 0)
- {
- if ((ap->flags & MOUNT_SYSTEM) != (bp->flags & MOUNT_SYSTEM))
- {
- /* need to select between user and system mount to same native path */
- if (!(bp->flags & MOUNT_SYSTEM)) /* user mount */
- return 1;
- else
- return -1;
- }
- else
- /* All things being equal, sort by POSIX path */
- return sort_by_posix_name (a, b);
- }
+ {
+ /* need to select between user and system mount to same POSIX path */
+ if (!(bp->flags & MOUNT_SYSTEM)) /* user mount */
+ return 1;
+ else
+ return -1;
+ }
+
return res;
}
@@ -1439,9 +1441,11 @@ mount_info::add_item (const char *native, const char *posix,
if (i == nmounts)
nmounts++;
- /* only /usr thanks */
- if (strcmp (posixtmp, "/usr") == 0)
- root_mnt = true;
+ if (strcmp (posixtmp, "/usr/bin") == 0)
+ got_usr_bin = true;
+
+ if (strcmp (posixtmp, "/usr/lib") == 0)
+ got_usr_lib = true;
if (posixtmp[0] == '/' && posixtmp[1] == '\0' && !(mountflags & MOUNT_CYGDRIVE))
root_idx = i;
diff --git a/winsup/cygwin/mount.h b/winsup/cygwin/mount.h
index 67319a2..55b8fd4 100644
--- a/winsup/cygwin/mount.h
+++ b/winsup/cygwin/mount.h
@@ -169,9 +169,9 @@ class mount_info
int nmounts;
mount_item mount[MAX_MOUNTS];
- /* changed a bit for msys */
- static bool root_mnt;
- static int root_idx;
+ static bool got_usr_bin;
+ static bool got_usr_lib;
+ static int root_idx;
/* cygdrive_prefix is used as the root of the path automatically
prepended to a path when the path has no associated mount.
--
1.8.5.5