debian/0000775000000000000000000000000012270515212007165 5ustar debian/urfkill.install0000664000000000000000000000012512270514661012232 0ustar etc/ usr/share/dbus-1/ usr/share/polkit-1/ usr/share/man/ usr/lib/*/urfkill/urfkilld debian/urfkill.dirs0000664000000000000000000000002012270514661011517 0ustar var/lib/urfkill debian/control0000664000000000000000000000506012270515140010571 0ustar Source: urfkill Section: net Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Keng-Yu Lin Build-Depends: debhelper (>= 9), dh-autoreconf (>=2), dh-exec (>=0.3), autotools-dev, libglib2.0-dev, libdbus-1-dev, libdbus-glib-1-dev, libudev-dev, libpolkit-gobject-1-dev, libexpat1-dev, intltool (>=0.40.0), gobject-introspection (>= 0.6.7), libgirepository1.0-dev (>= 0.6.7), gir1.2-gtk-2.0, gir1.2-gtk-3.0, autopoint, gtk-doc-tools, hardening-wrapper Standards-Version: 3.9.4 Homepage: http://www.freedesktop.org/wiki/Software/urfkill Package: urfkill Architecture: any Multi-Arch: foreign Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, libglib2.0-0, libdbus-1-3, libdbus-glib-1-2, dbus, libgudev-1.0-0, libpolkit-gobject-1-0, libexpat1, systemd-services Description: wireless killswitch management daemon for laptops The urfkill daemon allow managing the rfkill-related hotkeys and the killswitches in a more configurable way for the common RF devices (WiFi, Bluetooth, WWan...). It handles the various key codes (KEY_WLAN, KEY_BLUETOOTH, KEY_RFKILL...) and toggles the killswitches based on a pre-defined policy. Package: liburfkill-glib0 Section: libs Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Recommends: urfkill Depends: ${shlibs:Depends}, ${misc:Depends} Description: wireless killswitch management library liburfkill provides the basic functions for urfkilld, which handles the configuration of the rfkill-related function keys and provides the management of the wireless killswitches. Package: liburfkill-glib-dev Section: libdevel Architecture: any Pre-Depends: ${misc:Pre-Depends} Depends: liburfkill-glib0 (= ${binary:Version}), gir1.2-urfkill-glib0 (= ${binary:Version}), ${misc:Depends} Description: wireless killswitch management library (development files) liburfkill provides the basic functions for urfkilld, which handles the configuration of the rfkill-related function keys and provides the management of the wireless killswitches. . This package contains development files for the urfkill library. Package: gir1.2-urfkill-glib0 Section: introspection Architecture: any Pre-Depends: ${misc:Pre-Depends} Depends: ${gir:Depends}, ${misc:Depends}, liburfkill-glib0 Description: GObject introspection data for the urfkill library This package contains introspection data for liburfkill. It provides the management of the wireless killswitches . It can be used by packages using the GIRepository format to generate dynamic bindings. debian/gir1.2-urfkill-glib0.install0000664000000000000000000000006612270514661014231 0ustar usr/lib/*/girepository-1.0/Urfkill-*.typelib usr/lib/ debian/source/0000775000000000000000000000000012270515211010464 5ustar debian/source/format0000664000000000000000000000001412270514661011702 0ustar 3.0 (quilt) debian/liburfkill-glib0.install0000664000000000000000000000003312270514661013712 0ustar usr/lib/*/liburfkill*.so.* debian/watch0000664000000000000000000000044212270514661010225 0ustar version=3 opts=uversionmangle=s/_/./g;s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|b|a)[\-\.]?\d*)$/$1~$2/ \ https://github.com/lcp/urfkill/tags .*[^n]/(?:v||release-|urfkill[_\-])(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) # Bart Martens Fri, 18 Jan 2013 23:28:33 +0000 debian/rules0000775000000000000000000000144312270514661010256 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_BUILD_HARDENING=1 debian/urfkill.init: debian/urfkill.init.in sed -e "s/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g" $? > debian/`basename $? .in` chmod 755 $@ debian/urfkill.upstart: debian/urfkill.upstart.in sed -e "s/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g" $? > debian/`basename $? .in` override_dh_autoreconf: NOCONFIGURE=1 dh_autoreconf gnome-autogen.sh intltoolize -f -c override_dh_auto_clean: rm -f debian/urfkill.init debian/urfkill.upstart dh_auto_clean override_dh_auto_configure: debian/urfkill.init debian/urfkill.upstart dh_auto_configure -- --libexecdir=\$${libdir}/urfkill \ --with-session-tracking=systemd %: dh $@ --with autotools_dev,autoreconf debian/compat0000664000000000000000000000000212270514661010372 0ustar 9 debian/patches/0000775000000000000000000000000012270515211010613 5ustar debian/patches/01_fix_ftbfs_on_intltool.patch0000664000000000000000000000107112270514661016535 0ustar Description: Add missing POTFILES.* needed for successful building Author: Keng-Yu Lin Last-Update: 2012-07-17 --- po/POTFILES.in | 1 + po/POTFILES.skip | 1 + 2 files changed, 2 insertions(+) Index: b/po/POTFILES.skip =================================================================== --- /dev/null +++ b/po/POTFILES.skip @@ -0,0 +1 @@ +policy/org.freedesktop.urfkill.policy.in Index: b/po/POTFILES.in =================================================================== --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1 @@ +src/urf-main.c debian/patches/urfkill-debug-input.patch0000664000000000000000000000157112270514661015541 0ustar From: Mathieu Trudel-Lapierre Subject: add some debug message for input events Some people have reported there are issues with high CPU usage because of the input event handler; try to get additional information so we can actually debug this if there really is an issue. diff --git a/src/urf-input.c b/src/urf-input.c index f53a222..9f1d377 100644 --- a/src/urf-input.c +++ b/src/urf-input.c @@ -83,6 +83,12 @@ input_event_cb (GIOChannel *source, GIOCondition condition, UrfInput *input) { + g_debug ("input event condition %x (%s%s%s%s )", + condition & G_IO_IN ? " G_IO_IN" : "", + condition & G_IO_ERR ? " G_IO_ERR" : "", + condition & G_IO_HUP ? " G_IO_HUP" : "", + condition & ~(G_IO_IN | G_IO_ERR | G_IO_HUP) ? " with extra state" : ""); + if (condition & G_IO_IN) { GIOStatus status; struct input_event event; debian/patches/03_fix_nfc_crash.patch0000664000000000000000000000112512270514661014741 0ustar From: Tony Espy Subject: Add missing RFKILL_TYPE_NFC. Last-Updated: 2013-12-09 Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/urfkill/+bug/1218567 Index: urfkill-nocrash/src/urf-utils.c =================================================================== --- urfkill-nocrash.orig/src/urf-utils.c 2013-08-28 11:10:16.145814096 -0400 +++ urfkill-nocrash/src/urf-utils.c 2013-08-28 11:11:14.241816908 -0400 @@ -169,6 +169,8 @@ return "GPS"; case RFKILL_TYPE_FM: return "FM"; + case RFKILL_TYPE_NFC: + return "NFC"; default: g_assert_not_reached (); } debian/patches/02_fix_arm_profile_crash.patch0000664000000000000000000000255512270514661016501 0ustar From: Tony Espy Subject: Don't crash for missing DMI. Last-Updated: 2013-12-09 Some systems don't have it. Index: urfkill/src/urf-config.c =================================================================== --- urfkill.orig/src/urf-config.c 2013-08-27 17:50:22.976552733 -0400 +++ urfkill/src/urf-config.c 2013-08-27 17:50:22.972552733 -0400 @@ -357,7 +357,7 @@ } match_key = get_match_key (info->hardware_info, key); - if (!match_rule (match_key, operator, match_body)) + if (match_key && !match_rule (match_key, operator, match_body)) return; } else if (g_strcmp0 (name, "option") == 0) { for (i = 0; atts[i]; i++) { Index: urfkill/src/urf-utils.c =================================================================== --- urfkill.orig/src/urf-utils.c 2013-08-27 17:50:22.976552733 -0400 +++ urfkill/src/urf-utils.c 2013-08-27 17:51:04.044554721 -0400 @@ -21,13 +21,18 @@ return NULL; } - info = g_new0 (DmiInfo, 1); - enumerate = udev_enumerate_new (udev); udev_enumerate_add_match_subsystem (enumerate, "dmi"); udev_enumerate_scan_devices (enumerate); devices = udev_enumerate_get_list_entry (enumerate); + if (devices == NULL) { + g_warning("No dmi devices found."); + return NULL; + } + + info = g_new0 (DmiInfo, 1); + udev_list_entry_foreach (dev_list_entry, devices) { const char *path; const char *attribute; debian/patches/04_add_flight_mode.patch0000664000000000000000000002707612270514661015254 0ustar Index: urfkill/src/urf-daemon.c =================================================================== --- urfkill.orig/src/urf-daemon.c 2013-08-27 17:54:43.396503000 -0400 +++ urfkill/src/urf-daemon.c 2013-08-28 16:31:56.326748170 -0400 @@ -57,6 +57,13 @@ " " " " " " +" " +" " +" " +" " +" " +" " +" " " " " " " " @@ -116,6 +123,7 @@ UrfInput *input; UrfConsolekit *consolekit; gboolean key_control; + gboolean flight_mode; gboolean master_key; GDBusConnection *connection; GDBusNodeInfo *introspection_data; @@ -302,6 +310,58 @@ } /** + * urf_daemon_is_flight_mode: + **/ +gboolean +urf_daemon_is_flight_mode (UrfDaemon *daemon, + GDBusMethodInvocation *invocation) +{ + UrfDaemonPrivate *priv = daemon->priv; + GVariant *value; + + value = g_variant_new ("(b)", priv->flight_mode); + g_dbus_method_invocation_return_value (invocation, value); + + return TRUE; +} + +/** + * urf_daemon_flight_mode: + **/ +gboolean +urf_daemon_flight_mode (UrfDaemon *daemon, + const gboolean block, + GDBusMethodInvocation *invocation) +{ + UrfDaemonPrivate *priv = daemon->priv; + PolkitSubject *subject = NULL; + gboolean ret = FALSE; + + if (!urf_arbitrator_has_devices (priv->arbitrator)) + goto out; + + subject = urf_polkit_get_subject (priv->polkit, invocation); + if (subject == NULL) + goto out; + + if (!urf_polkit_check_auth (priv->polkit, subject, "org.freedesktop.urfkill.flight_mode", invocation)) + goto out; + + ret = urf_arbitrator_set_flight_mode (priv->arbitrator, block); + + if (ret == TRUE) + priv->flight_mode = block; + + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", ret)); +out: + if (subject != NULL) + g_object_unref (subject); + + return ret; +} + +/** * urf_daemon_is_inhibited: **/ gboolean @@ -369,6 +429,14 @@ } else if (g_strcmp0 (method_name, "EnumerateDevices") == 0) { urf_daemon_enumerate_devices (daemon, invocation); return; + } else if (g_strcmp0 (method_name, "IsFlightMode") == 0) { + urf_daemon_is_flight_mode (daemon, invocation); + return; + } else if (g_strcmp0 (method_name, "FlightMode") == 0) { + gboolean block; + g_variant_get (parameters, "(b)", &block); + urf_daemon_flight_mode (daemon, block, invocation); + return; } else if (g_strcmp0 (method_name, "IsInhibited") == 0) { urf_daemon_is_inhibited (daemon, invocation); return; Index: urfkill/src/urf-daemon.h =================================================================== --- urfkill.orig/src/urf-daemon.h 2013-08-27 17:54:43.396503000 -0400 +++ urfkill/src/urf-daemon.h 2013-08-28 13:24:15.198203163 -0400 @@ -71,6 +71,11 @@ GDBusMethodInvocation *invocation); gboolean urf_daemon_enumerate_devices (UrfDaemon *daemon, GDBusMethodInvocation *invocation); +gboolean urf_daemon_is_flight_mode (UrfDaemon *daemon, + GDBusMethodInvocation *invocation); +gboolean urf_daemon_flight_mode (UrfDaemon *daemon, + const gboolean block, + GDBusMethodInvocation *invocation); gboolean urf_daemon_is_inhibited (UrfDaemon *daemon, GDBusMethodInvocation *invocation); gboolean urf_daemon_inhibit (UrfDaemon *daemon, Index: urfkill/src/urf-device.c =================================================================== --- urfkill.orig/src/urf-device.c 2013-08-28 11:09:20.000000000 -0400 +++ urfkill/src/urf-device.c 2013-08-28 13:02:12.554139151 -0400 @@ -34,6 +34,20 @@ #define URF_DEVICE_INTERFACE "org.freedesktop.URfkill.Device" +/* + * TODO: new property 'ofono' has been added so that + * the arbitrator code can handle special as the modem + * managed by ofono/rilmodem doesn't provide a driver + * -based rfkill interface. + * + * Adding a new 'type' value is possible, but as the + * current types are pulled from , + * this isn't ideal either. + * + * One last alternative would be a 'meta-type' property + * ( suggestions welcoe ) which could have values like + * 'rfkill', 'ofono', 'custom', ... + */ static const char introspection_xml[] = "" " " @@ -44,6 +58,7 @@ " " " " " " +" " " " ""; @@ -56,6 +71,7 @@ PROP_DEVICE_SOFT, PROP_DEVICE_HARD, PROP_DEVICE_PLATFORM, + PROP_DEVICE_OFONO, PROP_LAST }; @@ -76,6 +92,7 @@ gboolean soft; gboolean hard; gboolean platform; + gboolean ofono; KillswitchState state; char *object_path; GDBusConnection *connection; @@ -231,6 +248,15 @@ } /** + * urf_device_is_ofono: + */ +gboolean +urf_device_is_ofono (UrfDevice *device) +{ + return device->priv->ofono; +} + +/** * urf_device_get_property: **/ static void Index: urfkill/src/urf-arbitrator.c =================================================================== --- urfkill.orig/src/urf-arbitrator.c 2013-08-28 11:09:20.000000000 -0400 +++ urfkill/src/urf-arbitrator.c 2013-08-28 18:52:00.311154899 -0400 @@ -63,6 +63,7 @@ guint watch_id; GList *devices; /* a GList of UrfDevice */ UrfKillswitch *killswitch[NUM_RFKILL_TYPES]; + // add ofono ril control here... }; G_DEFINE_TYPE(UrfArbitrator, urf_arbitrator, G_TYPE_OBJECT) @@ -151,6 +152,60 @@ } /** + * urf_arbitrator_set_flight_mode: + **/ +gboolean +urf_arbitrator_set_flight_mode (UrfArbitrator *arbitrator, + const gboolean block) +{ + UrfArbitratorPrivate *priv = arbitrator->priv; + KillswitchState state = KILLSWITCH_STATE_NO_ADAPTER; + KillswitchState saved_state = KILLSWITCH_STATE_NO_ADAPTER; + gboolean ret = FALSE; + int i; + + g_message("set_flight_mode: %d:", (int) block); + + for (i = RFKILL_TYPE_ALL + 1; i < NUM_RFKILL_TYPES; i++) { + state = urf_killswitch_get_state (priv->killswitch[i]); + + if (state != KILLSWITCH_STATE_NO_ADAPTER) { + g_message("killswitch[%s] state: %s", type_to_string(i), + state_to_string(state)); + + /* + * TODO: This code isn't really properly guarded by a transaction; + * should we add rollback support if one of the operations fail?? + */ + + if (block == TRUE) { + // save state, & block if necessary + urf_killswitch_set_saved_state (priv->killswitch[i], state); + + if (state == KILLSWITCH_STATE_UNBLOCKED) { + g_message ("calling set_block 1"); + ret = urf_arbitrator_set_block (arbitrator, i, block); + } + } else { + saved_state = urf_killswitch_get_saved_state(priv->killswitch[i]); + g_message("saved_state is: %s", state_to_string(saved_state)); + + if (saved_state == KILLSWITCH_STATE_UNBLOCKED) { + g_message ("calling set_block 0"); + ret = urf_arbitrator_set_block (arbitrator, i, block); + } + + } + + if (ret == FALSE) + break; + } + } + + return ret; +} + +/** * urf_arbitrator_get_state: **/ KillswitchState Index: urfkill/src/urf-arbitrator.h =================================================================== --- urfkill.orig/src/urf-arbitrator.h 2013-08-27 17:54:43.396503000 -0400 +++ urfkill/src/urf-arbitrator.h 2013-08-28 13:27:55.870213843 -0400 @@ -77,6 +77,8 @@ gboolean urf_arbitrator_set_block_idx (UrfArbitrator *arbitrator, const guint index, const gboolean block); +gboolean urf_arbitrator_set_flight_mode (UrfArbitrator *arbitrator, + const gboolean block); KillswitchState urf_arbitrator_get_state (UrfArbitrator *arbitrator, guint type); KillswitchState urf_arbitrator_get_state_idx (UrfArbitrator *arbitrator, Index: urfkill/src/urf-device.h =================================================================== --- urfkill.orig/src/urf-device.h 2013-08-27 17:54:43.396503000 -0400 +++ urfkill/src/urf-device.h 2013-08-28 13:03:33.018143045 -0400 @@ -68,6 +68,7 @@ const char *urf_device_get_object_path (UrfDevice *device); KillswitchState urf_device_get_state (UrfDevice *device); gboolean urf_device_is_platform (UrfDevice *device); +gboolean urf_device_is_ofono (UrfDevice *device); G_END_DECLS Index: urfkill/policy/org.freedesktop.urfkill.policy.in =================================================================== --- urfkill.orig/policy/org.freedesktop.urfkill.policy.in 2013-08-27 17:54:43.396503000 -0400 +++ urfkill/policy/org.freedesktop.urfkill.policy.in 2013-08-28 16:34:54.786756807 -0400 @@ -35,4 +35,14 @@ + + <_description>Enable flight mode + <_message>Authentication is required to enable/disable flight mode + + no + yes + + + + Index: urfkill/src/urf-killswitch.c =================================================================== --- urfkill.orig/src/urf-killswitch.c 2013-08-28 17:36:32.390935761 -0400 +++ urfkill/src/urf-killswitch.c 2013-08-29 10:53:05.529172795 -0400 @@ -51,6 +51,7 @@ { GList *devices; enum rfkill_type type; + KillswitchState saved_state; KillswitchState state; char *object_path; GDBusConnection *connection; @@ -69,6 +70,20 @@ } KillswitchState +urf_killswitch_get_saved_state (UrfKillswitch *killswitch) + +{ + return killswitch->priv->saved_state; +} + +void +urf_killswitch_set_saved_state (UrfKillswitch *killswitch, + KillswitchState state) +{ + killswitch->priv->saved_state = state; +} + +KillswitchState aggregate_states (KillswitchState platform, KillswitchState non_platform) { @@ -127,6 +142,7 @@ if (priv->devices == NULL) { priv->state = KILLSWITCH_STATE_NO_ADAPTER; + priv->saved_state = KILLSWITCH_STATE_NO_ADAPTER; return; } @@ -152,6 +168,9 @@ if (platform_checked) new_state = aggregate_states (platform, new_state); + + g_message("killswitch state: %s new_state: %s", + state_to_string(priv->state), state_to_string(new_state)); /* emit a signal for change */ if (priv->state != new_state) { priv->state = new_state; @@ -175,6 +194,7 @@ device_changed_cb (UrfDevice *device, UrfKillswitch *killswitch) { + g_message("device_changed_cb: %s", urf_device_get_name(device)); urf_killswitch_state_refresh (killswitch); } @@ -315,6 +335,7 @@ killswitch->priv->devices = NULL; killswitch->priv->object_path = NULL; killswitch->priv->state = KILLSWITCH_STATE_NO_ADAPTER; + killswitch->priv->saved_state = KILLSWITCH_STATE_NO_ADAPTER; } static GVariant * Index: urfkill/src/urf-killswitch.h =================================================================== --- urfkill.orig/src/urf-killswitch.h 2013-08-28 17:36:34.486935862 -0400 +++ urfkill/src/urf-killswitch.h 2013-08-28 18:35:19.195106448 -0400 @@ -59,7 +59,10 @@ UrfDevice *device); void urf_killswitch_del_device (UrfKillswitch *killswitch, UrfDevice *device); -KillswitchState urf_killswitch_get_state (UrfKillswitch *killswitch); +KillswitchState urf_killswitch_get_state (UrfKillswitch *killswitch); +KillswitchState urf_killswitch_get_saved_state (UrfKillswitch *killswitch); +void urf_killswitch_set_saved_state (UrfKillswitch *killswitch, + KillswitchState state); G_END_DECLS debian/patches/urf_log_handler.patch0000664000000000000000000000632112270514661015000 0ustar From: Mathieu Trudel-Lapierre Subject: Create a log handler to show messages in syslog. Last-Update: 2013-12-09 --- src/urf-main.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) Index: b/src/urf-main.c =================================================================== --- a/src/urf-main.c +++ b/src/urf-main.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -40,6 +41,8 @@ #define URFKILL_CONFIG_FILE URFKILL_CONFIG_DIR"urfkill.conf" static GMainLoop *loop = NULL; +static int default_log_level = LOG_EMERG | LOG_ALERT | LOG_CRIT | LOG_ERR | LOG_WARNING | LOG_NOTICE | LOG_INFO; + static void on_name_lost (GDBusConnection *connection, const gchar *name, @@ -73,6 +76,44 @@ urf_main_timed_exit_cb (GMainLoop *loop) } /** + * urf_log_handler: + * + * Writes a message to syslog. + */ +static void +urf_log_handler (const gchar *log_domain, + GLogLevelFlags level, + const gchar *message, + gpointer ignored) +{ + int syslog_priority; + + switch (level) { + case G_LOG_LEVEL_ERROR: + syslog_priority = LOG_CRIT; + break; + case G_LOG_LEVEL_CRITICAL: + syslog_priority = LOG_ERR; + break; + case G_LOG_LEVEL_WARNING: + syslog_priority = LOG_WARNING; + break; + case G_LOG_LEVEL_MESSAGE: + syslog_priority = LOG_NOTICE; + break; + case G_LOG_LEVEL_DEBUG: + syslog_priority = LOG_DEBUG; + break; + case G_LOG_LEVEL_INFO: + default: + syslog_priority = LOG_INFO; + break; + } + + syslog (syslog_priority, "%s", message); +} + +/** * main: **/ gint @@ -86,6 +127,7 @@ main (gint argc, gchar **argv) gboolean timed_exit = FALSE; gboolean immediate_exit = FALSE; gboolean fork_daemon = FALSE; + gboolean enable_debug = FALSE; guint owner_id; guint timer_id = 0; struct passwd *user; @@ -100,6 +142,8 @@ main (gint argc, gchar **argv) { "immediate-exit", '\0', 0, G_OPTION_ARG_NONE, &immediate_exit, /* TRANSLATORS: exit straight away, used for automatic profiling */ _("Exit after the engine has loaded"), NULL }, + { "debug", '\0', 0, G_OPTION_ARG_NONE, &enable_debug, + _("Enable debugging messages."), NULL }, { "fork", 'f', 0, G_OPTION_ARG_NONE, &fork_daemon, /* TRANSLATORS: fork to background */ _("Fork on startup"), NULL }, @@ -127,6 +171,20 @@ main (gint argc, gchar **argv) loop = g_main_loop_new (NULL, FALSE); + if (fork_daemon) + openlog (G_LOG_DOMAIN, LOG_PID, LOG_DAEMON); + else + openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR | LOG_PID, LOG_USER); + + setlogmask(default_log_level); + if (enable_debug) + setlogmask(default_log_level | LOG_DEBUG); + + g_log_set_handler (G_LOG_DOMAIN, + G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, + urf_log_handler, + NULL); + /* acquire name */ owner_id = g_bus_own_name (G_BUS_TYPE_SYSTEM, URFKILL_SERVICE_NAME, @@ -208,6 +266,8 @@ main (gint argc, gchar **argv) retval = 0; g_bus_unown_name (owner_id); out: + closelog (); + if (daemon != NULL) g_object_unref (daemon); if (config != NULL) debian/patches/series0000664000000000000000000000007112270514661012036 0ustar 01_fix_ftbfs_on_intltool.patch urfkill-debug-input.patch debian/copyright0000664000000000000000000000533212270514661011132 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: urfkill Source: https://github.com/lcp/urfkill/ Files: * Copyright: 2011 Gary Ching-Pang Lin 2005-2008 Marcel Holtmann 2006-2009 Bastien Nocera 2008 David Zeuthen 2008 Richard Hughes License: GPL-2 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". Files: liburfkill-glib/* Copyright: 2011 Gary Ching-Pang Lin License: LGPL-2 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. . On Debian systems, the complete text of the GNU Lesser General Public License can be found in `/usr/share/common-licenses/LGPL-2'. Files: debian/* Copyright: 2011 Keng-Yu Lin License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". debian/docs0000664000000000000000000000001412270514661010042 0ustar NEWS README debian/changelog0000664000000000000000000000703312270515207011046 0ustar urfkill (0.4.0+20140119.184011.2a32da2-0ubuntu2) trusty; urgency=medium * debian/control: replace Depends on consolekit with systemd-services for the urfkill binary package: it's now built with logind support instead. -- Mathieu Trudel-Lapierre Fri, 24 Jan 2014 11:53:26 -0500 urfkill (0.4.0+20140119.184011.2a32da2-0ubuntu1) trusty; urgency=low * New release / git snapshot from github.com/lcp/urfkill: - Add a flight mode option - Implement killswitch persistence (saving and restoring across reboot) - Support logging to syslog - Added a debug mode * debian/rules: configure with --with-session-tracking=systemd. * debian/patches/02_fix_arm_profile_crash.patch, debian/patches/03_fix_nfc_crash.patch: dropped, included. * debian/source/format: switch to format 3.0 (quilt) * debian/urfkill.dirs: add /var/lib/urfkill so that it gets created. * debian/urfkill-debug-input.patch: debug input events too. Set G_MESSAGES_DEBUG=URfkill to start urfkill to debug the messages. * debian/urfkill.upstart.in: upstart job for the daemon. * debian/control, debian/rules: don't do a separate -dbg package. -- Mathieu Trudel-Lapierre Mon, 23 Dec 2013 14:12:32 -0500 urfkill (0.4.0-4ubuntu1) trusty; urgency=low [ Tony Espy ] * debian/control: create urfkill-dbg package. * debian/rules: added dh_strip logic for new -dbg package. * debian/patches/02_fix_arm_profile_crash.patch: check for for the existence of DMI devices before creating an instance of DmiInfo to prevent a crash. * debian/patches/03_fix_nfc_crash.patch: add support for the new RFKILL_NFC type to prevent an assertion/crash. (LP: #1218567) [ Mathieu Trudel-Lapierre ] * debian/rules: use --with autotools_dev to update config.{sub,guess} on build so as to fix building on arm64. -- Mathieu Trudel-Lapierre Mon, 09 Dec 2013 11:20:16 -0500 urfkill (0.4.0-4) unstable; urgency=low [Martin Pitt] * debian/control: Add missing consolekit dependency. (Closes: #706569) -- Keng-Yu Lin Thu, 15 Aug 2013 13:58:52 +0800 urfkill (0.4.0-3) unstable; urgency=low * debian/gir1.2-urfkill-glib0.install: change to non-multi-arch path. (Closes: #695341) * Bump Standards-Version to 3.9.4 [Bart Martens] * debian/watch: watch the tag in github. -- Keng-Yu Lin Tue, 19 Mar 2013 17:50:54 +0800 urfkill (0.4.0-2) unstable; urgency=low [Mathieu Trudel-Lapierre] * debian/rules: clean up sample comments, simplify rules to make use of DEB_HOST_MULTIARCH as it is already available. * debian/urfkill.init.in: fix typo: add lib/ to the multiarch path to the urfkilld binary. (Closes: #694821) -- Keng-Yu Lin Fri, 04 Jan 2013 21:15:20 +0800 urfkill (0.4.0-1) unstable; urgency=low * New upstream release (Closes: #668888) * Add Multiarch support * Bump Standards-Version to 3.9.3 * Changed gir1.2-urfkill-glib0 to introspection section * Added DM-Upload-Allowed: yes * Advanced to DH9 * Removed debian/patches/02_add_missing_autogen_sh.patch * Update debian/copyright format to 1.0 * Add DEB-3 compliant headers in debian/patches/* -- Keng-Yu Lin Tue, 24 Jul 2012 22:48:51 +0800 urfkill (0.3.0-1) unstable; urgency=low * New upstream release -- Keng-Yu Lin Thu, 29 Sep 2011 10:48:56 +0800 urfkill (0.2.0-1) unstable; urgency=low * Initial release (Closes: #637351) -- Keng-Yu Lin Thu, 18 Aug 2011 13:06:26 +0800 debian/urfkill.init.in0000664000000000000000000001023112270514661012133 0ustar #! /bin/sh ### BEGIN INIT INFO # Provides: urfkilld # Required-Start: $network $local_fs $remote_fs # Required-Stop: $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: # Description: ### END INIT INFO # Author: Keng-Yu Lin PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC=urfkill # Introduce a short description here NAME=urfkill # Introduce the short server's name here DAEMON=/usr/lib/@DEB_HOST_MULTIARCH@/urfkill/urfkilld # Introduce the server's location here DAEMON_ARGS="" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x $DAEMON ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions # # Function that starts the daemon/service # do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --background --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --background -- \ $DAEMON_ARGS \ || return 2 # Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend # on this one. As a last resort, sleep for some time. } # # Function that stops the daemon/service # do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks # and if the daemon is only ever run from this initscript. # If the above conditions are not satisfied then add some other code # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" } # # Function that sends a SIGHUP to the daemon/service # do_reload() { # # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. # start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME return 0 } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; #reload|force-reload) # # If do_reload() is not implemented then leave this commented out # and leave 'force-reload' as an alias for 'restart'. # #log_daemon_msg "Reloading $DESC" "$NAME" #do_reload #log_end_msg $? #;; restart|force-reload) # # If the "reload" option is implemented then remove the # 'force-reload' alias # log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac : debian/liburfkill-glib-dev.install0000664000000000000000000000014712270514661014414 0ustar usr/include usr/lib/*/*.so usr/lib/*/liburfkill*.a usr/lib/*/pkgconfig usr/share/gir-1.0/Urfkill-*.gir debian/urfkill.upstart.in0000664000000000000000000000060112270514661012672 0ustar # urfkill - killswitch manager # # This daemon manages the states of various radios on the system, such as # for WiFi, Bluetooth, Cellular, FM, etc. and can properly handle input events # to toggle these radios on devices that have such input keys. description "killswitch manager" start on started udev stop on shutdown respawn exec /usr/lib/@DEB_HOST_MULTIARCH@/urfkill/urfkilld