Commit Graph

10267 Commits

Author SHA1 Message Date
Thomas Haller
d44d526c00 contrib/nm-live-vm: merge branch 'contrib/nm-live-vm'
Merge script to create a VM image with NetworkManager.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:43:17 +02:00
Thomas Haller
031142000a contrib/nm-live-vm: install required packages readline, gobject-introspection, and pygobject3
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
04591cfa2e contrib/nm-live-vm: fix run.sh script to into script directory
run.sh refers to the image file via relative path.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
c274725dc3 contrib/nm-live-vm: start the VM with less memory (1024 mb)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
6a5c05e61a contrib/nm-live-vm: install wget and setup bashrc and git
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
acfb0b1bbf contrib/nm-live-vm: enable option main.debug for NM in VM
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
cd7c97eb1d contrib/nm-live-vm: write /etc/fstab
Everytime you call mock again, the fstab file will be reset.
So, we have to write it shortly before creating the image.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
0178d73699 contrib/nm-live-vm: disable rate limiting in the journal of the VM
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
0689efc768 contrib/nm-live-vm: don't remove the temporary directory with the extracted VM image
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
fe267b0fd2 contrib/nm-live-vm: enable ssh server and add port forward from localhost:10022
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
78f94726a7 contrib/nm-live-vm: share a directory with the live-vm
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
fbc9c41e96 contrib/nm-live-vm: include the NetworkManager source in the live-mv file for debugging
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
f2878b7633 contrib/nm-live-vm: compile live-vm build without compiler optimization
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Jiří Klimeš
ef052ead88 contrib/nm-live-vm: add dnsmasq to the VM 2014-06-30 17:42:09 +02:00
Jiří Klimeš
84b3e924df contrib/nm-live-vm: fix build - libndp-devel is now required 2014-06-30 17:42:09 +02:00
Jiří Klimeš
f20f706d34 contrib/nm-live-vm: also build nmtui 2014-06-30 17:42:09 +02:00
Jiří Klimeš
dc872b7e52 contrib/nm-live-vm: add rootfstype=ramfs kernel parameter to run.sh
Kernel changed default filesystem for roots from ramfs to tmpfs.
See http://lwn.net/Articles/559176/ for more information.
The change caused our initramfs to be mounted with size= parameter that equals
to the actual size of unpacked initramfs. That's why mounted / was full and no
space was available (without manual remounting: mount -o remount,size=100% /).

So we explicitly require usage of ramfs to have all RAM of the virtual machine
available for /.

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2014-06-30 17:42:09 +02:00
Jiří Klimeš
26626c75c3 contrib/nm-live-vm: put qemu network-related options into a variable
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2014-06-30 17:42:09 +02:00
Jiří Klimeš
9b3922390c contrib/nm-live-vm: update scripts to make VM based on Fedora 20
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
e9ed87a920 contrib/nm-live-vm: adjust build script to enable DEBUG logging
Enable more logging when starting NM.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Thomas Haller
7b43e0526e contrib/nm-live-vm: change scripts to be run by unprevileged user
The user must still be member of the 'mock' group though.

Also, hack something, that the current git repositoy will be reused, so
that we don't have to fetch the entire repositoy from upstream.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:09 +02:00
Jiří Klimeš
b0f9302e1f contrib/nm-live-vm: add 'teamd' and 'libteam' packages to the VM for teaming to work 2014-06-30 17:42:09 +02:00
Jiří Klimeš
b22b063f97 contrib/nm-live-vm: add some debugging tools and useful utilities 2014-06-30 17:42:09 +02:00
Thomas Haller
2469601a0e build: 'nm-setting-docs.xml' must depend on 'NetworkManager-1.0.typelib'
Build of 'nm-setting-docs.xml' must depend on 'NetworkManager-1.0.typelib', otherwise
'NetworkManager-1.0.typelib' is not yet created and './generate-setting-docs.py'
fails.

  g-ir-scanner: compile: gcc -Wall -Wno-deprecated-declarations -pthread -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -std=gnu89 -g -Og -Wshadow -Wmissing-declarations -Wmiss
  g-ir-scanner: link: /bin/sh ../libtool --mode=link --tag=CC gcc -o /NetworkManager/libnm-util/tmp-introspectEda05I/NetworkManager-1.0 -export-dynamic -Wall -std=gnu89 -g -Og -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wdeclarat
  libtool: link: gcc -o /NetworkManager/libnm-util/tmp-introspectEda05I/.libs/NetworkManager-1.0 -Wall -std=gnu89 -g -Og -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wformat-security -Wfloat-equal -Wn
  export GI_TYPELIB_PATH=/NetworkManager/libnm-util${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}; \
  export LD_LIBRARY_PATH=/NetworkManager/libnm-util/.libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}; \
  strace -o /tmp/strace.out ./generate-setting-docs.py \
          --gir ./NetworkManager-1.0.gir \
          --output nm-setting-docs.xml
  ERROR:root:Could not find any typelib for NetworkManager
  Traceback (most recent call last):
    File "./generate-setting-docs.py", line 19, in <module>
      from gi.repository import NetworkManager, GObject
  ImportError: cannot import name NetworkManager
  make[4]: *** [nm-setting-docs.xml] Error 1

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 17:42:08 +02:00
Jiří Klimeš
c976724571 contrib/nm-live-vm: correct and simplify paths for configure 2014-06-30 17:42:08 +02:00
Jiří Klimeš
ebc1183542 contrib/nm-live-vm: documentation/man pages now depend on '--enable-gtk-doc' 2014-06-30 17:42:08 +02:00
Jiří Klimeš
f1c0a1a85b contrib/nm-live-vm: put the archive name explicitly inside the bundled script
Getting the archive name from the bundled script file name is fragile.
2014-06-30 17:42:08 +02:00
Jiří Klimeš
514d594e9d contrib/nm-live-vm: add 'gdb' to the VM
It is very helful for testing the size doesn't hurt (~ 2 MB)
2014-06-30 17:42:08 +02:00
Jiří Klimeš
39fdae3799 contrib/nm-live-vm: set of scripts for building a live initramfs for NM testing
The scripts use Fedora to build a Fedora 18 (i386) live image, and pack
it into a single self-extracting script, that can be easily distributed.

$ sudo ./build [-n name] [-b branch/commit]
will create name-bundle.sh with NM built of a specified NM branch(commit).
(defaults are: name="nm-live-vm"; branch="master")

Resulting nm-live-vm-bundle.sh can be run with almost any distro.
The only requirement is qemu-kvm (and VNC (tigervnc) on RHEL).
2014-06-30 17:42:08 +02:00
Giovanni Campagna
86ca7dce0c core: don't reject activating devices with incomplete IP config
An activating device may have an IP config that is unrelated to
the current activation (for example if it comes from capturing
the existing config when NM is started), and that config might
not have a gateway, which would have NM ignore that the device
is activating until after DHCP.

https://bugzilla.gnome.org/show_bug.cgi?id=726400

[thaller@redhat.com: move variables inside if-block]
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 16:58:35 +02:00
Thomas Haller
2a89258562 platform: fix invalid address lifetimes on startup
When starting, the initally loaded addresses were not fixed to have
absolute lifetimes.

This also leads to a crash due to failed assertion[1], when having
already expired addresses during NetworkManager start.

[1] backtrace:
  #0  0x00007f39db91ec39 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
  #1  0x00007f39db920348 in __GI_abort () at abort.c:89
  #2  0x00007f39dc35a0ed in _g_log_abort () at gmessages.c:255
  #3  0x00007f39dc377c97 in g_assertion_message (domain=domain@entry=0x7f39e0085c67 "NetworkManager", file=file@entry=0x7f39e007f070 "platform/nm-linux-platform.c", line=line@entry=1146,
      func=func@entry=0x7f39e0081430 <__FUNCTION__.23775> "_init_ip_address_lifetime", message=message@entry=0x7f39e13828b0 "assertion failed: (a_preferred <= a_valid && a_valid > 0 && a_preferred > 0)") at gtestutils.c:2278
  #4  0x00007f39dc377cfa in g_assertion_message_expr (domain=domain@entry=0x7f39e0085c67 "NetworkManager", file=file@entry=0x7f39e007f070 "platform/nm-linux-platform.c", line=line@entry=1146,
      func=func@entry=0x7f39e0081430 <__FUNCTION__.23775> "_init_ip_address_lifetime", expr=expr@entry=0x7f39e007f4e8 "a_preferred <= a_valid && a_valid > 0 && a_preferred > 0") at gtestutils.c:2293
  #5  0x00007f39e0004608 in _init_ip_address_lifetime (address=address@entry=0x7fff7f8a2580, rtnladdr=rtnladdr@entry=0x7f39e12cdb20) at platform/nm-linux-platform.c:1144
  #6  0x00007f39e0004ae4 in init_ip6_address (address=address@entry=0x7fff7f8a2580, rtnladdr=rtnladdr@entry=0x7f39e12cdb20) at platform/nm-linux-platform.c:1216
  #7  0x00007f39e000a75e in ip6_address_get_all (platform=<optimized out>, ifindex=3) at platform/nm-linux-platform.c:3342
  #8  0x00007f39e0032729 in nm_ip6_config_capture (ifindex=ifindex@entry=3, capture_resolv_conf=capture_resolv_conf@entry=0, use_temporary=use_temporary@entry=NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN) at nm-ip6-config.c:303
  #9  0x00007f39dffee8fa in update_ip_config (self=0x7f39e1380300, initial=<optimized out>) at devices/nm-device.c:5841
  #10 0x00007f39dffef52a in nm_device_capture_initial_config (dev=<optimized out>) at devices/nm-device.c:5869
  #11 0x00007f39e003e74e in get_existing_connection (manager=manager@entry=0x7f39e132b150, device=device@entry=0x7f39e1380300) at nm-manager.c:1576
  #12 0x00007f39e003edb2 in add_device (self=self@entry=0x7f39e132b150, device=device@entry=0x7f39e1380300, generate_con=<optimized out>) at nm-manager.c:1826
  #13 0x00007f39e003f503 in platform_link_added (reason=<optimized out>, plink=0x7f39e1372340, ifindex=3, self=0x7f39e132b150) at nm-manager.c:2205
  #14 platform_link_cb (platform=<optimized out>, ifindex=3, plink=0x7f39e1372340, change_type=<optimized out>, reason=<optimized out>, user_data=<optimized out>) at nm-manager.c:2220
  #15 0x00007f39da868d8c in ffi_call_unix64 () at ../src/x86/unix64.S:76
  #16 0x00007f39da8686bc in ffi_call (cif=cif@entry=0x7fff7f8a2a40, fn=0x7f39e003f360 <platform_link_cb>, rvalue=0x7fff7f8a29b0, avalue=avalue@entry=0x7fff7f8a2930) at ../src/x86/ffi64.c:522
  #17 0x00007f39dc84aad8 in g_cclosure_marshal_generic (closure=0x7f39e1368080, return_gvalue=0x0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=0x0) at gclosure.c:1454
  #18 0x00007f39dc84a298 in g_closure_invoke (closure=0x7f39e1368080, return_value=return_value@entry=0x0, n_param_values=5, param_values=param_values@entry=0x7fff7f8a2c40, invocation_hint=invocation_hint@entry=0x7fff7f8a2be0)
      at gclosure.c:777
  #19 0x00007f39dc85c35d in signal_emit_unlocked_R (node=node@entry=0x7f39e12c16c0, detail=detail@entry=0, instance=instance@entry=0x7f39e12c30a0, emission_return=emission_return@entry=0x0,
      instance_and_params=instance_and_params@entry=0x7fff7f8a2c40) at gsignal.c:3586
  #20 0x00007f39dc8640f2 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fff7f8a2e20) at gsignal.c:3330
  #21 0x00007f39dc8643af in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3386
  #22 0x00007f39e000e24c in nm_platform_query_devices () at platform/nm-platform.c:330
  #23 0x00007f39e0040f30 in nm_manager_start (self=0x7f39e132b150) at nm-manager.c:4207
  #24 0x00007f39dffe53ab in main (argc=1, argv=0x7fff7f8a3468) at main.c:657

Regression introduced by commit 8310a039d8.

https://bugzilla.gnome.org/show_bug.cgi?id=732472

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 14:19:27 +02:00
Dan Winship
9f82c16557 libnm-util: build nm-setting-docs.xml against uninstalled libnm-util
Set GI_TYPELIB_PATH and LD_LIBRARY_PATH so that we build
nm-setting-docs.xml against the just-built typelib and .so, not the
installed ones.
2014-06-27 17:24:58 -04:00
Dan Winship
377f72a66f build: fix nm-setting-docs build in various configurations
Certain build configurations (like --enable-gtk-doc
--disable-introspection) were broken with respect to nm-setting-docs.
Fix this. Also, we don't require just gobject-introspection, we need
pygobject specifically as well.
2014-06-27 17:24:57 -04:00
Thomas Haller
87c48023f1 libnm-util, libnm-glib: add NM_VERSION_1_0, NM_DEPRECATED_IN_1_0, and NM_DEPRECATED_IN_1_0 macros
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-27 20:39:05 +02:00
Thomas Haller
3e9b6666de po: remove obsolete reference to nm-modem-old.c file
This breaks `make check`.

Regression introduced by commit 1a3a5c4526.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-27 20:13:25 +02:00
Dan Williams
29297f8531 build: check harder for readline
Not all distros build their readline linked with a termcap library,
since apps are (apparently) supposed to choose one for themselves
and explicitly link to it when using readline.  So add some checks
to figure out whether readline is already linked, and if not, prefer
ncurses since we use that for nmtui already.

ax_lib_readline based off:

http://www.gnu.org/software/autoconf-archive/ax_lib_readline.html
2014-06-27 13:10:50 -05:00
Thomas Haller
32ebcbe7c7 core: log when creating team device as generic due to missing plugin
Previous commit 38a83e15a2 moves the
team device to a plugin. If the plugin is not available, we should
log an information that we create a generic device instead.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-27 17:02:23 +02:00
Thomas Haller
918ff2b0f7 team: merge branch 'th/bgo731905_team_plugin'
https://bugzilla.gnome.org/show_bug.cgi?id=731905
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-27 13:27:54 +02:00
Thomas Haller
71cc0b2345 team: remove conditional compilation WITH_TEAMDCTL
teamdctl related parts are now in the device plugin src/devices/team/*. Remove
the conditional compilation.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-27 13:27:01 +02:00
Thomas Haller
38a83e15a2 team: make team support a plugin
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-27 13:27:01 +02:00
Thomas Haller
dfe4b45f87 core: allow creation of virtual devices (software devices) via NMDeviceFactory
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-27 13:27:01 +02:00
Thomas Haller
4c206d0aaf core: refactor update_slave_connection() as virtual function of master device
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-27 13:27:01 +02:00
Thomas Haller
b855c7b64a team/trivial: rename NM_TEAM_ERROR* to NM_DEVICE_TEAM_ERROR*
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-27 13:27:01 +02:00
Thomas Haller
05e2e701a8 core: check file permissions when loading device plugins and order by file modification time
Refactor the loading of device plugins by creating the list of
module filenames in a separate function.

Thereby also check for file permissions (must be only modifiable by root)
and sort the files by last file modification time. This has the advantage,
that if several plugins provide the same device type, that we (deterministically)
prefer the most recent one.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-27 13:27:01 +02:00
Dan Winship
baab3cc641 wwan, bluetooth: drop support for ModemManager 0.7
https://bugzilla.gnome.org/show_bug.cgi?id=732176
2014-06-26 12:53:33 -04:00
Dan Winship
0013572225 wwan: trivial: simplify variable names to not explicitly clarify MM 1.0
Since we don't care about MM 0.7 now.
2014-06-26 12:53:33 -04:00
Dan Winship
1a3a5c4526 wwan, bluetooth: drop support for ModemManager 0.7 2014-06-26 12:53:33 -04:00
Dan Williams
c3e8ddf075 build: fix multiple definitions of DISTCLEANFILES
Multiple definitions added by dcc109516d
2014-06-26 11:38:30 -05:00
Thomas Haller
c35d63ddea settings: fix invalid signature in impl_settings_get_connection_by_uuid()
impl_settings_get_connection_by_uuid() was changed from a synchronous
function to an asynchronous one. Thereby the @out_object_path argument
was forgotten, leaving the function completely broken.

This bug has the potential to crash NetworkManager.

Regression introduced by commit 8ab8990938.

Found running
  $ ./dfuzzer -v -n com.redhat.ifcfgrh1

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1113508

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-26 18:32:39 +02:00
Thomas Haller
7665585d4d core: fix crash in impl_settings_get_connection_by_uuid() when requesing non-existing uuid
Regression introduced by commit 8ab8990938.

Found running
  $ ./dfuzzer -v -n com.redhat.ifcfgrh1

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1113508

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-26 17:39:52 +02:00