X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=NetworkManager-pld.patch;h=a7cf3edb354f9f520580154995db273f69495b79;hb=532f20aaeaab187e486c181bcdc2f8e5c69d2bc4;hp=7fd593c52fb119ec8016a5a3e2158d77e1bb3747;hpb=ed122f583134d3f91047742a4a27433382ed170d;p=packages%2FNetworkManager.git diff --git a/NetworkManager-pld.patch b/NetworkManager-pld.patch index 7fd593c..a7cf3ed 100644 --- a/NetworkManager-pld.patch +++ b/NetworkManager-pld.patch @@ -1,44 +1,108 @@ -diff -urN NetworkManager-0.6.2-o/configure.in NetworkManager-0.6.2/configure.in ---- NetworkManager-0.6.2-o/configure.in 2006-03-27 09:05:17.000000000 -0700 -+++ NetworkManager-0.6.2/configure.in 2006-04-03 13:39:20.000000000 -0600 -@@ -60,7 +60,7 @@ - exit 1 - else - case $with_distro in -- redhat|suse|gentoo|debian|slackware|arch) ;; -+ redhat|suse|gentoo|debian|slackware|arch|pld) ;; - *) - echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)" - exit 1 -@@ -72,6 +72,7 @@ - AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian) - AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware) - AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch) -+AM_CONDITIONAL(TARGET_PLD, test x"$with_distro" = xpld) - - AC_MSG_CHECKING([for wireless-tools >= 28pre9]) - AC_TRY_COMPILE([#include ], -diff -urN NetworkManager-0.6.2-o/src/backends/Makefile.am NetworkManager-0.6.2/src/backends/Makefile.am ---- NetworkManager-0.6.2-o/src/backends/Makefile.am 2006-03-09 13:52:16.000000000 -0700 -+++ NetworkManager-0.6.2/src/backends/Makefile.am 2006-04-03 13:39:20.000000000 -0600 -@@ -38,6 +38,10 @@ - libnmbackend_la_SOURCES += NetworkManagerSlackware.c +diff -urN NetworkManager-0.8.2/initscript/Makefile.am NetworkManager-0.8.2.new//initscript/Makefile.am +--- NetworkManager-0.8.2/initscript/Makefile.am 2010-10-19 01:44:05.000000000 +0200 ++++ NetworkManager-0.8.2.new//initscript/Makefile.am 2010-11-04 23:09:47.487444761 +0100 +@@ -26,3 +26,6 @@ + if TARGET_LINEXA + SUBDIRS += linexa endif - +if TARGET_PLD -+libnmbackend_la_SOURCES += NetworkManagerPLD.c ++SUBDIRS += PLD +endif -+ - libnmbackend_la_LIBADD = $(DBUS_LIBS) $(GTHREAD_LIBS) - libnmbackend_la_CPPFLAGS = $(DBUS_CFLAGS) \ - $(GTHREAD_CFLAGS) \ -diff -urN NetworkManager-0.6.2-o/src/backends/NetworkManagerPLD.c NetworkManager-0.6.2/src/backends/NetworkManagerPLD.c ---- NetworkManager-0.6.2-o/src/backends/NetworkManagerPLD.c 1969-12-31 17:00:00.000000000 -0700 -+++ NetworkManager-0.6.2/src/backends/NetworkManagerPLD.c 2006-04-03 13:39:45.000000000 -0600 -@@ -0,0 +1,430 @@ +diff -urN NetworkManager-0.8.2/initscript/PLD/Makefile.am NetworkManager-0.8.2.new//initscript/PLD/Makefile.am +--- NetworkManager-0.8.2/initscript/PLD/Makefile.am 1970-01-01 01:00:00.000000000 +0100 ++++ NetworkManager-0.8.2.new//initscript/PLD/Makefile.am 2010-11-04 21:54:27.000000000 +0100 +@@ -0,0 +1,5 @@ ++EXTRA_DIST = NetworkManager ++DISTCLEANFILES = NetworkManager ++ ++initddir = $(sysconfdir)/rc.d/init.d ++initd_SCRIPTS = NetworkManager +diff -urN NetworkManager-0.8.2/initscript/PLD/NetworkManager.in NetworkManager-0.8.2.new//initscript/PLD/NetworkManager.in +--- NetworkManager-0.8.2/initscript/PLD/NetworkManager.in 1970-01-01 01:00:00.000000000 +0100 ++++ NetworkManager-0.8.2.new//initscript/PLD/NetworkManager.in 2010-11-04 21:54:27.000000000 +0100 +@@ -0,0 +1,75 @@ ++#!/bin/sh ++# ++# NetworkManager NetworkManager daemon ++# ++# chkconfig: 345 99 01 ++# ++# description: This is a daemon for automatically switching network \ ++# connections to the best available connection. ++# ++# processname: NetworkManager ++# pidfile: /var/run/NetworkManager.pid ++# ++ ++# Source function library. ++. /etc/rc.d/init.d/functions ++ ++# Source networking configuration. ++. /etc/sysconfig/network ++ ++# Check that networking is up. ++if is_yes "${NETWORKING}"; then ++ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then ++ msg_network_down NetworkManager ++ exit 1 ++ fi ++else ++ exit 0 ++fi ++ ++start() { ++ # Check if the service is already running? ++ if [ ! -f /var/lock/subsys/NetworkManager ]; then ++ msg_starting NetworkManager ++ daemon NetworkManager --pid-file=/var/run/NetworkManager.pid ++ RETVAL=$? ++ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/NetworkManager ++ else ++ msg_already_running NetworkManager ++ fi ++} ++stop() { ++ if [ -f /var/lock/subsys/NetworkManager ]; then ++ # Stop daemons. ++ msg_stopping NetworkManager ++ killproc NetworkManager ++ rm -f /var/lock/subsys/NetworkManager ++ else ++ msg_not_running NetworkManager ++ fi ++} ++ ++upstart_controlled ++ ++RETVAL=0 ++case "$1" in ++ start) ++ start ++ ;; ++ stop) ++ stop ++ ;; ++ restart) ++ stop ++ start ++ ;; ++ status) ++ status NetworkManager ++ RETVAL=$? ++ ;; ++ *) ++ msg_usage "$0 {start|stop|restart|status}" ++ exit 3 ++esac ++ ++exit $RETVAL +diff -urN NetworkManager-0.8.2/src/backends/NetworkManagerPLD.c NetworkManager-0.8.2.new//src/backends/NetworkManagerPLD.c +--- NetworkManager-0.8.2/src/backends/NetworkManagerPLD.c 1970-01-01 01:00:00.000000000 +0100 ++++ NetworkManager-0.8.2.new//src/backends/NetworkManagerPLD.c 2010-11-04 21:54:27.000000000 +0100 +@@ -0,0 +1,62 @@ +/* NetworkManager -- Network link manager + * -+ * Narayan Newton ++ * Patryk Zawadzki + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by @@ -57,145 +121,21 @@ diff -urN NetworkManager-0.6.2-o/src/backends/NetworkManagerPLD.c NetworkManager + * (C) Copyright 2004 RedHat, Inc. + * (C) Copyright 2004 Narayan Newton + * (C) Copyright 2005 wrobell -+ * (C) Copyright 2005 Patryk Zawadzki -+ */ -+ -+#include -+#include -+#include -+#include "NetworkManagerSystem.h" -+#include "NetworkManagerUtils.h" -+#include "nm-device.h" -+#include "nm-device-802-3-ethernet.h" -+#include "nm-device-802-11-wireless.h" -+#include "nm-utils.h" -+ -+/* -+ * PLD specific backend based on Slackware backend. -+ */ -+ -+/* -+ * nm_system_init -+ * -+ * Initializes the distribution-specific system backend -+ * ++ * (C) Copyright 2007 Marcin Banasiak ++ * (C) Copyright 2005-2008 Patryk Zawadzki + */ -+void nm_system_init (void) -+{ -+ nm_system_kill_all_dhcp_daemons(); -+} -+ -+/* -+ * nm_system_device_flush_routes -+ * -+ * Flush all routes associated with a network device -+ * -+ */ -+void nm_system_device_flush_routes (NMDevice *dev) -+{ -+ char buf [100]; + -+ g_return_if_fail (dev != NULL); ++#ifdef HAVE_CONFIG_H ++#include ++#endif + -+ /* Not really applicable for test devices */ -+ if (nm_device_is_test_device (dev)) -+ return; -+ -+ nm_system_device_flush_routes_with_iface (nm_device_get_iface (dev)); -+} -+ -+/* -+ * nm_system_device_flush_routes_with_iface -+ * -+ * Flush all routes associated with a network device -+ * -+ */ -+void nm_system_device_flush_routes_with_iface (const char *iface) -+{ -+ char *buf; -+ -+ g_return_if_fail (iface != NULL); -+ -+ /* Remove routing table entries */ -+ buf = g_strdup_printf ("/sbin/ip route flush dev %s", iface); -+ nm_spawn_process (buf); -+ g_free (buf); -+} -+ -+/* -+ * nm_system_device_flush_addresses -+ * -+ * Flush all network addresses associated with a network device -+ * -+ */ -+void nm_system_device_flush_addresses (NMDevice *dev) -+{ -+ char buf [100]; -+ -+ g_return_if_fail (dev != NULL); -+ -+ /* Not really applicable for test devices */ -+ if (nm_device_is_test_device (dev)) -+ return; -+ nm_system_device_flush_addresses_with_iface (nm_device_get_iface (dev)); -+} -+ -+/* -+ * nm_system_device_flush_addresses_with_iface -+ * -+ * Flush all network addresses associated with a network device -+ * -+ */ -+void nm_system_device_flush_addresses_with_iface (const char *iface) -+{ -+ char *buf; -+ -+ g_return_if_fail (iface != NULL); -+ -+ /* Remove all IP addresses for a device */ -+ buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface); -+ nm_spawn_process (buf); -+ g_free (buf); -+} -+ -+/* -+ * nm_system_device_setup_static_ip4_config -+ * -+ * Set up the device with a particular IPv4 address/netmask/gateway. -+ * -+ * Returns: TRUE on success -+ * FALSE on error -+ * -+ */ -+gboolean nm_system_device_setup_static_ip4_config (NMDevice *dev) -+{ -+ syslog (LOG_WARNING, "nm_system_device_setup_static_ip4_config() is not implemented yet for this distribution.\n"); -+} -+ -+/* -+ * nm_system_device_get_system_config -+ * -+ * Retrieve any relevant configuration info for a particular device -+ * from the system network configuration information. Clear out existing -+ * info before setting stuff too. -+ * -+ */ -+void *nm_system_device_get_system_config (NMDevice *dev, struct NMData *data) -+{ -+ return NULL; -+} ++#include ++#include ++#include + -+/* -+ * nm_system_device_has_active_routes -+ * -+ * Find out whether the specified device has any routes in the routing -+ * table. -+ * -+ */ -+gboolean nm_system_device_has_active_routes (NMDevice *dev) -+{ -+ return FALSE; -+} ++#include "NetworkManagerGeneric.h" ++#include "nm-system.h" ++#include "NetworkManagerUtils.h" + +/* + * nm_system_enable_loopback @@ -205,264 +145,98 @@ diff -urN NetworkManager-0.6.2-o/src/backends/NetworkManagerPLD.c NetworkManager + */ +void nm_system_enable_loopback (void) +{ -+ nm_spawn_process ("/sbin/ip link set dev lo up"); -+ nm_spawn_process ("/sbin/ip addr add 127.0.0.1/8 brd 127.255.255.255 dev lo label loopback"); -+} -+ -+/* -+ * nm_system_delete_default_route -+ * -+ * Remove the old default route in preparation for a new one -+ * -+ */ -+void nm_system_delete_default_route (void) -+{ -+ nm_spawn_process ("/sbin/ip route del default"); -+} -+ -+/* -+ * nm_system_kill_all_dhcp_daemons -+ * -+ * Kill all DHCP daemons currently running, done at startup. -+ * -+ */ -+void nm_system_kill_all_dhcp_daemons (void) -+{ -+ nm_spawn_process ("/bin/killall -q dhcpcd"); ++ nm_generic_enable_loopback (); +} + +/* + * nm_system_update_dns + * -+ * Make glibc/nscd aware of any changes to the resolv.conf file by -+ * restarting nscd. ++ * Invalidate the nscd host cache, if it exists, since ++ * we changed resolv.conf. + * + */ +void nm_system_update_dns (void) +{ -+ /* I'm not running nscd */ -+} -+ -+/* -+ * nm_system_restart_mdns_responder -+ * -+ * Restart the multicast DNS responder so that it knows about new -+ * network interfaces and IP addresses. -+ * -+ */ -+void nm_system_restart_mdns_responder (void) -+{ -+ /* not implemented */ ++ if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE | G_FILE_TEST_IS_REGULAR)) { ++ nm_spawn_process ("/usr/sbin/nscd -i hosts"); ++ } +} + -+/* -+ * nm_system_device_add_ip6_link_address -+ * -+ * Add a default link-local IPv6 address to a device. -+ * -+ */ -+void nm_system_device_add_ip6_link_address (NMDevice *dev) -+{ -+ char *buf; -+ struct ether_addr hw_addr; -+ unsigned char eui[8]; -+ -+ if (nm_device_is_802_3_ethernet (dev)) -+ nm_device_802_3_ethernet_get_address (NM_DEVICE_802_3_ETHERNET (dev), &hw_addr); -+ else if (nm_device_is_802_11_wireless (dev)) -+ nm_device_802_11_wireless_get_address (NM_DEVICE_802_11_WIRELESS (dev), &hw_addr); -+ -+ memcpy (eui, &(hw_addr.ether_addr_octet), sizeof (hw_addr.ether_addr_octet)); -+ memmove (eui+5, eui+3, 3); -+ eui[3] = 0xff; -+ eui[4] = 0xfe; -+ eui[0] ^= 2; -+ -+ /* Add the default link-local IPv6 address to a device */ -+ buf = g_strdup_printf ("/sbin/ip -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s", -+ eui[0], eui[1], eui[2], eui[3], eui[4], eui[5], -+ eui[6], eui[7], nm_device_get_iface (dev)); -+ nm_spawn_process (buf); -+ g_free (buf); -+} -+ -+/* -+ * nm_system_device_add_route_via_device_with_iface -+ * -+ * Add route to the given device -+ * -+ */ -+void nm_system_device_add_route_via_device_with_iface (const char *iface, const char *route) -+{ -+ char *buf; -+ -+ g_return_if_fail (iface != NULL); -+ -+ /* Add default gateway */ -+ buf = g_strdup_printf ("/sbin/ip route add %s dev %s", route, iface); -+ nm_spawn_process (buf); -+ g_free (buf); -+} -+ -+/* -+ * nm_system_device_add_default_route_via_device -+ * -+ * Flush all routes associated with a network device -+ * -+ */ -+void nm_system_device_add_default_route_via_device (NMDevice *dev) -+{ -+ g_return_if_fail (dev != NULL); -+ -+ /* Not really applicable for test devices */ -+ if (nm_device_is_test_device (dev)) -+ return; -+ -+ nm_system_device_add_default_route_via_device_with_iface (nm_device_get_iface (dev)); -+} -+ -+/* -+ * * nm_system_device_add_default_route_via_device_with_iface -+ * * -+ * * Add default route to the given device -+ * * -+ * */ -+void nm_system_device_add_default_route_via_device_with_iface (const char *iface) -+{ -+ char *buf; -+ -+ g_return_if_fail (iface != NULL); -+ -+ /* Add default gateway */ -+ buf = g_strdup_printf ("/sbin/ip route add default dev %s", iface); -+ nm_spawn_process (buf); -+ g_free (buf); -+} -+ -+/* -+ * nm_system_flush_loopback_routes -+ * -+ * Flush all routes associated with the loopback device, because it -+ * sometimes gets the first route for ZeroConf/Link-Local traffic. -+ * -+ */ -+void nm_system_flush_loopback_routes (void) -+{ -+ /* Remove routing table entries for lo */ -+ nm_spawn_process ("/sbin/ip route flush dev lo"); -+} -+ -+/* -+ * nm_system_flush_arp_cache -+ * -+ * Flush all entries in the arp cache. -+ * -+ */ -+void nm_system_flush_arp_cache (void) -+{ -+ nm_spawn_process ("/sbin/ip neigh flush all"); -+} -+ -+void nm_system_deactivate_all_dialup (GSList *list) -+{ -+} -+ -+gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup) -+{ -+ return FALSE; -+} -+ -+gboolean nm_system_activate_dialup (GSList *list, const char *dialup) -+{ -+ return FALSE; -+} -+ -+/* -+ * nm_system_get_dialup_config -+ * -+ * Enumerate dial up options on this system, allocate NMDialUpConfig's, -+ * fill them out, and return. -+ * -+ */ -+GSList * nm_system_get_dialup_config (void) -+{ -+ return NULL; -+} -+ -+void nm_system_device_free_system_config (NMDevice *dev, void *system_config_data) -+{ -+} -+ -+NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev) -+{ -+ return NULL; -+} -+ -+gboolean nm_system_device_get_use_dhcp (NMDevice *dev) -+{ -+ return TRUE; -+} -+ -+/* -+ * nm_system_device_get_disabled -+ * -+ * Return whether the distro-specific system config tells us to use -+ * dhcp for this device. -+ * -+ */ -+gboolean nm_system_device_get_disabled (NMDevice *dev) -+{ -+ return FALSE; -+} -+ -+/* -+ * nm_system_activate_nis -+ * -+ * set up the nis domain and write a yp.conf -+ * -+ */ -+void nm_system_activate_nis (NMIP4Config *config) -+{ -+} -+ -+/* -+ * nm_system_shutdown_nis -+ * -+ * shutdown ypbind -+ * -+ */ -+void nm_system_shutdown_nis (void) -+{ -+} -+ -+/* -+ * nm_system_set_hostname -+ * -+ * set the hostname -+ * -+ */ -+void nm_system_set_hostname (NMIP4Config *config) -+{ -+} -+ -+/* -+ * nm_system_should_modify_resolv_conf -+ * -+ * Can NM update resolv.conf, or is it locked down? -+ */ -+gboolean nm_system_should_modify_resolv_conf (void) -+{ -+ return TRUE; -+} +diff -urN NetworkManager-0.8.996/configure.ac NetworkManager-0.8.996.new//configure.ac +--- NetworkManager-0.8.996/configure.ac 2011-03-10 07:44:53.000000000 +0000 ++++ NetworkManager-0.8.996.new//configure.ac 2011-03-11 21:56:12.369999140 +0000 +@@ -95,7 +95,7 @@ + dnl + AC_C_BIGENDIAN + +-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva, pardus, linexa or exherbo])) ++AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva, pardus, linexa, exherbo or pld])) + if test "z$with_distro" = "z"; then + AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat") + AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse") +@@ -109,6 +109,7 @@ + AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus") + AC_CHECK_FILE(/etc/linexa-release,with_distro="linexa") + AC_CHECK_FILE(/etc/exherbo-release,with_distro="exherbo") ++ AC_CHECK_FILE(/etc/pld-release,with_distro="pld") + if test "z$with_distro" = "z"; then + with_distro=`lsb_release -is` + fi +@@ -120,7 +121,7 @@ + exit 1 + else + case $with_distro in +- redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa|exherbo) ;; ++ redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa|exherbo|pld) ;; + *) + echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)" + exit 1 +@@ -188,6 +189,11 @@ + AC_DEFINE(TARGET_EXHERBO, 1, [Define if you have Exherbo]) + fi + ++AM_CONDITIONAL(TARGET_PLD, test x"$with_distro" = xpld) ++if test x"$with_distro" = xpld; then ++ AC_DEFINE(TARGET_PLD, 1, [Define if you have PLD]) ++fi ++ + dnl + dnl Distribution version string + dnl +@@ -617,6 +623,8 @@ + initscript/paldo/NetworkManager + initscript/Mandriva/Makefile + initscript/Mandriva/networkmanager ++initscript/PLD/Makefile ++initscript/PLD/NetworkManager + initscript/linexa/Makefile + initscript/linexa/networkmanager + introspection/Makefile +diff -urN NetworkManager-0.8.996/src/backends/Makefile.am NetworkManager-0.8.996.new//src/backends/Makefile.am +--- NetworkManager-0.8.996/src/backends/Makefile.am 2011-01-02 23:18:57.000000000 +0000 ++++ NetworkManager-0.8.996.new//src/backends/Makefile.am 2011-03-11 21:57:30.163333077 +0000 +@@ -61,6 +61,10 @@ + libnmbackend_la_SOURCES += NetworkManagerExherbo.c + endif + ++if TARGET_PLD ++libnmbackend_la_SOURCES += NetworkManagerPLD.c ++endif + + libnmbackend_la_LIBADD += \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ +diff -urN NetworkManager-0.8.996/src/settings/plugins/Makefile.am NetworkManager-0.8.996.new//src/settings/plugins/Makefile.am +--- NetworkManager-0.8.996/src/settings/plugins/Makefile.am 2011-03-08 16:19:01.000000000 +0000 ++++ NetworkManager-0.8.996.new//src/settings/plugins/Makefile.am 2011-03-11 21:59:26.183332964 +0000 +@@ -4,6 +4,10 @@ + SUBDIRS+=ifcfg-rh + endif + ++if TARGET_PLD ++SUBDIRS+=ifcfg-rh ++endif + -+/* -+ * nm_system_get_mtu -+ * -+ * Return a user-provided or system-mandated MTU for this device or zero if -+ * no such MTU is provided. -+ */ -+unsigned int nm_system_get_mtu (NMDevice *dev) -+{ -+ return 0; -+} + if TARGET_SUSE + SUBDIRS+=ifcfg-suse + endif