From c9bfd4318cd8edb44dccab0fb2c4a40e5af6525e Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Mon, 10 Mar 2014 12:05:01 +0000 Subject: [PATCH] msys2-runtime: Add (unused) experimental revert-mounting.patch --- msys2-runtime/PKGBUILD | 9 ++- msys2-runtime/revert-mounting.patch | 121 ++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 msys2-runtime/revert-mounting.patch diff --git a/msys2-runtime/PKGBUILD b/msys2-runtime/PKGBUILD index 5c720ceb..e30990b8 100644 --- a/msys2-runtime/PKGBUILD +++ b/msys2-runtime/PKGBUILD @@ -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() { diff --git a/msys2-runtime/revert-mounting.patch b/msys2-runtime/revert-mounting.patch new file mode 100644 index 00000000..a83064a7 --- /dev/null +++ b/msys2-runtime/revert-mounting.patch @@ -0,0 +1,121 @@ +From 92177a96e1deb38b4c53fe1ddbede880557d4ecc Mon Sep 17 00:00:00 2001 +From: Alexpux +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 +