2015-01-20 09:23:57 +00:00
|
|
|
{ stdenv, fetchurl }:
|
|
|
|
|
2015-11-26 17:35:39 +00:00
|
|
|
let version = "4.3"; in
|
2015-07-30 17:00:14 +01:00
|
|
|
stdenv.mkDerivation {
|
2015-01-20 09:23:57 +00:00
|
|
|
name = "freefall-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2015-11-26 17:35:39 +00:00
|
|
|
sha256 = "1bpkr45i4yzp32p0vpnz8mlv9lk4q2q9awf1kg9khg4a9g42qqja";
|
2015-08-31 00:07:52 +01:00
|
|
|
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
|
2015-01-20 09:23:57 +00:00
|
|
|
};
|
|
|
|
|
2015-08-31 00:07:52 +01:00
|
|
|
postPatch = ''
|
|
|
|
cd tools/laptop/freefall
|
2015-01-20 09:23:57 +00:00
|
|
|
|
|
|
|
# Default time-out is a little low, probably because the AC/lid status
|
|
|
|
# functions were never implemented. Because no-one still uses HDDs, right?
|
2015-11-26 17:35:39 +00:00
|
|
|
substituteInPlace freefall.c --replace "alarm(2)" "alarm(5)"
|
2015-01-20 09:23:57 +00:00
|
|
|
'';
|
|
|
|
|
2015-11-26 17:44:44 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
2015-01-20 09:23:57 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Free-fall protection for spinning HP/Dell laptop hard drives";
|
|
|
|
longDescription = ''
|
2015-08-31 00:07:52 +01:00
|
|
|
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!
|
2015-01-20 09:23:57 +00:00
|
|
|
'';
|
2015-05-28 18:20:29 +01:00
|
|
|
license = licenses.gpl2;
|
2015-11-17 20:29:29 +00:00
|
|
|
platforms = platforms.linux;
|
2015-01-20 09:23:57 +00:00
|
|
|
maintainers = with maintainers; [ nckx ];
|
|
|
|
};
|
|
|
|
}
|