diff options
author | lethalman <lucabru@src.gnome.org> | 2015-01-28 18:52:46 +0100 |
---|---|---|
committer | lethalman <lucabru@src.gnome.org> | 2015-01-28 18:52:46 +0100 |
commit | a15edc22e30176892ce273a05df3d6e499b5a67e (patch) | |
tree | 97f39aafe088ad0c2c87dcd35c56bff81651cbeb /pkgs | |
parent | 269523382324f6e51c60222ae8351460ff27dd0a (diff) | |
parent | ff5eae075a6a42994b8ae406afdb4cb64146f4b0 (diff) | |
download | nixlib-a15edc22e30176892ce273a05df3d6e499b5a67e.tar nixlib-a15edc22e30176892ce273a05df3d6e499b5a67e.tar.gz nixlib-a15edc22e30176892ce273a05df3d6e499b5a67e.tar.bz2 nixlib-a15edc22e30176892ce273a05df3d6e499b5a67e.tar.lz nixlib-a15edc22e30176892ce273a05df3d6e499b5a67e.tar.xz nixlib-a15edc22e30176892ce273a05df3d6e499b5a67e.tar.zst nixlib-a15edc22e30176892ce273a05df3d6e499b5a67e.zip |
Merge pull request #5615 from nckx/freefall
Add freefall: hard drive protection on HP/Dell laptops
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/os-specific/linux/freefall/default.nix | 42 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
2 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/freefall/default.nix b/pkgs/os-specific/linux/freefall/default.nix new file mode 100644 index 000000000000..9903cb5b963d --- /dev/null +++ b/pkgs/os-specific/linux/freefall/default.nix @@ -0,0 +1,42 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + version = "3.18.3"; + name = "freefall-${version}"; + + src = fetchurl { + url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz"; + sha256 = "0ma2x68975xsi9kb15p0615nx9sm5ppb309kfdz7fgx9pg84q0hf"; + }; + + buildPhase = '' + cd Documentation/laptops + + # Default time-out is a little low, probably because the AC/lid status + # functions were never implemented. Because no-one still uses HDDs, right? + substituteInPlace freefall.c --replace "alarm(2)" "alarm(5)" + + cc -o freefall freefall.c + ''; + + installPhase = '' + mkdir -p $out/bin + install freefall $out/bin + ''; + + meta = with stdenv.lib; { + description = "Free-fall protection for spinning HP/Dell laptop hard drives"; + longDescription = '' + ATA/ATAPI-7 specifies the IDLE IMMEDIATE command with unload feature. + Issuing this command should cause the drive to switch to idle mode and + unload disk heads. This feature is being used in modern laptops in + conjunction with accelerometers and appropriate software to implement + a shock protection facility. The idea is to stop all I/O operations on + the internal hard drive and park its heads on the ramp when critical + situations are anticipated. This has no effect on SSD devices! + ''; + license = with licenses; gpl2; + platforms = with platforms; linux; + maintainers = with maintainers; [ nckx ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 79e33e9ac4a9..f9f8e0ad499a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8418,6 +8418,8 @@ let firejail = callPackage ../os-specific/linux/firejail {}; + freefall = callPackage ../os-specific/linux/freefall { }; + fuse = callPackage ../os-specific/linux/fuse { }; fxload = callPackage ../os-specific/linux/fxload { }; |