summaryrefslogtreecommitdiff
path: root/src/shared
Commit message (Collapse)AuthorAge
* Remove utmp thingsAndy Wingo2015-04-08
|
* shared: set - make argument to set_remove() constTom Gundersen2015-04-01
|
* ARM: detect-virt: detect QEMU/KVMAndrew Jones2015-03-31
| | | | | | | | | | | | | | | | | | QEMU/KVM guests do not have hypervisor nodes, but they do have fw-cfg nodes (since qemu v2.3.0-rc0). fw-cfg nodes are documented, see kernel doc Documentation/devicetree/bindings/arm/fw-cfg.txt, and therefore we should be able to rely on it in this detection. Unfortunately, we currently don't have enough information in the DT, or elsewhere, to determine if we're using KVM acceleration with QEMU or not, so we can only report 'qemu' at this time, even if KVM is in use. This shouldn't really matter in practice though, because if detect-virt is used interactively it will be clear to the user whether or not KVM acceleration is present by the overall speed of the guest. If used by a script, then the script's behavior should not change whether it's 'qemu' or 'kvm'. QEMU emulated guests and QEMU/KVM guests of the same type should behave identically, only the speed at which they run should differ.
* ARM: detect-virt: detect XenAndrew Jones2015-03-31
|
* detect-virt: use /proc/device-treeAndrew Jones2015-03-31
| | | | | | | Kernel doc Documentation/ABI/testing/sysfs-firmware-ofw says that the /proc/device-tree symlink should be used, as opposed to directly accessing /sys/firmware/devicetree/base. The former is ABI, but not the later.
* fix gcc warnings about uninitialized variablesHarald Hoyer2015-03-27
| | | | | | | | | | | | | like: src/shared/install.c: In function ‘unit_file_lookup_state’: src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] return r < 0 ? r : state; ^ src/shared/install.c:1796:13: note: ‘r’ was declared here int r; ^
* util: rework word parsing and c unescaping codeLennart Poettering2015-03-26
| | | | | | | | | | | When parsing words from input files, optionally automatically unescape the passed strings, controllable via a new flags parameter. Make use of this in tmpfiles, and port everything else over, too. This improves parsing quite a bit, since we no longer have to process the same string multiple times with different calls, where an earlier call might corrupt the input for a later call.
* fstab-generator: don't accept missing root=, but accept root=noneTobias Hunger2015-03-25
| | | | | | | | | | | | | | | | | | | | | | | And other non-device entries (like fstab does). Mount whatever the user asked to be mounted on / on the kernel command line. Do less sanity check and do *not* bail out when the mount device looks strange or does not exist. This basically makes the changes for deviceless filesystems from yesterday unnecessary and is in line with what we do for filesystems set up in fstab. Remove some code that is now dead (reverting fb02a2775a65 and b0438462). [tomegun: - change patch title/description a bit. - don't touch the /usr logic, that would be a separate change and we don't currently have a convincing use-case for that. - don't bail out on /sys ro. This only makes sense in containers, where we would not be doing this anyway. If there is a use-case we could consider that as a separate patch.]
* timedate: remove daylight saving time handling and tzfile parserKay Sievers2015-03-24
| | | | | | | | | | | | We planned to support (the conceptually broken) daylight saving time/local time features in the kernel, SCSI, networking, FAT filesystem, but it turned out to be a race we cannot win and do not want to get involved. Systemd should not fiddle with daylight saving time or parse timezone information itself. Leave everything to glibc or tools like date(1) and do not make any promises or raise expectations that systemd should handle anything like this.
* fstab-generator: Do not check deviceless filesystemsTobias Hunger2015-03-24
| | | | There is no need to check those.
* fstab-generator: Support root on tmpfs (or other deviceless FS)Tobias Hunger2015-03-24
| | | | This allows for stateless systems.
* missing.h: add more btrfs types and definesMichael Olbrich2015-03-21
|
* shared/mkdir: do not set errno in addition to return valueZbigniew Jędrzejewski-Szmek2015-03-21
| | | | All callers look at the return value anyway.
* Add change_attr_fd()Goffredo Baroncelli2015-03-19
| | | | Add change_attr_fd() function to modify the file/directory attribute.
* strv: return NULL from strv_free()David Herrmann2015-03-19
| | | | | We always return NULL/invalid-object from destructors, fix strv_free() to do the same.
* shared: add path_compare(), an ordering path comparisonMichal Schmidt2015-03-16
| | | | ... and make path_equal() a simple wrapper around it.
* shared - reinstate plymouth_running()Tom Gundersen2015-03-16
| | | | | This will be used by fsckd. This reverts part of 031886edfc6e96ab778c241035a8d00fb0de99d3.
* core: Remove explicit Plymouth integrationJasper St. Pierre2015-03-16
| | | | | | | | | | | | | | | | | | | | | Even if plymouth is running, it might have not displayed the splash yet, so we'll see a few lines on fbcon when we should have otherwise had nothing. Plymouth integration was added to systemd in commit 6faa11140bf776cdaeb8d22d01816e6e48296971. That same day, Plymouth got systemd integration [0]. As such, the Plymouth integration has always been obsolete, and was probably only for older Plymouth's. But I can't imagine anybody running a Plymouth from 2011 with a systemd from 2015. Remove the Plymouth/systemd integration, and let Plymouth's code tell systemd to print the details. [0] http://cgit.freedesktop.org/plymouth/commit/?id=537c16422cd49f1beeaab1ad39846a00018faec1 Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net> Cc: Daniel Drake <dsd@endlessm.com> Cc: Ray Strode <rstrode@redhat.com>
* util: check asprintf return valueZbigniew Jędrzejewski-Szmek2015-03-15
| | | | CID #1237546.
* sysv-generator: initialize LookupPaths just onceZbigniew Jędrzejewski-Szmek2015-03-14
| | | | | | | | With debugging on, sysv-generator would print the full set of lookup paths for *every* sysv script. While at it, pass LookupPaths as a pointer in sysv-generator, and constify it everywhere.
* util: remove redundant debug messageZbigniew Jędrzejewski-Szmek2015-03-14
| | | | | | | mar 14 20:05:34 fedora22 systemd[4058]: /usr/lib/systemd/system-generators/kdump-dep-generator.sh will be executed. mar 14 20:05:34 fedora22 systemd[4058]: Spawned /usr/lib/systemd/system-generators/kdump-dep-generator.sh as 4059. The second line already says everything.
* selinux: fix SEGV during switch-root if SELinux policy loadedWill Woods2015-03-13
| | | | | | | | | | | | | | | | | | If you've got SELinux policy loaded, label_hnd is your labeling handle. When systemd is shutting down, we free that handle via mac_selinux_finish(). But: switch_root() calls mkdir_p_label(), which tries to look up a label using that freed handle, and so we get a bunch of garbage and eventually SEGV in libselinux. (This doesn't happen in the switch-root from initramfs to real root because there's no SELinux policy loaded in initramfs, so label_hnd is NULL and we never attempt any lookups.) So: make sure that mac_selinux_finish() actually sets label_hnd to NULL, so nobody tries to use it after it becomes invalid. https://bugzilla.redhat.com/show_bug.cgi?id=1185604
* Use space after a silencing (void)Zbigniew Jędrzejewski-Szmek2015-03-13
| | | | | We were using a space more often than not, and this way is codified in CODING_STYLE.
* Check that EWOULDBLOCK is the same as EAGAINZbigniew Jędrzejewski-Szmek2015-03-13
| | | | | | It certainly is everywhere on Linux, but as a courtesy to people doing some strange cross-compilation, check that the assumption holds.
* tree-wide: there is no ENOTSUP on linuxDavid Herrmann2015-03-13
| | | | Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
* socket-util: refactor error handling in sockaddr_prettyZbigniew Jędrzejewski-Szmek2015-03-11
|
* sysctl: move property handling to shared/Kay Sievers2015-03-11
|
* util: add rename_noreplaceAlban Crequy2015-03-10
| | | | | | | | | renameat2() exists since Linux 3.15 but btrfs support for the flag RENAME_NOREPLACE was added later. This patch implements a fallback when renameat2() returns EINVAL. EINVAL is the error returned when the filesystem does not support one of the flags.
* path-util: fix path_is_mount_point() for symlinksHarald Hoyer2015-03-10
| | | | | | | | | path_is_mount_point() compares the mount_id of a directory and the mount_id of the parent directory. When following symlinks, the function to get the parent directory does not take the symlink into account. /bin -> /usr/bin with /usr being a mountpoint: mount_id of /bin with AT_SYMLINK_FOLLOW != mount_id of /
* shared: the btrfs quota field is called "referenced" not "referred"Lennart Poettering2015-03-10
|
* add REMOTE_ADDR and REMOTE_PORT for Accept=yesShawn Landden2015-03-10
|
* Add type specifier for intThomas Hindoe Paaboel Andersen2015-03-10
|
* logs-show: fix check of loop_read_exactThomas Hindoe Paaboel Andersen2015-03-10
| | | | just a typo fix
* Introduce loop_read_exact helperZbigniew Jędrzejewski-Szmek2015-03-09
| | | | | | | | Usually when using loop_read(), we want to read the full buffer. Add a helper that mirrors loop_write(), and returns 0 when full buffer was read, and an error otherwise. Use -ENODATA for the short read, to distinguish it from a read error.
* efivars: itialize variableZbigniew Jędrzejewski-Szmek2015-03-09
| | | | Introduced a few commits ago.
* Add missing includesZbigniew Jędrzejewski-Szmek2015-03-09
| | | | | audit.h uses uint32_t and bool. log.h uses abs.
* efivars: use greedy_reallocZbigniew Jędrzejewski-Szmek2015-03-09
|
* efivars: use more _cleanup_Zbigniew Jędrzejewski-Szmek2015-03-09
| | | | Also rename r to buf, since r is customarily reserved for the return value.
* efivars: do binary and before converting to boolZbigniew Jędrzejewski-Szmek2015-03-09
| | | | I'm pretty sure that this is what was meant here.
* efivars: rename last remaining err to rZbigniew Jędrzejewski-Szmek2015-03-09
|
* efivars: modernizationZbigniew Jędrzejewski-Szmek2015-03-09
| | | | Fix return value if unlink fails.
* importd: add API for exporting container/VM imagesLennart Poettering2015-03-09
| | | | Also, expose it in machinectl.
* tree-wide: use _packed_ macro instead of raw gcc __attribute__Lennart Poettering2015-03-09
|
* missing.h: add NDA_*Michael Olbrich2015-03-09
| | | | | This is necessary to build with older kernel headers. NDA_VLAN was introduced in v3.9 and NDA_PORT, NDA_VNI and NDA_IFINDEX in v3.10
* shared/machine-pool: remove unnecessary checkZbigniew Jędrzejewski-Szmek2015-03-07
| | | | CID #128739.
* Use correct uname identifiers in arch_map for SuperH architectureJohn Paul Adrian Glaubitz2015-03-04
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=89421
* importd: add new bus calls for importing local tar and raw imagesLennart Poettering2015-03-05
| | | | | | | | This also adds "machinectl import-raw" and "machinectl import-tar" to wrap these new bus calls. THe commands basically do for local files that "machinectl pull-raw" and friends do for remote files.
* shared/util: assume ac when /sys/class/power_supply is missingZbigniew Jędrzejewski-Szmek2015-03-03
| | | | | On s390 (at least) /sys/class/power_supply is not present. We should treat this like if this directory was empty, and not an error.
* importd: automatically grow /var/lib/machines/ loopback filesystem during ↵Lennart Poettering2015-03-03
| | | | | | | | | | | downloads If /var/lib/machines is mounted as btrfs loopback file system in /var/lib/machines.raw with this change we automatically grow the file system as it fills up. After each 10M we write to it during imports, we check the free disk space, and if the fill level grows beyond 66% we increase the size of the file system to 3x the fill level (thus lowering it to 33%).
* machined: also set up /var/lib/machines as btrfs, if "machinectl set-limit" ↵Lennart Poettering2015-03-02
| | | | is called