2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, kernel }:
|
2015-01-20 10:23:57 +01:00
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2016-03-16 20:47:54 +01:00
|
|
|
inherit (kernel) version src;
|
2015-01-20 10:23:57 +01:00
|
|
|
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "freefall";
|
2015-01-20 10:23:57 +01:00
|
|
|
|
2015-08-31 01:07:52 +02:00
|
|
|
postPatch = ''
|
|
|
|
cd tools/laptop/freefall
|
2015-01-20 10:23:57 +01: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 18:35:39 +01:00
|
|
|
substituteInPlace freefall.c --replace "alarm(2)" "alarm(5)"
|
2015-01-20 10:23:57 +01:00
|
|
|
'';
|
|
|
|
|
2015-11-26 18:44:44 +01:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
2015-01-20 10:23:57 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2016-03-16 20:47:54 +01:00
|
|
|
inherit (kernel.meta) homepage license;
|
|
|
|
|
2015-01-20 10:23:57 +01:00
|
|
|
description = "Free-fall protection for spinning HP/Dell laptop hard drives";
|
|
|
|
longDescription = ''
|
2015-08-31 01:07:52 +02: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 10:23:57 +01:00
|
|
|
'';
|
2016-03-16 20:47:54 +01:00
|
|
|
|
2015-11-17 21:29:29 +01:00
|
|
|
platforms = platforms.linux;
|
2015-01-20 10:23:57 +01:00
|
|
|
};
|
|
|
|
}
|