summaryrefslogtreecommitdiffstats
path: root/src/mount (follow)
Commit message (Collapse)AuthorAgeFilesLines
* bus-util: Log more information when connecting to a bus socket failsDaan De Meyer2024-10-091-1/+1
| | | | | Let's log about which bus we're trying to connect to and what transport we're using to do it.
* mount: use sd_bus_set_allow_interactive_authorization()Yu Watanabe2024-08-191-12/+2
|
* tree-wide: voidify polkit_agent_open_if_enabled()Yu Watanabe2024-08-191-3/+3
|
* mount-tool: show diskseq in --list outputLennart Poettering2024-07-101-1/+17
| | | | Let's expose the diskseq a bit more prominently.
* mount-tool: use the usual coloring in --help textLennart Poettering2024-07-101-1/+3
|
* mount-tool: add support for a --json= output modeLennart Poettering2024-07-101-8/+12
| | | | Let's add a JSON output mode, like we have it for so many of our tools.
* mount-tool: use lowercase table column namesLennart Poettering2024-07-101-1/+1
| | | | | | | | | | The "systemd-mount" tool is the one outlier in our codebase to specify upper case column names. And it's quite pointless given that our table output logic uppercases this anyway on output. Hence, let's fix that. (This would be a compat break, if we'd support JSON output of this table, but we do not currently. JSON fields use the literal column name after all.)
* Rename spawn-polkit-agent.c to just polkit-agent.cZbigniew Jędrzejewski-Szmek2024-06-261-1/+1
| | | | | The functions in the file were *not* using the spawn prefix, and the prefix seems completely unnecessary.
* tree-wide: Use log_setup() everywhereDaan De Meyer2024-04-251-3/+1
| | | | | Otherwise the default log target is the console and we won't use the journal socket even if it is available.
* tree-wide: use device_in_subsystem() and device_is_devtype()Yu Watanabe2023-12-221-1/+1
|
* dbus-wait-for-jobs: change 'quiet' flag to enumMatteo Croce2023-12-191-3/+3
| | | | | Change the 'quiet' flag to `bus_wait_for_jobs()` to an enum, so we can select with more granularity the type of information logged.
* mount: don't call sd_device_get_property_value() with a NULL pointerFrantisek Sumsal2023-11-151-2/+1
| | | | | | | Otherwise bad thing would've happened is this was a hard assert: + systemd-mount --umount /dev/loop0 Assertion 'device' failed at src/libsystemd/sd-device/sd-device.c:2202, function sd_device_get_property_value(). Ignoring.
* Merge pull request #30010 from poettering/mount-tool-tweaklesYu Watanabe2023-11-131-13/+14
|\ | | | | mount-tool: trivial tweaklets
| * mount-tool: make internal and external column name matchLennart Poettering2023-11-131-1/+1
| |
| * mount-tool: rely on format-table.c's ersatz logicLennart Poettering2023-11-131-1/+2
| | | | | | | | | | Let the table logic handle the special casing ov unavailable data, rather than doing that ourselves.
| * mount-tool: reduce scope of enumLennart Poettering2023-11-131-11/+11
| |
* | udev-util: add generic device_get_{vendor,model}_string() helpersLennart Poettering2023-11-131-18/+5
|/ | | | | We chck the same props in various places, add a single implementation of a call to inquire this.
* tree-wide: add path_simplify_alloc() and use itZbigniew Jędrzejewski-Szmek2023-09-221-24/+17
| | | | | | | | | | | | | | path_simplify_full()/path_simplify() are changed to allow a NULL path, for which a NULL is returned. Generally, callers have already asserted before that the argument is nonnull. This way path_simplify_full()/path_simplify() and path_simplify_alloc() behave consistently. In sd-device.c, logging in device_set_syspath() is intentionally dropped: other branches don't log. In mount-tool.c, logging in parse_argv() is changed to log the user-specified value, not the simplified string. In an error message, we should show the actual argument we got, not some transformed version.
* mount/mount-tool: return correct errnoMike Yuan2023-08-261-1/+1
| | | | Follow-up for 9269296df05a724c6b121bcbb0b420c8b4088f2f
* mount-tool: override mode of --tmpfs mounts to (rwxrwxrwx & ~umask)Zbigniew Jędrzejewski-Szmek2023-08-221-9/+32
| | | | | | | | | | | The kernel default for tmpfs mounts is rwxrwxrwt, i.e. world-writable with the sticky bit set. This makes sense for /tmp and /var/tmp, but less so for other directories. Users will not use systemd-mount to mount /tmp and /var/tmp, so the existing behaviour is surprising. The defaults are overriden to the same defaults we use for "internal tmpfs mounts", i.e. no sticky bit, nosuid, nodev, and limits of size=10%, nr_inodes=400k. --tmpfs is new, so we can modify the behaviour without breaking compatibility.
* mount-tool: reduce scope of iterator variablesZbigniew Jędrzejewski-Szmek2023-08-221-11/+7
|
* mount-tool,man: reword comments and error messagesZbigniew Jędrzejewski-Szmek2023-08-211-2/+2
| | | | | We were consistenly using --umount everywhere, but add a comment to make this clearer. Also, reword a few things for clarity.
* sd-mount: allow creating tmpfsLuca Boccassi2023-08-211-32/+78
| | | | | | Mount units can do it, but the command line tool cannot, as it needs a valid 'what'. If --tmpfs/-T if passed, parse the argument as 'where' and send a literal 'tmpfs' as the 'what' if not specified.
* meson: use install_emptydir() and drop meson-make-symlink.shYu Watanabe2023-08-081-2/+2
| | | | | | The script is mostly equivalent to 'mkdir -p' and 'ln -sfr'. Let's replace it with install_emptydir() builtin function and inline meson call.
* meson: move declarations of cgls, cgtop, initctl, and systemd-mountYu Watanabe2023-08-011-0/+13
|
* device-util: Declare iterator variables inlineDaan De Meyer2023-07-121-2/+0
|
* stat-util: rename files_same() → inode_same()Lennart Poettering2023-05-191-1/+1
| | | | | | | | | | | Let's be more accurate about what this function does: it checks whether the underlying reported inode is the same. Internally, this already uses a better named stat_inode_same() call, hence let's similarly name the wrapping function following the same logic. Similar for files_same_at() and path_equal_or_same_files(). No code changes, just some renaming.
* chase-symlinks: Rename chase_symlinks() to chase()Daan De Meyer2023-03-241-4/+4
| | | | | | | | | Chasing symlinks is a core function that's used in a lot of places so it deservers a less verbose names so let's rename it to chase() and chaseat(). We also slightly change the pattern used for the chaseat() helpers so we get chase_and_openat() and similar.
* basic: add RuntimeScope enumLennart Poettering2023-03-101-8/+9
| | | | | | | | | | | | In various tools and services we have a per-system and per-user concept. So far we sometimes used a boolean indicating whether we are in system mode, or a reversed boolean indicating whether we are in user mode, or the LookupScope enum used by the lookup path logic. Let's address that, in introduce a common enum for this, we can use all across the board. This is mostly just search/replace, no actual code changes.
* mount-tool: port over basename() → path_extract_filename()Lennart Poettering2022-12-231-4/+13
|
* mount: use device enumerator to find matching loopback block deviceYu Watanabe2022-11-241-53/+33
| | | | No functional change, just refactoring.
* mount: split umount_by_device() into twoYu Watanabe2022-11-241-30/+37
| | | | | No functional change, just refactoring and preparation for later commits.
* mount: make acquire_mount_where_for_loop_dev() take sd-device objectYu Watanabe2022-11-241-11/+18
| | | | No functional change, just refactoring.
* basic: move version() to build.h+cZbigniew Jędrzejewski-Szmek2022-11-081-0/+1
|
* generator: skip fsck if fsck command is missingJonas Kümmerlin2022-09-301-1/+1
| | | | | | | | | | | This is useful for systems which don't have any fsck. We already skip emitting the fsck dependency when the fsck.$fstype helper is missing, but fstab-generator doesn't necessarily know the fstype when handling the root= parameter. Previously, systemd-fsck was started for these mounts and then exited immediately because it couldn't find the fsck.$fstype helper.
* dbus-wait-for-jobs: add extra_args to bus_wait_for_jobs_one()Luca Boccassi2021-12-301-3/+3
| | | | And pass it through to bus_wait_for_jobs()
* Define FOREACH_DIRENT through FOREACH_DIRENT_ALLZbigniew Jędrzejewski-Szmek2021-12-151-1/+0
| | | | As in the previous commit, 'de' is used as the iterator variable name.
* Merge pull request #20138 from keszybz/coding-style-variable-declsLuca Boccassi2021-11-051-1/+1
|\ | | | | A coding style tweak and checking of sd_notify() calls and voidification of pager_open()
| * Make pager_open() return voidZbigniew Jędrzejewski-Szmek2021-11-031-1/+1
| |
* | tree-wide: do not print hint about -M if -M is already usedZbigniew Jędrzejewski-Szmek2021-11-041-1/+1
|/ | | | | | | | (Or when -H is used, since -H and -M are incompatible.) Note that the slightly unusual form with separate boolean variables (hint_vars, hint_addr) instead of e.g. a const char* variable to hold the message, because this way we don't trigger the warning about non-literal format.
* basic: spit out chase_symlinks() from fs-util.[ch] → chase-symlinks.[ch]Lennart Poettering2021-10-051-0/+1
|
* run/mount/systemctl: don't fork off PolicyKit/ask-pw agent when in --user modeLennart Poettering2021-08-301-0/+3
| | | | | | | | When we are in --user mode there's no point in doing PolicyKit/ask-pw because both of these systems are only used by system-level services. Let's disable the two agents for that automaticlly hence. Prompted by: #20576
* Drop the text argument from assert_not_reached()Zbigniew Jędrzejewski-Szmek2021-08-031-2/+2
| | | | | | | | | | | | | | | | | In general we almost never hit those asserts in production code, so users see them very rarely, if ever. But either way, we just need something that users can pass to the developers. We have quite a few of those asserts, and some have fairly nice messages, but many are like "WTF?" or "???" or "unexpected something". The error that is printed includes the file location, and function name. In almost all functions there's at most one assert, so the function name alone is enough to identify the failure for a developer. So we don't get much extra from the message, and we might just as well drop them. Dropping them makes our code a tiny bit smaller, and most importantly, improves development experience by making it easy to insert such an assert in the code without thinking how to phrase the argument.
* dirent-util: use readdir_ensure_type() in readdir_no_dot() and FOREACH_DIRENT()Yu Watanabe2021-06-231-2/+0
|
* tree-wide: always drop unnecessary dot in pathYu Watanabe2021-05-281-3/+3
|
* alloc-util: simplify GREEDY_REALLOC() logic by relying on malloc_usable_size()Lennart Poettering2021-05-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | We recently started making more use of malloc_usable_size() and rely on it (see the string_erase() story). Given that we don't really support sytems where malloc_usable_size() cannot be trusted beyond statistics anyway, let's go fully in and rework GREEDY_REALLOC() on top of it: instead of passing around and maintaining the currenly allocated size everywhere, let's just derive it automatically from malloc_usable_size(). I am mostly after this for the simplicity this brings. It also brings minor efficiency improvements I guess, but things become so much nicer to look at if we can avoid these allocation size variables everywhere. Note that the malloc_usable_size() man page says relying on it wasn't "good programming practice", but I think it does this for reasons that don't apply here: the greedy realloc logic specifically doesn't rely on the returned extra size, beyond the fact that it is equal or larger than what was requested. (This commit was supposed to be a quick patch btw, but apparently we use the greedy realloc stuff quite a bit across the codebase, so this ends up touching *a*lot* of code.)
* table: drop last SIZE_MAX from table_set_sort() and table_set_display()Yu Watanabe2021-03-041-1/+1
|
* tree-wide: use sd_device_new_from_stat_rdev() whereever appropriateLennart Poettering2021-02-221-3/+3
|
* mount-tool: sd_device_get_sysattr_value() returns 0 on successYu Watanabe2021-02-201-1/+1
|
* systemctl: don't search in the full argv[0] for the invocation nameLennart Poettering2021-02-201-2/+3
| | | | | | | | | | | | argv[0] might be prefixed by a path, and we shouldn't get confused by that. Hence provide a simple helper call that abstracts the checking away, which we can use everywhere, and expose the same behaviour, even if argv[0] is not set. (While we are at it, port all other multi-call binaries over to the new helper, too) Follow-up for: d41a9e4fc1e1bcdefc8d358da2744a97aac5820a