Merge pull request #184992 from wegank/prl-tools-5.19-rc5

This commit is contained in:
Sandro 2022-08-04 00:36:18 +02:00 committed by GitHub
commit ae9208358e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 6 deletions

View file

@ -1,7 +1,24 @@
{ stdenv, lib, makeWrapper, p7zip
, gawk, util-linux, xorg, glib, dbus-glib, zlib, bbe, bash, timetrap, netcat, cups
, kernel ? null, libsOnly ? false
, fetchurl, undmg, perl, autoPatchelfHook
{ stdenv
, lib
, makeWrapper
, p7zip
, gawk
, util-linux
, xorg
, glib
, dbus-glib
, zlib
, bbe
, bash
, timetrap
, netcat
, cups
, kernel ? null
, libsOnly ? false
, fetchurl
, undmg
, perl
, autoPatchelfHook
}:
assert (!libsOnly) -> kernel != null;
@ -14,7 +31,7 @@ stdenv.mkDerivation rec {
# We download the full distribution to extract prl-tools-lin.iso from
# => ${dmg}/Parallels\ Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso
src = fetchurl {
url = "https://download.parallels.com/desktop/v${lib.versions.major version}/${version}/ParallelsDesktop-${version}.dmg";
url = "https://download.parallels.com/desktop/v${lib.versions.major version}/${version}/ParallelsDesktop-${version}.dmg";
sha256 = "sha256-gjLxQOTFuVghv1Bj+zfbNW97q1IN2rurSnPQi13gzRA=";
};
@ -39,7 +56,8 @@ stdenv.mkDerivation rec {
fi
'';
patches = lib.optionals (lib.versionAtLeast kernel.version "5.18") [ ./prl-tools.patch ];
patches = lib.optional (lib.versionAtLeast kernel.version "5.18") ./prl-tools-5.18.patch
++ lib.optional (lib.versionAtLeast kernel.version "5.19") ./prl-tools-5.19.patch;
kernelVersion = lib.optionalString (!libsOnly) kernel.modDirVersion;
kernelDir = lib.optionalString (!libsOnly) "${kernel.dev}/lib/modules/${kernelVersion}";

View file

@ -0,0 +1,29 @@
diff -puNr prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
--- prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
+++ prl-tools-build/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
@@ -851,7 +851,7 @@ ssize_t prlfs_rw(struct inode *inode, char *buf, size_t size,
loff_t *off, unsigned int rw, int user, int flags);
-int prlfs_readpage(struct file *file, struct page *page) {
+int prlfs_read_folio(struct file *file, struct folio *folio) {
char *buf;
ssize_t ret;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
@@ -859,6 +859,7 @@ int prlfs_readpage(struct file *file, struct page *page) {
#else
struct inode *inode = file->f_dentry->d_inode;
#endif
+ struct page *page = &folio->page;
loff_t off = page->index << PAGE_SHIFT;
if (!file) {
@@ -950,7 +951,7 @@ out:
}
static const struct address_space_operations prlfs_aops = {
- .readpage = prlfs_readpage,
+ .read_folio = prlfs_read_folio,
.writepage = prlfs_writepage,
.write_begin = simple_write_begin,
.write_end = prlfs_write_end,