]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Add a config option which controls whether fs checks are skipped when on battery
authorTheodore Ts'o <tytso@mit.edu>
Sun, 29 Jan 2006 10:15:36 +0000 (05:15 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 29 Jan 2006 10:15:36 +0000 (05:15 -0500)
Whether fs checks are skipped when the system is running on battery can be
controlled by the new e2fsck.conf option defer_check_on_battery (this option
defaults to TRUE).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/ChangeLog
e2fsck/unix.c

index 497a0cca94fc571d2c322b8c28b039935130eb67..a2bfcf981da91f40c5bd72c930a43033f6ad85cb 100644 (file)
@@ -1,7 +1,11 @@
 2006-01-29  Theodore Ts'o  <tytso@mit.edu>
 
        * unix.c (check_if_skip): When skipping a check due to being on
-               battery, print an explanatory message to this effect.  
+               battery, print an explanatory message to this effect.  Add
+               an e2fsck configuration option defer_check_on_battery
+               which defaults to true.  If the configuration option is
+               turned off, then e2fsck will not attempt to defer
+               filesystem checks when the system is running on battery.
                (Addresses Debain Bug: #350306)
 
 2006-01-06  Theodore Ts'o  <tytso@mit.edu>
index 4a7e08ae1177f38241ed3609f851eeb8ef71e02d..b3db14c97cc593a32f882ecec139815f4b5cf3de 100644 (file)
@@ -259,7 +259,14 @@ static void check_if_skip(e2fsck_t ctx)
        unsigned int reason_arg = 0;
        long next_check;
        int batt = is_on_batt();
-       
+       int defer_check_on_battery;
+
+       profile_get_boolean(ctx->profile, "options",
+                           "defer_check_on_battery", 0, 1, 
+                           &defer_check_on_battery);
+       if (!defer_check_on_battery)
+               batt = 0;
+
        if ((ctx->options & E2F_OPT_FORCE) || bad_blocks_file ||
            cflag || swapfs)
                return;