freefall: 3.19 -> 4.2

This commit is contained in:
Tobias Geerinckx-Rice 2015-08-31 01:07:52 +02:00
parent 4a8797d827
commit 8a0a151d60

View File

@ -1,39 +1,33 @@
{ stdenv, fetchurl }: { stdenv, fetchurl }:
let version = "3.19"; in let version = "4.2"; in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "freefall-${version}"; name = "freefall-${version}";
src = fetchurl { src = fetchurl {
sha256 = "0v40b5l6dcviqgl47bxlcbimz7kawmy1c2909axi441jwlgm2hmy"; sha256 = "1syv8n5hwzdbx69rsj4vayyzskfq1w5laalg5jjd523my52f086g";
url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz"; url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
}; };
buildPhase = '' postPatch = ''
cd Documentation/laptops cd tools/laptop/freefall
# Default time-out is a little low, probably because the AC/lid status # Default time-out is a little low, probably because the AC/lid status
# functions were never implemented. Because no-one still uses HDDs, right? # functions were never implemented. Because no-one still uses HDDs, right?
substituteInPlace freefall.c --replace "alarm(2)" "alarm(5)" substituteInPlace freefall.c --replace "alarm(2)" "alarm(7)"
cc -o freefall freefall.c
''; '';
installPhase = '' makeFlags = "PREFIX=$(out)";
mkdir -p $out/bin
install freefall $out/bin
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Free-fall protection for spinning HP/Dell laptop hard drives"; description = "Free-fall protection for spinning HP/Dell laptop hard drives";
longDescription = '' longDescription = ''
ATA/ATAPI-7 specifies the IDLE IMMEDIATE command with unload feature. Provides a shock protection facility in modern laptops with spinning hard
Issuing this command should cause the drive to switch to idle mode and drives, by stopping all input/output operations on the internal hard drive
unload disk heads. This feature is being used in modern laptops in and parking its heads on the ramp when critical situations are anticipated.
conjunction with accelerometers and appropriate software to implement Requires support for the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
a shock protection facility. The idea is to stop all I/O operations on feature, which should cause the drive to switch to idle mode and unload the
the internal hard drive and park its heads on the ramp when critical disk heads, and an accelerometer device. It has no effect on SSD devices!
situations are anticipated. This has no effect on SSD devices!
''; '';
license = licenses.gpl2; license = licenses.gpl2;
platforms = with platforms; linux; platforms = with platforms; linux;