Удалены устаревшие патчи

mhiretskiy
parent 83acb0f39b
commit 02070ce84c

@ -1,15 +0,0 @@
# Calculate format=diff merge(app-emulation/vpcs)=>0.6,0.7
diff --git a/src/getopt.h b/src/getopt.h
index 4394aa2..bf59e10 100644
--- a/src/getopt.h
+++ b/src/getopt.h
@@ -49,9 +49,6 @@ extern int optind;
extern int opterr;
extern int optopt;
-#ifndef FreeBSD
-int getopt(int argc, char** argv, char* optstr);
-#endif
int arg_to_int(const char* arg, int min, int max, int defalt);
#ifdef __cplusplus

@ -1,122 +0,0 @@
# Calculate format=diff merge(app-office/libreoffice)=>5.4.2.2,5.4.4
From 985523eee724f41eefb3aa84edcfcd1a4a3cf3db Mon Sep 17 00:00:00 2001
From: Eike Rathke <erack@redhat.com>
Date: Fri, 17 Nov 2017 00:16:17 +0100
Subject: Resolves: tdf#113889 no date particle reordering when exporting to
Excel
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Change-Id: I45667a67c6c69106d86755ed41438f23e019dfea
(cherry picked from commit eb8bd7f21103ed2349b44c954db977709de2e4ec)
Reviewed-on: https://gerrit.libreoffice.org/44841
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
---
include/svl/zforlist.hxx | 3 ++-
svl/source/numbers/zforlist.cxx | 7 ++++---
svl/source/numbers/zforscan.cxx | 6 +++++-
svl/source/numbers/zforscan.hxx | 4 +++-
4 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index f6f3389..82e30ce 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -390,7 +390,8 @@ public:
language/country eNewLnge */
bool PutandConvertEntry( OUString& rString, sal_Int32& nCheckPos,
short& nType, sal_uInt32& nKey,
- LanguageType eLnge, LanguageType eNewLnge );
+ LanguageType eLnge, LanguageType eNewLnge,
+ bool bForExcelExport = false );
/** Same as <method>PutandConvertEntry</method> but the format code string
is considered to be of the System language/country eLnge and is
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 7db6810..9a2e443 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -636,14 +636,15 @@ bool SvNumberFormatter::PutandConvertEntry(OUString& rString,
short& nType,
sal_uInt32& nKey,
LanguageType eLnge,
- LanguageType eNewLnge)
+ LanguageType eNewLnge,
+ bool bForExcelExport )
{
bool bRes;
if (eNewLnge == LANGUAGE_DONTKNOW)
{
eNewLnge = IniLnge;
}
- pFormatScanner->SetConvertMode(eLnge, eNewLnge);
+ pFormatScanner->SetConvertMode(eLnge, eNewLnge, false, bForExcelExport);
bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge);
pFormatScanner->SetConvertMode(false);
return bRes;
@@ -821,7 +822,7 @@ OUString SvNumberFormatter::GetFormatStringForExcel( sal_uInt32 nKey, const NfKe
short nType = css::util::NumberFormat::DEFINED;
sal_uInt32 nTempKey;
OUString aTemp( pEntry->GetFormatstring());
- rTempFormatter.PutandConvertEntry( aTemp, nCheckPos, nType, nTempKey, nLang, LANGUAGE_ENGLISH_US);
+ rTempFormatter.PutandConvertEntry( aTemp, nCheckPos, nType, nTempKey, nLang, LANGUAGE_ENGLISH_US, true);
SAL_WARN_IF( nCheckPos != 0, "svl.numbers",
"SvNumberFormatter::GetFormatStringForExcel - format code not convertible");
if (nTempKey != NUMBERFORMAT_ENTRY_NOT_FOUND)
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index b3fae53..cd09a44 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -47,6 +47,7 @@ ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP )
pFormatter = pFormatterP;
xNFC = css::i18n::NumberFormatMapper::create( pFormatter->GetComponentContext() );
bConvertMode = false;
+ mbConvertForExcelExport = false;
bConvertSystemToSystem = false;
//! All keywords MUST be UPPERCASE!
sKeyword[NF_KEY_E] = "E"; // Exponent
@@ -1580,7 +1581,10 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString )
pLoc = pFormatter->GetLocaleData();
//! init new keywords
InitKeywords();
- bNewDateOrder = (eOldDateOrder != pLoc->getDateOrder());
+ // Adapt date order to target locale, but Excel does not handle date
+ // particle re-ordering for the target locale when loading documents,
+ // though it does exchange separators, tdf#113889
+ bNewDateOrder = (!mbConvertForExcelExport && eOldDateOrder != pLoc->getDateOrder());
}
const CharClass* pChrCls = pFormatter->GetCharClass();
diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx
index 13d5b1a..5e5d981 100644
--- a/svl/source/numbers/zforscan.hxx
+++ b/svl/source/numbers/zforscan.hxx
@@ -124,12 +124,13 @@ public:
}
void SetConvertMode(LanguageType eTmpLge, LanguageType eNewLge,
- bool bSystemToSystem = false )
+ bool bSystemToSystem = false, bool bForExcelExport = false)
{
bConvertMode = true;
eNewLnge = eNewLge;
eTmpLnge = eTmpLge;
bConvertSystemToSystem = bSystemToSystem;
+ mbConvertForExcelExport = bForExcelExport;
}
// Only changes the bool variable, in order to temporarily pause the convert mode
void SetConvertMode(bool bMode) { bConvertMode = bMode; }
@@ -183,6 +184,7 @@ private: // Private section
OUString sErrStr; // String for error output
bool bConvertMode; // Set in the convert mode
+ bool mbConvertForExcelExport; // Set in the convert mode whether to convert for Excel export
LanguageType eNewLnge; // Language/country which the scanned string is converted to (for Excel filter)
LanguageType eTmpLnge; // Language/country which the scanned string is converted from (for Excel filter)
--
cgit v1.1

@ -1,14 +0,0 @@
# Calculate format=diff
diff --git a/otp_src_R15B03/erts/configure b/otp_src_R15B03/erts/configure
index 166f716..d01d32f 100755
--- a/otp_src_R15B03/erts/configure
+++ b/otp_src_R15B03/erts/configure
@@ -18337,7 +18337,7 @@ TERMCAP_LIB=
if test "x$with_termcap" != "xno" &&
test "X$host" != "Xwin32"; then
# try these libs
- termcap_libs="ncurses curses termcap termlib"
+ termcap_libs="tinfo ncurses curses termcap termlib"
for termcap_lib in $termcap_libs; do
as_ac_Lib=`echo "ac_cv_lib_$termcap_lib''_tgetent" | $as_tr_sh`

@ -1,16 +0,0 @@
# Calculate format=diff
diff --git a/ace/os_include/os_sched.h b/ace/os_include/os_sched.h
index f06541b..6d0c07d 100644
--- a/ace/os_include/os_sched.h
+++ b/ace/os_include/os_sched.h
@@ -41,10 +41,6 @@ extern "C"
typedef cpuset_t cpu_set_t;
#else
# define ACE_CPU_SETSIZE 1024
- typedef struct
- {
- ACE_UINT32 bit_array_[ACE_CPU_SETSIZE / (8 * sizeof (ACE_UINT32))];
- } cpu_set_t;
#endif
#endif /* !ACE_HAS_CPU_SET_T || !__cpu_set_t_defined */

@ -1,37 +0,0 @@
# Calculate format=diff merge(dev-libs/efl)<1.22
From 0d2b624f1e24240a1c4e651aa1cfe9a8dd10a573 Mon Sep 17 00:00:00 2001
From: "Carsten Haitzler (Rasterman)" <raster@rasterman.com>
Date: Sat, 15 Dec 2018 16:19:01 +0000
Subject: evas gl - make GLintptr etc. also ndefed for GL_VERSION_1_5 fix
typedef
It seems that GL_VERSION_1_5 define == these provided by gl already. At
least reading the mesa headers I do, so this should fix T7502
@fix
---
src/lib/evas/Evas_GL.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'src/lib/evas/Evas_GL.h')
diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h
index b6b642400f..4f67b1695f 100644
--- a/src/lib/evas/Evas_GL.h
+++ b/src/lib/evas/Evas_GL.h
@@ -4272,9 +4272,11 @@ typedef signed int GLfixed; // Changed khronos_int32_t
#ifndef GL_ES_VERSION_2_0
/* GL types for handling large vertex buffer objects */
-#include <stddef.h>
+# ifndef GL_VERSION_1_5
+# include <stddef.h>
typedef ptrdiff_t GLintptr; // Changed khronos_intptr_t
typedef ptrdiff_t GLsizeiptr; // Changed khronos_ssize_t
+# endif
#endif
/* Some definitions from GLES 3.0.
--
cgit v1.2.1

@ -1,14 +0,0 @@
# Calculate format=diff merge(dev-libs/libqtxdg)=>3.2.0,3.2.1
diff --git a/qtxdg/xdgmenuwidget.cpp b/qtxdg/xdgmenuwidget.cpp
index 3756b34..b4be855 100644
--- a/qtxdg/xdgmenuwidget.cpp
+++ b/qtxdg/xdgmenuwidget.cpp
@@ -170,7 +170,7 @@ void XdgMenuWidgetPrivate::mouseMoveEvent(QMouseEvent *event)
return;
QList<QUrl> urls;
- urls << QUrl(a->desktopFile().fileName());
+ urls << QUrl::fromLocalFile(a->desktopFile().fileName());
QMimeData *mimeData = new QMimeData();
mimeData->setUrls(urls);

@ -1,37 +0,0 @@
# Calculate format=diff
diff --git a/transport/http.py b/transport/http.py
index e2a2717..ee539c9 100644
--- a/transport/http.py
+++ b/transport/http.py
@@ -304,7 +304,7 @@ class HttpTransport(Transport):
# the workaround breaks things on other systems, so it is applied
# on an on-demand basis
log.warning("Activating SSL workaround")
- CheckingHTTPSConnection.FORCE_SSL_VERSION = ssl.PROTOCOL_SSLv3
+ CheckingHTTPSConnection.FORCE_SSL_VERSION = ssl.PROTOCOL_SSLv23
elif "ASN1_item_verify:unknown message digest algorithm" in str(e):
# this bug was reported but is present for now
# see: http://bugs.python.org/issue8484
diff --git a/transport/pyopenssl_wrapper.py b/transport/pyopenssl_wrapper.py
index 790b6d9..35fd8bd 100644
--- a/transport/pyopenssl_wrapper.py
+++ b/transport/pyopenssl_wrapper.py
@@ -11,8 +11,8 @@ import _ssl # if we can't import it, let the error propagate
from _ssl import SSLError
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
-from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
-from _ssl import RAND_status, RAND_egd, RAND_add
+from _ssl import PROTOCOL_SSLv23, PROTOCOL_TLSv1
+from _ssl import RAND_status, RAND_add
from _ssl import \
SSL_ERROR_ZERO_RETURN, \
SSL_ERROR_WANT_READ, \
@@ -39,7 +39,6 @@ _ssl_to_openssl_cert_op_remap = {
}
_ssl_to_openssl_version_remap = {
- PROTOCOL_SSLv3: OpenSSL.SSL.SSLv3_METHOD,
PROTOCOL_SSLv23: OpenSSL.SSL.SSLv23_METHOD,
PROTOCOL_TLSv1: OpenSSL.SSL.TLSv1_METHOD,
}

@ -1,31 +0,0 @@
# Calculate format=diff merge(kde-apps/umbrello)=>18.08.3,18.08.4
From 62a9e5e6afdd920779f1211afb0381857659e578 Mon Sep 17 00:00:00 2001
From: Ralf Habacker <ralf.habacker@freenet.de>
Date: Thu, 6 Dec 2018 13:36:34 +0100
Subject: [PATCH] Fix KDE CI compile error with Qt 5.10 on linux
The error was "specialization of template<class T>
struct QMetaTypeId in different namespace [-fpermissive]"
The Qt 5.10 related issue is fixed by using another approach
to exclude KF5 class KAboutData.
---
umbrello/main.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/umbrello/main.cpp b/umbrello/main.cpp
index e3315fa09..9d2acd820 100644
--- a/umbrello/main.cpp
+++ b/umbrello/main.cpp
@@ -19,9 +19,8 @@
// kde includes
#if QT_VERSION > 0x050000
-namespace dummy {
-#include <kaboutdata.h>
-}
+// prevent including of <kaboutdata.h>
+#define KABOUTDATA_H
#include <k4aboutdata.h>
#define KAboutData K4AboutData
#include <KCrash>

@ -1,18 +0,0 @@
# Calculate format=diff
diff --git a/kdeui/icons/kiconloader.cpp b/kdeui/icons/kiconloader.cpp
index ef54230..af3ef94 100644
--- a/kdeui/icons/kiconloader.cpp
+++ b/kdeui/icons/kiconloader.cpp
@@ -1041,6 +1041,10 @@ K3Icon KIconLoaderPrivate::findMatchingIcon(const QString& name, int size) const
}
#endif
if (genericFallback)
+ {
+ // restore genericFallback flag
+ genericFallback = name.endsWith(QLatin1String("-x-generic"));
// we already tested the base name
break;
+ }
int rindex = currentName.lastIndexOf('-');
if (rindex > 1) { // > 1 so that we don't split x-content or x-epoc

@ -1,20 +0,0 @@
# Calculate format=diff
--- kdelibs-4.3.1.orig/kdecore/services/kfoldermimetype.cpp
+++ kdelibs-4.3.1/kdecore/services/kfoldermimetype.cpp
@@ -77,11 +77,11 @@ QString KFolderMimeTypePrivate::iconName( const KUrl& _url ) const
// There are also other directories with 0 size, such as /proc, that may
// be mounted, but those are unlikely to contain .directory (and checking
// this would require KMountPoint from kio).
- KDE_struct_stat buff;
- if (KDE_stat( QFile::encodeName( _url.toLocalFile()), &buff ) == 0
- && S_ISDIR( buff.st_mode ) && buff.st_size == 0 ) {
- return KMimeTypePrivate::iconName( _url );
- }
+ //KDE_struct_stat buff;
+ //if (KDE_stat( QFile::encodeName( _url.toLocalFile()), &buff ) == 0
+ // && S_ISDIR( buff.st_mode ) && buff.st_size == 0 ) {
+ // return KMimeTypePrivate::iconName( _url );
+ //}
KUrl u( _url );
u.addPath( ".directory" );

@ -1,13 +0,0 @@
# Calculate format=diff
diff --git a/wayland_server.cpp b/wayland_server.cpp
index 3f273ca..837be8b 100644
--- a/wayland_server.cpp
+++ b/wayland_server.cpp
@@ -34,6 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Server
#include <KWayland/Server/compositor_interface.h>
#include <KWayland/Server/datadevicemanager_interface.h>
+#include <KWayland/Server/datasource_interface.h>
#include <KWayland/Server/display.h>
#include <KWayland/Server/dpms_interface.h>
#include <KWayland/Server/idle_interface.h>

@ -1,20 +0,0 @@
# Calculate format=diff
diff --git a/lxqt-config-monitor/monitor.h b/lxqt-config-monitor/monitor.h
index 01d313c..6674fbe 100644
--- a/lxqt-config-monitor/monitor.h
+++ b/lxqt-config-monitor/monitor.h
@@ -20,6 +20,7 @@
#ifndef _MONITOR_H_
#define _MONITOR_H_
+#include <QObject>
#include <QStringList>
#include <QHash>
#include <QList>
@@ -79,4 +80,4 @@ public:
/**Gets size from string rate. String rate format is "widthxheight". Example: 800x600*/
QSize sizeFromString(QString str);
-#endif // _MONITOR_H_
\ No newline at end of file
+#endif // _MONITOR_H_

@ -1,63 +0,0 @@
# Calculate format=diff
--- clamsmtp-1.10/common/usuals.h 2007-05-27 01:57:56.000000000 +0200
+++ clamsmtp-patched/common/usuals.h 2015-03-01 16:48:10.684201573 +0100
@@ -39,10 +39,10 @@
#ifndef __USUALS_H__
#define __USUALS_H__
-#include <sys/types.h>
-
#include "config.h"
+#include <sys/types.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
diff -Nru clamsmtp-1.10/configure.in clamsmtp-patched/configure.in
--- clamsmtp-1.10/configure.in 2008-06-30 19:01:48.000000000 +0200
+++ clamsmtp-patched/configure.in 2015-03-01 16:40:02.278986882 +0100
@@ -51,6 +51,8 @@
AC_PROG_LN_S
AC_PROG_MAKE_SET
+AC_USE_SYSTEM_EXTENSIONS
+
# Debug mode
AC_ARG_ENABLE(debug,=20
AC_HELP_STRING([--enable-debug],
diff -Nru clamsmtp-1.10/common/smtppass.c clamsmtp-patched/common/smtppass.c
--- clamsmtp-1.10/common/smtppass.c 2015-03-02 09:36:27.793398352 +0100
+++ clamsmtp-patched/common/smtppass.c 2015-03-02 09:38:50.843467581 +0100
@@ -38,6 +38,8 @@
* Olivier Beyssac <ob@r14.freenix.org>
*/
+#include "usuals.h"
+
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -58,17 +58,15 @@
#include <pwd.h>
#include <time.h>
-#include "usuals.h"
-
-#ifdef LINUX_TRANSPARENT_PROXY
-#include <linux/netfilter_ipv4.h>
-#endif
-
#include "compat.h"
#include "sock_any.h"
#include "stringx.h"
#include "sppriv.h"
+#ifdef LINUX_TRANSPARENT_PROXY
+#include <linux/netfilter_ipv4.h>
+#endif
+
/* -----------------------------------------------------------------------
* STRUCTURES
*/

@ -1,14 +0,0 @@
# Calculate format=diff merge(media-gfx/darktable)==2.6.0&&os_install_arch_machine==i686
diff --git a/src/iop/filmic.c b/src/iop/filmic.c
index fd6a176..99096ca 100644
--- a/src/iop/filmic.c
+++ b/src/iop/filmic.c
@@ -584,7 +584,7 @@ void process_sse2(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, c
}
- rgb = luma + _mm_set1_ps(concavity) * (rgb - luma);
+ rgb = _mm_set1_ps(luma) + _mm_set1_ps(concavity) * (rgb - _mm_set1_ps(luma));
rgb = _mm_max_ps(rgb, zero);
rgb = _mm_min_ps(rgb, one);

@ -1,28 +0,0 @@
# Calculate format=diff merge(media-gfx/gimp)>=2.8.6
diff --git a/app/config/gimpguiconfig.c b/app/config/gimpguiconfig.c
index a1fc464..223762c 100644
--- a/app/config/gimpguiconfig.c
+++ b/app/config/gimpguiconfig.c
@@ -197,7 +197,7 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TOOLBOX_WILBER,
"toolbox-wilber",
TOOLBOX_WILBER_BLURB,
- TRUE,
+ FALSE,
GIMP_PARAM_STATIC_STRINGS);
path = gimp_config_build_data_path ("themes");
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_THEME_PATH,
diff --git a/app/widgets/gimpcairo-wilber.c b/app/widgets/gimpcairo-wilber.c
index 62fe06f..d991adb 100644
--- a/app/widgets/gimpcairo-wilber.c
+++ b/app/widgets/gimpcairo-wilber.c
@@ -37,8 +37,7 @@
* It works best if you combine all paths into one. Inkscape has a
* function to do that.
*/
-static const gchar wilber_path[] =
- "M 509.72445,438.68864 C 501.47706,469.77945 464.95038,491.54566 431.85915,497.74874 C 438.5216,503.01688 442.87782,511.227 442.87782,520.37375 C 442.87783,536.24746 429.95607,549.0223 414.08235,549.0223 C 398.20863,549.0223 385.28688,536.24746 385.28688,520.37375 C 385.28688,511.52403 389.27666,503.61286 395.57098,498.3364 C 359.36952,495.90384 343.70976,463.95812 343.70975,463.95814 L 342.68134,509.64891 C 342.68134,514.35021 342.08391,519.96098 340.18378,528.3072 C 339.84664,527.80364 339.51399,527.33515 339.15537,526.83804 C 330.25511,514.5011 317.25269,507.81431 306.39317,508.76741 C 302.77334,509.08511 299.47017,510.33348 296.54982,512.4403 C 284.86847,520.86757 284.97665,540.94721 296.84366,557.3965 C 306.96274,571.42287 322.32232,578.25612 333.8664,574.73254 C 391.94635,615.17624 532.16931,642.41915 509.72445,438.68864 z M 363.24953,501.1278 C 373.83202,501.12778 382.49549,509.79127 382.49549,520.37375 C 382.49549,530.95624 373.83201,539.47279 363.24953,539.47279 C 352.66706,539.47279 344.1505,530.95624 344.1505,520.37375 C 344.15049,509.79129 352.66706,501.1278 363.24953,501.1278 z M 305.80551,516.1132 C 311.68466,516.11318 316.38344,521.83985 316.38344,528.89486 C 316.38345,535.94982 311.68467,541.67652 305.80551,541.67652 C 299.92636,541.67652 295.08067,535.94987 295.08067,528.89486 C 295.08065,521.83985 299.92636,516.1132 305.80551,516.1132 z M 440.821,552.54828 C 440.821,552.54828 448.7504,554.02388 453.8965,559.45332 C 457.41881,563.16951 457.75208,569.15506 456.98172,577.37703 C 456.21143,573.8833 454.89571,571.76659 453.8965,569.29666 C 443.01388,582.47662 413.42981,583.08929 376.0312,569.88433 C 416.63248,578.00493 437.38806,570.56014 449.48903,561.2163 C 446.29383,557.08917 440.821,552.54828 440.821,552.54828 z M 434.64723,524.59684 C 434.64723,532.23974 428.44429,538.44268 420.80139,538.44268 C 413.15849,538.44268 406.95555,532.23974 406.95555,524.59684 C 406.95555,516.95394 413.15849,510.751 420.80139,510.751 C 428.44429,510.751 434.64723,516.95394 434.64723,524.59684 z M 378.00043,522.99931 C 378.00043,527.70264 374.18324,531.51984 369.47991,531.51984 C 364.77658,531.51984 360.95939,527.70264 360.95939,522.99931 C 360.95939,518.29599 364.77658,514.47879 369.47991,514.47879 C 374.18324,514.47879 378.00043,518.29599 378.00043,522.99931 z ";
+static const gchar wilber_path[] = "";
static cairo_path_t *wilber_cairo_path = NULL;
static gdouble wilber_x1, wilber_y1;

@ -1,77 +0,0 @@
# Calculate format=diff merge(media-gfx/nomacs)==3.8.0
commit 92a95cd288dd64829e33aeb5d8c6e9725219e6bd
Author: Raphael Kubo da Costa <rakuco@FreeBSD.org>
Date: Mon Jan 29 12:01:50 2018 +0100
cmake: Stop calling QT5_WRAP_CPP() when building quazip and libqpsd.
cmake/Utils.cmake already sets CMAKE_AUTOMOC to on.
Calling QT5_WRAP_CPP() used to be just redundant, as QUAZIP_MOC_SRC and
LIBQPSD_MOC_SRC were never actually added as source dependencies in
MacBuildTarget.cmake and UnixBuildTarget.cmake. In other words, CMake's own
automoc infrastructure was actually being used and the moc invocations from
QT5_WRAP_CPP() were not being made at all.
Starting with Qt 5.9.4, calling QT5_WRAP_CPP() disables the AUTOMOC property
on the macro's input files, which means neither CMake's automoc
infrastructure not QT5_WRAP_CPP()'s code were being used and we ended up
with several 'undefined reference to vtable' errors when linking.
diff --git a/ImageLounge/cmake/Mac.cmake b/ImageLounge/cmake/Mac.cmake
index 73c01430..14e9494d 100644
--- a/ImageLounge/cmake/Mac.cmake
+++ b/ImageLounge/cmake/Mac.cmake
@@ -104,7 +104,6 @@ unset(QUAZIP_LIBRARIES CACHE)
unset(QUAZIP_HEADERS CACHE)
unset(QUAZIP_SOURCES CACHE)
-unset(QUAZIP_MOCS CACHE)
unset(QT_ROOT CACHE)
if(ENABLE_QUAZIP)
@@ -123,9 +122,7 @@ if(ENABLE_QUAZIP)
file(GLOB QUAZIP_SOURCES "3rdparty/quazip-0.7/quazip/*.c" "3rdparty/quazip-0.7/quazip/*.cpp")
file(GLOB QUAZIP_HEADERS "3rdparty/quazip-0.7/quazip/*.h")
- file(GLOB QUAZIP_MOCS "3rdparty/quazip-0.7/quazip/*.h")
- QT5_WRAP_CPP(QUAZIP_MOC_SRC ${QUAZIP_MOCS})
add_definitions(-DWITH_QUAZIP)
endif(USE_SYSTEM_QUAZIP)
endif(ENABLE_QUAZIP)
@@ -134,5 +131,3 @@ endif(ENABLE_QUAZIP)
# add libqpsd
file(GLOB LIBQPSD_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.cpp")
file(GLOB LIBQPSD_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.h")
-file(GLOB LIBQPSD_MOCS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.h")
-QT5_WRAP_CPP(LIBQPSD_MOC_SRC ${LIBQPSD_MOCS})
diff --git a/ImageLounge/cmake/Unix.cmake b/ImageLounge/cmake/Unix.cmake
index 4cf2c0ec..5297d48c 100644
--- a/ImageLounge/cmake/Unix.cmake
+++ b/ImageLounge/cmake/Unix.cmake
@@ -97,7 +97,6 @@ unset(QUAZIP_LIBRARIES CACHE)
unset(QUAZIP_HEADERS CACHE)
unset(QUAZIP_SOURCES CACHE)
-unset(QUAZIP_MOCS CACHE)
unset(QT_ROOT CACHE)
if(ENABLE_QUAZIP)
@@ -116,9 +115,7 @@ if(ENABLE_QUAZIP)
file(GLOB QUAZIP_SOURCES "3rdparty/quazip-0.7/quazip/*.c" "3rdparty/quazip-0.7/quazip/*.cpp")
file(GLOB QUAZIP_HEADERS "3rdparty/quazip-0.7/quazip/*.h")
- file(GLOB QUAZIP_MOCS "3rdparty/quazip-0.7/quazip/*.h")
- QT5_WRAP_CPP(QUAZIP_MOC_SRC ${QUAZIP_MOCS})
add_definitions(-DWITH_QUAZIP)
endif(USE_SYSTEM_QUAZIP)
endif(ENABLE_QUAZIP)
@@ -132,6 +129,4 @@ IF(USE_SYSTEM_LIBQPSD)
ELSE()
file(GLOB LIBQPSD_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.cpp")
file(GLOB LIBQPSD_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.h")
- file(GLOB LIBQPSD_MOCS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.h")
- QT5_WRAP_CPP(LIBQPSD_MOC_SRC ${LIBQPSD_MOCS})
ENDIF(USE_SYSTEM_LIBQPSD)

@ -1,25 +0,0 @@
# Calculate format=diff merge(media-libs/allegro)=>5.2.4,5.2.5
commit fd29999446c0d29177b6902443c3732057cf4049
Author: Christian Mauduit (ufoot) <ufoot@ufoot.org>
Date: Sun Dec 23 09:10:27 2018 +0100
Added ifdef to prevent hard ref to glXCreateContextAttribsARB
diff --git a/src/x/xglx_config.c b/src/x/xglx_config.c
index eebe2a0a7..ab9636914 100644
--- a/src/x/xglx_config.c
+++ b/src/x/xglx_config.c
@@ -491,8 +491,12 @@ static GLXContext create_context_new(int ver, Display *dpy, GLXFBConfig fb,
GCCA_PROC _xglx_glXCreateContextAttribsARB = NULL;
if (ver >= 140) {
- /* GLX 1.4 should have this */
+ /* GLX 1.4 should have this, if it's defined, use it directly. */
+ /* OTOH it *could* be there but only available through dynamic loading. */
+ /* In that case, fallback to calling glxXGetProcAddress. */
+#ifdef glXCreateContextAttribsARB
_xglx_glXCreateContextAttribsARB = glXCreateContextAttribsARB;
+#endif // glXCreateContextAttribsARB
}
if (!_xglx_glXCreateContextAttribsARB) {
/* Load the extension manually. */

@ -1,45 +0,0 @@
# Calculate format=diff merge(media-libs/allegro)=>5.2.4,5.2.5
commit a40d30e21802ecf5c9382cf34af9b01bd3781e47
Author: Sebastian Krzyszkowiak <dos@dosowisko.net>
Date: Fri Dec 7 03:23:44 2018 +0100
opengl: fix compilation with Mesa 18.2.5 and later
Mesa headers have been updated and changed some defines that Allegro
is hackily relying on.
https://gitlab.freedesktop.org/mesa/mesa/commit/f7d42ee7d319256608ad60778f6787c140badada
diff --git a/include/allegro5/allegro_opengl.h b/include/allegro5/allegro_opengl.h
index 0f86a6768..652dd024e 100644
--- a/include/allegro5/allegro_opengl.h
+++ b/include/allegro5/allegro_opengl.h
@@ -103,10 +103,14 @@
/* HACK: Prevent both Mesa and SGI's broken headers from screwing us */
#define __glext_h_
+#define __gl_glext_h_
#define __glxext_h_
+#define __glx_glxext_h_
#include <GL/gl.h>
#undef __glext_h_
+#undef __gl_glext_h_
#undef __glxext_h_
+#undef __glx_glxext_h_
#endif /* ALLEGRO_MACOSX */
diff --git a/include/allegro5/opengl/GLext/glx_ext_defs.h b/include/allegro5/opengl/GLext/glx_ext_defs.h
index 49c502091..fba8aea5d 100644
--- a/include/allegro5/opengl/GLext/glx_ext_defs.h
+++ b/include/allegro5/opengl/GLext/glx_ext_defs.h
@@ -1,7 +1,9 @@
/* HACK: Prevent both Mesa and SGI's broken headers from screwing us */
#define __glxext_h_
+#define __glx_glxext_h_
#include <GL/glx.h>
#undef __glxext_h_
+#undef __glx_glxext_h_
#ifndef GLX_VERSION_1_3
#define _ALLEGRO_GLX_VERSION_1_3

@ -1,14 +0,0 @@
# Calculate format=diff merge(media-plugins/kodi-pvr-mediaportal-tvserver)=>2.4.19,2.5
diff --git a/src/lib/live555/liveMedia/include/Locale.hh b/src/lib/live555/liveMedia/include/Locale.hh
index b327948..44ea81c 100644
--- a/src/lib/live555/liveMedia/include/Locale.hh
+++ b/src/lib/live555/liveMedia/include/Locale.hh
@@ -43,7 +43,7 @@ along with this library; if not, write to the Free Software Foundation, Inc.,
#ifndef LOCALE_NOT_USED
#include <locale.h>
-#ifndef XLOCALE_NOT_USED
+#if !defined(XLOCALE_NOT_USED) && (!defined(__GLIBC__) || !defined(__GLIBC_MINOR__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 26))
#include <xlocale.h> // because, on some systems, <locale.h> doesn't include <xlocale.h>; this makes sure that we get both
#endif
#endif

@ -1,13 +0,0 @@
# Calculate format=diff merge(media-plugins/kodi-pvr-stalker)=>2.8.6,2.9
diff --git a/src/CWatchdog.h b/src/CWatchdog.h
index c465e91..239d95d 100644
--- a/src/CWatchdog.h
+++ b/src/CWatchdog.h
@@ -22,6 +22,7 @@
*/
#include <thread>
+#include <functional>
#include "SAPI.h"

@ -1,20 +0,0 @@
# Calculate format=diff
commit 2d1b425493797b24bca9e190f9b57fb694a04f2e
Author: Jacob Henner <code@ventricle.us>
Date: Tue Mar 14 13:23:16 2017 -0400
Fixes #5660 - compile error
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2243d4481..f0a8a569b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1199,7 +1199,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/version.h)
-qt4_wrap_cpp(MOC ${HEADERS})
+qt4_wrap_cpp(MOC ${HEADERS} OPTIONS "-D_SYS_SYSMACROS_H_OUTER")
qt4_wrap_ui(UIC ${UI})
qt4_add_resources(QRC ${RESOURCES})

@ -1,3 +0,0 @@
# Calculate append=skip
Модуль взят из репозитория https://github.com/processone/ejabberd-contrib.
Необходим для работы сохраниения переписки ejabberd.

@ -1,278 +0,0 @@
# Calculate format=diff merge(net-im/ejabberd)=>16.01,16.02
diff --git a/src/mod_logxml.erl b/src/mod_logxml.erl
new file mode 100644
index 0000000..ac822c1
--- /dev/null
+++ b/src/mod_logxml.erl
@@ -0,0 +1,271 @@
+%%%----------------------------------------------------------------------
+%%% File : mod_logxml.erl
+%%% Author : Badlop
+%%% Purpose : Log XMPP packets to XML file
+%%% Created :
+%%% Id :
+%%%----------------------------------------------------------------------
+
+-module(mod_logxml).
+-author('badlop@ono.com').
+
+-behaviour(gen_mod).
+
+-export([start/2, init/7, stop/1,
+ send_packet/4, receive_packet/5]).
+
+-include("ejabberd.hrl").
+-include("jlib.hrl").
+
+-define(PROCNAME, ejabberd_mod_logxml).
+
+%% -------------------
+%% Module control
+%% -------------------
+
+start(Host, Opts) ->
+ Logdir = gen_mod:get_opt(logdir, Opts, fun(A) -> A end, "/tmp/jabberlogs/"),
+
+ Rd = gen_mod:get_opt(rotate_days, Opts, fun(A) -> A end, 1),
+ Rf = case gen_mod:get_opt(rotate_megs, Opts, fun(A) -> A end, 10) of
+ no -> no;
+ Rf1 -> Rf1*1024*1024
+ end,
+ Rp = case gen_mod:get_opt(rotate_kpackets, Opts, fun(A) -> A end, 10) of
+ no -> no;
+ Rp1 -> Rp1*1000
+ end,
+ RotateO = {Rd, Rf, Rp},
+ CheckRKP = gen_mod:get_opt(check_rotate_kpackets, Opts, fun(A) -> A end, 1),
+
+ Timezone = gen_mod:get_opt(timezone, Opts, fun(A) -> A end, local),
+
+ Orientation = gen_mod:get_opt(orientation, Opts, fun(A) -> A end, [send, recv]),
+ Stanza = gen_mod:get_opt(stanza, Opts, fun(A) -> A end, [iq, message, presence, other]),
+ Direction = gen_mod:get_opt(direction, Opts, fun(A) -> A end, [internal, vhosts, external]),
+ FilterO = {
+ {orientation, Orientation},
+ {stanza, Stanza},
+ {direction, Direction}},
+ ShowIP = gen_mod:get_opt(show_ip, Opts, fun(A) -> A end, false),
+
+ ejabberd_hooks:add(user_send_packet, Host, ?MODULE, send_packet, 90),
+ ejabberd_hooks:add(user_receive_packet, Host, ?MODULE, receive_packet, 90),
+ register(gen_mod:get_module_proc(Host, ?PROCNAME),
+ spawn(?MODULE, init, [binary_to_list(Host), Logdir, RotateO, CheckRKP,
+ Timezone, ShowIP, FilterO])).
+
+stop(Host) ->
+ ejabberd_hooks:delete(user_send_packet, Host, ?MODULE, send_packet, 90),
+ ejabberd_hooks:delete(user_receive_packet, Host, ?MODULE, receive_packet, 90),
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! stop,
+ {wait, Proc}.
+
+init(Host, Logdir, RotateO, CheckRKP, Timezone, ShowIP, FilterO) ->
+ {IoDevice, Filename, Gregorian_day} = open_file(Logdir, Host, Timezone),
+ loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, 0, Gregorian_day,
+ Timezone, ShowIP, FilterO).
+
+%% -------------------
+%% Main
+%% -------------------
+
+manage_rotate(Host, IoDevice, Filename, Logdir, RotateO, PacketC,
+ Gregorian_day_log, Timezone) ->
+ {RO_days, RO_size, RO_packets} = RotateO,
+
+ Rotate1 = case RO_packets of
+ no -> false;
+ PacketC -> true;
+ _ -> false
+ end,
+
+ Filesize = filelib:file_size(Filename),
+ Rotate2 = if
+ RO_size == no -> false;
+ Filesize >= RO_size -> true;
+ true -> false
+ end,
+
+ Gregorian_day_today = get_gregorian_day(),
+ Rotate3 = if
+ RO_days == no -> false;
+ (Gregorian_day_today - Gregorian_day_log) >= RO_days ->
+ true;
+ true -> false
+ end,
+
+ case lists:any(fun(E) -> E end, [Rotate1, Rotate2, Rotate3]) of
+ true ->
+ {IoDevice2, Filename2, Gregorian_day2} =
+ rotate_log(IoDevice, Logdir, Host, Timezone),
+ {IoDevice2, Filename2, Gregorian_day2, 0};
+ false ->
+ {IoDevice, Filename, Gregorian_day_log, PacketC+1}
+ end.
+
+filter(FilterO, E) ->
+ {{orientation, OrientationO},{stanza, StanzaO},{direction, DirectionO}} =
+ FilterO,
+ {Orientation, From, To, Packet} = E,
+
+ {xmlel, Stanza_str, _Attrs, _Els} = Packet,
+ Stanza = list_to_atom(binary_to_list(Stanza_str)),
+
+ Hosts_all = ejabberd_config:get_global_option(hosts, fun(A) -> A end),
+ {Host_local, Host_remote} = case Orientation of
+ send -> {From#jid.lserver, To#jid.lserver};
+ recv -> {To#jid.lserver, From#jid.lserver}
+ end,
+ Direction = case Host_remote of
+ Host_local -> internal;
+ _ ->
+ case lists:member(Host_remote, Hosts_all) of
+ true -> vhosts;
+ false -> external
+ end
+ end,
+
+ {lists:all(fun(O) -> O end,
+ [lists:member(Orientation, OrientationO),
+ lists:member(Stanza, StanzaO),
+ lists:member(Direction, DirectionO)]),
+ {Orientation, Stanza, Direction}}.
+
+loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, PacketC,
+ Gregorian_day, Timezone, ShowIP, FilterO) ->
+ receive
+ {addlog, E} ->
+ {IoDevice3, Filename3, Gregorian_day3, PacketC3} =
+ case filter(FilterO, E) of
+ {true, OSD} ->
+ Div = calc_div(PacketC, CheckRKP),
+ {IoDevice2, Filename2, Gregorian_day2, PacketC2} =
+ case Div==round(Div) of
+ true ->
+ manage_rotate(Host, IoDevice, Filename,
+ Logdir, RotateO, PacketC,
+ Gregorian_day, Timezone);
+ false ->
+ {IoDevice, Filename, Gregorian_day,
+ PacketC+1}
+ end,
+ add_log(IoDevice2, Timezone, ShowIP, E, OSD),
+ {IoDevice2, Filename2, Gregorian_day2, PacketC2};
+ _ ->
+ {IoDevice, Filename, Gregorian_day, PacketC}
+ end,
+ loop(Host, IoDevice3, Filename3, Logdir, CheckRKP, RotateO,
+ PacketC3, Gregorian_day3, Timezone, ShowIP, FilterO);
+ stop ->
+ close_file(IoDevice),
+ ok;
+ _ ->
+ loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, PacketC,
+ Gregorian_day, Timezone, ShowIP, FilterO)
+ end.
+
+send_packet(P, _C2SState, FromJID, ToJID) ->
+ Host = FromJID#jid.lserver,
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! {addlog, {send, FromJID, ToJID, P}},
+ P.
+
+receive_packet(P, _C2SState, _JID, From, To) ->
+ Host = To#jid.lserver,
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! {addlog, {recv, From, To, P}},
+ P.
+
+add_log(Io, Timezone, ShowIP, {Orientation, From, To, Packet}, _OSD) ->
+ %%{Orientation, Stanza, Direction} = OSD,
+ LocalJID = case Orientation of
+ send -> From;
+ recv -> To
+ end,
+ LocalIPS = case ShowIP of
+ true ->
+ case ejabberd_sm:get_user_ip(
+ LocalJID#jid.user,
+ LocalJID#jid.server,
+ LocalJID#jid.resource) of
+ {UserIP, _Port} ->
+ io_lib:format("lip=\"~s\" ", [inet_parse:ntoa(UserIP)]);
+ undefined -> "lip=\"undefined\" "
+ end;
+ false -> ""
+ end,
+ TimestampISO = get_now_iso(Timezone),
+ io:fwrite(Io, "<packet or=\"~p\" ljid=\"~s\" ~sts=\"~s\">~s</packet>~n",
+ [Orientation, jlib:jid_to_string(LocalJID), LocalIPS,
+ TimestampISO, binary_to_list(xml:element_to_binary(Packet))]).
+
+%% -------------------
+%% File
+%% -------------------
+
+open_file(Logdir, Host, Timezone) ->
+ TimeStamp = get_now_iso(Timezone),
+ Year = string:substr(TimeStamp, 1, 4),
+ Month = string:substr(TimeStamp, 5, 2),
+ Day = string:substr(TimeStamp, 7, 2),
+ Hour = string:substr(TimeStamp, 10, 2),
+ Min = string:substr(TimeStamp, 13, 2),
+ Sec = string:substr(TimeStamp, 16, 2),
+ S = "-",
+ Logname = lists:flatten([Host,S,Year,S,Month,S,Day,S,Hour,S,Min,S,Sec,
+ ".xml"]),
+ Filename = filename:join([Logdir, Logname]),
+
+ Gregorian_day = get_gregorian_day(),
+
+ %% Open file, create if it does not exist, create parent dirs if needed
+ case file:read_file_info(Filename) of
+ {ok, _} ->
+ {ok, IoDevice} = file:open(Filename, [append]);
+ {error, enoent} ->
+ make_dir_rec(Logdir),
+ {ok, IoDevice} = file:open(Filename, [append]),
+ io:fwrite(IoDevice, "~s~n", ["<?xml version=\"1.0\"?>"]),
+ io:fwrite(IoDevice, "~s~n", ["<?xml-stylesheet href=\"xmpp.xsl\" type=\"text/xsl\"?>"]),
+ io:fwrite(IoDevice, "~s~n", ["<log>"])
+ end,
+ {IoDevice, Filename, Gregorian_day}.
+
+close_file(IoDevice) ->
+ io:fwrite(IoDevice, "~s~n", ["</log>"]),
+ file:close(IoDevice).
+
+rotate_log(IoDevice, Logdir, Host, Timezone) ->
+ close_file(IoDevice),
+ open_file(Logdir, Host, Timezone).
+
+make_dir_rec(Dir) ->
+ case file:read_file_info(Dir) of
+ {ok, _} ->
+ ok;
+ {error, enoent} ->
+ DirS = filename:split(Dir),
+ DirR = lists:sublist(DirS, length(DirS)-1),
+ make_dir_rec(filename:join(DirR)),
+ file:make_dir(Dir)
+ end.
+
+%% -------------------
+%% Utils
+%% -------------------
+
+get_gregorian_day() -> calendar:date_to_gregorian_days(date()).
+
+get_now_iso(Timezone) ->
+ TimeStamp = case Timezone of
+ local -> calendar:now_to_local_time(now());
+ universal -> calendar:now_to_universal_time(now())
+ end,
+ binary_to_list(jlib:timestamp_to_iso(TimeStamp)).
+
+calc_div(A, B) when is_integer(A) and is_integer(B) and (B /= 0) ->
+ A/B;
+calc_div(_A, _B) ->
+ 0.5. %% This ensures that no rotation is performed

@ -1,278 +0,0 @@
# Calculate format=diff merge(net-im/ejabberd)=>16.02,16.04
diff --git a/src/mod_logxml.erl b/src/mod_logxml.erl
new file mode 100644
index 0000000..ac822c1
--- /dev/null
+++ b/src/mod_logxml.erl
@@ -0,0 +1,271 @@
+%%%----------------------------------------------------------------------
+%%% File : mod_logxml.erl
+%%% Author : Badlop
+%%% Purpose : Log XMPP packets to XML file
+%%% Created :
+%%% Id :
+%%%----------------------------------------------------------------------
+
+-module(mod_logxml).
+-author('badlop@ono.com').
+
+-behaviour(gen_mod).
+
+-export([start/2, init/7, stop/1,
+ send_packet/4, receive_packet/5]).
+
+-include("ejabberd.hrl").
+-include("jlib.hrl").
+
+-define(PROCNAME, ejabberd_mod_logxml).
+
+%% -------------------
+%% Module control
+%% -------------------
+
+start(Host, Opts) ->
+ Logdir = gen_mod:get_opt(logdir, Opts, fun(A) -> A end, "/tmp/jabberlogs/"),
+
+ Rd = gen_mod:get_opt(rotate_days, Opts, fun(A) -> A end, 1),
+ Rf = case gen_mod:get_opt(rotate_megs, Opts, fun(A) -> A end, 10) of
+ no -> no;
+ Rf1 -> Rf1*1024*1024
+ end,
+ Rp = case gen_mod:get_opt(rotate_kpackets, Opts, fun(A) -> A end, 10) of
+ no -> no;
+ Rp1 -> Rp1*1000
+ end,
+ RotateO = {Rd, Rf, Rp},
+ CheckRKP = gen_mod:get_opt(check_rotate_kpackets, Opts, fun(A) -> A end, 1),
+
+ Timezone = gen_mod:get_opt(timezone, Opts, fun(A) -> A end, local),
+
+ Orientation = gen_mod:get_opt(orientation, Opts, fun(A) -> A end, [send, recv]),
+ Stanza = gen_mod:get_opt(stanza, Opts, fun(A) -> A end, [iq, message, presence, other]),
+ Direction = gen_mod:get_opt(direction, Opts, fun(A) -> A end, [internal, vhosts, external]),
+ FilterO = {
+ {orientation, Orientation},
+ {stanza, Stanza},
+ {direction, Direction}},
+ ShowIP = gen_mod:get_opt(show_ip, Opts, fun(A) -> A end, false),
+
+ ejabberd_hooks:add(user_send_packet, Host, ?MODULE, send_packet, 90),
+ ejabberd_hooks:add(user_receive_packet, Host, ?MODULE, receive_packet, 90),
+ register(gen_mod:get_module_proc(Host, ?PROCNAME),
+ spawn(?MODULE, init, [binary_to_list(Host), Logdir, RotateO, CheckRKP,
+ Timezone, ShowIP, FilterO])).
+
+stop(Host) ->
+ ejabberd_hooks:delete(user_send_packet, Host, ?MODULE, send_packet, 90),
+ ejabberd_hooks:delete(user_receive_packet, Host, ?MODULE, receive_packet, 90),
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! stop,
+ {wait, Proc}.
+
+init(Host, Logdir, RotateO, CheckRKP, Timezone, ShowIP, FilterO) ->
+ {IoDevice, Filename, Gregorian_day} = open_file(Logdir, Host, Timezone),
+ loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, 0, Gregorian_day,
+ Timezone, ShowIP, FilterO).
+
+%% -------------------
+%% Main
+%% -------------------
+
+manage_rotate(Host, IoDevice, Filename, Logdir, RotateO, PacketC,
+ Gregorian_day_log, Timezone) ->
+ {RO_days, RO_size, RO_packets} = RotateO,
+
+ Rotate1 = case RO_packets of
+ no -> false;
+ PacketC -> true;
+ _ -> false
+ end,
+
+ Filesize = filelib:file_size(Filename),
+ Rotate2 = if
+ RO_size == no -> false;
+ Filesize >= RO_size -> true;
+ true -> false
+ end,
+
+ Gregorian_day_today = get_gregorian_day(),
+ Rotate3 = if
+ RO_days == no -> false;
+ (Gregorian_day_today - Gregorian_day_log) >= RO_days ->
+ true;
+ true -> false
+ end,
+
+ case lists:any(fun(E) -> E end, [Rotate1, Rotate2, Rotate3]) of
+ true ->
+ {IoDevice2, Filename2, Gregorian_day2} =
+ rotate_log(IoDevice, Logdir, Host, Timezone),
+ {IoDevice2, Filename2, Gregorian_day2, 0};
+ false ->
+ {IoDevice, Filename, Gregorian_day_log, PacketC+1}
+ end.
+
+filter(FilterO, E) ->
+ {{orientation, OrientationO},{stanza, StanzaO},{direction, DirectionO}} =
+ FilterO,
+ {Orientation, From, To, Packet} = E,
+
+ {xmlel, Stanza_str, _Attrs, _Els} = Packet,
+ Stanza = list_to_atom(binary_to_list(Stanza_str)),
+
+ Hosts_all = ejabberd_config:get_global_option(hosts, fun(A) -> A end),
+ {Host_local, Host_remote} = case Orientation of
+ send -> {From#jid.lserver, To#jid.lserver};
+ recv -> {To#jid.lserver, From#jid.lserver}
+ end,
+ Direction = case Host_remote of
+ Host_local -> internal;
+ _ ->
+ case lists:member(Host_remote, Hosts_all) of
+ true -> vhosts;
+ false -> external
+ end
+ end,
+
+ {lists:all(fun(O) -> O end,
+ [lists:member(Orientation, OrientationO),
+ lists:member(Stanza, StanzaO),
+ lists:member(Direction, DirectionO)]),
+ {Orientation, Stanza, Direction}}.
+
+loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, PacketC,
+ Gregorian_day, Timezone, ShowIP, FilterO) ->
+ receive
+ {addlog, E} ->
+ {IoDevice3, Filename3, Gregorian_day3, PacketC3} =
+ case filter(FilterO, E) of
+ {true, OSD} ->
+ Div = calc_div(PacketC, CheckRKP),
+ {IoDevice2, Filename2, Gregorian_day2, PacketC2} =
+ case Div==round(Div) of
+ true ->
+ manage_rotate(Host, IoDevice, Filename,
+ Logdir, RotateO, PacketC,
+ Gregorian_day, Timezone);
+ false ->
+ {IoDevice, Filename, Gregorian_day,
+ PacketC+1}
+ end,
+ add_log(IoDevice2, Timezone, ShowIP, E, OSD),
+ {IoDevice2, Filename2, Gregorian_day2, PacketC2};
+ _ ->
+ {IoDevice, Filename, Gregorian_day, PacketC}
+ end,
+ loop(Host, IoDevice3, Filename3, Logdir, CheckRKP, RotateO,
+ PacketC3, Gregorian_day3, Timezone, ShowIP, FilterO);
+ stop ->
+ close_file(IoDevice),
+ ok;
+ _ ->
+ loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, PacketC,
+ Gregorian_day, Timezone, ShowIP, FilterO)
+ end.
+
+send_packet(P, _C2SState, FromJID, ToJID) ->
+ Host = FromJID#jid.lserver,
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! {addlog, {send, FromJID, ToJID, P}},
+ P.
+
+receive_packet(P, _C2SState, _JID, From, To) ->
+ Host = To#jid.lserver,
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! {addlog, {recv, From, To, P}},
+ P.
+
+add_log(Io, Timezone, ShowIP, {Orientation, From, To, Packet}, _OSD) ->
+ %%{Orientation, Stanza, Direction} = OSD,
+ LocalJID = case Orientation of
+ send -> From;
+ recv -> To
+ end,
+ LocalIPS = case ShowIP of
+ true ->
+ case ejabberd_sm:get_user_ip(
+ LocalJID#jid.user,
+ LocalJID#jid.server,
+ LocalJID#jid.resource) of
+ {UserIP, _Port} ->
+ io_lib:format("lip=\"~s\" ", [inet_parse:ntoa(UserIP)]);
+ undefined -> "lip=\"undefined\" "
+ end;
+ false -> ""
+ end,
+ TimestampISO = get_now_iso(Timezone),
+ io:fwrite(Io, "<packet or=\"~p\" ljid=\"~s\" ~sts=\"~s\">~s</packet>~n",
+ [Orientation, jlib:jid_to_string(LocalJID), LocalIPS,
+ TimestampISO, binary_to_list(fxml:element_to_binary(Packet))]).
+
+%% -------------------
+%% File
+%% -------------------
+
+open_file(Logdir, Host, Timezone) ->
+ TimeStamp = get_now_iso(Timezone),
+ Year = string:substr(TimeStamp, 1, 4),
+ Month = string:substr(TimeStamp, 5, 2),
+ Day = string:substr(TimeStamp, 7, 2),
+ Hour = string:substr(TimeStamp, 10, 2),
+ Min = string:substr(TimeStamp, 13, 2),
+ Sec = string:substr(TimeStamp, 16, 2),
+ S = "-",
+ Logname = lists:flatten([Host,S,Year,S,Month,S,Day,S,Hour,S,Min,S,Sec,
+ ".xml"]),
+ Filename = filename:join([Logdir, Logname]),
+
+ Gregorian_day = get_gregorian_day(),
+
+ %% Open file, create if it does not exist, create parent dirs if needed
+ case file:read_file_info(Filename) of
+ {ok, _} ->
+ {ok, IoDevice} = file:open(Filename, [append]);
+ {error, enoent} ->
+ make_dir_rec(Logdir),
+ {ok, IoDevice} = file:open(Filename, [append]),
+ io:fwrite(IoDevice, "~s~n", ["<?xml version=\"1.0\"?>"]),
+ io:fwrite(IoDevice, "~s~n", ["<?xml-stylesheet href=\"xmpp.xsl\" type=\"text/xsl\"?>"]),
+ io:fwrite(IoDevice, "~s~n", ["<log>"])
+ end,
+ {IoDevice, Filename, Gregorian_day}.
+
+close_file(IoDevice) ->
+ io:fwrite(IoDevice, "~s~n", ["</log>"]),
+ file:close(IoDevice).
+
+rotate_log(IoDevice, Logdir, Host, Timezone) ->
+ close_file(IoDevice),
+ open_file(Logdir, Host, Timezone).
+
+make_dir_rec(Dir) ->
+ case file:read_file_info(Dir) of
+ {ok, _} ->
+ ok;
+ {error, enoent} ->
+ DirS = filename:split(Dir),
+ DirR = lists:sublist(DirS, length(DirS)-1),
+ make_dir_rec(filename:join(DirR)),
+ file:make_dir(Dir)
+ end.
+
+%% -------------------
+%% Utils
+%% -------------------
+
+get_gregorian_day() -> calendar:date_to_gregorian_days(date()).
+
+get_now_iso(Timezone) ->
+ TimeStamp = case Timezone of
+ local -> calendar:now_to_local_time(now());
+ universal -> calendar:now_to_universal_time(now())
+ end,
+ binary_to_list(jlib:timestamp_to_legacy(TimeStamp)).
+
+calc_div(A, B) when is_integer(A) and is_integer(B) and (B /= 0) ->
+ A/B;
+calc_div(_A, _B) ->
+ 0.5. %% This ensures that no rotation is performed

@ -1,300 +0,0 @@
# Calculate format=diff merge(net-im/ejabberd)=>16.04,16.09
diff --git a/src/mod_logxml.erl b/src/mod_logxml.erl
new file mode 100644
index 0000000..ac822c1
--- /dev/null
+++ b/src/mod_logxml.erl
@@ -0,0 +1,271 @@
+%%%----------------------------------------------------------------------
+%%% File : mod_logxml.erl
+%%% Author : Badlop
+%%% Purpose : Log XMPP packets to XML file
+%%% Created :
+%%% Id :
+%%%----------------------------------------------------------------------
+
+-module(mod_logxml).
+-author('badlop@ono.com').
+
+-behaviour(gen_mod).
+
+-export([start/2, init/7, stop/1,
+ send_packet/4, receive_packet/5]).
+
+-include("ejabberd.hrl").
+-include("jlib.hrl").
+
+-define(PROCNAME, ejabberd_mod_logxml).
+
+%% -------------------
+%% Module control
+%% -------------------
+
+start(Host, Opts) ->
+ Logdir = gen_mod:get_opt(logdir, Opts, fun(A) -> A end, "/tmp/jabberlogs/"),
+
+ Rd = gen_mod:get_opt(rotate_days, Opts, fun(A) -> A end, 1),
+ Rf = case gen_mod:get_opt(rotate_megs, Opts, fun(A) -> A end, 10) of
+ no -> no;
+ Rf1 -> Rf1*1024*1024
+ end,
+ Rp = case gen_mod:get_opt(rotate_kpackets, Opts, fun(A) -> A end, 10) of
+ no -> no;
+ Rp1 -> Rp1*1000
+ end,
+ RotateO = {Rd, Rf, Rp},
+ CheckRKP = gen_mod:get_opt(check_rotate_kpackets, Opts, fun(A) -> A end, 1),
+
+ Timezone = gen_mod:get_opt(timezone, Opts, fun(A) -> A end, local),
+
+ Orientation = gen_mod:get_opt(orientation, Opts, fun(A) -> A end, [send, recv]),
+ Stanza = gen_mod:get_opt(stanza, Opts, fun(A) -> A end, [iq, message, presence, other]),
+ Direction = gen_mod:get_opt(direction, Opts, fun(A) -> A end, [internal, vhosts, external]),
+ FilterO = {
+ {orientation, Orientation},
+ {stanza, Stanza},
+ {direction, Direction}},
+ ShowIP = gen_mod:get_opt(show_ip, Opts, fun(A) -> A end, false),
+
+ ejabberd_hooks:add(user_send_packet, Host, ?MODULE, send_packet, 90),
+ ejabberd_hooks:add(user_receive_packet, Host, ?MODULE, receive_packet, 90),
+ register(gen_mod:get_module_proc(Host, ?PROCNAME),
+ spawn(?MODULE, init, [binary_to_list(Host), Logdir, RotateO, CheckRKP,
+ Timezone, ShowIP, FilterO])).
+
+stop(Host) ->
+ ejabberd_hooks:delete(user_send_packet, Host, ?MODULE, send_packet, 90),
+ ejabberd_hooks:delete(user_receive_packet, Host, ?MODULE, receive_packet, 90),
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! stop,
+ {wait, Proc}.
+
+init(Host, Logdir, RotateO, CheckRKP, Timezone, ShowIP, FilterO) ->
+ {IoDevice, Filename, Gregorian_day} = open_file(Logdir, Host, Timezone),
+ loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, 0, Gregorian_day,
+ Timezone, ShowIP, FilterO).
+
+%% -------------------
+%% Main
+%% -------------------
+
+manage_rotate(Host, IoDevice, Filename, Logdir, RotateO, PacketC,
+ Gregorian_day_log, Timezone) ->
+ {RO_days, RO_size, RO_packets} = RotateO,
+
+ Rotate1 = case RO_packets of
+ no -> false;
+ PacketC -> true;
+ _ -> false
+ end,
+
+ Filesize = filelib:file_size(Filename),
+ Rotate2 = if
+ RO_size == no -> false;
+ Filesize >= RO_size -> true;
+ true -> false
+ end,
+
+ Gregorian_day_today = get_gregorian_day(),
+ Rotate3 = if
+ RO_days == no -> false;
+ (Gregorian_day_today - Gregorian_day_log) >= RO_days ->
+ true;
+ true -> false
+ end,
+
+ case lists:any(fun(E) -> E end, [Rotate1, Rotate2, Rotate3]) of
+ true ->
+ {IoDevice2, Filename2, Gregorian_day2} =
+ rotate_log(IoDevice, Logdir, Host, Timezone),
+ {IoDevice2, Filename2, Gregorian_day2, 0};
+ false ->
+ {IoDevice, Filename, Gregorian_day_log, PacketC+1}
+ end.
+
+filter(FilterO, E) ->
+ {{orientation, OrientationO},{stanza, StanzaO},{direction, DirectionO}} =
+ FilterO,
+ {Orientation, From, To, Packet} = E,
+
+ {xmlel, Stanza_str, _Attrs, _Els} = Packet,
+ Stanza = list_to_atom(binary_to_list(Stanza_str)),
+
+ Hosts_all = ejabberd_config:get_global_option(hosts, fun(A) -> A end),
+ {Host_local, Host_remote} = case Orientation of
+ send -> {From#jid.lserver, To#jid.lserver};
+ recv -> {To#jid.lserver, From#jid.lserver}
+ end,
+ Direction = case Host_remote of
+ Host_local -> internal;
+ _ ->
+ case lists:member(Host_remote, Hosts_all) of
+ true -> vhosts;
+ false -> external
+ end
+ end,
+
+ {lists:all(fun(O) -> O end,
+ [lists:member(Orientation, OrientationO),
+ lists:member(Stanza, StanzaO),
+ lists:member(Direction, DirectionO)]),
+ {Orientation, Stanza, Direction}}.
+
+loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, PacketC,
+ Gregorian_day, Timezone, ShowIP, FilterO) ->
+ receive
+ {addlog, E} ->
+ {IoDevice3, Filename3, Gregorian_day3, PacketC3} =
+ case filter(FilterO, E) of
+ {true, OSD} ->
+ Div = calc_div(PacketC, CheckRKP),
+ {IoDevice2, Filename2, Gregorian_day2, PacketC2} =
+ case Div==round(Div) of
+ true ->
+ manage_rotate(Host, IoDevice, Filename,
+ Logdir, RotateO, PacketC,
+ Gregorian_day, Timezone);
+ false ->
+ {IoDevice, Filename, Gregorian_day,
+ PacketC+1}
+ end,
+ add_log(IoDevice2, Timezone, ShowIP, E, OSD),
+ {IoDevice2, Filename2, Gregorian_day2, PacketC2};
+ _ ->
+ {IoDevice, Filename, Gregorian_day, PacketC}
+ end,
+ loop(Host, IoDevice3, Filename3, Logdir, CheckRKP, RotateO,
+ PacketC3, Gregorian_day3, Timezone, ShowIP, FilterO);
+ stop ->
+ close_file(IoDevice),
+ ok;
+ _ ->
+ loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, PacketC,
+ Gregorian_day, Timezone, ShowIP, FilterO)
+ end.
+
+send_packet(P, _C2SState, FromJID, ToJID) ->
+ Host = FromJID#jid.lserver,
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! {addlog, {send, FromJID, ToJID, P}},
+ P.
+
+receive_packet(P, _C2SState, _JID, From, To) ->
+ Host = To#jid.lserver,
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! {addlog, {recv, From, To, P}},
+ P.
+
+add_log(Io, Timezone, ShowIP, {Orientation, From, To, Packet}, _OSD) ->
+ %%{Orientation, Stanza, Direction} = OSD,
+ LocalJID = case Orientation of
+ send -> From;
+ recv -> To
+ end,
+ LocalIPS = case ShowIP of
+ true ->
+ case ejabberd_sm:get_user_ip(
+ LocalJID#jid.user,
+ LocalJID#jid.server,
+ LocalJID#jid.resource) of
+ {UserIP, _Port} ->
+ io_lib:format("lip=\"~s\" ", [inet_parse:ntoa(UserIP)]);
+ undefined -> "lip=\"undefined\" "
+ end;
+ false -> ""
+ end,
+ TimestampISO = get_now_iso(Timezone),
+ io:fwrite(Io, "<packet or=\"~p\" ljid=\"~s\" ~sts=\"~s\">~s</packet>~n",
+ [Orientation, jlib:jid_to_string(LocalJID), LocalIPS,
+ TimestampISO, binary_to_list(fxml:element_to_binary(Packet))]).
+
+%% -------------------
+%% File
+%% -------------------
+
+open_file(Logdir, Host, Timezone) ->
+ TimeStamp = get_now_iso(Timezone),
+ Year = string:substr(TimeStamp, 1, 4),
+ Month = string:substr(TimeStamp, 5, 2),
+ Day = string:substr(TimeStamp, 7, 2),
+ Hour = string:substr(TimeStamp, 10, 2),
+ Min = string:substr(TimeStamp, 13, 2),
+ Sec = string:substr(TimeStamp, 16, 2),
+ S = "-",
+ Logname = lists:flatten([Host,S,Year,S,Month,S,Day,S,Hour,S,Min,S,Sec,
+ ".xml"]),
+ Filename = filename:join([Logdir, Logname]),
+
+ Gregorian_day = get_gregorian_day(),
+
+ %% Open file, create if it does not exist, create parent dirs if needed
+ case file:read_file_info(Filename) of
+ {ok, _} ->
+ {ok, IoDevice} = file:open(Filename, [append]);
+ {error, enoent} ->
+ make_dir_rec(Logdir),
+ {ok, IoDevice} = file:open(Filename, [append]),
+ io:fwrite(IoDevice, "~s~n", ["<?xml version=\"1.0\"?>"]),
+ io:fwrite(IoDevice, "~s~n", ["<?xml-stylesheet href=\"xmpp.xsl\" type=\"text/xsl\"?>"]),
+ io:fwrite(IoDevice, "~s~n", ["<log>"])
+ end,
+ {IoDevice, Filename, Gregorian_day}.
+
+close_file(IoDevice) ->
+ io:fwrite(IoDevice, "~s~n", ["</log>"]),
+ file:close(IoDevice).
+
+rotate_log(IoDevice, Logdir, Host, Timezone) ->
+ close_file(IoDevice),
+ open_file(Logdir, Host, Timezone).
+
+make_dir_rec(Dir) ->
+ case file:read_file_info(Dir) of
+ {ok, _} ->
+ ok;
+ {error, enoent} ->
+ DirS = filename:split(Dir),
+ DirR = lists:sublist(DirS, length(DirS)-1),
+ make_dir_rec(filename:join(DirR)),
+ file:make_dir(Dir)
+ end.
+
+%% -------------------
+%% Utils
+%% -------------------
+
+get_gregorian_day() -> calendar:date_to_gregorian_days(date()).
+
+get_now_iso(Timezone) ->
+ TimeStamp = case Timezone of
+ local -> calendar:now_to_local_time(now());
+ universal -> calendar:now_to_universal_time(now())
+ end,
+ binary_to_list(jlib:timestamp_to_legacy(TimeStamp)).
+
+calc_div(A, B) when is_integer(A) and is_integer(B) and (B /= 0) ->
+ A/B;
+calc_div(_A, _B) ->
+ 0.5. %% This ensures that no rotation is performed
diff --git a/src/gen_mod.erl b/src/gen_mod.erl
index efbfc08..8a432b4 100644
--- a/src/gen_mod.erl
+++ b/src/gen_mod.erl
@@ -301,7 +301,7 @@ validate_opts(Module, Opts) ->
db_type(Opts, Module) when is_list(Opts) ->
db_type(global, Opts, Module);
db_type(Host, Module) when is_atom(Module) ->
- case Module:mod_opt_type(db_type) of
+ case catch Module:mod_opt_type(db_type) of
F when is_function(F) ->
case get_module_opt(Host, Module, db_type, F) of
undefined -> ejabberd_config:default_db(Host, Module);
@@ -314,7 +314,7 @@ db_type(Host, Module) when is_atom(Module) ->
-spec db_type(binary(), opts(), module()) -> db_type().
db_type(Host, Opts, Module) ->
- case Module:mod_opt_type(db_type) of
+ case catch Module:mod_opt_type(db_type) of
F when is_function(F) ->
case get_opt(db_type, Opts, F) of
undefined -> ejabberd_config:default_db(Host, Module);

@ -1,278 +0,0 @@
# Calculate format=diff merge(net-im/ejabberd)>=16.09
diff --git a/src/mod_logxml.erl b/src/mod_logxml.erl
new file mode 100644
index 0000000..ac822c1
--- /dev/null
+++ b/src/mod_logxml.erl
@@ -0,0 +1,271 @@
+%%%----------------------------------------------------------------------
+%%% File : mod_logxml.erl
+%%% Author : Badlop
+%%% Purpose : Log XMPP packets to XML file
+%%% Created :
+%%% Id :
+%%%----------------------------------------------------------------------
+
+-module(mod_logxml).
+-author('badlop@ono.com').
+
+-behaviour(gen_mod).
+
+-export([start/2, init/7, stop/1,
+ send_packet/4, receive_packet/5]).
+
+-include("ejabberd.hrl").
+-include("jlib.hrl").
+
+-define(PROCNAME, ejabberd_mod_logxml).
+
+%% -------------------
+%% Module control
+%% -------------------
+
+start(Host, Opts) ->
+ Logdir = gen_mod:get_opt(logdir, Opts, fun(A) -> A end, "/tmp/jabberlogs/"),
+
+ Rd = gen_mod:get_opt(rotate_days, Opts, fun(A) -> A end, 1),
+ Rf = case gen_mod:get_opt(rotate_megs, Opts, fun(A) -> A end, 10) of
+ no -> no;
+ Rf1 -> Rf1*1024*1024
+ end,
+ Rp = case gen_mod:get_opt(rotate_kpackets, Opts, fun(A) -> A end, 10) of
+ no -> no;
+ Rp1 -> Rp1*1000
+ end,
+ RotateO = {Rd, Rf, Rp},
+ CheckRKP = gen_mod:get_opt(check_rotate_kpackets, Opts, fun(A) -> A end, 1),
+
+ Timezone = gen_mod:get_opt(timezone, Opts, fun(A) -> A end, local),
+
+ Orientation = gen_mod:get_opt(orientation, Opts, fun(A) -> A end, [send, recv]),
+ Stanza = gen_mod:get_opt(stanza, Opts, fun(A) -> A end, [iq, message, presence, other]),
+ Direction = gen_mod:get_opt(direction, Opts, fun(A) -> A end, [internal, vhosts, external]),
+ FilterO = {
+ {orientation, Orientation},
+ {stanza, Stanza},
+ {direction, Direction}},
+ ShowIP = gen_mod:get_opt(show_ip, Opts, fun(A) -> A end, false),
+
+ ejabberd_hooks:add(user_send_packet, Host, ?MODULE, send_packet, 90),
+ ejabberd_hooks:add(user_receive_packet, Host, ?MODULE, receive_packet, 90),
+ register(gen_mod:get_module_proc(Host, ?PROCNAME),
+ spawn(?MODULE, init, [binary_to_list(Host), Logdir, RotateO, CheckRKP,
+ Timezone, ShowIP, FilterO])).
+
+stop(Host) ->
+ ejabberd_hooks:delete(user_send_packet, Host, ?MODULE, send_packet, 90),
+ ejabberd_hooks:delete(user_receive_packet, Host, ?MODULE, receive_packet, 90),
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! stop,
+ {wait, Proc}.
+
+init(Host, Logdir, RotateO, CheckRKP, Timezone, ShowIP, FilterO) ->
+ {IoDevice, Filename, Gregorian_day} = open_file(Logdir, Host, Timezone),
+ loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, 0, Gregorian_day,
+ Timezone, ShowIP, FilterO).
+
+%% -------------------
+%% Main
+%% -------------------
+
+manage_rotate(Host, IoDevice, Filename, Logdir, RotateO, PacketC,
+ Gregorian_day_log, Timezone) ->
+ {RO_days, RO_size, RO_packets} = RotateO,
+
+ Rotate1 = case RO_packets of
+ no -> false;
+ PacketC -> true;
+ _ -> false
+ end,
+
+ Filesize = filelib:file_size(Filename),
+ Rotate2 = if
+ RO_size == no -> false;
+ Filesize >= RO_size -> true;
+ true -> false
+ end,
+
+ Gregorian_day_today = get_gregorian_day(),
+ Rotate3 = if
+ RO_days == no -> false;
+ (Gregorian_day_today - Gregorian_day_log) >= RO_days ->
+ true;
+ true -> false
+ end,
+
+ case lists:any(fun(E) -> E end, [Rotate1, Rotate2, Rotate3]) of
+ true ->
+ {IoDevice2, Filename2, Gregorian_day2} =
+ rotate_log(IoDevice, Logdir, Host, Timezone),
+ {IoDevice2, Filename2, Gregorian_day2, 0};
+ false ->
+ {IoDevice, Filename, Gregorian_day_log, PacketC+1}
+ end.
+
+filter(FilterO, E) ->
+ {{orientation, OrientationO},{stanza, StanzaO},{direction, DirectionO}} =
+ FilterO,
+ {Orientation, From, To, Packet} = E,
+
+ {xmlel, Stanza_str, _Attrs, _Els} = Packet,
+ Stanza = list_to_atom(binary_to_list(Stanza_str)),
+
+ Hosts_all = ejabberd_config:get_global_option(hosts, fun(A) -> A end),
+ {Host_local, Host_remote} = case Orientation of
+ send -> {From#jid.lserver, To#jid.lserver};
+ recv -> {To#jid.lserver, From#jid.lserver}
+ end,
+ Direction = case Host_remote of
+ Host_local -> internal;
+ _ ->
+ case lists:member(Host_remote, Hosts_all) of
+ true -> vhosts;
+ false -> external
+ end
+ end,
+
+ {lists:all(fun(O) -> O end,
+ [lists:member(Orientation, OrientationO),
+ lists:member(Stanza, StanzaO),
+ lists:member(Direction, DirectionO)]),
+ {Orientation, Stanza, Direction}}.
+
+loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, PacketC,
+ Gregorian_day, Timezone, ShowIP, FilterO) ->
+ receive
+ {addlog, E} ->
+ {IoDevice3, Filename3, Gregorian_day3, PacketC3} =
+ case filter(FilterO, E) of
+ {true, OSD} ->
+ Div = calc_div(PacketC, CheckRKP),
+ {IoDevice2, Filename2, Gregorian_day2, PacketC2} =
+ case Div==round(Div) of
+ true ->
+ manage_rotate(Host, IoDevice, Filename,
+ Logdir, RotateO, PacketC,
+ Gregorian_day, Timezone);
+ false ->
+ {IoDevice, Filename, Gregorian_day,
+ PacketC+1}
+ end,
+ add_log(IoDevice2, Timezone, ShowIP, E, OSD),
+ {IoDevice2, Filename2, Gregorian_day2, PacketC2};
+ _ ->
+ {IoDevice, Filename, Gregorian_day, PacketC}
+ end,
+ loop(Host, IoDevice3, Filename3, Logdir, CheckRKP, RotateO,
+ PacketC3, Gregorian_day3, Timezone, ShowIP, FilterO);
+ stop ->
+ close_file(IoDevice),
+ ok;
+ _ ->
+ loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, PacketC,
+ Gregorian_day, Timezone, ShowIP, FilterO)
+ end.
+
+send_packet(P, _C2SState, FromJID, ToJID) ->
+ Host = FromJID#jid.lserver,
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! {addlog, {send, FromJID, ToJID, P}},
+ P.
+
+receive_packet(P, _C2SState, _JID, From, To) ->
+ Host = To#jid.lserver,
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! {addlog, {recv, From, To, P}},
+ P.
+
+add_log(Io, Timezone, ShowIP, {Orientation, From, To, Packet}, _OSD) ->
+ %%{Orientation, Stanza, Direction} = OSD,
+ LocalJID = case Orientation of
+ send -> From;
+ recv -> To
+ end,
+ LocalIPS = case ShowIP of
+ true ->
+ case ejabberd_sm:get_user_ip(
+ LocalJID#jid.user,
+ LocalJID#jid.server,
+ LocalJID#jid.resource) of
+ {UserIP, _Port} ->
+ io_lib:format("lip=\"~s\" ", [inet_parse:ntoa(UserIP)]);
+ undefined -> "lip=\"undefined\" "
+ end;
+ false -> ""
+ end,
+ TimestampISO = get_now_iso(Timezone),
+ io:fwrite(Io, "<packet or=\"~p\" ljid=\"~s\" ~sts=\"~s\">~s</packet>~n",
+ [Orientation, jlib:jid_to_string(LocalJID), LocalIPS,
+ TimestampISO, binary_to_list(fxml:element_to_binary(Packet))]).
+
+%% -------------------
+%% File
+%% -------------------
+
+open_file(Logdir, Host, Timezone) ->
+ TimeStamp = get_now_iso(Timezone),
+ Year = string:substr(TimeStamp, 1, 4),
+ Month = string:substr(TimeStamp, 5, 2),
+ Day = string:substr(TimeStamp, 7, 2),
+ Hour = string:substr(TimeStamp, 10, 2),
+ Min = string:substr(TimeStamp, 13, 2),
+ Sec = string:substr(TimeStamp, 16, 2),
+ S = "-",
+ Logname = lists:flatten([Host,S,Year,S,Month,S,Day,S,Hour,S,Min,S,Sec,
+ ".xml"]),
+ Filename = filename:join([Logdir, Logname]),
+
+ Gregorian_day = get_gregorian_day(),
+
+ %% Open file, create if it does not exist, create parent dirs if needed
+ case file:read_file_info(Filename) of
+ {ok, _} ->
+ {ok, IoDevice} = file:open(Filename, [append]);
+ {error, enoent} ->
+ make_dir_rec(Logdir),
+ {ok, IoDevice} = file:open(Filename, [append]),
+ io:fwrite(IoDevice, "~s~n", ["<?xml version=\"1.0\"?>"]),
+ io:fwrite(IoDevice, "~s~n", ["<?xml-stylesheet href=\"xmpp.xsl\" type=\"text/xsl\"?>"]),
+ io:fwrite(IoDevice, "~s~n", ["<log>"])
+ end,
+ {IoDevice, Filename, Gregorian_day}.
+
+close_file(IoDevice) ->
+ io:fwrite(IoDevice, "~s~n", ["</log>"]),
+ file:close(IoDevice).
+
+rotate_log(IoDevice, Logdir, Host, Timezone) ->
+ close_file(IoDevice),
+ open_file(Logdir, Host, Timezone).
+
+make_dir_rec(Dir) ->
+ case file:read_file_info(Dir) of
+ {ok, _} ->
+ ok;
+ {error, enoent} ->
+ DirS = filename:split(Dir),
+ DirR = lists:sublist(DirS, length(DirS)-1),
+ make_dir_rec(filename:join(DirR)),
+ file:make_dir(Dir)
+ end.
+
+%% -------------------
+%% Utils
+%% -------------------
+
+get_gregorian_day() -> calendar:date_to_gregorian_days(date()).
+
+get_now_iso(Timezone) ->
+ TimeStamp = case Timezone of
+ local -> calendar:now_to_local_time(now());
+ universal -> calendar:now_to_universal_time(now())
+ end,
+ binary_to_list(jlib:timestamp_to_legacy(TimeStamp)).
+
+calc_div(A, B) when is_integer(A) and is_integer(B) and (B /= 0) ->
+ A/B;
+calc_div(_A, _B) ->
+ 0.5. %% This ensures that no rotation is performed

@ -1,266 +0,0 @@
# Calculate format=diff merge(net-im/ejabberd)=>2,3
diff -uNr ejabberd-2.0.2-beta1.ORIG/src/mod_logxml.erl ejabberd-2.0.2-beta1/src/mod_logxml.erl
--- mod_logxml.erl
+++ mod_logxml.erl
@@ -0,0 +1,261 @@
+%%%----------------------------------------------------------------------
+%%% File : mod_logxml.erl
+%%% Author : Badlop
+%%% Purpose : Log XMPP packets to XML file
+%%% Created :
+%%% Id :
+%%%----------------------------------------------------------------------
+
+-module(mod_logxml).
+-author('badlop@ono.com').
+
+-behaviour(gen_mod).
+
+-export([start/2, init/7, stop/1,
+ send_packet/3, receive_packet/4]).
+
+-include("ejabberd.hrl").
+-include("jlib.hrl").
+
+-define(PROCNAME, ejabberd_mod_logxml).
+
+%% -------------------
+%% Module control
+%% -------------------
+
+start(Host, Opts) ->
+ Logdir = gen_mod:get_opt(logdir, Opts, "/tmp/jabberlogs/"),
+
+ Rd = gen_mod:get_opt(rotate_days, Opts, 1),
+ Rf = case gen_mod:get_opt(rotate_megs, Opts, 10) of
+ no -> no;
+ Rf1 -> Rf1*1024*1024
+ end,
+ Rp = case gen_mod:get_opt(rotate_kpackets, Opts, 10) of
+ no -> no;
+ Rp1 -> Rp1*1000
+ end,
+ RotateO = {Rd, Rf, Rp},
+ CheckRKP = gen_mod:get_opt(check_rotate_kpackets, Opts, 1),
+
+ Timezone = gen_mod:get_opt(timezone, Opts, local),
+
+ Orientation = gen_mod:get_opt(orientation, Opts, [send, recv]),
+ Stanza = gen_mod:get_opt(stanza, Opts, [iq, message, presence, other]),
+ Direction = gen_mod:get_opt(direction, Opts, [internal, vhosts, external]),
+ FilterO = {
+ {orientation, Orientation},
+ {stanza, Stanza},
+ {direction, Direction}},
+ ShowIP = gen_mod:get_opt(show_ip, Opts, false),
+
+ ejabberd_hooks:add(user_send_packet, Host, ?MODULE, send_packet, 90),
+ ejabberd_hooks:add(user_receive_packet, Host, ?MODULE, receive_packet, 90),
+ register(gen_mod:get_module_proc(Host, ?PROCNAME),
+ spawn(?MODULE, init, [Host, Logdir, RotateO, CheckRKP,
+ Timezone, ShowIP, FilterO])).
+
+stop(Host) ->
+ ejabberd_hooks:delete(user_send_packet, Host, ?MODULE, send_packet, 90),
+ ejabberd_hooks:delete(user_receive_packet, Host, ?MODULE, receive_packet, 90),
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! stop,
+ {wait, Proc}.
+
+init(Host, Logdir, RotateO, CheckRKP, Timezone, ShowIP, FilterO) ->
+ {IoDevice, Filename, Gregorian_day} = open_file(Logdir, Host, Timezone),
+ loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, 0, Gregorian_day,
+ Timezone, ShowIP, FilterO).
+
+%% -------------------
+%% Main
+%% -------------------
+
+manage_rotate(Host, IoDevice, Filename, Logdir, RotateO, PacketC,
+ Gregorian_day_log, Timezone) ->
+ {RO_days, RO_size, RO_packets} = RotateO,
+
+ Rotate1 = case RO_packets of
+ no -> false;
+ PacketC -> true;
+ _ -> false
+ end,
+
+ Filesize = filelib:file_size(Filename),
+ Rotate2 = if
+ RO_size == no -> false;
+ Filesize >= RO_size -> true;
+ true -> false
+ end,
+
+ Gregorian_day_today = get_gregorian_day(),
+ Rotate3 = if
+ RO_days == no -> false;
+ (Gregorian_day_today - Gregorian_day_log) >= RO_days ->
+ true;
+ true -> false
+ end,
+
+ case lists:any(fun(E) -> E end, [Rotate1, Rotate2, Rotate3]) of
+ true ->
+ {IoDevice2, Filename2, Gregorian_day2} =
+ rotate_log(IoDevice, Logdir, Host, Timezone),
+ {IoDevice2, Filename2, Gregorian_day2, 0};
+ false ->
+ {IoDevice, Filename, Gregorian_day_log, PacketC+1}
+ end.
+
+filter(FilterO, E) ->
+ {{orientation, OrientationO},{stanza, StanzaO},{direction, DirectionO}} =
+ FilterO,
+ {Orientation, From, To, Packet} = E,
+
+ {xmlelement, Stanza_str, _Attrs, _Els} = Packet,
+ Stanza = list_to_atom(Stanza_str),
+
+ Hosts_all = ejabberd_config:get_global_option(hosts),
+ {Host_local, Host_remote} = case Orientation of
+ send -> {From#jid.lserver, To#jid.lserver};
+ recv -> {To#jid.lserver, From#jid.lserver}
+ end,
+ Direction = case Host_remote of
+ Host_local -> internal;
+ _ ->
+ case lists:member(Host_remote, Hosts_all) of
+ true -> vhosts;
+ false -> external
+ end
+ end,
+
+ {lists:all(fun(O) -> O end,
+ [lists:member(Orientation, OrientationO),
+ lists:member(Stanza, StanzaO),
+ lists:member(Direction, DirectionO)]),
+ {Orientation, Stanza, Direction}}.
+
+loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, PacketC,
+ Gregorian_day, Timezone, ShowIP, FilterO) ->
+ receive
+ {addlog, E} ->
+ {IoDevice3, Filename3, Gregorian_day3, PacketC3} =
+ case filter(FilterO, E) of
+ {true, OSD} ->
+ Div = PacketC/CheckRKP,
+ {IoDevice2, Filename2, Gregorian_day2, PacketC2} =
+ case Div==round(Div) of
+ true ->
+ manage_rotate(Host, IoDevice, Filename,
+ Logdir, RotateO, PacketC,
+ Gregorian_day, Timezone);
+ false ->
+ {IoDevice, Filename, Gregorian_day,
+ PacketC+1}
+ end,
+ add_log(IoDevice2, Timezone, ShowIP, E, OSD),
+ {IoDevice2, Filename2, Gregorian_day2, PacketC2};
+ _ ->
+ {IoDevice, Filename, Gregorian_day, PacketC}
+ end,
+ loop(Host, IoDevice3, Filename3, Logdir, CheckRKP, RotateO,
+ PacketC3, Gregorian_day3, Timezone, ShowIP, FilterO);
+ stop ->
+ close_file(IoDevice),
+ ok;
+ _ ->
+ loop(Host, IoDevice, Filename, Logdir, CheckRKP, RotateO, PacketC,
+ Gregorian_day, Timezone, ShowIP, FilterO)
+ end.
+
+send_packet(FromJID, ToJID, P) ->
+ Host = FromJID#jid.lserver,
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! {addlog, {send, FromJID, ToJID, P}}.
+
+receive_packet(_JID, From, To, P) ->
+ Host = To#jid.lserver,
+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
+ Proc ! {addlog, {recv, From, To, P}}.
+
+add_log(Io, Timezone, ShowIP, {Orientation, From, To, Packet}, _OSD) ->
+ %%{Orientation, Stanza, Direction} = OSD,
+ LocalJID = case Orientation of
+ send -> From;
+ recv -> To
+ end,
+ LocalIPS = case ShowIP of
+ true ->
+ {UserIP, _Port} = ejabberd_sm:get_user_ip(
+ LocalJID#jid.user,
+ LocalJID#jid.server,
+ LocalJID#jid.resource),
+ io_lib:format("lip=\"~s\" ", [inet_parse:ntoa(UserIP)]);
+ false -> ""
+ end,
+ TimestampISO = get_now_iso(Timezone),
+ io:fwrite(Io, "<packet or=\"~p\" ljid=\"~s\" ~sts=\"~s\">~s</packet>~n",
+ [Orientation, jlib:jid_to_string(LocalJID), LocalIPS,
+ TimestampISO, xml:element_to_string(Packet)]).
+
+%% -------------------
+%% File
+%% -------------------
+
+open_file(Logdir, Host, Timezone) ->
+ TimeStamp = get_now_iso(Timezone),
+ Year = string:substr(TimeStamp, 1, 4),
+ Month = string:substr(TimeStamp, 5, 2),
+ Day = string:substr(TimeStamp, 7, 2),
+ Hour = string:substr(TimeStamp, 10, 2),
+ Min = string:substr(TimeStamp, 13, 2),
+ Sec = string:substr(TimeStamp, 16, 2),
+ S = "-",
+ Logname = lists:flatten([Host,S,Year,S,Month,S,Day,S,Hour,S,Min,S,Sec,
+ ".xml"]),
+ Filename = filename:join([Logdir, Logname]),
+
+ Gregorian_day = get_gregorian_day(),
+
+ %% Open file, create if it does not exist, create parent dirs if needed
+ case file:read_file_info(Filename) of
+ {ok, _} ->
+ {ok, IoDevice} = file:open(Filename, [append]);
+ {error, enoent} ->
+ make_dir_rec(Logdir),
+ {ok, IoDevice} = file:open(Filename, [append]),
+ io:fwrite(IoDevice, "~s~n", ["<?xml version=\"1.0\"?>"]),
+ io:fwrite(IoDevice, "~s~n", ["<?xml-stylesheet href=\"xmpp.xsl\" type=\"text/xsl\"?>"]),
+ io:fwrite(IoDevice, "~s~n", ["<log>"])
+ end,
+ {IoDevice, Filename, Gregorian_day}.
+
+close_file(IoDevice) ->
+ io:fwrite(IoDevice, "~s~n", ["</log>"]),
+ file:close(IoDevice).
+
+rotate_log(IoDevice, Logdir, Host, Timezone) ->
+ close_file(IoDevice),
+ open_file(Logdir, Host, Timezone).
+
+make_dir_rec(Dir) ->
+ case file:read_file_info(Dir) of
+ {ok, _} ->
+ ok;
+ {error, enoent} ->
+ DirS = filename:split(Dir),
+ DirR = lists:sublist(DirS, length(DirS)-1),
+ make_dir_rec(filename:join(DirR)),
+ file:make_dir(Dir)
+ end.
+
+%% -------------------
+%% Utils
+%% -------------------
+
+get_gregorian_day() -> calendar:date_to_gregorian_days(date()).
+
+get_now_iso(Timezone) ->
+ TimeStamp = case Timezone of
+ local -> calendar:now_to_local_time(now());
+ universal -> calendar:now_to_universal_time(now())
+ end,
+ jlib:timestamp_to_iso(TimeStamp).

@ -1,20 +0,0 @@
# Calculate format=diff
--- webkitgtk-2.4.11.orig/Source/JavaScriptCore/API/JSStringRef.h 2016-04-10 08:48:36.000000000 +0200
+++ webkitgtk-2.4.11/Source/JavaScriptCore/API/JSStringRef.h 2017-12-20 23:04:55.000000000 +0100
@@ -27,6 +27,7 @@
#define JSStringRef_h
#include <JavaScriptCore/JSValueRef.h>
+#include <uchar.h>
#ifndef __cplusplus
#include <stdbool.h>
@@ -43,7 +44,7 @@
@typedef JSChar
@abstract A Unicode character.
*/
- typedef unsigned short JSChar;
+ typedef char16_t JSChar;
#else
typedef wchar_t JSChar;
#endif

@ -1,20 +0,0 @@
# Calculate format=diff
--- webkitgtk-2.4.11.orig/Source/WebKit2/Shared/API/c/WKString.h 2016-04-10 08:48:37.000000000 +0200
+++ webkitgtk-2.4.11/Source/WebKit2/Shared/API/c/WKString.h 2017-12-20 22:14:19.097225121 +0100
@@ -28,6 +28,7 @@
#include <WebKit2/WKBase.h>
#include <stddef.h>
+#include <uchar.h>
#ifndef __cplusplus
#include <stdbool.h>
@@ -39,7 +40,7 @@
#if !defined(WIN32) && !defined(_WIN32) \
&& !((defined(__CC_ARM) || defined(__ARMCC__)) && !defined(__linux__)) /* RVCT */
- typedef unsigned short WKChar;
+ typedef char16_t WKChar;
#else
typedef wchar_t WKChar;
#endif

@ -1,13 +0,0 @@
# Calculate format=diff merge(net-misc/netkit-rwho)=>0.17,0.18
diff --git a/rwhod/rwhod.c b/rwhod/rwhod.c
index 16a43c0..f22d637 100644
--- a/rwhod/rwhod.c
+++ b/rwhod/rwhod.c
@@ -75,6 +75,7 @@ char rcsid[] =
#include <pwd.h>
#include <grp.h>
#include <time.h>
+#include <inttypes.h>
#include "../version.h"

@ -1,116 +0,0 @@
# Calculate format=diff pkg(sys-kernel/calculate-sources)=>3.10,3.11&&merge(net-wireless/broadcom-sta)=>6.30.223.30,6.30.223.31
diff -ru build.3.9/src/wl/sys/wl_linux.c build/src/wl/sys/wl_linux.c
--- build.3.9/src/wl/sys/wl_linux.c 2013-06-18 13:48:04.109167642 +0000
+++ build/src/wl/sys/wl_linux.c 2013-06-18 14:24:33.448198331 +0000
@@ -3236,7 +3236,7 @@
void
wl_tkip_printstats(wl_info_t *wl, bool group_key)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
char debug_buf[512];
int idx;
if (wl->tkipmodops) {
@@ -3409,6 +3409,7 @@
return 0;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
static int
wl_proc_read(char *buffer, char **start, off_t offset, int length, int *eof, void *data)
{
@@ -3463,19 +3464,90 @@
return length;
}
+#else
+
+static int
+wl_proc_read(struct seq_file *seq, void *offset)
+{
+ wl_info_t * wl = (wl_info_t *)seq->private;
+ int bcmerror, to_user;
+
+ WL_LOCK(wl);
+ bcmerror = wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL);
+ WL_UNLOCK(wl);
+
+ seq_printf(seq, "%d\n", to_user);
+ return bcmerror;
+}
+
+static ssize_t wl_proc_write(struct file *file, const char __user *buff,
+ size_t length, loff_t *ppos)
+{
+ struct seq_file *seq = file->private_data;
+ wl_info_t * wl = (wl_info_t *)seq->private;
+ int bcmerror, from_user = 0;
+
+ if (length != 1) {
+ WL_ERROR(("%s: Invalid data length\n", __FUNCTION__));
+ return -EIO;
+ }
+
+ if (copy_from_user(&from_user, buff, 1)) {
+ WL_ERROR(("%s: copy from user failed\n", __FUNCTION__));
+ return -EFAULT;
+ }
+
+ if (from_user >= 0x30)
+ from_user -= 0x30;
+
+ WL_LOCK(wl);
+ bcmerror = wlc_ioctl(wl->wlc, WLC_SET_MONITOR, &from_user, sizeof(int), NULL);
+ WL_UNLOCK(wl);
+
+ if (bcmerror < 0) {
+ WL_ERROR(("%s: SET_MONITOR failed with %d\n", __FUNCTION__, bcmerror));
+ return -EIO;
+ }
+ *ppos += length;
+ return length;
+}
+
+static int wl_proc_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, wl_proc_read, PDE_DATA(inode));
+}
+
+static const struct file_operations wl_proc_fops = {
+ .owner = THIS_MODULE,
+ .open = wl_proc_open,
+ .read = seq_read,
+ .write = wl_proc_write,
+ .llseek = seq_lseek,
+ .release = single_release,
+};
+#endif
+
static int
wl_reg_proc_entry(wl_info_t *wl)
{
char tmp[32];
sprintf(tmp, "%s%d", HYBRID_PROC, wl->pub->unit);
- if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
+ wl->proc_entry = create_proc_entry(tmp, 0644, NULL);
+ if (wl->proc_entry) {
+ wl->proc_entry->read_proc = wl_proc_read;
+ wl->proc_entry->write_proc = wl_proc_write;
+ wl->proc_entry->data = wl;
+ }
+#else
+ wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_proc_fops, wl);
+#endif
+ if (!wl->proc_entry) {
WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
ASSERT(0);
return -1;
}
- wl->proc_entry->read_proc = wl_proc_read;
- wl->proc_entry->write_proc = wl_proc_write;
- wl->proc_entry->data = wl;
return 0;
}
#ifdef WLOFFLD

@ -1,14 +0,0 @@
# Calculate format=diff pkg(sys-kernel/calculate-sources)=>4.3,4.5&&merge(net-wireless/broadcom-sta)=>6.30.223.271,6.30.223.272&&os_arch_machine==i686
diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c
index f879398..c098234 100644
--- a/src/shared/linux_osl.c
+++ b/src/shared/linux_osl.c
@@ -932,7 +932,7 @@ osl_getcycles(void)
uint cycles;
#if defined(__i386__)
- cycles = (u32)native_read_tsc();
+ cycles = (u32)rdtsc();
#else
cycles = 0;
#endif

@ -1,200 +0,0 @@
# Calculate format=diff merge(net-wireless/ndiswrapper)>=1.61
From: Seth Forshee <seth.forshee@canonical.com>
Date: Wed, 13 Dec 2017 15:53:31 -0600
Subject: [PATCH] Build fixes for Linux 4.15
Fixes two build issues for 4.15:
- init_timer() was eliminated in 4.15, and all callers were
converted to using timer_setup(). The callback prototype has
also changed to pass a timer_list argument instead of callback
data, and from_timer() must be used to get to the object in
which the timer is embedded.
- usb_get_status() was changed to take an additional argument,
and usb_get_std_status() was added as a wrapper for callers to
use as a replacment. Call the wrapper in 4.15 and later.
LP: #1737749
---
driver/ntoskernel.c | 19 ++++++++++++++++++-
driver/usb.c | 10 ++++++++--
driver/wrapndis.c | 28 ++++++++++++++++++++++++++++
3 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/driver/ntoskernel.c b/driver/ntoskernel.c
index 4fe0dc1..156c688 100644
--- a/driver/ntoskernel.c
+++ b/driver/ntoskernel.c
@@ -77,7 +77,6 @@ u64 wrap_ticks_to_boot;
#if defined(CONFIG_X86_64)
static struct timer_list shared_data_timer;
struct kuser_shared_data kuser_shared_data;
-static void update_user_shared_data_proc(unsigned long data);
#endif
WIN_SYMBOL_MAP("KeTickCount", &jiffies)
@@ -91,7 +90,11 @@ DEFINE_PER_CPU(struct irql_info, irql_info);
#endif
#if defined(CONFIG_X86_64)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
static void update_user_shared_data_proc(unsigned long data)
+#else
+static void update_user_shared_data_proc(struct timer_list *t)
+#endif
{
/* timer is supposed to be scheduled every 10ms, but bigger
* intervals seem to work (tried up to 50ms) */
@@ -407,9 +410,15 @@ static void initialize_object(struct dispatcher_header *dh, enum dh_type type,
InitializeListHead(&dh->wait_blocks);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
static void timer_proc(unsigned long data)
{
struct wrap_timer *wrap_timer = (struct wrap_timer *)data;
+#else
+static void timer_proc(struct timer_list *t)
+{
+ struct wrap_timer *wrap_timer = from_timer(wrap_timer, t, timer);
+#endif
struct nt_timer *nt_timer;
struct kdpc *kdpc;
@@ -452,9 +461,13 @@ void wrap_init_timer(struct nt_timer *nt_timer, enum timer_type type,
return;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
init_timer(&wrap_timer->timer);
wrap_timer->timer.data = (unsigned long)wrap_timer;
wrap_timer->timer.function = timer_proc;
+#else
+ timer_setup(&wrap_timer->timer, timer_proc, 0);
+#endif
wrap_timer->nt_timer = nt_timer;
#ifdef TIMER_DEBUG
wrap_timer->wrap_timer_magic = WRAP_TIMER_MAGIC;
@@ -2559,9 +2572,13 @@ int ntoskernel_init(void)
#if defined(CONFIG_X86_64)
memset(&kuser_shared_data, 0, sizeof(kuser_shared_data));
*((ULONG64 *)&kuser_shared_data.system_time) = ticks_1601();
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
init_timer(&shared_data_timer);
shared_data_timer.function = update_user_shared_data_proc;
shared_data_timer.data = 0;
+#else
+ timer_setup(&shared_data_timer, update_user_shared_data_proc, 0);
+#endif
#endif
return 0;
}
diff --git a/driver/usb.c b/driver/usb.c
index 3e7021a..e55c2c6 100644
--- a/driver/usb.c
+++ b/driver/usb.c
@@ -750,6 +750,12 @@ static USBD_STATUS wrap_set_clear_feature(struct usb_device *udev,
USBEXIT(return NT_URB_STATUS(nt_urb));
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+#define wrap_usb_get_status usb_get_status
+#else
+#define wrap_usb_get_status usb_get_std_status
+#endif
+
static USBD_STATUS wrap_get_status_request(struct usb_device *udev,
struct irp *irp)
{
@@ -776,8 +782,8 @@ static USBD_STATUS wrap_get_status_request(struct usb_device *udev,
return NT_URB_STATUS(nt_urb);
}
assert(status_req->transfer_buffer_length == sizeof(u16));
- ret = usb_get_status(udev, type, status_req->index,
- status_req->transfer_buffer);
+ ret = wrap_usb_get_status(udev, type, status_req->index,
+ status_req->transfer_buffer);
if (ret >= 0) {
assert(ret <= status_req->transfer_buffer_length);
status_req->transfer_buffer_length = ret;
diff --git a/driver/wrapndis.c b/driver/wrapndis.c
index 870e4c2..f653440 100644
--- a/driver/wrapndis.c
+++ b/driver/wrapndis.c
@@ -1093,9 +1093,15 @@ send_assoc_event:
EXIT2(return);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
static void iw_stats_timer_proc(unsigned long data)
{
struct ndis_device *wnd = (struct ndis_device *)data;
+#else
+static void iw_stats_timer_proc(struct timer_list *t)
+{
+ struct ndis_device *wnd = from_timer(wnd, t, iw_stats_timer);
+#endif
ENTER2("%d", wnd->iw_stats_interval);
if (wnd->iw_stats_interval > 0) {
@@ -1111,8 +1117,12 @@ static void add_iw_stats_timer(struct ndis_device *wnd)
return;
if (wnd->iw_stats_interval < 0)
wnd->iw_stats_interval *= -1;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
wnd->iw_stats_timer.data = (unsigned long)wnd;
wnd->iw_stats_timer.function = iw_stats_timer_proc;
+#else
+ timer_setup(&wnd->iw_stats_timer, iw_stats_timer_proc, 0);
+#endif
mod_timer(&wnd->iw_stats_timer, jiffies + wnd->iw_stats_interval);
}
@@ -1124,9 +1134,15 @@ static void del_iw_stats_timer(struct ndis_device *wnd)
EXIT2(return);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
static void hangcheck_proc(unsigned long data)
{
struct ndis_device *wnd = (struct ndis_device *)data;
+#else
+static void hangcheck_proc(struct timer_list *t)
+{
+ struct ndis_device *wnd = from_timer(wnd, t, hangcheck_timer);
+#endif
ENTER3("%d", wnd->hangcheck_interval);
if (wnd->hangcheck_interval > 0) {
@@ -1147,8 +1163,12 @@ void hangcheck_add(struct ndis_device *wnd)
wnd->hangcheck_interval = hangcheck_interval * HZ;
if (wnd->hangcheck_interval < 0)
wnd->hangcheck_interval *= -1;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
wnd->hangcheck_timer.data = (unsigned long)wnd;
wnd->hangcheck_timer.function = hangcheck_proc;
+#else
+ timer_setup(&wnd->hangcheck_timer, hangcheck_proc, 0);
+#endif
mod_timer(&wnd->hangcheck_timer, jiffies + wnd->hangcheck_interval);
EXIT2(return);
}
@@ -2138,9 +2158,17 @@ static NTSTATUS ndis_add_device(struct driver_object *drv_obj,
wnd->dma_map_count = 0;
wnd->dma_map_addr = NULL;
wnd->nick[0] = 0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
init_timer(&wnd->hangcheck_timer);
+#else
+ timer_setup(&wnd->hangcheck_timer, NULL, 0);
+#endif
wnd->scan_timestamp = 0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
init_timer(&wnd->iw_stats_timer);
+#else
+ timer_setup(&wnd->iw_stats_timer, NULL, 0);
+#endif
wnd->iw_stats_interval = 10 * HZ;
wnd->ndis_pending_work = 0;
memset(&wnd->essid, 0, sizeof(wnd->essid));

@ -1,14 +0,0 @@
# Calculate format=diff
diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py
index a7f2d44..91d24e0 100644
--- a/pym/_emerge/BinpkgFetcher.py
+++ b/pym/_emerge/BinpkgFetcher.py
@@ -133,7 +133,7 @@ class BinpkgFetcher(SpawnProcess):
if bintree._remote_has_index:
remote_mtime = bintree._remotepkgs[
bintree.dbapi._instance_key(
- self.pkg.cpv)].get("MTIME")
+ self.pkg.cpv)].get("_mtime_")
if remote_mtime is not None:
try:
remote_mtime = long(remote_mtime)

@ -1,12 +0,0 @@
# Calculate format=diff
--- v86d-0.1.10-orig/v86.h
+++ v86d-0.1.10/v86.h
@@ -19,6 +19,8 @@
struct completion;
+typedef struct { int counter; } atomic_t;
+
#include <video/uvesafb.h>
//#define ulog(args...) do {} while (0)

@ -1 +0,0 @@
# Calculate append=skip merge(sys-boot/grub)<2.00_p5000

@ -1,147 +0,0 @@
# Calculate format=diff merge(sys-boot/grub)>=2.00
Add CHROOT_PATH ability. Add sync before grub_setup.
diff --git util/grub-install.in util/grub-install.in
index e19f1cd..aa978c8 100644
--- util/grub-install.in
+++ util/grub-install.in
@@ -737,6 +737,8 @@ fi
# Perform the grub_modinfo_platform-dependent install
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-pc" ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "sparc64-ieee1275" ] ; then
+ # sync filesystem before grub_setup
+ sync
# Now perform the installation.
"$grub_setup" ${allow_floppy} ${setup_verbose} ${setup_force} --directory="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform" \
--device-map="${device_map}" "${install_device}" || exit 1
diff --git util/grub-mkconfig.in util/grub-mkconfig.in
index 516be86..9f19817 100644
--- util/grub-mkconfig.in
+++ util/grub-mkconfig.in
@@ -129,19 +129,19 @@ else
fi
# Device containing our userland. Typically used for root= parameter.
-GRUB_DEVICE="`${grub_probe} --target=device /`"
+GRUB_DEVICE="`${grub_probe} --target=device /${CHROOT_PATH#/}`"
GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
# Device containing our /boot partition. Usually the same as GRUB_DEVICE.
-GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`"
+GRUB_DEVICE_BOOT="`${grub_probe} --target=device ${CHROOT_PATH%/}/boot`"
GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true
# Filesystem for the device containing our userland. Used for stuff like
# choosing Hurd filesystem module.
GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`"
-if test -f ${sysconfdir}/default/grub ; then
- . ${sysconfdir}/default/grub
+if test -f ${CHROOT_PATH}${sysconfdir}/default/grub ; then
+ . ${CHROOT_PATH}${sysconfdir}/default/grub
fi
# XXX: should this be deprecated at some point?
diff --git util/grub.d/00_header.in util/grub.d/00_header.in
index 765bfdc..2622638 100644
--- util/grub.d/00_header.in
+++ util/grub.d/00_header.in
@@ -137,7 +137,7 @@ fi
if [ "x$gfxterm" = x1 ]; then
if [ -n "$GRUB_FONT" ] ; then
# Make the font accessible
- prepare_grub_to_access_device `${grub_probe} --target=device "${GRUB_FONT}"`
+ prepare_grub_to_access_device `${grub_probe} --target=device "${CHROOT_PATH%/}${GRUB_FONT}"`
cat << EOF
if loadfont `make_system_path_relative_to_its_root "${GRUB_FONT}"` ; then
EOF
@@ -160,7 +160,7 @@ if [ x\$feature_default_font_path = xy ] ; then
else
EOF
# Make the font accessible
- prepare_grub_to_access_device `${grub_probe} --target=device "${font_path}"`
+ prepare_grub_to_access_device `${grub_probe} --target=device "${CHROOT_PATH%/}${font_path}"`
cat << EOF
font="`make_system_path_relative_to_its_root "${font_path}"`"
fi
@@ -221,7 +221,7 @@ if [ "x$gfxterm" = x1 ]; then
&& is_path_readable_by_grub "$GRUB_THEME"; then
gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&2
- prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"`
+ prepare_grub_to_access_device `${grub_probe} --target=device "${CHROOT_PATH%/}$GRUB_THEME"`
cat << EOF
insmod gfxmenu
EOF
@@ -253,8 +253,8 @@ EOF
set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME`
export theme
EOF
- elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \
- && is_path_readable_by_grub "$GRUB_BACKGROUND"; then
+ elif [ "x${CHROOT_PATH}$GRUB_BACKGROUND" != x ] && [ -f "${CHROOT_PATH%/}$GRUB_BACKGROUND" ] \
+ && is_path_readable_by_grub "${CHROOT_PATH%/}$GRUB_BACKGROUND"; then
gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&2
case "$GRUB_BACKGROUND" in
*.png) reader=png ;;
@@ -262,7 +262,7 @@ EOF
*.jpg|*.jpeg) reader=jpeg ;;
*) gettext "Unsupported image format" >&2; echo >&2; exit 1 ;;
esac
- prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"`
+ prepare_grub_to_access_device `${grub_probe} --target=device "${CHROOT_PATH%/}$GRUB_BACKGROUND"`
cat << EOF
insmod $reader
background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"`
diff --git util/grub.d/10_linux.in util/grub.d/10_linux.in
index 14402e8..7cca45d 100644
--- util/grub.d/10_linux.in
+++ util/grub.d/10_linux.in
@@ -31,7 +31,7 @@ CLASS="--class gnu-linux --class gnu --class os"
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+ OS="${GRUB_DISTRIBUTOR}"
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
fi
@@ -153,12 +153,18 @@ EOF
machine=`uname -m`
case "x$machine" in
xi?86 | xx86_64)
- list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
- if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+ list=`for i in ${CHROOT_PATH%/}/boot/vmlinuz-* \
+ ${CHROOT_PATH%/}/vmlinuz-* \
+ ${CHROOT_PATH%/}/boot/kernel-* ; do
+ if grub_file_is_not_garbage "$i" && ! [[ -L $i ]] ; then echo -n "$i " ; fi
done` ;;
*)
- list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
- if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+ list=`for i in ${CHROOT_PATH%/}/boot/vmlinuz-* \
+ ${CHROOT_PATH%/}/boot/vmlinux-* \
+ ${CHROOT_PATH%/}/vmlinuz-* \
+ ${CHROOT_PATH%/}/vmlinux-* \
+ ${CHROOT_PATH%/}/boot/kernel-* ; do
+ if grub_file_is_not_garbage "$i" && ! [[ -L $i ]] ; then echo -n "$i " ; fi
done` ;;
esac
@@ -186,6 +192,7 @@ while [ "x$list" != "x" ] ; do
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
+ rel_dirname=${rel_dirname#/workspace}
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
@@ -197,6 +204,8 @@ while [ "x$list" != "x" ] ; do
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
"initramfs-genkernel-${version}" \
"initramfs-genkernel-${alt_version}" \
+ "initramfs-${version}" \
+ "initramfs-${version}-install" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
if test -e "${dirname}/${i}" ; then

@ -1,57 +0,0 @@
# Calculate format=diff merge(sys-boot/grub)>=2.00
Fix detect filesystem for lvm.
Fix readable_by_grub, prepare_grub_access_device for LVM. Fix
grub-install.
Sometimes program cann't determine fs for device by path /dev/mapper.
For resolve the problem filesystem for that devices determined by device
to which they point. (readlink -f)
diff --git util/grub-install.in util/grub-install.in
index aa978c8..f85d257 100644
--- util/grub-install.in
+++ util/grub-install.in
@@ -571,6 +571,11 @@ fi
# Create the core image. First, auto-detect the filesystem module.
fs_module="`echo "${grub_device}" | xargs "$grub_probe" --device-map="${device_map}" --target=fs --device `"
+# sometimes filesystem on LVM (place in /dev/mapper) is not detected. Try detect by /dev/dm-X
+if test "x$fs_module" = x ; then
+ grub_device_fs=$(readlink -f ${grub_device})
+ fs_module="`"$grub_probe" --device-map="${device_map}" --target=fs --device "${grub_device_fs}"`"
+fi
if test "x$fs_module" = x ; then
gettext_printf "Auto-detection of a filesystem of %s failed.\n" "${grub_device}" 1>&2
gettext "Try with --recheck." 1>&2
diff --git util/grub-mkconfig_lib.in util/grub-mkconfig_lib.in
index 76133b4..04241d9 100644
--- util/grub-mkconfig_lib.in
+++ util/grub-mkconfig_lib.in
@@ -60,7 +60,11 @@ is_path_readable_by_grub ()
# abort if file is in a filesystem we can't read
if "${grub_probe}" -t fs "$path" > /dev/null 2>&1 ; then : ; else
- return 1
+ # sometimes filesystem on LVM (place in /dev/mapper) is not detected. Try detect by /dev/dm-X
+ fsdevice=`readlink -f $(${grub_probe} -t device "$path" 2>/dev/null)`
+ if "${grub_probe}" -t fs -d "${fsdevice}" > /dev/null 2>&1 ; then : ; else
+ return 1
+ fi
fi
# ... or if we can't figure out the abstraction module, for example if
@@ -135,7 +139,13 @@ prepare_grub_to_access_device ()
echo "insmod ${module}"
done
- fs="`"${grub_probe}" --device "${device}" --target=fs`"
+ # sometimes filesystem on LVM (place in /dev/mapper) is not detected. Try detect by /dev/dm-X
+ if "${grub_probe}" --device "${device}" --target=fs >/dev/null 2>/dev/null; then
+ device_fs="${device}"
+ else
+ device_fs=`readlink -f "${device}"`
+ fi
+ fs="`"${grub_probe}" --device "${device_fs}" --target=fs`"
for module in ${fs} ; do
echo "insmod ${module}"
done

@ -1,26 +0,0 @@
# Calculate format=diff merge(sys-boot/grub)>=2.00
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 2622638..2a4726b 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -100,13 +100,13 @@ cat <<EOF
if [ x\$feature_all_video_module = xy ]; then
insmod all_video
else
- insmod efi_gop
- insmod efi_uga
- insmod ieee1275_fb
- insmod vbe
- insmod vga
- insmod video_bochs
- insmod video_cirrus
+ for vm in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus
+ do
+ if [ -f \${prefix}/\${vm}.mod ]
+ then
+ insmod \$vm
+ fi
+ done
fi
EOF
fi

@ -1 +0,0 @@
# Calculate append=skip merge(sys-boot/grub)=>2.00_p5000,2.01

@ -1,23 +0,0 @@
# Calculate format=diff merge(sys-boot/grub)>=2.00
diff --git util/grub.d/10_linux.in util/grub.d/10_linux.in
index 14402e8..7cca45d 100644
--- util/grub.d/10_linux.in
+++ util/grub.d/10_linux.in
@@ -31,7 +31,7 @@ CLASS="--class gnu-linux --class gnu --class os"
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+ OS="${GRUB_DISTRIBUTOR}"
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
fi
@@ -197,6 +204,8 @@ while [ "x$list" != "x" ] ; do
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
"initramfs-genkernel-${version}" \
"initramfs-genkernel-${alt_version}" \
+ "initramfs-${version}" \
+ "initramfs-${version}-install" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
if test -e "${dirname}/${i}" ; then

@ -1,26 +0,0 @@
# Calculate format=diff merge(sys-boot/grub)>=2.00
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 2622638..2a4726b 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -100,13 +100,13 @@ cat <<EOF
if [ x\$feature_all_video_module = xy ]; then
insmod all_video
else
- insmod efi_gop
- insmod efi_uga
- insmod ieee1275_fb
- insmod vbe
- insmod vga
- insmod video_bochs
- insmod video_cirrus
+ for vm in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus
+ do
+ if [ -f \${prefix}/\${vm}.mod ]
+ then
+ insmod \$vm
+ fi
+ done
fi
EOF
fi

@ -1,43 +0,0 @@
# Calculate format=diff pkg(sys-boot/os-prober)<=1.53
diff --git linux-boot-prober linux-boot-prober
index e32dc84..b522567 100755
--- linux-boot-prober
+++ linux-boot-prober
@@ -33,7 +33,7 @@ if ! grep -q "^$mapped " "$OS_PROBER_TMP/mounted-map"; then
else
mpoint=$(grep "^$mapped " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 2)
mpoint="$(unescape_mount "$mpoint")"
- if [ "$mpoint" != "/target/boot" ] && [ "$mpoint" != "/target" ] && [ "$mpoint" != "/" ]; then
+ if [ "$mpoint" != "/target/boot" ] && [ "$mpoint" != "/target" ] && [ "$mpoint" != "/$(echo ${CHROOT_PATH%/} | cut -d/ -f 2-)" ]; then
type=$(grep "^$mapped " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 3)
if ! grep -q " $mpoint/boot " "$OS_PROBER_TMP/mounted-map"; then
linux_mount_boot "$partition" "$mpoint"
diff --git linux-boot-probes/mounted/common/90fallback linux-boot-probes/mounted/common/90fallback
index 9ff78e1..9a5cf1a 100755
--- linux-boot-probes/mounted/common/90fallback
+++ linux-boot-probes/mounted/common/90fallback
@@ -34,8 +34,10 @@ for kernpat in /vmlinuz /vmlinux /boot/vmlinuz /boot/vmlinux "/boot/vmlinuz*" \
initrdname3=$(echo "$kernfile" | sed "s/vmlinu[zx]/initramfs\*/" | sed 's/$/.img/')
# And Gentoo's also
initrdname4=$(echo "$kernfile" | sed "s/kernel/initramfs\*/")
+ # And Calculate's also
+ initrdname5=$(echo "$kernfile" | sed "s/vmlinu[zx]/initramfs\*/" | sed 's/$/-install/')
foundinitrd=0
- for initrd in $(eval ls "$initrdname" "$initrdname1" "$initrdname2" "$initrdname3" "$initrdname4" 2>/dev/null); do
+ for initrd in $(eval ls "$initrdname" "$initrdname1" "$initrdname2" "$initrdname3" "$initrdname4" "$initrdname5" 2>/dev/null); do
if [ "$initrd" != "$kernfile" ] && [ -f "$initrd" ] && [ ! -L "$initrd" ]; then
initrd=$(echo "$initrd" | sed "s!^$mpoint!!")
result "$partition:$kernbootpart::$kernbasefile:$initrd:root=$mappedpartition"
diff --git os-prober os-prober
index fc4de2c..55dc20b 100755
--- os-prober
+++ os-prober
@@ -147,7 +147,7 @@ for partition in $(partitions); do
else
mpoint=$(grep "^$mapped " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 2)
mpoint="$(unescape_mount "$mpoint")"
- if [ "$mpoint" != "/target/boot" ] && [ "$mpoint" != "/target" ] && [ "$mpoint" != "/" ]; then
+ if [ "$mpoint" != "/target/boot" ] && [ "$mpoint" != "/target" ] && [ "$mpoint" != "/$(echo ${CHROOT_PATH%/} | cut -d/ -f 2-)" ]; then
type=$(grep "^$mapped " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 3)
for test in /usr/lib/os-probes/mounted/*; do
if [ -f "$test" ] && [ -x "$test" ]; then

@ -1,19 +0,0 @@
# Calculate merge(sys-kernel/dracut)=>37,39 format=diff
diff --git modules.d/95resume/parse-resume.sh modules.d/95resume/parse-resume.sh
index d7b2d7f..6ab59c3 100755
--- modules.d/95resume/parse-resume.sh
+++ modules.d/95resume/parse-resume.sh
@@ -70,9 +70,10 @@ if ! getarg noresume; then
printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm -f -- "$job" "%s/initqueue/timeout/resume.sh"; }\n' \
"$resume" "$resume" "$hookdir" >> $hookdir/initqueue/settled/resume.sh
- printf -- "%s" 'warn "Cancelling resume operation. Device not found.";'
- printf -- ' cancel_wait_for_dev /dev/resume; rm -f -- "$job" "%s/initqueue/settled/resume.sh";\n' \
- "$hookdir" >> $hookdir/initqueue/timeout/resume.sh
+ {
+ printf -- "%s" 'warn "Cancelling resume operation. Device not found.";'
+ printf -- ' cancel_wait_for_dev /dev/resume; rm -f -- "$job" "%s/initqueue/settled/resume.sh";\n' "$hookdir"
+ } >> $hookdir/initqueue/timeout/resume.sh
mv /lib/dracut/resume.sh /lib/dracut/hooks/pre-mount/10-resume.sh
else

@ -1,16 +0,0 @@
# Calculate merge(sys-kernel/dracut)=>40,44 format=diff
diff --git dracut.sh dracut.sh
index 1c7e208..6327201 100755
--- dracut.sh
+++ dracut.sh
@@ -1485,7 +1485,10 @@ if [[ $UID = 0 ]] && [[ $PRELINK_BIN ]]; then
elif [[ $do_prelink == yes ]]; then
dinfo "*** Pre-linking files ***"
inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf
+ [[ -d $initdir/proc ]] || mkdir $initdir/proc
+ mount -n -t proc none $initdir/proc
chroot "$initdir" "$PRELINK_BIN" -a
+ umount -n $initdir/proc
rm -f -- "$initdir/$PRELINK_BIN"
rm -fr -- "$initdir"/etc/prelink.*
dinfo "*** Pre-linking files done ***"

@ -1,16 +0,0 @@
# Calculate merge(sys-kernel/dracut)<40 format=diff
# Calculate format=diff
diff -ruN dracut-034.orig/dracut.sh dracut-034/dracut.sh
--- dracut-034.orig/dracut.sh 2013-12-27 17:19:20.082554927 +0400
+++ dracut-034/dracut.sh 2014-01-09 14:42:53.235039034 +0400
@@ -1270,7 +1270,10 @@
else
dinfo "*** Pre-linking files ***"
inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf
+ [[ -d $initdir/proc ]] || mkdir $initdir/proc
+ mount -n -t proc none $initdir/proc
chroot "$initdir" "$PRELINK_BIN" -a
+ umount -n $initdir/proc
rm -f -- "$initdir/$PRELINK_BIN"
rm -fr -- "$initdir"/etc/prelink.*
dinfo "*** Pre-linking files done ***"

@ -1,14 +0,0 @@
# Calculate format=diff os_install_arch_machine==i686&&merge(www-client/firefox)=>68,68.1
diff --git a/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h b/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h
index 69efc98..25f1e63 100644
--- a/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h
+++ b/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h
@@ -559,7 +559,7 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
// GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3)
// when targeting MIPS 64, I think attempting to inline clut() into exec_ops().
-#if 1 && defined(__GNUC__) && !defined(__clang__) && defined(__mips64)
+#if 1 && defined(__GNUC__) && !defined(__clang__) && (defined(__mips64) || defined(__i386))
#define MAYBE_NOINLINE __attribute__((noinline))
#else
#define MAYBE_NOINLINE

@ -1,15 +0,0 @@
# Calculate format=diff pkg(sys-kernel/calculate-sources)=>4.9,4.13&&merge(x11-drivers/nvidia-drivers)=>340.100,340.104
--- a/kernel/nv-drm.c 2016-12-15 12:41:26.000000000 +0100
+++ b/kernel/nv-drm.c 2016-12-15 12:58:48.000000000 +0100
@@ -115,7 +115,11 @@
};
static struct drm_driver nv_drm_driver = {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
+#else
.driver_features = DRIVER_GEM | DRIVER_PRIME,
+#endif
.load = nv_drm_load,
.unload = nv_drm_unload,
.fops = &nv_drm_fops,

@ -1,132 +0,0 @@
# Calculate format=diff pkg(sys-kernel/calculate-sources)=>4.10,4.11&&merge(x11-drivers/nvidia-drivers)=>340.102,340.103
From 983a2ca221a371e08bb5ad11758a729cfa5aa88c Mon Sep 17 00:00:00 2001
From: Alberto Milone <alberto.milone@canonical.com>
Date: Wed, 15 Feb 2017 17:05:55 +0100
Subject: [PATCH 1/1] Add support for Linux 4.10
---
nv-linux.h | 7 +++++++
nv-pat.c | 40 ++++++++++++++++++++++++++++++++++++++++
uvm/nvidia_uvm_lite.c | 4 ++++
3 files changed, 51 insertions(+)
diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
index e7068e3..2d62492 100644
--- a/kernel/nv-linux.h
+++ b/kernel/nv-linux.h
@@ -2082,6 +2082,8 @@ static inline NvU64 nv_node_end_pfn(int nid)
* 2016 Dec 14:5b56d49fc31dbb0487e14ead790fc81ca9fb2c99
*/
+#include <linux/version.h>
+
#if defined(NV_GET_USER_PAGES_REMOTE_PRESENT)
#if defined(NV_GET_USER_PAGES_HAS_WRITE_AND_FORCE_ARGS)
#define NV_GET_USER_PAGES get_user_pages
@@ -2129,8 +2131,13 @@ static inline NvU64 nv_node_end_pfn(int nid)
#else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
pages, vmas);
+#else
+ return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
+ pages, vmas, NULL);
+#endif
#endif
diff --git a/kernel/nv-pat.c b/kernel/nv-pat.c
index a725533..cec6f3f 100644
--- a/kernel/nv-pat.c
+++ b/kernel/nv-pat.c
@@ -203,6 +203,7 @@ void nv_disable_pat_support(void)
}
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
static int
nvidia_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
{
@@ -234,6 +235,34 @@ static struct notifier_block nv_hotcpu_nfb = {
.notifier_call = nvidia_cpu_callback,
.priority = 0
};
+#else
+static int nvidia_cpu_online(unsigned int hcpu)
+{
+ unsigned int cpu = get_cpu();
+ if (cpu == hcpu)
+ nv_setup_pat_entries(NULL);
+ else
+ NV_SMP_CALL_FUNCTION(nv_setup_pat_entries, (void *)(long int)hcpu, 1);
+
+ put_cpu();
+
+ return 0;
+}
+
+static int nvidia_cpu_down_prep(unsigned int hcpu)
+{
+ unsigned int cpu = get_cpu();
+ if (cpu == hcpu)
+ nv_restore_pat_entries(NULL);
+ else
+ NV_SMP_CALL_FUNCTION(nv_restore_pat_entries, (void *)(long int)hcpu, 1);
+
+ put_cpu();
+
+ return 0;
+}
+#endif
+
#endif
int nv_init_pat_support(nv_stack_t *sp)
@@ -255,7 +284,14 @@ int nv_init_pat_support(nv_stack_t *sp)
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
if (nv_pat_mode == NV_PAT_MODE_BUILTIN)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0)
+#else
+ if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
+ "gpu/nvidia:online",
+ nvidia_cpu_online,
+ nvidia_cpu_down_prep) != 0)
+#endif
{
nv_disable_pat_support();
nv_printf(NV_DBG_ERRORS,
@@ -280,7 +316,11 @@ void nv_teardown_pat_support(void)
{
nv_disable_pat_support();
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
unregister_hotcpu_notifier(&nv_hotcpu_nfb);
+#else
+ cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);
+#endif
#endif
}
}
diff --git a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
index 9627f60..2158b45 100644
--- a/kernel/uvm/nvidia_uvm_lite.c
+++ b/kernel/uvm/nvidia_uvm_lite.c
@@ -820,7 +820,11 @@ done:
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
unsigned long vaddr = (unsigned long)vmf->virtual_address;
+#else
+ unsigned long vaddr = (unsigned long)vmf->address;
+#endif
struct page *page = NULL;
int retval;
--
2.7.4

@ -1,212 +0,0 @@
# Calculate format=diff pkg(sys-kernel/calculate-sources)=>4.11,4.12&&merge(x11-drivers/nvidia-drivers)=>340.102,340.103
--- kernel/nv-linux.h
+++ kernel/nv-linux.h
@@ -2082,6 +2082,8 @@ static inline NvU64 nv_node_end_pfn(int nid)
* 2016 Dec 14:5b56d49fc31dbb0487e14ead790fc81ca9fb2c99
*/
+#include <linux/version.h>
+
#if defined(NV_GET_USER_PAGES_REMOTE_PRESENT)
#if defined(NV_GET_USER_PAGES_HAS_WRITE_AND_FORCE_ARGS)
#define NV_GET_USER_PAGES get_user_pages
@@ -2129,8 +2131,13 @@ static inline NvU64 nv_node_end_pfn(int nid)
#else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
pages, vmas);
+#else
+ return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
+ pages, vmas, NULL);
+#endif
#endif
--- kernel/nv-pat.c
+++ kernel/nv-pat.c
@@ -203,6 +203,7 @@ void nv_disable_pat_support(void)
}
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
static int
nvidia_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
{
@@ -234,6 +235,34 @@ static struct notifier_block nv_hotcpu_nfb = {
.notifier_call = nvidia_cpu_callback,
.priority = 0
};
+#else
+static int nvidia_cpu_online(unsigned int hcpu)
+{
+ unsigned int cpu = get_cpu();
+ if (cpu == hcpu)
+ nv_setup_pat_entries(NULL);
+ else
+ NV_SMP_CALL_FUNCTION(nv_setup_pat_entries, (void *)(long int)hcpu, 1);
+
+ put_cpu();
+
+ return 0;
+}
+
+static int nvidia_cpu_down_prep(unsigned int hcpu)
+{
+ unsigned int cpu = get_cpu();
+ if (cpu == hcpu)
+ nv_restore_pat_entries(NULL);
+ else
+ NV_SMP_CALL_FUNCTION(nv_restore_pat_entries, (void *)(long int)hcpu, 1);
+
+ put_cpu();
+
+ return 0;
+}
+#endif
+
#endif
int nv_init_pat_support(nv_stack_t *sp)
@@ -255,7 +284,14 @@ int nv_init_pat_support(nv_stack_t *sp)
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
if (nv_pat_mode == NV_PAT_MODE_BUILTIN)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0)
+#else
+ if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
+ "gpu/nvidia:online",
+ nvidia_cpu_online,
+ nvidia_cpu_down_prep) != 0)
+#endif
{
nv_disable_pat_support();
nv_printf(NV_DBG_ERRORS,
@@ -280,7 +316,11 @@ void nv_teardown_pat_support(void)
{
nv_disable_pat_support();
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
unregister_hotcpu_notifier(&nv_hotcpu_nfb);
+#else
+ cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);
+#endif
#endif
}
}
--- kernel/uvm/nvidia_uvm_lite.c
+++ kernel/uvm/nvidia_uvm_lite.c
@@ -820,7 +820,11 @@ done:
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
unsigned long vaddr = (unsigned long)vmf->virtual_address;
+#else
+ unsigned long vaddr = (unsigned long)vmf->address;
+#endif
struct page *page = NULL;
int retval;
--- kernel/nv-drm.c 2017-03-31 03:42:21.000000000 +0200
+++ kernel/nv-drm.c 2017-04-06 23:53:14.273356795 +0200
@@ -48,7 +48,7 @@
return -ENODEV;
}
-static int nv_drm_unload(
+static void nv_drm_unload(
struct drm_device *dev
)
{
@@ -60,7 +60,7 @@
{
BUG_ON(nvl->drm != dev);
nvl->drm = NULL;
- return 0;
+ return;
}
}
@@ -64,7 +64,7 @@
}
}
- return -ENODEV;
+ return;
}
static void nv_gem_free(
--- kernel/uvm/nvidia_uvm_linux.h 2017-03-31 03:42:21.000000000 +0200
+++ kernel/uvm/nvidia_uvm_linux.h 2017-04-06 23:53:14.273356795 +0200
@@ -124,6 +124,7 @@
#include <linux/delay.h> /* mdelay, udelay */
#include <linux/sched.h> /* suser(), capable() replacement */
+#include <linux/sched/signal.h>
#include <linux/moduleparam.h> /* module_param() */
#if !defined(NV_VMWARE)
#include <asm/tlbflush.h> /* flush_tlb(), flush_tlb_all() */
@@ -362,17 +363,6 @@
void address_space_init_once(struct address_space *mapping);
#endif
-#if !defined(NV_FATAL_SIGNAL_PENDING_PRESENT)
- static inline int __fatal_signal_pending(struct task_struct *p)
- {
- return unlikely(sigismember(&p->pending.signal, SIGKILL));
- }
-
- static inline int fatal_signal_pending(struct task_struct *p)
- {
- return signal_pending(p) && __fatal_signal_pending(p);
- }
-#endif
//
// Before the current->cred structure was introduced, current->euid,
--- kernel/uvm/nvidia_uvm_lite.c 2017-03-31 03:42:21.000000000 +0200
+++ kernel/uvm/nvidia_uvm_lite.c 2017-04-06 23:53:14.273356795 +0200
@@ -818,7 +818,7 @@
}
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
-int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int _fault(struct vm_fault *vmf)
{
unsigned long vaddr = (unsigned long)vmf->virtual_address;
struct page *page = NULL;
@@ -828,7 +828,7 @@
struct page *page = NULL;
int retval;
- retval = _fault_common(vma, vaddr, &page, vmf->flags);
+ retval = _fault_common(NULL, vaddr, &page, vmf->flags);
vmf->page = page;
@@ -866,7 +866,7 @@
// it's dealing with anonymous mapping (see handle_pte_fault).
//
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
-int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int _sigbus_fault(struct vm_fault *vmf)
{
vmf->page = NULL;
return VM_FAULT_SIGBUS;
--- kernel/nv-drm.c
+++ kernel/nv-drm.c
@@ -115,7 +115,11 @@ static const struct file_operations nv_drm_fops = {
};
static struct drm_driver nv_drm_driver = {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
+#else
.driver_features = DRIVER_GEM | DRIVER_PRIME,
+#endif
.load = nv_drm_load,
.unload = nv_drm_unload,
.fops = &nv_drm_fops,

@ -1,39 +0,0 @@
# Calculate format=diff os_install_arch_machine==x86_64&&pkg(sys-kernel/calculate-sources)=>4.11,4.13&&merge(x11-drivers/nvidia-drivers)=>340.104,340.105
--- kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:50:46.334075042 +0200
+++ kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:56:06.358041280 +0200
@@ -818,7 +818,11 @@
}
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+#else
+int _fault(struct vm_fault *vmf)
+#endif
{
#if defined(NV_VM_FAULT_HAS_ADDRESS)
unsigned long vaddr = vmf->address;
@@ -828,7 +832,11 @@
struct page *page = NULL;
int retval;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
retval = _fault_common(vma, vaddr, &page, vmf->flags);
+#else
+ retval = _fault_common(NULL, vaddr, &page, vmf->flags);
+#endif
vmf->page = page;
@@ -866,7 +874,11 @@
// it's dealing with anonymous mapping (see handle_pte_fault).
//
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+#else
+int _sigbus_fault(struct vm_fault *vmf)
+#endif
{
vmf->page = NULL;
return VM_FAULT_SIGBUS;

@ -1,50 +0,0 @@
# Calculate format=diff pkg(sys-kernel/calculate-sources)=>4.14,4.15&&merge(x11-drivers/nvidia-drivers)=>340.104,340.105
--- kernel/uvm/nvidia_uvm_lite.c
+++ kernel/uvm/nvidia_uvm_lite.c
@@ -818,8 +818,15 @@ done:
}
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+#else
+int _fault(struct vm_fault *vmf)
+#endif
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+ struct vm_area_struct *vma = vmf->vma;
+#endif
#if defined(NV_VM_FAULT_HAS_ADDRESS)
unsigned long vaddr = vmf->address;
#else
@@ -866,7 +873,11 @@ static struct vm_operations_struct uvmlite_vma_ops =
// it's dealing with anonymous mapping (see handle_pte_fault).
//
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+#else
+int _sigbus_fault(struct vm_fault *vmf)
+#endif
{
vmf->page = NULL;
return VM_FAULT_SIGBUS;
--- kernel/nv-drm.c 2017-09-21 12:58:23.901972670 +0200
+++ kernel/nv-drm.c 2017-09-21 13:07:32.418269409 +0200
@@ -173,7 +173,7 @@
{
int ret = 0;
#if defined(NV_DRM_AVAILABLE)
- ret = drm_pci_init(&nv_drm_driver, pci_driver);
+ ret = drm_legacy_pci_init(&nv_drm_driver, pci_driver);
#endif
return ret;
}
@@ -183,7 +183,7 @@
)
{
#if defined(NV_DRM_AVAILABLE)
- drm_pci_exit(&nv_drm_driver, pci_driver);
+ drm_legacy_pci_exit(&nv_drm_driver, pci_driver);
#endif
}

@ -1,31 +0,0 @@
# Calculate format=diff pkg(sys-kernel/calculate-sources)=>4.14,4.15&&merge(x11-drivers/nvidia-drivers)=>340.106,340.107
--- kernel/uvm/nvidia_uvm_lite.c
+++ kernel/uvm/nvidia_uvm_lite.c
@@ -818,8 +818,15 @@ done:
}
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+#else
+int _fault(struct vm_fault *vmf)
+#endif
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+ struct vm_area_struct *vma = vmf->vma;
+#endif
#if defined(NV_VM_FAULT_HAS_ADDRESS)
unsigned long vaddr = vmf->address;
#else
@@ -866,7 +873,11 @@ static struct vm_operations_struct uvmlite_vma_ops =
// it's dealing with anonymous mapping (see handle_pte_fault).
//
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+#else
+int _sigbus_fault(struct vm_fault *vmf)
+#endif
{
vmf->page = NULL;
return VM_FAULT_SIGBUS;

@ -1,204 +0,0 @@
# Calculate format=diff pkg(sys-kernel/calculate-sources)=>4.18&&merge(x11-drivers/nvidia-drivers)=>387.34,388&&os_install_arch_machine==x86_64
diff --git a/kernel/nvidia-drm/nvidia-drm-connector.c b/kernel/nvidia-drm/nvidia-drm-connector.c
index b834021..46d1fe6 100644
--- a/kernel/nvidia-drm/nvidia-drm-connector.c
+++ b/kernel/nvidia-drm/nvidia-drm-connector.c
@@ -107,7 +107,7 @@ nvidia_connector_detect(struct drm_connector *connector, bool force)
break;
}
- encoder = drm_encoder_find(dev, id);
+ encoder = drm_encoder_find(dev, NULL, id);
if (encoder == NULL)
{
diff --git a/kernel/nvidia-drm/nvidia-drm-crtc.c b/kernel/nvidia-drm/nvidia-drm-crtc.c
index 33af2c7..bf1fc53 100644
--- a/kernel/nvidia-drm/nvidia-drm-crtc.c
+++ b/kernel/nvidia-drm/nvidia-drm-crtc.c
@@ -434,7 +434,7 @@ int nvidia_drm_get_crtc_crc32(struct drm_device *dev,
goto done;
}
- crtc = drm_crtc_find(dev, params->crtc_id);
+ crtc = drm_crtc_find(dev, NULL, params->crtc_id);
if (!crtc) {
NV_DRM_DEV_LOG_DEBUG(nv_dev, "Unknown CRTC ID %d\n", params->crtc_id);
ret = -ENOENT;
diff --git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
index e28151e..c122633 100644
--- a/kernel/nvidia-drm/nvidia-drm-drv.c
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c
@@ -679,26 +679,26 @@ static const struct drm_ioctl_desc nv_drm_ioctls[] = {
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_IMPORT_NVKMS_MEMORY,
nvidia_drm_gem_import_nvkms_memory,
- DRM_CONTROL_ALLOW|DRM_UNLOCKED),
+ DRM_UNLOCKED),
#endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_IMPORT_USERSPACE_MEMORY,
nvidia_drm_gem_import_userspace_memory,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(NVIDIA_GET_DEV_INFO,
nvidia_drm_get_dev_info,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
#if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
DRM_IOCTL_DEF_DRV(NVIDIA_FENCE_SUPPORTED,
nvidia_drm_fence_supported,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(NVIDIA_FENCE_CONTEXT_CREATE,
nvidia_drm_fence_context_create,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_FENCE_ATTACH,
nvidia_drm_gem_fence_attach,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
#endif
DRM_IOCTL_DEF_DRV(NVIDIA_GET_CLIENT_CAPABILITY,
@@ -707,7 +707,7 @@ static const struct drm_ioctl_desc nv_drm_ioctls[] = {
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
DRM_IOCTL_DEF_DRV(NVIDIA_GET_CRTC_CRC32,
nvidia_drm_get_crtc_crc32,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
#endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
};
diff --git a/kernel/nvidia-drm/nvidia-drm-linux.c b/kernel/nvidia-drm/nvidia-drm-linux.c
index c5465a9..ecce218 100644
--- a/kernel/nvidia-drm/nvidia-drm-linux.c
+++ b/kernel/nvidia-drm/nvidia-drm-linux.c
@@ -185,7 +185,7 @@ module_init(nv_linux_drm_init);
module_exit(nv_linux_drm_exit);
#if defined(MODULE_LICENSE)
- MODULE_LICENSE("MIT");
+ MODULE_LICENSE("GPL");
#endif
#if defined(MODULE_INFO)
MODULE_INFO(supported, "external");
diff --git a/kernel/nvidia-drm/nvidia-drm-modeset.c b/kernel/nvidia-drm/nvidia-drm-modeset.c
index 116b14a..6fdb03b 100644
--- a/kernel/nvidia-drm/nvidia-drm-modeset.c
+++ b/kernel/nvidia-drm/nvidia-drm-modeset.c
@@ -252,7 +252,7 @@ static int drm_atomic_state_to_nvkms_requested_config(
/* Loops over all crtcs and fill head configuration for changes */
- for_each_crtc_in_state(state, crtc, crtc_state, i)
+ for_each_new_crtc_in_state(state, crtc, crtc_state, i)
{
struct nvidia_drm_crtc *nv_crtc;
struct NvKmsKapiHeadRequestedConfig *head_requested_config;
@@ -303,7 +303,7 @@ static int drm_atomic_state_to_nvkms_requested_config(
head_requested_config->flags.displaysChanged = NV_TRUE;
- for_each_connector_in_state(state, connector, connector_state, j) {
+ for_each_new_connector_in_state(state, connector, connector_state, j) {
if (connector_state->crtc != crtc) {
continue;
}
@@ -324,7 +324,7 @@ static int drm_atomic_state_to_nvkms_requested_config(
/* Loops over all planes and fill plane configuration for changes */
- for_each_plane_in_state(state, plane, plane_state, i)
+ for_each_new_plane_in_state(state, plane, plane_state, i)
{
struct NvKmsKapiHeadRequestedConfig *head_requested_config;
@@ -634,7 +634,7 @@ void nvidia_drm_atomic_helper_commit_tail(struct drm_atomic_state *state)
nvidia_drm_write_combine_flush();
}
- for_each_crtc_in_state(state, crtc, crtc_state, i) {
+ for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
struct nvidia_drm_crtc *nv_crtc = DRM_CRTC_TO_NV_CRTC(crtc);
struct nv_drm_crtc_state *nv_crtc_state = to_nv_crtc_state(crtc->state);
struct nv_drm_flip *nv_flip = nv_crtc_state->nv_flip;
diff --git a/kernel/nvidia-modeset/nvidia-modeset-linux.c b/kernel/nvidia-modeset/nvidia-modeset-linux.c
index edeb152..df1d0bb 100644
--- a/kernel/nvidia-modeset/nvidia-modeset-linux.c
+++ b/kernel/nvidia-modeset/nvidia-modeset-linux.c
@@ -566,9 +566,9 @@ static void nvkms_queue_work(nv_kthread_q_t *q, nv_kthread_q_item_t *q_item)
WARN_ON(!ret);
}
-static void nvkms_timer_callback(unsigned long arg)
+static void nvkms_timer_callback(struct timer_list *t)
{
- struct nvkms_timer_t *timer = (struct nvkms_timer_t *) arg;
+ struct nvkms_timer_t *timer = from_timer(timer, t, kernel_timer);
/* In softirq context, so schedule nvkms_kthread_q_callback(). */
nvkms_queue_work(&nvkms_kthread_q, &timer->nv_kthread_q_item);
@@ -606,10 +606,8 @@ nvkms_init_timer(struct nvkms_timer_t *timer, nvkms_timer_proc_t *proc,
timer->kernel_timer_created = NV_FALSE;
nvkms_queue_work(&nvkms_kthread_q, &timer->nv_kthread_q_item);
} else {
- init_timer(&timer->kernel_timer);
+ timer_setup(&timer->kernel_timer, nvkms_timer_callback, 0);
timer->kernel_timer_created = NV_TRUE;
- timer->kernel_timer.function = nvkms_timer_callback;
- timer->kernel_timer.data = (unsigned long) timer;
mod_timer(&timer->kernel_timer, jiffies + NVKMS_USECS_TO_JIFFIES(usec));
}
spin_unlock_irqrestore(&nvkms_timers.lock, flags);
diff --git a/kernel/nvidia-uvm/uvm8_va_block.c b/kernel/nvidia-uvm/uvm8_va_block.c
index 792d9a3..0b49210 100644
--- a/kernel/nvidia-uvm/uvm8_va_block.c
+++ b/kernel/nvidia-uvm/uvm8_va_block.c
@@ -36,6 +36,8 @@
#include "uvm8_perf_prefetch.h"
#include "uvm8_mem.h"
+#include <linux/sched/task_stack.h>
+
typedef enum
{
BLOCK_PTE_OP_MAP,
diff --git a/kernel/nvidia/nv.c b/kernel/nvidia/nv.c
index ad5091b..e0d97d4 100644
--- a/kernel/nvidia/nv.c
+++ b/kernel/nvidia/nv.c
@@ -320,7 +320,7 @@ static irqreturn_t nvidia_isr (int, void *, struct pt_regs *);
#else
static irqreturn_t nvidia_isr (int, void *);
#endif
-static void nvidia_rc_timer (unsigned long);
+static void nvidia_rc_timer (struct timer_list *t);
static int nvidia_ctl_open (struct inode *, struct file *);
static int nvidia_ctl_close (struct inode *, struct file *);
@@ -2472,10 +2472,10 @@ nvidia_isr_bh_unlocked(
static void
nvidia_rc_timer(
- unsigned long data
+ struct timer_list *t
)
{
- nv_linux_state_t *nvl = (nv_linux_state_t *) data;
+ nv_linux_state_t *nvl = from_timer(nvl, t, rc_timer);
nv_state_t *nv = NV_STATE_PTR(nvl);
nvidia_stack_t *sp = nvl->sp[NV_DEV_STACK_TIMER];
@@ -3386,9 +3386,7 @@ int NV_API_CALL nv_start_rc_timer(
return -1;
nv_printf(NV_DBG_INFO, "NVRM: initializing rc timer\n");
- init_timer(&nvl->rc_timer);
- nvl->rc_timer.function = nvidia_rc_timer;
- nvl->rc_timer.data = (unsigned long) nvl;
+ timer_setup(&nvl->rc_timer, nvidia_rc_timer, 0);
nv->rc_timer_enabled = 1;
mod_timer(&nvl->rc_timer, jiffies + HZ); /* set our timeout for 1 second */
nv_printf(NV_DBG_INFO, "NVRM: rc timer initialized\n");

@ -1,191 +0,0 @@
# Calculate format=diff pkg(sys-kernel/calculate-sources)=>4.18&&merge(x11-drivers/nvidia-drivers)=>387.34,388&&os_install_arch_machine==i686
diff --git a/kernel/nvidia-drm/nvidia-drm-connector.c b/kernel/nvidia-drm/nvidia-drm-connector.c
index b834021..46d1fe6 100644
--- a/kernel/nvidia-drm/nvidia-drm-connector.c
+++ b/kernel/nvidia-drm/nvidia-drm-connector.c
@@ -107,7 +107,7 @@ nvidia_connector_detect(struct drm_connector *connector, bool force)
break;
}
- encoder = drm_encoder_find(dev, id);
+ encoder = drm_encoder_find(dev, NULL, id);
if (encoder == NULL)
{
diff --git a/kernel/nvidia-drm/nvidia-drm-crtc.c b/kernel/nvidia-drm/nvidia-drm-crtc.c
index 33af2c7..bf1fc53 100644
--- a/kernel/nvidia-drm/nvidia-drm-crtc.c
+++ b/kernel/nvidia-drm/nvidia-drm-crtc.c
@@ -434,7 +434,7 @@ int nvidia_drm_get_crtc_crc32(struct drm_device *dev,
goto done;
}
- crtc = drm_crtc_find(dev, params->crtc_id);
+ crtc = drm_crtc_find(dev, NULL, params->crtc_id);
if (!crtc) {
NV_DRM_DEV_LOG_DEBUG(nv_dev, "Unknown CRTC ID %d\n", params->crtc_id);
ret = -ENOENT;
diff --git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
index e28151e..c122633 100644
--- a/kernel/nvidia-drm/nvidia-drm-drv.c
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c
@@ -679,26 +679,26 @@ static const struct drm_ioctl_desc nv_drm_ioctls[] = {
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_IMPORT_NVKMS_MEMORY,
nvidia_drm_gem_import_nvkms_memory,
- DRM_CONTROL_ALLOW|DRM_UNLOCKED),
+ DRM_UNLOCKED),
#endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_IMPORT_USERSPACE_MEMORY,
nvidia_drm_gem_import_userspace_memory,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(NVIDIA_GET_DEV_INFO,
nvidia_drm_get_dev_info,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
#if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
DRM_IOCTL_DEF_DRV(NVIDIA_FENCE_SUPPORTED,
nvidia_drm_fence_supported,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(NVIDIA_FENCE_CONTEXT_CREATE,
nvidia_drm_fence_context_create,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(NVIDIA_GEM_FENCE_ATTACH,
nvidia_drm_gem_fence_attach,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
#endif
DRM_IOCTL_DEF_DRV(NVIDIA_GET_CLIENT_CAPABILITY,
@@ -707,7 +707,7 @@ static const struct drm_ioctl_desc nv_drm_ioctls[] = {
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
DRM_IOCTL_DEF_DRV(NVIDIA_GET_CRTC_CRC32,
nvidia_drm_get_crtc_crc32,
- DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
+ DRM_RENDER_ALLOW|DRM_UNLOCKED),
#endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
};
diff --git a/kernel/nvidia-drm/nvidia-drm-linux.c b/kernel/nvidia-drm/nvidia-drm-linux.c
index c5465a9..ecce218 100644
--- a/kernel/nvidia-drm/nvidia-drm-linux.c
+++ b/kernel/nvidia-drm/nvidia-drm-linux.c
@@ -185,7 +185,7 @@ module_init(nv_linux_drm_init);
module_exit(nv_linux_drm_exit);
#if defined(MODULE_LICENSE)
- MODULE_LICENSE("MIT");
+ MODULE_LICENSE("GPL");
#endif
#if defined(MODULE_INFO)
MODULE_INFO(supported, "external");
diff --git a/kernel/nvidia-drm/nvidia-drm-modeset.c b/kernel/nvidia-drm/nvidia-drm-modeset.c
index 116b14a..6fdb03b 100644
--- a/kernel/nvidia-drm/nvidia-drm-modeset.c
+++ b/kernel/nvidia-drm/nvidia-drm-modeset.c
@@ -252,7 +252,7 @@ static int drm_atomic_state_to_nvkms_requested_config(
/* Loops over all crtcs and fill head configuration for changes */
- for_each_crtc_in_state(state, crtc, crtc_state, i)
+ for_each_new_crtc_in_state(state, crtc, crtc_state, i)
{
struct nvidia_drm_crtc *nv_crtc;
struct NvKmsKapiHeadRequestedConfig *head_requested_config;
@@ -303,7 +303,7 @@ static int drm_atomic_state_to_nvkms_requested_config(
head_requested_config->flags.displaysChanged = NV_TRUE;
- for_each_connector_in_state(state, connector, connector_state, j) {
+ for_each_new_connector_in_state(state, connector, connector_state, j) {
if (connector_state->crtc != crtc) {
continue;
}
@@ -324,7 +324,7 @@ static int drm_atomic_state_to_nvkms_requested_config(
/* Loops over all planes and fill plane configuration for changes */
- for_each_plane_in_state(state, plane, plane_state, i)
+ for_each_new_plane_in_state(state, plane, plane_state, i)
{
struct NvKmsKapiHeadRequestedConfig *head_requested_config;
@@ -634,7 +634,7 @@ void nvidia_drm_atomic_helper_commit_tail(struct drm_atomic_state *state)
nvidia_drm_write_combine_flush();
}
- for_each_crtc_in_state(state, crtc, crtc_state, i) {
+ for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
struct nvidia_drm_crtc *nv_crtc = DRM_CRTC_TO_NV_CRTC(crtc);
struct nv_drm_crtc_state *nv_crtc_state = to_nv_crtc_state(crtc->state);
struct nv_drm_flip *nv_flip = nv_crtc_state->nv_flip;
diff --git a/kernel/nvidia-modeset/nvidia-modeset-linux.c b/kernel/nvidia-modeset/nvidia-modeset-linux.c
index edeb152..df1d0bb 100644
--- a/kernel/nvidia-modeset/nvidia-modeset-linux.c
+++ b/kernel/nvidia-modeset/nvidia-modeset-linux.c
@@ -566,9 +566,9 @@ static void nvkms_queue_work(nv_kthread_q_t *q, nv_kthread_q_item_t *q_item)
WARN_ON(!ret);
}
-static void nvkms_timer_callback(unsigned long arg)
+static void nvkms_timer_callback(struct timer_list *t)
{
- struct nvkms_timer_t *timer = (struct nvkms_timer_t *) arg;
+ struct nvkms_timer_t *timer = from_timer(timer, t, kernel_timer);
/* In softirq context, so schedule nvkms_kthread_q_callback(). */
nvkms_queue_work(&nvkms_kthread_q, &timer->nv_kthread_q_item);
@@ -606,10 +606,8 @@ nvkms_init_timer(struct nvkms_timer_t *timer, nvkms_timer_proc_t *proc,
timer->kernel_timer_created = NV_FALSE;
nvkms_queue_work(&nvkms_kthread_q, &timer->nv_kthread_q_item);
} else {
- init_timer(&timer->kernel_timer);
+ timer_setup(&timer->kernel_timer, nvkms_timer_callback, 0);
timer->kernel_timer_created = NV_TRUE;
- timer->kernel_timer.function = nvkms_timer_callback;
- timer->kernel_timer.data = (unsigned long) timer;
mod_timer(&timer->kernel_timer, jiffies + NVKMS_USECS_TO_JIFFIES(usec));
}
spin_unlock_irqrestore(&nvkms_timers.lock, flags);
diff --git a/kernel/nvidia/nv.c b/kernel/nvidia/nv.c
index ad5091b..e0d97d4 100644
--- a/kernel/nvidia/nv.c
+++ b/kernel/nvidia/nv.c
@@ -320,7 +320,7 @@ static irqreturn_t nvidia_isr (int, void *, struct pt_regs *);
#else
static irqreturn_t nvidia_isr (int, void *);
#endif
-static void nvidia_rc_timer (unsigned long);
+static void nvidia_rc_timer (struct timer_list *t);
static int nvidia_ctl_open (struct inode *, struct file *);
static int nvidia_ctl_close (struct inode *, struct file *);
@@ -2472,10 +2472,10 @@ nvidia_isr_bh_unlocked(
static void
nvidia_rc_timer(
- unsigned long data
+ struct timer_list *t
)
{
- nv_linux_state_t *nvl = (nv_linux_state_t *) data;
+ nv_linux_state_t *nvl = from_timer(nvl, t, rc_timer);
nv_state_t *nv = NV_STATE_PTR(nvl);
nvidia_stack_t *sp = nvl->sp[NV_DEV_STACK_TIMER];
@@ -3386,9 +3386,7 @@ int NV_API_CALL nv_start_rc_timer(
return -1;
nv_printf(NV_DBG_INFO, "NVRM: initializing rc timer\n");
- init_timer(&nvl->rc_timer);
- nvl->rc_timer.function = nvidia_rc_timer;
- nvl->rc_timer.data = (unsigned long) nvl;
+ timer_setup(&nvl->rc_timer, nvidia_rc_timer, 0);
nv->rc_timer_enabled = 1;
mod_timer(&nvl->rc_timer, jiffies + HZ); /* set our timeout for 1 second */
nv_printf(NV_DBG_INFO, "NVRM: rc timer initialized\n");

@ -1,19 +0,0 @@
# Calculate format=diff pkg(sys-kernel/calculate-sources)=>4.16,4.17&&merge(x11-drivers/nvidia-drivers)=>390.42,390.43
--- a/kernel/common/inc/nv-linux.h~ 2018-01-25 06:09:41.000000000 +0100
+++ b/kernel/common/inc/nv-linux.h 2018-03-05 13:58:17.746725638 +0100
@@ -1209,6 +1209,7 @@ static inline NvU32 nv_alloc_init_flags(
static inline NvBool nv_dma_maps_swiotlb(struct pci_dev *dev)
{
NvBool swiotlb_in_use = NV_FALSE;
+#if 0
#if defined(CONFIG_SWIOTLB)
#if defined(NV_DMA_OPS_PRESENT) || defined(NV_GET_DMA_OPS_PRESENT)
/*
@@ -1251,7 +1252,7 @@ static inline NvBool nv_dma_maps_swiotlb
swiotlb_in_use = (swiotlb == 1);
#endif
#endif
-
+#endif
return swiotlb_in_use;
}

@ -1,29 +0,0 @@
# Calculate merge(x11-misc/light-locker)==1.4.0 format=diff
diff --git a/po/ru.po b/po/ru.po
index c49c4b0..bb129d5 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -39,19 +39,19 @@ msgstr "Заблокировать экран через S секунд посл
#: ../src/light-locker.c:73
msgid "Lock the screen on screensaver deactivation"
-msgstr ""
+msgstr "Заблокировать экран при выключении хранителя экрана"
#: ../src/light-locker.c:74
msgid "Lock the screen on screensaver activation"
-msgstr ""
+msgstr "Заблокировать экран при включении хранителя экрана"
#: ../src/light-locker.c:78
msgid "Lock the screen on suspend/resume"
-msgstr ""
+msgstr "Заблокировать экран при спящем/ждущем режимах"
#: ../src/light-locker.c:79
msgid "Do not lock the screen on suspend/resume"
-msgstr ""
+msgstr "Не блокировать экран при спящем/ждущем режимах"
#: ../src/light-locker.desktop.in.in.h:1
msgid "Screen Locker"

@ -1,41 +0,0 @@
# Calculate format=diff merge(x11-misc/lightdm-gtk-greeter)<2
diff -ruN lightdm-gtk-greeter-1.6.1.orig/po/ru.po lightdm-gtk-greeter-1.6.1/po/ru.po
--- lightdm-gtk-greeter-1.6.1.orig/po/ru.po 2013-12-16 16:18:57.832013404 +0400
+++ lightdm-gtk-greeter-1.6.1/po/ru.po 2013-12-16 16:19:51.597016178 +0400
@@ -20,12 +20,15 @@
#: ../src/lightdm-gtk-greeter.c:355
msgid "Unlock"
-msgstr ""
+msgstr "Разблокировать"
#: ../src/lightdm-gtk-greeter.c:357 ../src/lightdm-gtk-greeter.glade.h:1
msgid "Login"
msgstr "Войти"
+msgid "Log In"
+msgstr "Войти"
+
#: ../src/lightdm-gtk-greeter.c:515
msgid "Failed to start session"
msgstr "Не удалось запустить сеанс"
@@ -61,6 +64,9 @@
msgid "Shutdown"
msgstr "Выключить"
+msgid "Shut Down"
+msgstr "Выключить"
+
#: ../src/lightdm-gtk-greeter.c:862
msgid "Guest Account"
msgstr "Гость"
@@ -89,6 +95,9 @@
msgid "Shutdown..."
msgstr "Выключить..."
+msgid "Shut Down..."
+msgstr "Выключить..."
+
#: ../src/lightdm-gtk-greeter.glade.h:7
msgid "Large Font"
msgstr "Крупный шрифт"

@ -1,50 +0,0 @@
# Calculate format=diff merge(x11-misc/lightdm-gtk-greeter)==2.0.1-r1
=== modified file 'src/greeterconfiguration.h'
--- src/greeterconfiguration.h 2015-03-27 05:29:45 +0000
+++ src/greeterconfiguration.h 2017-05-22 08:44:01 +0000
@@ -11,6 +11,8 @@
#define CONFIG_KEY_SCREENSAVER_TIMEOUT "screensaver-timeout"
#define CONFIG_KEY_THEME "theme-name"
#define CONFIG_KEY_ICON_THEME "icon-theme-name"
+#define CONFIG_KEY_CURSOR_THEME "cursor-theme-name"
+#define CONFIG_KEY_CURSOR_THEME_SIZE "cursor-theme-size"
#define CONFIG_KEY_FONT "font-name"
#define CONFIG_KEY_DPI "xft-dpi"
#define CONFIG_KEY_ANTIALIAS "xft-antialias"
=== modified file 'src/lightdm-gtk-greeter.c'
--- src/lightdm-gtk-greeter.c 2016-10-06 09:33:35 +0000
+++ src/lightdm-gtk-greeter.c 2017-05-22 08:44:01 +0000
@@ -275,7 +275,8 @@
/* a11y indicator */
static gchar *default_font_name,
*default_theme_name,
- *default_icon_theme_name;
+ *default_icon_theme_name,
+ *default_cursor_theme_name;
void a11y_font_cb (GtkCheckMenuItem *item);
void a11y_contrast_cb (GtkCheckMenuItem *item);
void a11y_keyboard_cb (GtkCheckMenuItem *item, gpointer user_data);
@@ -2745,6 +2746,21 @@
g_object_get (gtk_settings_get_default (), "gtk-icon-theme-name", &default_icon_theme_name, NULL);
g_debug ("[Configuration] Icons theme: '%s'", default_icon_theme_name);
+ value = config_get_string (NULL, CONFIG_KEY_CURSOR_THEME, NULL);
+ if (value)
+ {
+ g_debug ("[Configuration] Changing cursor theme to '%s'", value);
+ g_object_set (gtk_settings_get_default (), "gtk-cursor-theme-name", value, NULL);
+ g_free (value);
+ }
+ g_object_get (gtk_settings_get_default (), "gtk-cursor-theme-name", &default_cursor_theme_name, NULL);
+ g_debug ("[Configuration] Cursor theme: '%s'", default_cursor_theme_name);
+
+ if (config_has_key(NULL, CONFIG_KEY_CURSOR_THEME_SIZE))
+ {
+ g_object_set (gtk_settings_get_default (), "gtk-cursor-theme-size", config_get_int (NULL, CONFIG_KEY_CURSOR_THEME_SIZE, 16), NULL);
+ }
+
value = config_get_string (NULL, CONFIG_KEY_FONT, "Sans 10");
if (value)
{

@ -1,14 +0,0 @@
# Calculate format=diff merge(x11-misc/lightdm-gtk-greeter)==2.0.1-r1
diff --git a/configure b/configure
index 374d6bc..56b0dfc 100755
--- a/configure
+++ b/configure
@@ -12833,7 +12833,7 @@ fi
if test "${enable_kill_on_sigterm+set}" = set; then :
enableval=$enable_kill_on_sigterm;
else
- enable_kill_on_sigterm=no
+ enable_kill_on_sigterm=yes
fi

@ -1,17 +0,0 @@
# Calculate format=diff merge(x11-misc/lightdm)=>1.18,1.26
diff --git a/src/seat.c b/src/seat.c
index e3be8f9..4b4fe5e 100644
--- a/src/seat.c
+++ b/src/seat.c
@@ -781,7 +781,10 @@ session_stopped_cb (Session *session, Seat *seat)
}
/* Cleanup */
- if (!IS_GREETER_SESSION (session))
+ // don't launch cleanup script for non-authenticated session and on switch
+ // sessions
+ if (!IS_GREETER_SESSION (session) && session_get_is_authenticated(session) &&
+ !find_user_session (seat, session_get_username (session), session))
{
const gchar *script;
script = seat_get_string_property (seat, "session-cleanup-script");

@ -1,32 +0,0 @@
# Calculate format=diff merge(x11-misc/lightdm)=>1.26,1.28
diff --git a/src/seat.c b/src/seat.c
index 775ddbb..18f7ec6 100644
--- a/src/seat.c
+++ b/src/seat.c
@@ -718,6 +718,7 @@ session_authentication_complete_cb (Session *session, Seat *seat)
static void
session_stopped_cb (Session *session, Seat *seat)
{
+ gboolean reactivate = FALSE;
l_debug (seat, "Session stopped");
g_signal_handlers_disconnect_matched (session, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, seat);
@@ -726,13 +727,16 @@ session_stopped_cb (Session *session, Seat *seat)
g_clear_object (&seat->priv->active_session);
if (session == seat->priv->next_session)
g_clear_object (&seat->priv->next_session);
- if (session == seat->priv->session_to_activate)
+ if (session == seat->priv->session_to_activate) {
g_clear_object (&seat->priv->session_to_activate);
+ reactivate = TRUE;
+ }
DisplayServer *display_server = session_get_display_server (session);
/* Cleanup */
- if (!IS_GREETER_SESSION (session))
+ // don't launch cleanup script for non-authenticated session and session reactivation
+ if (!IS_GREETER_SESSION (session) && session_get_is_authenticated(session) && reactivate == FALSE)
{
const gchar *script = seat_get_string_property (seat, "session-cleanup-script");
if (script)

@ -1,16 +0,0 @@
# Calculate format=diff merge(x11-misc/lightdm)=>1.8.5,1.18
diff -ruN lightdm-1.9.5.orig/src/seat.c lightdm-1.9.5/src/seat.c
--- lightdm-1.9.5.orig/src/seat.c 2013-12-16 14:04:28.475005084 +0400
+++ lightdm-1.9.5/src/seat.c 2013-12-16 14:07:36.934014806 +0400
@@ -617,7 +617,10 @@
}
/* Cleanup */
- if (!IS_GREETER (session))
+ // don't launch cleanup script for non-authenticated session and on switch
+ // sessions
+ if (!IS_GREETER (session) && session_get_is_authenticated(session) &&
+ !find_user_session (seat, session_get_username (session), session))
{
const gchar *script;
script = seat_get_string_property (seat, "session-cleanup-script");

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save