mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
Merge pull request #151156 from Artturin/fsckonbat
This commit is contained in:
commit
3239e947d1
1 changed files with 0 additions and 16 deletions
|
@ -263,15 +263,6 @@ if test -n "$debug1devices"; then fail; fi
|
||||||
@postDeviceCommands@
|
@postDeviceCommands@
|
||||||
|
|
||||||
|
|
||||||
# Return true if the machine is on AC power, or if we can't determine
|
|
||||||
# whether it's on AC power.
|
|
||||||
onACPower() {
|
|
||||||
! test -d "/proc/acpi/battery" ||
|
|
||||||
! ls /proc/acpi/battery/BAT[0-9]* > /dev/null 2>&1 ||
|
|
||||||
! cat /proc/acpi/battery/BAT*/state | grep "^charging state" | grep -q "discharg"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Check the specified file system, if appropriate.
|
# Check the specified file system, if appropriate.
|
||||||
checkFS() {
|
checkFS() {
|
||||||
local device="$1"
|
local device="$1"
|
||||||
|
@ -316,13 +307,6 @@ checkFS() {
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Don't run `fsck' if the machine is on battery power. !!! Is
|
|
||||||
# this a good idea?
|
|
||||||
if ! onACPower; then
|
|
||||||
echo "on battery power, so no \`fsck' will be performed on \`$device'"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "checking $device..."
|
echo "checking $device..."
|
||||||
|
|
||||||
fsckFlags=
|
fsckFlags=
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue