From: Yu Watanabe Date: Sun, 20 Apr 2025 21:05:10 +0000 (+0900) Subject: fsck,quotacheck: drop support for traditional /forcefsck, /fastboot, and /forcequotac... X-Git-Tag: v258-rc1~48^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3445ec416d26fb4fc9fd2bac84d850eac4a98d9;p=thirdparty%2Fsystemd.git fsck,quotacheck: drop support for traditional /forcefsck, /fastboot, and /forcequotacheck files Instead, please use the kernel command line options with the same name. I am not sure these files are System V complieant or not, but at least they are very traditional way to control fsck or quotacheck. However, the concept of the files are really broken, especially for fsck. As when we want to fsck the root filesystem, we need to access the filessystem, but it may be broken... Let's drop such traditional ways to control fsck and quotacheck. We already support kernel command line options to control the behaviors. Maybe, also it is better to provide ways to control them by credentials. --- diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c index a41427ab4dc..9e4f7c66464 100644 --- a/src/fsck/fsck.c +++ b/src/fsck/fsck.c @@ -33,7 +33,6 @@ static bool arg_skip = false; static bool arg_force = false; -static bool arg_show_progress = false; static const char *arg_repair = "-a"; static void start_target(const char *target, const char *mode) { @@ -105,23 +104,6 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat return 0; } -static void test_files(void) { - -#if HAVE_SYSV_COMPAT - if (access("/fastboot", F_OK) >= 0) { - log_error("Please pass 'fsck.mode=skip' on the kernel command line rather than creating /fastboot on the root file system."); - arg_skip = true; - } - - if (access("/forcefsck", F_OK) >= 0) { - log_error("Please pass 'fsck.mode=force' on the kernel command line rather than creating /forcefsck on the root file system."); - arg_force = true; - } -#endif - - arg_show_progress = access("/run/systemd/show-status", F_OK) >= 0; -} - static double percent(int pass, unsigned long cur, unsigned long max) { /* Values stolen from e2fsck */ @@ -249,7 +231,7 @@ static int run(int argc, char *argv[]) { if (r < 0) log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m"); - test_files(); + bool show_progress = access("/run/systemd/show-status", F_OK) >= 0; if (!arg_force && arg_skip) return 0; @@ -328,7 +310,7 @@ static int run(int argc, char *argv[]) { console = fopen("/dev/console", "we"); if (console && - arg_show_progress && + show_progress && pipe(progress_pipe) < 0) return log_error_errno(errno, "pipe(): %m"); diff --git a/src/quotacheck/quotacheck.c b/src/quotacheck/quotacheck.c index 3451f63ef2b..23a5f414c5c 100644 --- a/src/quotacheck/quotacheck.c +++ b/src/quotacheck/quotacheck.c @@ -38,16 +38,6 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat return 0; } -static void test_files(void) { - -#if HAVE_SYSV_COMPAT - if (access("/forcequotacheck", F_OK) >= 0) { - log_error("Please pass 'quotacheck.mode=force' on the kernel command line rather than creating /forcequotacheck on the root file system. Proceeding anyway."); - arg_force = true; - } -#endif -} - static int run(int argc, char *argv[]) { int r; @@ -63,8 +53,6 @@ static int run(int argc, char *argv[]) { if (r < 0) log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m"); - test_files(); - if (!arg_force) { if (arg_skip) return 0; diff --git a/tmpfiles.d/legacy.conf.in b/tmpfiles.d/legacy.conf.in index b475500e587..cdef21fa9b3 100644 --- a/tmpfiles.d/legacy.conf.in +++ b/tmpfiles.d/legacy.conf.in @@ -21,11 +21,4 @@ L$ /var/log/README - - - - ../..{{DOC_DIR}}/README.logs # /run/lock/subsys is used for serializing SysV service execution, and # hence without use on SysV-less systems. d /run/lock/subsys 0755 root root - - -# /forcefsck, /fastboot and /forcequotacheck are deprecated in favor of the -# kernel command line options 'fsck.mode=force', 'fsck.mode=skip' and -# 'quotacheck.mode=force' -r! /forcefsck -r! /fastboot -r! /forcequotacheck {% endif %}