summary refs log tree commit diff
path: root/pkgs/os-specific/linux/freefall
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2015-08-31 01:07:52 +0200
committerTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2015-08-31 17:17:30 +0200
commit8a0a151d60c6ccd657d4f1d9af6daf3ca5692688 (patch)
treea04d8638d7ac570844f93c97074e53bf7eb6b6e6 /pkgs/os-specific/linux/freefall
parent4a8797d8276aa1bd9c09d1f591eef1bd04adf2ec (diff)
downloadnixpkgs-8a0a151d60c6ccd657d4f1d9af6daf3ca5692688.tar
nixpkgs-8a0a151d60c6ccd657d4f1d9af6daf3ca5692688.tar.gz
nixpkgs-8a0a151d60c6ccd657d4f1d9af6daf3ca5692688.tar.bz2
nixpkgs-8a0a151d60c6ccd657d4f1d9af6daf3ca5692688.tar.lz
nixpkgs-8a0a151d60c6ccd657d4f1d9af6daf3ca5692688.tar.xz
nixpkgs-8a0a151d60c6ccd657d4f1d9af6daf3ca5692688.tar.zst
nixpkgs-8a0a151d60c6ccd657d4f1d9af6daf3ca5692688.zip
freefall: 3.19 -> 4.2
Diffstat (limited to 'pkgs/os-specific/linux/freefall')
-rw-r--r--pkgs/os-specific/linux/freefall/default.nix32
1 files changed, 13 insertions, 19 deletions
diff --git a/pkgs/os-specific/linux/freefall/default.nix b/pkgs/os-specific/linux/freefall/default.nix
index 34d0f3881e4..683ec9f6155 100644
--- a/pkgs/os-specific/linux/freefall/default.nix
+++ b/pkgs/os-specific/linux/freefall/default.nix
@@ -1,39 +1,33 @@
 { stdenv, fetchurl }:
 
-let version = "3.19"; in
+let version = "4.2"; in
 stdenv.mkDerivation {
   name = "freefall-${version}";
 
   src = fetchurl {
-    sha256 = "0v40b5l6dcviqgl47bxlcbimz7kawmy1c2909axi441jwlgm2hmy";
-    url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
+    sha256 = "1syv8n5hwzdbx69rsj4vayyzskfq1w5laalg5jjd523my52f086g";
+    url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
   };
 
-  buildPhase = ''
-    cd Documentation/laptops
+  postPatch = ''
+    cd tools/laptop/freefall
 
     # 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
+    substituteInPlace freefall.c --replace "alarm(2)" "alarm(7)"
   '';
 
-  installPhase = ''
-    mkdir -p $out/bin
-    install freefall $out/bin
-  '';
+  makeFlags = "PREFIX=$(out)";
 
   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!
+      Provides a shock protection facility in modern laptops with spinning hard
+      drives, by stopping all input/output operations on the internal hard drive
+      and parking its heads on the ramp when critical situations are anticipated.
+      Requires support for the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
+      feature, which should cause the drive to switch to idle mode and unload the
+      disk heads, and an accelerometer device. It has no effect on SSD devices!
     '';
     license = licenses.gpl2;
     platforms = with platforms; linux;