Commit graph

5379 commits

Author SHA1 Message Date
Tom Gundersen 0b99c9f8f0 udev: builtin - rename net_link to net_setup_link
Also add shell completions.
2013-10-29 14:17:57 +01:00
Tom Gundersen 9dc670ea76 network: move configuration to /etc/systemd/network
This is private configuraiton, so let's not pollute the namespace (and hence make Debian happy :) ).
2013-10-29 14:17:57 +01:00
Zbigniew Jędrzejewski-Szmek f11880744c journalctl: add --list-boots to show boot IDs and times
Suggested by David Wilkins <dwilkins@maths.tcd.ie> in
https://bugzilla.redhat.com/show_bug.cgi?id=967521:

> [Specific boot ID is a] bit of a palaver to obtain.  I consulted the
> verbose dump of the journal to discover the _BOOT_ID for the
> timestamp, and then generated the journal dump for that boot using
> journalctl _BOOT_ID=foo -o short-monotonic.
2013-10-28 23:43:57 -04:00
Tom Gundersen 16b9b87aee udev: link-config - add mac address policy
This introduces a new key MACAddressPolicy.

The possible policies are 'persistent' and 'random'.

'persistent' will do nothing if the current address is the hardware address,
but if the hardware does not have an address (or another address is set for
whatever reason), we will generate an address which will be random, but
persistent between boots (based on machineid and persistent netif name).

'random' will do nothing if the kernel already set a random address, otherwise
it will generate a random one and use that instead.

This patch sets MACAddressPolicy=persistent in the default .link file.
2013-10-28 18:10:23 +01:00
Tom Gundersen daeb71a36a udev: link-config - move naming policy from udev rules
This introduces a new key NamePolicy, which takes an ordered list of naming
policies. The first successful one is applide. If all fail the value of Name
(if any) is used.

The possible policies are 'onboard', 'slot', 'path' and 'mac'.

This patch introduces a default link file, which replaces the equivalent udev
rule.
2013-10-28 01:18:04 +01:00
Tom Gundersen 2a73e0d39a udev: link-config - sanity check the ifname and mac address 2013-10-27 23:09:05 +01:00
Tom Gundersen eab97a4666 rtnl: relax the tests a bit
It is a bit too optimisitc that this stuff is the same on different hosts.
2013-10-27 22:45:14 +01:00
Tom Gundersen 43b3a5ef61 udev: link-config: add rtnl support
This adds support for setting the mac address, name and mtu.

Example:

[Link]
MTU=1450
MACAddress=98:76:54:32:10:ab
Name=wireless0
2013-10-27 22:23:58 +01:00
Tom Gundersen 65f568bbeb libsystemd-rtnl: add a rtnetlink library
This is intentionally as similar to sd-bus as possible. While it
would be simple to export it, the intentions is to keep this
internal (at least for the forseeable future).

Currently only synchronous communication is implemented
2013-10-27 22:18:34 +01:00
Daniel Buch 02f19706a9 test-strv.c: added STRV_FOREACH and STRV_FOREACH_BACKWARDS 2013-10-27 11:51:22 -04:00
Daniel Buch fb15be8395 path_lookup: moved _cleanup_lookup_paths_free_ from install.c to path-lookup.h 2013-10-27 11:51:22 -04:00
Tom Gundersen a501033335 udev: link-config: add ethtool support
This adds support for setting the link speed, duplex and WakeOnLan
settings.

Example:

[Link]
SpeedMBytes=100
Duplex=half
WakeOnLan=magic
2013-10-26 22:09:20 +02:00
Tom Gundersen af6f0d422c udev: add network link configuration tool
This tool applies hardware specific settings to network devices before they
are announced via libudev.

Settings that will probably eventually be supported are MTU, Speed,
DuplexMode, WakeOnLan, MACAddress, MACAddressPolicy (e.g., 'hardware',
'synthetic' or 'random'), Name and NamePolicy (replacing our current
interface naming logic). This patch only introduces support for
Description, as a proof of concept.

Some of these settings may later be overriden by a network management
daemon/script. However, these tools should always listen and wait on libudev
before touching a device (listening on netlink is not enough). This is no
different from how things used to be, as we always supported changing the
network interface name from udev rules, which does not work if someone
has already started using it.

The tool is configured by .link files in /etc/net/links/ (with the usual
overriding logic in /run and /lib). The first (in lexicographical order)
matching .link file is applied to a given device, and all others are ignored.

The .link files contain a [Match] section with (currently) the keys
MACAddress, Driver, Type (see DEVTYPE in udevadm info) and Path (this
matches on the stable device path as exposed as ID_PATH, and not the
unstable DEVPATH). A .link file matches a given device if all of the
specified keys do. Currently the keys are treated as plain strings,
but some limited globbing may later be added to the keys where it
makes sense.

Example:

/etc/net/links/50-wireless.link
[Match]
MACAddress=98:f2:e4:42:c6:92
Path=pci-0000:02:00.0-bcma-0
Type=wlan

[Link]
Description=The wireless link
2013-10-26 22:09:20 +02:00
Tom Gundersen ca5c410573 STRV_FOREACH_BACKWARDS: improve readability a bit
The indentation was wrong, also put the semicolon on a separate line to make it clear it is a for-loop
with an epmyt body.
2013-10-26 16:43:28 +02:00
Tom Gundersen 89f17d4f80 udev-builtin: path_id - add support for bcma bus
This matches the bcma support in the network device naming.

Eventually wa want to make sure ID_PATH is equivalent to ID_NET_NAME_PATH,
so we never need to match on the latter.
2013-10-26 14:34:41 +02:00
Tom Gundersen 8e18485284 udev: move udev_rules_check_timestamp to shared
I want to use this from a bulitin in a subsequent patch.
2013-10-26 14:34:31 +02:00
Tom Gundersen 5ecb28f69e STRV_FOREACH_BACWARDS: start at the tail of the list
Otherwise, the user would have to manually initialize the pointer. Nobody currently uses this code,
so the change in behaviour sohuld be fine.
2013-10-26 13:42:38 +02:00
Thomas Hindoe Paaboel Andersen 7d9cb4229c typo fix in comment 2013-10-26 22:38:41 +02:00
Thomas Hindoe Paaboel Andersen 048ecf5b84 analyze: port to sd-bus 2013-10-25 20:59:01 +02:00
Kay Sievers 77b421d050 bus: disable debug output in test-bus-kernel-benchmark 2013-10-25 07:28:19 +02:00
Zbigniew Jędrzejewski-Szmek d8c9d3a468 systemd: use unit name in PrivateTmp directories
Unit name is used whole in the directory name, so that the unit name
can be easily extracted from it, e.g. "/tmp/systemd-abcd.service-DEDBIF1".

https://bugzilla.redhat.com/show_bug.cgi?id=957439
2013-10-22 22:54:09 -04:00
Tom Gundersen 0fb0c56f52 inhibit: port to sd-bus 2013-10-22 13:00:54 +01:00
Kay Sievers b0770377ab analyze: systemd-analyze.c -> analyze.c 2013-10-22 13:55:50 +02:00
Lennart Poettering 28d6633ae1 bus: NULL signatures are OK too 2013-10-22 12:41:54 +01:00
Lennart Poettering 430fb8fab2 bus: only if the user tries to read over the end of an array we should handle this as EOF 2013-10-22 12:41:54 +01:00
Kay Sievers 8d45130966 localed: port from libdbus to libsystemd-bus 2013-10-22 13:25:17 +02:00
David Strauss f4bd42aa3c socket-proxyd: Fix-up from previous change to avoid looping on errors. 2013-10-21 18:41:35 -07:00
Kay Sievers 9bcbce4201 bus: avoid 'bool' storage when retrieving 'b' from the message
Just use an unsigned int as a bool type to avoid issues in the public
message reading API; sizeof(bool) == 1, but the code copies 4 bytes at
the pointers destination.
2013-10-22 03:35:45 +02:00
David Strauss 40976028c6 socket-proxyd: Use ONESHOT to behave properly with multiple accept() processes. 2013-10-21 18:32:08 -07:00
David Strauss 9ec9694ce3 sd-event: EPOLLONESHOT only disables event reporting after an event. The fd is still registered. 2013-10-21 17:23:01 -07:00
Thomas Hindoe Paaboel Andersen 418e37506e analyze: set white backgound
In programs like eog and gimp the transparant background did not
look very good.

https://bugs.freedesktop.org/show_bug.cgi?id=70720
2013-10-21 21:36:15 +02:00
Kay Sievers 7759ecb21e silent a few more gcc warnings 2013-10-21 18:40:33 +02:00
Kay Sievers df28bc0836 build-sys: use -Og instead of -O0 to catch warnings
$ touch src/core/dbus.c; make CFLAGS=-O0
  make --no-print-directory all-recursive
  Making all in .
    CC       src/core/libsystemd_core_la-dbus.lo
    CCLD     libsystemd-core.la

  $ touch src/core/dbus.c; make CFLAGS=-Og
  make --no-print-directory all-recursive
  Making all in .
    CC       src/core/libsystemd_core_la-dbus.lo
  src/core/dbus.c: In function 'init_registered_system_bus':
  src/core/dbus.c:798:18: warning: 'id' may be used uninitialized in this function [-Wmaybe-uninitialized]
           dbus_free(id);
                    ^
    CCLD     libsystemd-core.la

-Og Optimize debugging experience. -Og enables optimizations that do
not interfere with debugging. It should be the optimization level of
choice for the standard edit-compile-debug cycle, offering a
reasonable level of optimization while maintaining fast compilation
and a good debugging experience.
2013-10-21 15:46:00 +02:00
Kay Sievers bd4b5df2cb bus: initialize variable, now that we might skip debug logging 2013-10-21 00:56:47 +02:00
Kay Sievers ca2871d9b0 bus: remove static introspection file export 2013-10-21 00:41:26 +02:00
Kay Sievers af8601fa8b bus: allow to specify NULL as an empty string to add 2013-10-21 00:21:27 +02:00
Colin Walters f24e86530c log: Fix previous commit to use correct level 2013-10-20 16:02:26 -04:00
Kay Sievers 87ff6b1c2a log: avoid calling the logging functions for log levels above the current maximum
Messages with log levels above the current maximum log level will be dropped
inside log_meta(). But to be able to call the function, all parameters for
the function need to be provided. This can easily get expensive, if values
need to be calculated or functions are used in parameters.

Avoid all useless work by checking inside the macro, before we look
at any parameters passed to the logging functions.
2013-10-20 21:26:47 +02:00
David Strauss 6298945d5c socket-proxyd: Remove datagram research TODO. This proxy will not work with them. 2013-10-19 17:11:36 -07:00
David Strauss 20c7c931a9 socket-proxyd: Comment and log text cleanup.
* Standardize on "nonblocking" spelling, per Linux man pages.
 * Clarify that the nonblocking sockets are never in a "blocking"
   or "unblocked" state, just a "would block" or "ready" state.
2013-10-19 17:05:42 -07:00
Kay Sievers b6818c7d10 socket-proxyd: initialize variable used in error code path 2013-10-20 01:10:49 +02:00
Tom Gundersen a7f9b27596 trivial: rfkill - don't include util.h twice 2013-10-19 19:28:21 +02:00
Colin Walters e6a5e5be83 trivial: rfkill: It's util.h, not utils.h
How about we actually run make locally before pushing, eh?
2013-10-19 09:02:01 -04:00
Tom Gundersen 06f0639331 udev-builtin: uaccess - inherit logging form udev
Not that it makes a difference in this builtin, but otherwise /etc/udev/udev.conf is not respected.
2013-10-19 12:23:17 +02:00
Tom Gundersen a7623afb7a fsck-root: only run when requested in fstab
fsck-root is redundant in case an initrd is used, or in case the rootfs
is never remounted 'rw', so the new default is the correct behavior for
most users. For the rest, they should enable it in fstab.
2013-10-19 12:23:17 +02:00
Tom Gundersen d09ee17da2 efi-boot-generator: hookup to fsck 2013-10-19 12:23:17 +02:00
Tom Gundersen accdd018ed mount/service: drop FsckPassNo support
We now treat passno as boleans in the generators, and don't need this any more. fsck itself
is able to sequentialize checks on the same local media, so in the common case the ordering
is redundant.

It is still possible to force an order by using .d fragments, in case that is desired.
2013-10-19 12:23:17 +02:00
Thomas Bächler 4c8bda2442 gpt-auto-generator: Generate explicit dependencies on systemd-fsck@.service instead of using FsckPassNo
[tomegun: check for OOM]
2013-10-19 12:23:17 +02:00
Thomas Bächler 64e70e4b86 fstab-generator: Generate explicit dependencies on systemd-fsck@.service instead of using FsckPassNo
[tomegun:
  * order all fsck instances after fsck-root
  * check for OOM
  * added notes in the manpages]
2013-10-19 12:23:17 +02:00
Thomas Bächler 7f5806d709 fstab-generator: When parsing the root= cmdline option, set FsckPassNo to 1
[tomegun: without this we would never fsck the rootfs if it was directly
mounted 'rw' from the initrd. We now risk fsck'ing it twice in the case it
is mounted 'ro', so that should be addressed in a separate patch.]
2013-10-19 12:23:17 +02:00