summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2021-12-27 04:18:40 +0200
committerGitHub <noreply@github.com>2021-12-27 04:18:40 +0200
commit3239e947d1bfb7cfef6fdc1a88753059d4847aaa (patch)
tree2b1606d9e35a73d8e55b2123caf733110b587c2f /nixos
parent2684d1a99002e19cc93ee64f344ea3b238a4512b (diff)
parentc44f95a85539e4371620e6a4bcdef7bdc0a33849 (diff)
downloadnixpkgs-3239e947d1bfb7cfef6fdc1a88753059d4847aaa.tar
nixpkgs-3239e947d1bfb7cfef6fdc1a88753059d4847aaa.tar.gz
nixpkgs-3239e947d1bfb7cfef6fdc1a88753059d4847aaa.tar.bz2
nixpkgs-3239e947d1bfb7cfef6fdc1a88753059d4847aaa.tar.lz
nixpkgs-3239e947d1bfb7cfef6fdc1a88753059d4847aaa.tar.xz
nixpkgs-3239e947d1bfb7cfef6fdc1a88753059d4847aaa.tar.zst
nixpkgs-3239e947d1bfb7cfef6fdc1a88753059d4847aaa.zip
Merge pull request #151156 from Artturin/fsckonbat
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/stage-1-init.sh16
1 files changed, 0 insertions, 16 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh
index e8e32bab6e3..98409ed6ae5 100644
--- a/nixos/modules/system/boot/stage-1-init.sh
+++ b/nixos/modules/system/boot/stage-1-init.sh
@@ -263,15 +263,6 @@ if test -n "$debug1devices"; then fail; fi
 @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.
 checkFS() {
     local device="$1"
@@ -316,13 +307,6 @@ checkFS() {
         return 0
     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..."
 
     fsckFlags=