Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1:Update
systemd-mini.4328
respect_ro_bootparam.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File respect_ro_bootparam.patch of Package systemd-mini.4328
Index: systemd-210/src/remount-fs/remount-fs.c =================================================================== --- systemd-210.orig/src/remount-fs/remount-fs.c +++ systemd-210/src/remount-fs/remount-fs.c @@ -38,6 +38,27 @@ * options that are in /etc/fstab that systemd might not have * respected */ +static int check_ro_from_cmdline(void) { + _cleanup_free_ char *line = NULL; + int r; + + /* check for 'ro' boot parameter */ + r = read_one_line_file("/proc/cmdline", &line); + if (r >= 0) { + char *w, *state; + size_t l; + + FOREACH_WORD_QUOTED(w, l, line, state) { + if (l == 2 && memcmp(w, "ro", 2) == 0) { + return 1; + break; + } + } + } + return 0; +} + + int main(int argc, char *argv[]) { int ret = EXIT_FAILURE; _cleanup_endmntent_ FILE *f = NULL; @@ -99,7 +120,10 @@ int main(int argc, char *argv[]) { arguments[0] = "/bin/mount"; arguments[1] = me->mnt_dir; arguments[2] = "-o"; - arguments[3] = "remount"; + if (check_ro_from_cmdline() && (path_equal(me->mnt_dir, "/") || path_equal(me->mnt_dir, "/usr"))) + arguments[3] = "remount,ro"; + else + arguments[3] = "remount"; arguments[4] = NULL; execv("/bin/mount", (char **) arguments);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor