-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple service to comment / in fstab
ostree modes have conflictings / mount needs: - "hardlinks" mode need / to be rw - composefs mode need / to be ro Some installation methods (at least Anaconda) add / to fstab, so when systemd-remount-fs.service tries to remount the composefs / rw, it fails because it can only be ro. To be able to edit /etc this early during the boot it rely on having the 'rw' kargs. bootc has a systemd generator to edit fstab but not everyone uses bootc (yet).
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ systemdsystemunit_DATA = src/boot/ostree-prepare-root.service \ | |
src/boot/ostree-finalize-staged.service \ | ||
src/boot/ostree-finalize-staged.path \ | ||
src/boot/ostree-finalize-staged-hold.service \ | ||
src/boot/ostree-edit-fstab.service \ | ||
src/boot/[email protected] \ | ||
$(NULL) | ||
systemdtmpfilesdir = $(prefix)/lib/tmpfiles.d | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2 of the License, or (at your option) any later version. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
[Unit] | ||
Description=OSTree comment / in fstab | ||
DefaultDependencies=no | ||
ConditionKernelCommandLine=ostree | ||
Conflicts=shutdown.target | ||
After=systemd-fsck-root.service | ||
Before=bootc-fstab-edit.service systemd-remount-fs.service local-fs-pre.target local-fs.target shutdown.target | ||
Wants=local-fs-pre.target | ||
ConditionPathIsReadWrite=/etc | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=/usr/bin/sed -i 's/^\\([^#[:space:]]\\+[[:space:]]\\+\\/[[:space:]]\\+\\)/# Avoid \\/ being remounted by systemd-remount-fs.service (ostree-edit-fstab.service)\\n#\\1/' /etc/fstab | ||
|
||
[Install] | ||
WantedBy=local-fs.target |