Hello community, here is the log from the commit of package cachefilesd for openSUSE:Factory checked in at 2012-11-11 08:14:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cachefilesd (Old) and /work/SRC/openSUSE:Factory/.cachefilesd.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cachefilesd", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/cachefilesd/cachefilesd.changes 2012-10-23 19:35:37.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.cachefilesd.new/cachefilesd.changes 2012-11-11 08:14:33.000000000 +0100 @@ -1,0 +2,7 @@ +Thu Nov 1 16:42:48 UTC 2012 - [email protected] + +- IF the user starts the daemon he/she expects it to work + with no fiddling, load the cachefiles kernel module + directly from the daemon using libkmod so it just works. + +------------------------------------------------------------------- New: ---- cachefilesd-loadmod.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cachefilesd.spec ++++++ --- /var/tmp/diff_new_pack.f1PBbO/_old 2012-11-11 08:14:34.000000000 +0100 +++ /var/tmp/diff_new_pack.f1PBbO/_new 2012-11-11 08:14:34.000000000 +0100 @@ -27,9 +27,11 @@ Source1: cachefilesd.init Patch0: cachefilesd-autotools.patch Patch1: cachefilesd-config.patch +Patch2: cachefilesd-loadmod.patch Url: http://people.redhat.com/~dhowells/fscache/ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: automake +BuildRequires: libkmod-devel BuildRequires: pkgconfig BuildRequires: systemd %{?systemd_requires} @@ -42,7 +44,7 @@ %setup -q %patch0 %patch1 - +%patch2 %build autoreconf -fiv %configure --with-systemdsystemunitdir=%{_unitdir} @@ -53,8 +55,6 @@ mkdir -p $RPM_BUILD_ROOT/var/cache/fscache install -D -c -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d/cachefilesd ln -s ../../etc/init.d/cachefilesd $RPM_BUILD_ROOT/usr/sbin/rccachefilesd -mkdir -p %{buildroot}/usr/lib/modules-load.d -echo "cachefiles" > %{buildroot}/usr/lib/modules-load.d/cachefiles.conf %pre %service_add_pre %{name}.service @@ -82,6 +82,5 @@ %config(noreplace) /etc/cachefilesd.conf %dir /var/cache/fscache %{_unitdir}/%{name}.service -/usr/lib/modules-load.d/cachefiles.conf %changelog ++++++ cachefilesd-autotools.patch ++++++ --- /var/tmp/diff_new_pack.f1PBbO/_old 2012-11-11 08:14:34.000000000 +0100 +++ /var/tmp/diff_new_pack.f1PBbO/_new 2012-11-11 08:14:34.000000000 +0100 @@ -84,7 +84,7 @@ -Type=simple -ExecStartPre=-/sbin/modprobe -qab cachefiles -ExecStart=/sbin/cachefilesd -n -f /etc/cachefilesd.conf -+ExecStart=/usr/sbin/cachefilesd -n -f /etc/cachefilesd.conf ++ExecStart=/usr/sbin/cachefilesd -s -n [Install] WantedBy=multi-user.target ++++++ cachefilesd-loadmod.patch ++++++ --- cachefilesd.c.orig +++ cachefilesd.c @@ -50,6 +50,7 @@ #include <sys/time.h> #include <sys/vfs.h> #include <sys/stat.h> +#include <libkmod.h> typedef enum objtype { OBJTYPE_INDEX, @@ -278,6 +279,9 @@ int main(int argc, char *argv[]) char *line, *cp; long page_size; int _cachefd, nullfd, opt, loop, open_max, nodaemon = 0; + struct kmod_ctx *ctx; + struct kmod_module *mod; + int kmod_status; /* handle help request */ if (argc == 2 && strcmp(argv[1], "--help") == 0) @@ -344,6 +348,29 @@ int main(int argc, char *argv[]) /* just in case... */ sync(); + if (!(ctx = kmod_new(NULL, NULL))) { + oserror("Failed to allocate memory for kmod."); + } + + kmod_load_resources(ctx); + + kmod_status = kmod_module_new_from_name(ctx, "cachefiles", &mod); + + if(kmod_status < 0) oserror("Cannot load cachefiles module"); + + kmod_status = kmod_module_probe_insert_module(mod, KMOD_PROBE_APPLY_BLACKLIST,NULL, NULL, NULL, NULL); + + if (kmod_status == 0) + info("Inserted module '%s'", kmod_module_get_name(mod)); + else if (kmod_status == KMOD_PROBE_APPLY_BLACKLIST) + oserror("Module '%s' is blacklisted", kmod_module_get_name(mod)); + else { + oserror("Failed to insert '%s'", kmod_module_get_name(mod)); + } + + kmod_module_unref(mod); + kmod_unref(ctx); + /* open the devfile or the procfile on fd 3 */ _cachefd = open(devfile, O_RDWR); if (_cachefd < 0) { --- configure.ac.orig +++ configure.ac @@ -29,6 +29,8 @@ AC_SUBST([systemdsystemunitdir], [$with_ fi AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) +PKG_CHECK_MODULES([KMOD], [libkmod]) + # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T AC_TYPE_SSIZE_T --- Makefile.am.orig +++ Makefile.am @@ -8,7 +8,8 @@ endif sysconf_DATA = cachefilesd.conf -cachefilesd_CFLAGS = -fwhole-program +cachefilesd_CFLAGS = $(KMOD_CFLAGS) -fwhole-program +cachefilesd_LDADD = $(KMOD_LIBS) cachefilesd_SOURCES = cachefilesd.c dist_man8_MANS = cachefilesd.8 -dist_man5_MANS = cachefilesd.conf.5 \ No newline at end of file +dist_man5_MANS = cachefilesd.conf.5 -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
