all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add freefall.
@ 2016-03-16  3:34 Tobias Geerinckx-Rice
  2016-03-16  6:47 ` Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: Tobias Geerinckx-Rice @ 2016-03-16  3:34 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/linux.scm (freefall): New variable.
---

A little example-cum-useful-tool included in the Linux tree.

Regards,

T G-R

 gnu/packages/linux.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index a2412d0..09c0c7e 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2524,3 +2524,29 @@ easy administration.")
     ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
     ;; GPL2: Everything else.
     (license (list license:gpl2 license:gpl2+))))
+
+(define-public freefall
+  (package
+    (name "freefall")
+    (version (package-version linux-libre))
+    (source (package-source linux-libre))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'enter-subdirectory
+                    (lambda _
+                      (chdir "tools/laptop/freefall")))
+                  (delete 'configure))
+       #:make-flags (list (string-append "PREFIX="
+                                         (assoc-ref %outputs "out")))
+       #:tests? #f)) ;no tests
+    (home-page (package-home-page linux-libre))
+    (synopsis "Free-fall protection for spinning laptop hard drives")
+    (description
+     "Prevents shock damage to the internal spinning hard drive(s) of some
+HP and Dell laptops.  When sudden movement is detected, all input/output
+operations on the drive are suspended and its heads are parked on the ramp,
+where they are less likely to cause damage to the spinning disc.  Requires a
+drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
+feature, and a laptop with an accelerometer.  It has no effect on SSDs.")
+    (license license:gpl2)))
-- 
2.7.0 :-(

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add freefall.
  2016-03-16  3:34 [PATCH] gnu: Add freefall Tobias Geerinckx-Rice
@ 2016-03-16  6:47 ` Leo Famulari
  2016-03-16 11:09   ` Tobias Geerinckx-Rice
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2016-03-16  6:47 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: guix-devel

On Wed, Mar 16, 2016 at 04:34:29AM +0100, Tobias Geerinckx-Rice wrote:
> * gnu/packages/linux.scm (freefall): New variable.

Looks good!

Do you think we should change the 'alarm' value as in the Nix package?

> ---
> 
> A little example-cum-useful-tool included in the Linux tree.
> 
> Regards,
> 
> T G-R
> 
>  gnu/packages/linux.scm | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index a2412d0..09c0c7e 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -2524,3 +2524,29 @@ easy administration.")
>      ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
>      ;; GPL2: Everything else.
>      (license (list license:gpl2 license:gpl2+))))
> +
> +(define-public freefall
> +  (package
> +    (name "freefall")
> +    (version (package-version linux-libre))
> +    (source (package-source linux-libre))
> +    (build-system gnu-build-system)
> +    (arguments
> +     '(#:phases (modify-phases %standard-phases
> +                  (add-after 'unpack 'enter-subdirectory
> +                    (lambda _
> +                      (chdir "tools/laptop/freefall")))
> +                  (delete 'configure))
> +       #:make-flags (list (string-append "PREFIX="
> +                                         (assoc-ref %outputs "out")))
> +       #:tests? #f)) ;no tests
> +    (home-page (package-home-page linux-libre))
> +    (synopsis "Free-fall protection for spinning laptop hard drives")
> +    (description
> +     "Prevents shock damage to the internal spinning hard drive(s) of some
> +HP and Dell laptops.  When sudden movement is detected, all input/output
> +operations on the drive are suspended and its heads are parked on the ramp,
> +where they are less likely to cause damage to the spinning disc.  Requires a
> +drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
> +feature, and a laptop with an accelerometer.  It has no effect on SSDs.")
> +    (license license:gpl2)))
> -- 
> 2.7.0 :-(
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add freefall.
  2016-03-16  6:47 ` Leo Famulari
@ 2016-03-16 11:09   ` Tobias Geerinckx-Rice
  2016-03-16 18:34     ` Efraim Flashner
  2016-03-17  4:34     ` Leo Famulari
  0 siblings, 2 replies; 7+ messages in thread
From: Tobias Geerinckx-Rice @ 2016-03-16 11:09 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

On 16/03/2016, Leo Famulari <leo@famulari.name> wrote:
> Do you think we should change the 'alarm' value as in the Nix package?

(Disclaimer of sorts: I wrote that package as well, a long time ago.
For the same machine I'm hoping to migrate to Guix soon.)

Yes please! Since the main purpose of this package is peace of mind, I
consider it worth patching.

In my very scientific tests of pretend-dropping my laptop and watching
the HDD LED, the default seemed needlessly short. I've seen expensive
things bounce about for much longer...

Should I add a separate .patch file for this, or just do it inline like Nix?

Kind regards,

T G-R

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add freefall.
  2016-03-16 11:09   ` Tobias Geerinckx-Rice
@ 2016-03-16 18:34     ` Efraim Flashner
  2016-03-16 20:45       ` [PATCH v2] " Tobias Geerinckx-Rice
  2016-03-17  4:28       ` [PATCH] " Leo Famulari
  2016-03-17  4:34     ` Leo Famulari
  1 sibling, 2 replies; 7+ messages in thread
From: Efraim Flashner @ 2016-03-16 18:34 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

On Wed, 16 Mar 2016 12:09:06 +0100
Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com> wrote:

> On 16/03/2016, Leo Famulari <leo@famulari.name> wrote:
>  [...]  
> 
> (Disclaimer of sorts: I wrote that package as well, a long time ago.
> For the same machine I'm hoping to migrate to Guix soon.)
> 
> Yes please! Since the main purpose of this package is peace of mind, I
> consider it worth patching.
> 
> In my very scientific tests of pretend-dropping my laptop and watching
> the HDD LED, the default seemed needlessly short. I've seen expensive
> things bounce about for much longer...
> 
> Should I add a separate .patch file for this, or just do it inline like Nix?
> 
> Kind regards,
> 
> T G-R
> 

I personally prefer inline as long as it isn't too big/hard. In my
unscientific understanding of it, it allows people who don't use substitutes
to be more self-reliant.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] gnu: Add freefall.
  2016-03-16 18:34     ` Efraim Flashner
@ 2016-03-16 20:45       ` Tobias Geerinckx-Rice
  2016-03-17  4:28       ` [PATCH] " Leo Famulari
  1 sibling, 0 replies; 7+ messages in thread
From: Tobias Geerinckx-Rice @ 2016-03-16 20:45 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/linux.scm (freefall): New variable.
---

Hullo all,

Thanks for the feedback! I added an 'increase-timeout phase.

Kind regards,

T G-R

 gnu/packages/linux.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index a2412d0..a320c6b 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2524,3 +2524,35 @@ easy administration.")
     ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
     ;; GPL2: Everything else.
     (license (list license:gpl2 license:gpl2+))))
+
+(define-public freefall
+  (package
+    (name "freefall")
+    (version (package-version linux-libre))
+    (source (package-source linux-libre))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'enter-subdirectory
+                    (lambda _
+                      (chdir "tools/laptop/freefall")))
+                  (delete 'configure)
+                  (add-before 'build 'increase-timeout
+                    (lambda _
+                      ;; The default of 2 seconds is too low: it assumes an
+                      ;; open lid and AC power without actually checking.
+                      (substitute* "freefall.c"
+                        (("alarm\\(2\\)") "alarm(5)")))))
+       #:make-flags (list (string-append "PREFIX="
+                                         (assoc-ref %outputs "out")))
+       #:tests? #f)) ;no tests
+    (home-page (package-home-page linux-libre))
+    (synopsis "Free-fall protection for spinning laptop hard drives")
+    (description
+     "Prevents shock damage to the internal spinning hard drive(s) of some
+HP and Dell laptops.  When sudden movement is detected, all input/output
+operations on the drive are suspended and its heads are parked on the ramp,
+where they are less likely to cause damage to the spinning disc.  Requires a
+drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
+feature, and a laptop with an accelerometer.  It has no effect on SSDs.")
+    (license license:gpl2)))
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add freefall.
  2016-03-16 18:34     ` Efraim Flashner
  2016-03-16 20:45       ` [PATCH v2] " Tobias Geerinckx-Rice
@ 2016-03-17  4:28       ` Leo Famulari
  1 sibling, 0 replies; 7+ messages in thread
From: Leo Famulari @ 2016-03-17  4:28 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

On Wed, Mar 16, 2016 at 08:34:46PM +0200, Efraim Flashner wrote:
> On Wed, 16 Mar 2016 12:09:06 +0100
> Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com> wrote:
> 
> > On 16/03/2016, Leo Famulari <leo@famulari.name> wrote:
> >  [...]  
> > 
> > (Disclaimer of sorts: I wrote that package as well, a long time ago.
> > For the same machine I'm hoping to migrate to Guix soon.)
> > 
> > Yes please! Since the main purpose of this package is peace of mind, I
> > consider it worth patching.
> > 
> > In my very scientific tests of pretend-dropping my laptop and watching
> > the HDD LED, the default seemed needlessly short. I've seen expensive
> > things bounce about for much longer...
> > 
> > Should I add a separate .patch file for this, or just do it inline like Nix?
> > 
> > Kind regards,
> > 
> > T G-R
> > 
> 
> I personally prefer inline as long as it isn't too big/hard. In my
> unscientific understanding of it, it allows people who don't use substitutes
> to be more self-reliant.

I also think it's much more likely to be read later on, which is a
positive thing.

Plus it's Scheme so you could do more things with the data.

> 
> -- 
> Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
> GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
> Confidentiality cannot be guaranteed on emails sent or received unencrypted

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add freefall.
  2016-03-16 11:09   ` Tobias Geerinckx-Rice
  2016-03-16 18:34     ` Efraim Flashner
@ 2016-03-17  4:34     ` Leo Famulari
  1 sibling, 0 replies; 7+ messages in thread
From: Leo Famulari @ 2016-03-17  4:34 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: guix-devel

On Wed, Mar 16, 2016 at 12:09:06PM +0100, Tobias Geerinckx-Rice wrote:
> On 16/03/2016, Leo Famulari <leo@famulari.name> wrote:
> > Do you think we should change the 'alarm' value as in the Nix package?
> 
> (Disclaimer of sorts: I wrote that package as well, a long time ago.
> For the same machine I'm hoping to migrate to Guix soon.)

Now I always check nixpkgs for your packages :)

Pushed as 08e9daf505.

> 
> Yes please! Since the main purpose of this package is peace of mind, I
> consider it worth patching.
> 
> In my very scientific tests of pretend-dropping my laptop and watching
> the HDD LED, the default seemed needlessly short. I've seen expensive
> things bounce about for much longer...
> 
> Should I add a separate .patch file for this, or just do it inline like Nix?
> 
> Kind regards,
> 
> T G-R

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-03-17  4:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-16  3:34 [PATCH] gnu: Add freefall Tobias Geerinckx-Rice
2016-03-16  6:47 ` Leo Famulari
2016-03-16 11:09   ` Tobias Geerinckx-Rice
2016-03-16 18:34     ` Efraim Flashner
2016-03-16 20:45       ` [PATCH v2] " Tobias Geerinckx-Rice
2016-03-17  4:28       ` [PATCH] " Leo Famulari
2016-03-17  4:34     ` Leo Famulari

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.