summaryrefslogtreecommitdiffstats
path: root/src/shared/mount-setup.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* mount-setup: fix typoMike Yuan2024-04-261-1/+1
|
* mount-setup: use mount_verbose_full where appropriateMike Yuan2024-04-241-4/+1
|
* use FOREACH_ELEMENTMatteo Croce2024-04-181-2/+2
| | | | | | | | Use FOREACH_ELEMENT where possible. Generated with this command, and checked manually: git grep -l 'FOREACH_ARRAY.*ELEMENTSOF' | \ xargs sed -ri 's/FOREACH_ARRAY\((.*), (.*), (ELEMENTSOF.*)\)/FOREACH_ELEMENT(\1, \2)/'
* core: refuse cgroupv1 unless SYSTEMD_CGROUP_ENABLE_LEGACY_FORCEMike Yuan2024-02-271-0/+3
| | | | | | Also, add a 30s sleep even if cgroup v1 is forced. Closes #30852
* shared/mount-setup: split out mount_cgroup_legacy_controllersMike Yuan2024-02-271-117/+123
|
* shared/mount-setup: minor modernizationMike Yuan2024-02-271-15/+14
|
* mountpoint-util: introduce path_is_mount_point_fullMike Yuan2024-02-061-1/+1
|
* various: use FOREACH_ARRAY moreMike Yuan2023-12-251-2/+2
| | | | Prompted by #30622
* tree-wide: drop space between variable and an increment/decrementYu Watanabe2023-12-241-1/+1
|
* mute the memory recursiveprot log if version of kernel is low.cunshunxia2023-06-281-1/+16
|
* mount-setup: exclude /run/nextroot/ from relabellingLennart Poettering2023-06-021-2/+3
| | | | | Just like /run/initramfs/ the data in /run/nextroot/ should be a self-contained OS tree, and not require labelling, hence don't.
* label: Rename to label-util.hDaan De Meyer2023-05-301-1/+1
|
* Merge pull request #27648 from poettering/common-dissect-dirLennart Poettering2023-05-161-0/+5
|\ | | | | pid1: add common root dir inode to mount disk images to in private namespaces
| * namespace: introduce a common dir in /run/ that we can use to see new root ↵Lennart Poettering2023-05-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fs up on This creates a new dir /run/systemd/mount-rootfs/ early in PID 1 that thus always exists. It's supposed to be used by any code that creates its own mount namespace and then sets up a new root dir to switch into. So far in many cases we used a temporary dir (which needed explicit clean-up) or a purpose-specific fixed dir. Let's create a common dir instead, that always exists (as it is created in PID 1 early on, always). Besides making things more robust, as manual clean-up of the inode is not necessary anymore this also opens the door for unprivileged programs to use the same dir, since it now always exists. Set the access mode to 555 (instead of the otherwise previously used 0755, 0700 or similar), so that unprivileged programs can access it, but we make clear it's not supposed to be written directly to, by anyone, not even root.
* | mount-setup: minor modernizationLennart Poettering2023-05-161-15/+13
| |
* | mount-setup: minor log improvementLennart Poettering2023-05-161-1/+1
| |
* | mount-setup: port to logging about mount attempts via mount_*follow_verbose()Lennart Poettering2023-05-161-5/+3
|/
* mount-setup: use size_t when iterating through array indexesLennart Poettering2023-05-021-3/+1
|
* mount-setup: Fix typoDaan De Meyer2023-02-141-1/+1
|
* tree-wide: use mode=0nnn for mount optionZbigniew Jędrzejewski-Szmek2022-12-141-22/+24
| | | | | | This is an octal number. We used the 0 prefix in some places inconsistently. The kernel always interprets in base-8, so this has no effect, but I think it's nicer to use the 0 to remind the reader that this is not a decimal number.
* mount-setup: don't need to mount /sys/fs/pstore if there is no ENABLE_PSTOREjcg2022-12-101-0/+2
|
* strv: declare iterator of FOREACH_STRING() in the loopZbigniew Jędrzejewski-Szmek2022-03-231-4/+0
| | | | | | | | | | | Same idea as 03677889f0ef42cdc534bf3b31265a054b20a354. No functional change intended. The type of the iterator is generally changed to be 'const char*' instead of 'char*'. Despite the type commonly used, modifying the string was not allowed. I adjusted the naming of some short variables for clarity and reduced the scope of some variable declarations in code that was being touched anyway.
* strv: make iterator in STRV_FOREACH() declaread in the loopYu Watanabe2022-03-191-3/+0
| | | | This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
* shared: clean up mkdir.h/label.h situationLennart Poettering2021-11-161-1/+1
| | | | | | | | | | Previously the mkdir_label() family of calls was implemented in src/shared/mkdir-label.c but its functions partly declared ins src/shared/label.h and partly in src/basic/mkdir.h (!!). That's weird (and wrong). Let's clean this up, and add a proper mkdir-label.h matching the .c file.
* tree-wide: use new RET_NERRNO() helper at various placesLennart Poettering2021-11-161-1/+1
|
* mount-setup: port from nftw() to recurse_dir()Lennart Poettering2021-10-071-26/+45
|
* meson: ignore -Dsmack-run-label= if -Dsmack=falseZbigniew Jędrzejewski-Szmek2021-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Compilation would fail because we could have HAVE_SMACK_RUN_LABEL without HAVE_SMACK. This doesn't make much sense, so let's just make -Dsmack=false completely disable smack. Also, the logic in smack-setup.c seems dubious: '#ifdef SMACK_RUN_LABEL' would evaluate to true even if -Dsmack-run-label='' is used. I think this was introduced in the conversion to meson: 8b197c3a8a57c3f7c231b39e5660856fd9580c80 added AC_ARG_WITH(smack-run-label, AS_HELP_STRING([--with-smack-run-label=STRING], [run systemd --system with a specific SMACK label]), [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run with a smack label])], []) i.e. it really was undefined if not specified. And it was same still in 72cdb3e783174dcf9223a49f03e3b0e2ca95ddb8 when configure.ac was dropped. So let's use the single conditional HAVE_SMACK_RUN_LABEL everywhere.
* cgroup-util: use string_hash_ops_freeYu Watanabe2021-09-111-1/+1
|
* tree-wide: add FORMAT_TIMESPAN()Zbigniew Jędrzejewski-Szmek2021-07-091-2/+1
|
* tree-wide: always drop unnecessary dot in pathYu Watanabe2021-05-281-1/+1
|
* core: move several source files to src/sharedYu Watanabe2021-01-181-0/+561
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As, the files are used by many executables, fstab-generator, remount-fs, machine-id-setup, and etc. With this change, the total size of the relevant executables and libshared slightly decreases. Before: ``` $ ll systemd-fstab-generator systemd-remount-fs systemd-machine-id-setup systemd-shutdown systemd-nspawn systemd src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 watanabe watanabe 7577800 Jan 5 13:35 src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 watanabe watanabe 4608360 Jan 5 13:35 systemd -rwxrwxr-x 1 watanabe watanabe 117240 Jan 5 13:35 systemd-fstab-generator -rwxrwxr-x 1 watanabe watanabe 61576 Jan 5 13:35 systemd-machine-id-setup -rwxrwxr-x 1 watanabe watanabe 853080 Jan 5 13:35 systemd-nspawn -rwxrwxr-x 1 watanabe watanabe 70600 Jan 5 13:35 systemd-remount-fs -rwxrwxr-x 1 watanabe watanabe 172624 Jan 5 13:35 systemd-shutdown ``` Total: 13461280 After: ``` $ ll systemd-fstab-generator systemd-remount-fs systemd-machine-id-setup systemd-shutdown systemd-nspawn systemd src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 watanabe watanabe 7658336 Jan 5 13:32 src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 watanabe watanabe 4523560 Jan 5 13:32 systemd -rwxrwxr-x 1 watanabe watanabe 78288 Jan 5 13:32 systemd-fstab-generator -rwxrwxr-x 1 watanabe watanabe 30984 Jan 5 13:32 systemd-machine-id-setup -rwxrwxr-x 1 watanabe watanabe 840384 Jan 5 13:32 systemd-nspawn -rwxrwxr-x 1 watanabe watanabe 39104 Jan 5 13:32 systemd-remount-fs -rwxrwxr-x 1 watanabe watanabe 117160 Jan 5 13:32 systemd-shutdown ``` Total: 13287816
* build-sys: move *-setup out of shared to avoid selinux being pulled inLennart Poettering2012-04-121-423/+0
|
* move more common files to shared/ and add them to shared.laKay Sievers2012-04-121-0/+423