diff options
author | Theodore Ts'o <tytso@mit.edu> | 2006-01-29 05:15:36 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2006-01-29 05:15:36 -0500 |
commit | a5f37a9b25191421e08bfd909e14b533333cf367 (patch) | |
tree | 7a839799d8ec3817ba22c7ff4d77f36a387f47ff | |
parent | bc3392c389849f86e1c9abcef4055ad58bf96547 (diff) | |
download | e2fsprogs-a5f37a9b25191421e08bfd909e14b533333cf367.tar.gz |
Add a config option which controls whether fs checks are skipped when on battery
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>
-rw-r--r-- | e2fsck/ChangeLog | 6 | ||||
-rw-r--r-- | e2fsck/unix.c | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 497a0cca..a2bfcf98 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -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> diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 4a7e08ae..b3db14c9 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -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; |