mirror of
https://github.com/systemd/systemd.git
synced 2025-01-12 13:18:14 +03:00
Merge pull request #63 from arvidjaar/issue/50
fstab-generator: cescape device name in root-fsck service
This commit is contained in:
commit
3a3701f033
@ -34,9 +34,14 @@
|
|||||||
static int write_fsck_sysroot_service(const char *dir, const char *what) {
|
static int write_fsck_sysroot_service(const char *dir, const char *what) {
|
||||||
const char *unit;
|
const char *unit;
|
||||||
_cleanup_free_ char *device = NULL;
|
_cleanup_free_ char *device = NULL;
|
||||||
|
_cleanup_free_ char *escaped;
|
||||||
_cleanup_fclose_ FILE *f = NULL;
|
_cleanup_fclose_ FILE *f = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
escaped = cescape(what);
|
||||||
|
if (!escaped)
|
||||||
|
return log_oom();
|
||||||
|
|
||||||
unit = strjoina(dir, "/systemd-fsck-root.service");
|
unit = strjoina(dir, "/systemd-fsck-root.service");
|
||||||
log_debug("Creating %s", unit);
|
log_debug("Creating %s", unit);
|
||||||
|
|
||||||
@ -61,11 +66,12 @@ static int write_fsck_sysroot_service(const char *dir, const char *what) {
|
|||||||
"[Service]\n"
|
"[Service]\n"
|
||||||
"Type=oneshot\n"
|
"Type=oneshot\n"
|
||||||
"RemainAfterExit=yes\n"
|
"RemainAfterExit=yes\n"
|
||||||
"ExecStart=" SYSTEMD_FSCK_PATH " %2$s\n"
|
"ExecStart=" SYSTEMD_FSCK_PATH " %4$s\n"
|
||||||
"TimeoutSec=0\n",
|
"TimeoutSec=0\n",
|
||||||
program_invocation_short_name,
|
program_invocation_short_name,
|
||||||
what,
|
what,
|
||||||
device);
|
device,
|
||||||
|
escaped);
|
||||||
|
|
||||||
r = fflush_and_check(f);
|
r = fflush_and_check(f);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user