wok rev 20616

virtualbox-ose: add virtualbox-linux.patch
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 25 00:10:50 2018 +0100 (2018-12-25)
parents b75a8bca8ff9
children b23839382755
files virtualbox-ose/receipt virtualbox-ose/stuff/virtualbox-linux.patch
line diff
     1.1 --- a/virtualbox-ose/receipt	Fri Dec 21 20:44:57 2018 +0100
     1.2 +++ b/virtualbox-ose/receipt	Tue Dec 25 00:10:50 2018 +0100
     1.3 @@ -26,8 +26,8 @@
     1.4  # Rules to configure and make the package.
     1.5  compile_rules()
     1.6  {
     1.7 -	find $src -name '*akefile*' -o -name '*conf*' | xargs \
     1.8 -		sed -i 's|uname -m|echo i486|'
     1.9 +	grep -rl 'uname -m' $src | xargs sed -i 's|\(.\)uname -m|\1echo i486|'
    1.10 +	patch -p1 < $stuff/virtualbox-linux.patch
    1.11  	cp $stuff/LocalConfig.kmk .
    1.12  	./configure \
    1.13  		--disable-pulse \
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/virtualbox-ose/stuff/virtualbox-linux.patch	Tue Dec 25 00:10:50 2018 +0100
     2.3 @@ -0,0 +1,204 @@
     2.4 +--- virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/dirops.c
     2.5 ++++ virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/dirops.c
     2.6 +@@ -233,7 +233,11 @@
     2.7 +  * b. failure to compute fake inode number
     2.8 +  * c. filldir returns an error (see comment on that)
     2.9 +  */
    2.10 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
    2.11 ++static int sf_dir_iterate (struct file *dir, struct dir_context *ctx)
    2.12 ++#else
    2.13 + static int sf_dir_read (struct file *dir, void *opaque, filldir_t filldir)
    2.14 ++#endif
    2.15 + {
    2.16 +     TRACE();
    2.17 +     for (;;)
    2.18 +@@ -257,12 +261,19 @@
    2.19 +                 /* skip erroneous entry and proceed */
    2.20 +                 LogFunc(("sf_getdent error %d\n", err));
    2.21 +                 dir->f_pos += 1;
    2.22 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
    2.23 ++                ctx->pos += 1;
    2.24 ++#endif
    2.25 +                 continue;
    2.26 +         }
    2.27 + 
    2.28 +         /* d_name now contains a valid entry name */
    2.29 + 
    2.30 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
    2.31 ++        sanity = ctx->pos + 0xbeef;
    2.32 ++#else
    2.33 +         sanity = dir->f_pos + 0xbeef;
    2.34 ++#endif
    2.35 +         fake_ino = sanity;
    2.36 +         if (sanity - fake_ino)
    2.37 +         {
    2.38 +@@ -270,8 +281,12 @@
    2.39 +             return -EINVAL;
    2.40 +         }
    2.41 + 
    2.42 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
    2.43 ++        err = dir_emit(ctx, d_name, strlen(d_name), fake_ino, DT_UNKNOWN);
    2.44 ++#else
    2.45 +         err = filldir(opaque, d_name, strlen(d_name),
    2.46 +                       dir->f_pos, fake_ino, DT_UNKNOWN);
    2.47 ++#endif
    2.48 +         if (err)
    2.49 +         {
    2.50 +             LogFunc(("filldir returned error %d\n", err));
    2.51 +@@ -281,6 +296,9 @@
    2.52 +         }
    2.53 + 
    2.54 +         dir->f_pos += 1;
    2.55 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
    2.56 ++	ctx->pos += 1;
    2.57 ++#endif
    2.58 +     }
    2.59 + 
    2.60 +     BUG();
    2.61 +@@ -289,7 +307,11 @@
    2.62 + struct file_operations sf_dir_fops =
    2.63 + {
    2.64 +     .open    = sf_dir_open,
    2.65 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
    2.66 ++    .iterate = sf_dir_iterate,
    2.67 ++#else
    2.68 +     .readdir = sf_dir_read,
    2.69 ++#endif
    2.70 +     .release = sf_dir_release,
    2.71 +     .read    = generic_read_dir
    2.72 + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
    2.73 +--- virtualbox-ose-4.2.6/src/VBox/Additions/linux/drm/vboxvideo_drv.c
    2.74 ++++ virtualbox-ose-4.2.6/src/VBox/Additions/linux/drm/vboxvideo_drv.c
    2.75 +@@ -88,7 +88,6 @@
    2.76 + #endif
    2.77 +         .mmap = drm_mmap,
    2.78 +         .poll = drm_poll,
    2.79 +-        .fasync = drm_fasync,
    2.80 +     },
    2.81 + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
    2.82 +     .pci_driver =
    2.83 +--- virtualbox-ose-4.2.6/src/VBox/Additions/linux/drm/vboxvideo_drm.c
    2.84 ++++ virtualbox-ose-4.2.6/src/VBox/Additions/linux/drm/vboxvideo_drm.c
    2.85 +@@ -98,7 +98,6 @@
    2.86 +         .unlocked_ioctl = drm_ioctl,
    2.87 +         .mmap = drm_mmap,
    2.88 +         .poll = drm_poll,
    2.89 +-        .fasync = drm_fasync,
    2.90 + };
    2.91 + #endif
    2.92 + 
    2.93 +@@ -129,7 +128,6 @@
    2.94 + #endif
    2.95 +         .mmap = drm_mmap,
    2.96 +         .poll = drm_poll,
    2.97 +-        .fasync = drm_fasync,
    2.98 +     },
    2.99 + #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) || defined(DRM_RHEL63) */
   2.100 +     .fops = &driver_fops,
   2.101 +--- virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/utils.c
   2.102 ++++ virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/utils.c
   2.103 +@@ -144,8 +144,13 @@
   2.104 + #endif
   2.105 +     }
   2.106 + 
   2.107 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
   2.108 +     inode->i_uid = sf_g->uid;
   2.109 +     inode->i_gid = sf_g->gid;
   2.110 ++#else
   2.111 ++    inode->i_uid.val = sf_g->uid;
   2.112 ++    inode->i_gid.val = sf_g->gid;
   2.113 ++#endif
   2.114 +     inode->i_size = info->cbObject;
   2.115 + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) && !defined(KERNEL_FC6)
   2.116 +     inode->i_blksize = 4096;
   2.117 +--- virtualBbx-ose-4.2.6/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
   2.118 ++++ virtualbox-ose-4.2.6/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
   2.119 +@@ -196,7 +196,7 @@
   2.120 + 
   2.121 + 
   2.122 + /** PCI hotplug structure. */
   2.123 +-static const struct pci_device_id __devinitdata g_VBoxGuestPciId[] =
   2.124 ++static const struct pci_device_id g_VBoxGuestPciId[] =
   2.125 + {
   2.126 +     {
   2.127 +         vendor:     VMMDEV_VENDORID,
   2.128 +--- virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/regops.c
   2.129 ++++ virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/regops.c
   2.130 +@@ -574,8 +574,13 @@
   2.131 + # else
   2.132 +     .sendfile    = generic_file_sendfile,
   2.133 + # endif
   2.134 ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
   2.135 ++    .read_iter   = generic_file_read_iter,
   2.136 ++    .write_iter  = generic_file_write_iter,
   2.137 ++# else
   2.138 +     .aio_read    = generic_file_aio_read,
   2.139 +     .aio_write   = generic_file_aio_write,
   2.140 ++# endif
   2.141 + # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
   2.142 +     .fsync       = noop_fsync,
   2.143 + # else
   2.144 +--- virtualbox-ose-4.2.6/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
   2.145 ++++ virtualbox-ose-4.2.6/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
   2.146 +@@ -429,7 +429,11 @@
   2.147 +         if (!pNewCreds)
   2.148 +                 goto done;
   2.149 + 
   2.150 ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
   2.151 ++        pNewCreds->fsuid.val = 0;
   2.152 ++# else
   2.153 +         pNewCreds->fsuid = 0;
   2.154 ++# endif
   2.155 +         pOldCreds = override_creds(pNewCreds);
   2.156 + #endif
   2.157 + 
   2.158 +@@ -539,7 +543,11 @@
   2.159 +         if (!pNewCreds)
   2.160 +             goto done;
   2.161 + 
   2.162 ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
   2.163 ++        pNewCreds->fsuid.val = 0;
   2.164 ++# else
   2.165 +         pNewCreds->fsuid = 0;
   2.166 ++# endif
   2.167 +         pOldCreds = override_creds(pNewCreds);
   2.168 + #endif
   2.169 +         RTStrPrintf(szFileBuf, cMaxBuf,
   2.170 +--- virtualbox-ose-4.2.6/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
   2.171 ++++ virtualbox-ose-4.2.6/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
   2.172 +@@ -223,7 +223,11 @@
   2.173 + DECLINLINE(RTUID) vboxdrvLinuxUid(void)
   2.174 + {
   2.175 + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
   2.176 ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
   2.177 ++    return current->cred->uid.val;
   2.178 ++# else
   2.179 +     return current->cred->uid;
   2.180 ++# endif
   2.181 + #else
   2.182 +     return current->uid;
   2.183 + #endif
   2.184 +@@ -232,7 +236,11 @@
   2.185 + DECLINLINE(RTGID) vboxdrvLinuxGid(void)
   2.186 + {
   2.187 + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
   2.188 ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
   2.189 ++    return current->cred->gid.val;
   2.190 ++# else
   2.191 +     return current->cred->gid;
   2.192 ++# endif
   2.193 + #else
   2.194 +     return current->gid;
   2.195 + #endif
   2.196 +@@ -241,7 +249,11 @@
   2.197 + DECLINLINE(RTUID) vboxdrvLinuxEuid(void)
   2.198 + {
   2.199 + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
   2.200 ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
   2.201 ++    return current->cred->euid.val;
   2.202 ++# else
   2.203 +     return current->cred->euid;
   2.204 ++# endif
   2.205 + #else
   2.206 +     return current->euid;
   2.207 + #endif