Author: pere
Date: Wed Feb 19 12:34:50 2014
New Revision: 1108

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=1108
Log:
Added 230_systemd_on_linux.patch to skip systemd support on non-Linux
architectures like kfreebsd and hurd.  Adjust testsuite to only use
-y option on Linux.

Added:
    trunk/src/insserv/debian/patches/230_systemd_on_linux.patch
Modified:
    trunk/src/insserv/debian/changelog
    trunk/src/insserv/debian/patches/series
    trunk/src/insserv/debian/run-testsuite

Modified: trunk/src/insserv/debian/changelog
URL: 
http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=1108&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog  (original)
+++ trunk/src/insserv/debian/changelog  Wed Feb 19 12:34:50 2014
@@ -2,6 +2,9 @@
 
   * Added patch 220_no_MAXSYMLINKS.patch to get source building on Hurd.
   * Drop now obsolete control file option DM-Upload-Allowed.
+  * Added 230_systemd_on_linux.patch to skip systemd support on non-Linux
+    architectures like kfreebsd and hurd.  Adjust testsuite to only use
+    -y option on Linux.
 
  -- Petter Reinholdtsen <[email protected]>  Tue, 18 Feb 2014 22:02:18 +0100
 

Added: trunk/src/insserv/debian/patches/230_systemd_on_linux.patch
URL: 
http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/230_systemd_on_linux.patch?rev=1108&op=file
==============================================================================
--- trunk/src/insserv/debian/patches/230_systemd_on_linux.patch (added)
+++ trunk/src/insserv/debian/patches/230_systemd_on_linux.patch Wed Feb 19 
12:34:50 2014
@@ -0,0 +1,232 @@
+Description: Only build systemd support on Linux
+ Systemd is only working on Linux.  Drop systemd support on
+ non-linux platforms like kfreebsd and hurd.
+Author: Petter Reinholdtsen <[email protected]>
+
+Forwarded: no
+Reviewed-By: Petter Reinholdtsen <[email protected]>
+Last-Update: 2014-02-19
+
+Index: insserv/Makefile
+===================================================================
+--- insserv.orig/Makefile      2014-02-19 12:58:29.457954636 +0100
++++ insserv/Makefile   2014-02-19 13:29:55.630204109 +0100
+@@ -15,6 +15,15 @@
+ VERSION        =      1.16.0
+ DATE   =      $(shell date +'%d%b%y' | tr '[:lower:]' '[:upper:]')
+ CFLDBUS        =      $(shell pkg-config --cflags dbus-1)
++OS := $(shell uname -s)
++
++ifeq ($(OS),Linux)
++SYSTEMD  =      -DUSE_SYSTEMD
++SYSTEMDOBJ = systemd.o
++else
++SYSTEMD  =
++SYSTEMDOBJ =
++endif
+ 
+ #
+ # Architecture
+@@ -29,7 +38,7 @@
+         COPTS ?= -g -O2
+ endif
+ endif
+-       CFLAGS = -W -Wall $(COPTS) $(DEBUG) $(LOOPS) -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64 \
++       CFLAGS = -W -Wall $(COPTS) $(DEBUG) $(SYSTEMD) $(LOOPS) -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64 \
+                 $(ISSUSE) -DINITDIR=\"$(INITDIR)\" -DINSCONF=\"$(INSCONF)\" 
-pipe
+         CLOOP = -falign-loops=0
+       LDFLAGS ?= -Wl,-O,3,--relax
+@@ -76,7 +85,7 @@
+ 
+ all:          $(TODO)
+ 
+-insserv:      insserv.o listing.o systemd.o
++insserv:      insserv.o listing.o $(SYSTEMDOBJ)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+ 
+ listing.o:    listing.c listing.h config.h .system
+Index: insserv/insserv.c
+===================================================================
+--- insserv.orig/insserv.c     2014-02-19 12:58:29.585955472 +0100
++++ insserv/insserv.c  2014-02-19 12:58:29.597955548 +0100
+@@ -23,11 +23,13 @@
+  *
+  */
+ 
++#if defined(USE_SYSTEMD)
+ /*
+  * Systemd integration
+  */
+ #define SYSTEMD_SERVICE_PATH  "/lib/systemd/system"
+ #define SYSTEMD_BINARY_PATH   "/bin/systemd"
++#endif /* USE_SYSTEMD */
+ 
+ #define MINIMAL_MAKE  1       /* Remove disabled scripts from .depend.boot,
+                                * .depend.start, .depend.halt, and 
.depend.stop */
+@@ -66,8 +68,11 @@
+ # include <sys/mount.h>
+ #endif /* SUSE */
+ #include "listing.h"
++#if defined(USE_SYSTEMD)
+ #include "systemd.h"
+-
++/* Systemd support */
++static DBusConnection *sbus;
++#endif /* USE_SYSTEMD */
+ #ifdef __m68k__ /* Fix #493637 */
+ #  define aligned(a)
+ #endif
+@@ -133,9 +138,6 @@
+ /* Upstart suport */
+ static const char *upstartjob_path = "/lib/init/upstart-job";
+ 
+-/* Systemd support */
+-static DBusConnection *sbus;
+-
+ /*
+  * For a description of regular expressions see regex(7).
+  */
+@@ -188,9 +190,11 @@
+ static boolean set_override = false;
+ static boolean set_insconf = false;
+ 
++#if defined(USE_SYSTEMD)
+ /* Wether systemd is active or not */
+ static boolean systemd = false;
+ static boolean is_overridden_by_systemd(const char *);
++#endif /* USE_SYSTEMD */
+ 
+ /* Search results points here */
+ typedef struct lsb_struct {
+@@ -1720,6 +1724,7 @@
+     }
+ #endif /* SUSE */
+ 
++#if defined(USE_SYSTEMD)
+     if (systemd) {
+       const char *serv;
+       serv = path;
+@@ -1729,6 +1734,7 @@
+           ret |= FOUND_LSB_SYSTEMD;
+       }
+     }
++#endif
+ 
+     if (is_upstart_job(path) != (char*)0) {
+       /*
+@@ -2287,6 +2293,7 @@
+     regfree(&creg.isactive);
+ }
+ 
++#if defined(USE_SYSTEMD)
+ /*
+  * Maps between systemd and SystemV
+  */
+@@ -2437,6 +2444,7 @@
+       }
+     }
+ }
++#endif /* USE_SYSTEMD */
+ 
+ static void expand_faci(list_t *restrict rlist, list_t *restrict head,
+                       int *restrict deep) 
attribute((noinline,nonnull(1,2,3)));
+@@ -2632,6 +2640,7 @@
+ }
+ #endif /* SUSE */
+ 
++#if defined(USE_SYSTEMD)
+ /*
+  * Systemd integration
+  */
+@@ -2687,6 +2696,7 @@
+       free (p);
+     }
+ }
++#endif /* USE_SYSTEMD */
+ 
+ static struct option long_options[] =
+ {
+@@ -2739,7 +2749,9 @@
+     char * override_path = OVERRIDEDIR;
+     char * insconf = INSCONF;
+     const char *const ipath = path;
++#if defined(USE_SYSTEMD)
+     char * systemd_binary_path = SYSTEMD_BINARY_PATH;
++#endif
+     int runlevel, c, dfd;
+     boolean del = false;
+     boolean defaults = false;
+@@ -2761,8 +2773,13 @@
+ 
+     for (c = 0; c < argc; c++)
+       argr[c] = (char*)0;
++#if defined(USE_SYSTEMD)
++#  define OPTIONS "c:dfrhvno:p:u:esy:"
++#else
++#  define OPTIONS "c:dfrhvno:p:u:es"
++#endif
+ 
+-    while ((c = getopt_long(argc, argv, "c:dfrhvno:p:u:esy:", long_options, 
(int *)0)) != -1) {
++    while ((c = getopt_long(argc, argv, OPTIONS, long_options, (int *)0)) != 
-1) {
+       size_t l;
+       switch (c) {
+           case 'c':
+@@ -2814,11 +2831,13 @@
+           case 'e':
+               recursive = true;
+               break;
++#if defined(USE_SYSTEMD)
+           case 'y':
+               if (optarg == (char*)0 || *optarg == '\0')
+                   goto err;
+               systemd_binary_path = optarg;
+               break;
++#endif /* USE_SYSTEMD */
+           case '?':
+           err:
+               error("For help use: %s -h\n", myname);
+@@ -2940,6 +2959,7 @@
+           printf("Overwrite argument for %s is %s\n", argv[c], argr[c]);
+ #endif /* DEBUG */
+ 
++#if defined(USE_SYSTEMD)
+ #ifdef SUSE
+     if (!underrpm())
+ #endif
+@@ -2955,23 +2975,26 @@
+       systemd_close_conn(sbus);
+       systemd = true;
+     }
+-
++#endif /* USE_SYSTEMD */
+     /*
+      * Scan and set our configuration for virtual services.
+      */
+     scan_conf(insconf);
+ 
++#if defined(USE_SYSTEMD)
+     /*
+      * Handle Systemd target as system facilities (<name>.target -> $<name>)
+      */
+     if (systemd)
+       import_systemd_facilities();
++#endif /* USE_SYSTEMD */
+ 
+     /*
+      * Expand system facilities to real services
+      */
+     expand_conf();
+ 
++#if defined(USE_SYSTEMD)
+     /*
+      * Handle Systemd services (<name>.service -> <name>)
+      */
+@@ -2979,7 +3002,7 @@
+       import_systemd_services();
+       systemd_free();         /* Not used anymore */
+     }
+-
++#endif /* USE_SYSTEMD */
+     /*
+      * Initialize the regular scanner for the scripts.
+      */

Modified: trunk/src/insserv/debian/patches/series
URL: 
http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/series?rev=1108&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/series     (original)
+++ trunk/src/insserv/debian/patches/series     Wed Feb 19 12:34:50 2014
@@ -13,3 +13,4 @@
 200_upstream-fixes.patch
 210_systemd_path_option.patch
 220_no_MAXSYMLINKS.patch
+230_systemd_on_linux.patch

Modified: trunk/src/insserv/debian/run-testsuite
URL: 
http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/run-testsuite?rev=1108&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite      (original)
+++ trunk/src/insserv/debian/run-testsuite      Wed Feb 19 12:34:50 2014
@@ -12,7 +12,9 @@
 fi
 
 # Run tests without trying to talk to systemd
-insopts="-y /non-existing"
+if [ Linux = $(uname -s) ] ; then
+    insopts="-y /non-existing"
+fi
 
 update_conf() {
 set +C
@@ -2418,7 +2420,9 @@
 test_cross_runlevel_dep() {
 
 initdir_purge
-insopts="-y /bin/true"
+if [ Linux = $(uname -s) ] ; then
+    insopts="-y /bin/true"
+fi
 
 insertscript rpcbind <<'EOF'
 ### BEGIN INIT INFO
@@ -2456,7 +2460,9 @@
 check_script_present 2 nfs-common
 check_script_present 2 nfs-server
 check_order 2 nfs-common nfs-server
-insopts="-y /non-existing"
+if [ Linux = $(uname -s) ] ; then
+    insopts="-y /non-existing"
+fi
 }
 ##########################################################################
 


_______________________________________________
Initscripts-ng-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/initscripts-ng-commits

Reply via email to