From a5f37a9b25191421e08bfd909e14b533333cf367 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 29 Jan 2006 05:15:36 -0500 Subject: [PATCH] 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" --- e2fsck/ChangeLog | 6 +++++- e2fsck/unix.c | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 497a0cc..a2bfcf9 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,7 +1,11 @@ 2006-01-29 Theodore Ts'o * 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 diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 4a7e08a..b3db14c 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; -- 1.8.3.1