Import Debian changes 1.21+ds-1

hd-idle (1.21+ds-1) unstable; urgency=medium
.
  [ Debian Janitor ]
  * Bump debhelper from old 12 to 13.
  * Set debhelper-compat version in Build-Depends.
  * Update standards version to 4.4.1, no changes needed.
.
  [ Alexandre Mestiashvili ]
  * d/watch, track new upstream
  * d/copyright:
    + new upstream source
    + switch to GPL-3+
    + add upstream to debian/* section
  * New upstream version 1.21+ds, Closes: #1026327
  * d/control
    + update build deps
    + update Homepage and Description
    + Rules-Requires-Root: no
    + bump Policy to 4.6.2
    + introduce XS-Go-Import-Path and Built-Using headers
  * d/rules, new build rules
  * d/docs, install only README.md
  * d/NEWS, new codebase
  * add d/lintian-overrides, hd-idle is statically linked
This commit is contained in:
Alexandre Mestiashvili
2024-04-21 17:21:11 +02:00
committed by geos_one
43 changed files with 3225 additions and 1145 deletions

8
debian/NEWS vendored Normal file
View File

@@ -0,0 +1,8 @@
hd-idle (1.21+ds-1) unstable; urgency=medium
Starting from the version 1.21, hd-idle is using a new codebase:
https://github.com/adelolmo/hd-idle - a reimplementation of
Christian Mueller's hd-idle with some extra features.
You might want to check the options and update your configs.
-- Alexandre Mestiashvili <mestia@debian.org> Fri, 22 Mar 2024 15:58:22 +0100

27
debian/changelog vendored
View File

@@ -1,3 +1,30 @@
hd-idle (1.21+ds-1) unstable; urgency=medium
[ Debian Janitor ]
* Bump debhelper from old 12 to 13.
* Set debhelper-compat version in Build-Depends.
* Update standards version to 4.4.1, no changes needed.
[ Alexandre Mestiashvili ]
* d/watch, track new upstream
* d/copyright:
+ new upstream source
+ switch to GPL-3+
+ add upstream to debian/* section
* New upstream version 1.21+ds, Closes: #1026327
* d/control
+ update build deps
+ update Homepage and Description
+ Rules-Requires-Root: no
+ bump Policy to 4.6.2
+ introduce XS-Go-Import-Path and Built-Using headers
* d/rules, new build rules
* d/docs, install only README.md
* d/NEWS, new codebase
* add d/lintian-overrides, hd-idle is statically linked
-- Alexandre Mestiashvili <mestia@debian.org> Sun, 21 Apr 2024 17:21:11 +0200
hd-idle (1.05+ds-2) unstable; urgency=medium
* No-change, Source-only upload

70
debian/changelog_orig vendored
View File

@@ -1,70 +0,0 @@
hd-idle (1.05) unstable; urgency=low
* Allow SCSI device names with more than one character (e.g. sdaa) in case
there are more than 26 SCSI targets.
-- Christian Mueller <cm1@mumac.de> Sun, 6 Apr 2014 22:02:00 +0200
hd-idle (1.04) unstable; urgency=low
* Make hd-idle's build environment compatible to Debian package management;
this effort is meant to allow hd-idle to become an official Debian package
* Man page for hd-idle
-- Christian Mueller <cm1@mumac.de> Fri, 30 Sep 2011 22:35:12 +0200
hd-idle (1.03) unstable; urgency=low
* Use %u in dprintf() when reporting number of reads and writes (the
corresponding variable is an unsigned int).
* Fix example in README where the parameter "-a" was written as "-n".
-- Christian Mueller <cm1@mumac.de> Sun, 5 Dec 2010 19:25:51 +0100
hd-idle (1.02) unstable; urgency=low
* In case the SCSI stop unit command fails with "check condition", print a
hex dump of the sense buffer to stderr. This is supposed to help
debugging.
-- Christian Mueller <cm1@mumac.de> Sat, 6 Nov 2010 15:47:00 +0100
hd-idle (1.01) unstable; urgency=low
* The parameter "-a" now also supports symlinks for disk names. Thus, disks
can be specified using something like /dev/disk/by-uuid/... Use "-d" to
verify that the resulting disk name is what you want.
Please note that disk names are resolved to device nodes at startup. Also,
since many entries in /dev/disk/by-xxx are actually partitions, partition
numbers are automatically removed from the resulting device node.
* Not really a bug, but the disk name comparison used strstr which is a bit
useless because only disks starting with "sd" and a single letter after
that are currently considered. Replaced the comparison with strcmp()
-- Christian Mueller <cm1@mumac.de> Fri, 26 Feb 2010 14:03:44 +0100
hd-idle (1.00) unstable; urgency=low
* New parameter "-a" to allow selecting idle timeouts for individual disks;
compatibility to previous releases is maintained by having an implicit
default which matches all SCSI disks
* Changed comparison operator for idle periods from '>' to '>=' to prevent
adding one polling interval to idle time
* Changed sleep time before calling sync after updating the log file to 1s
(from 3s) to accumulate fewer dirty blocks before synching. It's still
a compromize but the log file is for debugging purposes, anyway. A test
with fsync() was unsuccessful because the next bdflush-initiated sync
still caused spin-ups.
-- Christian Mueller <cm1@mumac.de> Wed, 18 Nov 2009 20:53:17 +0100
hd-idle (0.99) unstable; urgency=low
* Initial Release.
-- Christian Mueller <cm1@mumac.de> Mon, 23 Apr 2007 22:03:10 +0100

1
debian/compat vendored
View File

@@ -1 +0,0 @@
12

22
debian/control vendored
View File

@@ -2,18 +2,22 @@ Source: hd-idle
Maintainer: Alexandre Mestiashvili <mestia@debian.org>
Section: admin
Priority: optional
Build-Depends: debhelper (>= 12~)
Standards-Version: 4.3.0
Build-Depends: debhelper-compat (= 13), golang-any, dh-golang
Standards-Version: 4.6.2
Vcs-Browser: https://salsa.debian.org/debian/hd-idle
Vcs-Git: https://salsa.debian.org/debian/hd-idle.git
Homepage: http://hd-idle.sf.net
Rules-Requires-Root: no
Homepage: https://github.com/adelolmo/hd-idle
XS-Go-Import-Path: github.com/adelolmo/hd-idle
Package: hd-idle
Architecture: any
Pre-Depends: ${misc:Pre-Depends}
Depends: lsb-base,
${misc:Depends},
Depends: ${misc:Depends},
${shlibs:Depends},
Built-Using:
${misc:Built-Using},
Description: Spin down idle [USB] hard disks
hd-idle is a utility program for spinning-down external disks after a period
of idle time. Since most external IDE disk enclosures don't support setting
@@ -26,11 +30,3 @@ Description: Spin down idle [USB] hard disks
stress the spin-up causes on the spindle motor and bearings. It seems that
manufacturers recommend a minimum idle time of 3-5 minutes, the default in
hd-idle is 10 minutes.
.
One more word of caution: hd-idle will spin down any disk accessible via the
SCSI layer (USB, IEEE1394, ...) but it will not work with real SCSI disks
because they don't spin up automatically. Thus it's not called scsi-idle and
It is not recommended to use it on a real SCSI system unless you have a kernel
patch that automatically starts the SCSI disks after receiving a sense buffer
indicating the disk has been stopped. Without such a patch, real SCSI disks
won't start again and you can as well pull the plug.

24
debian/copyright vendored
View File

@@ -1,23 +1,24 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: hd-idle
Source: https://sourceforge.net/projects/hd-idle/files/
Source: https://github.com/adelolmo/hd-idle/
Files-Excluded:
debian/*
scripts/*
Files: *
Copyright: 2007 Christian Mueller <cm1@mumac.de>
License: GPL-2+
Copyright: 2018 Andoni del Olmo <andoni.delolmo@gmail.com>
Author: Andoni del Olmo <andoni.delolmo@gmail.com>
License: GPL-3+
Files: debian/*
Copyright: © 2019 Alex Mestiashvili <mestia@debian.org>
© 2007 Christian Mueller <cm1@mumac.de>
License: GPL-2+
@ 2018 Andoni del Olmo <andoni.delolmo@gmail.com>
License: GPL-3+
License: GPL-2+
This program is free software; you can redistribute it and/or modify
License: GPL-3+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
@@ -25,9 +26,8 @@ License: GPL-2+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

3
debian/docs vendored
View File

@@ -1,2 +1 @@
README
debian/changelog_orig
README.md

127
debian/hd-idle.8 vendored Normal file
View File

@@ -0,0 +1,127 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH HD-IDLE 8 "September 8, 2019"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
hd-idle \- spin down idle hard disks
.SH SYNOPSIS
.B hd-idle
.RI [ options ]
.P
.SH DESCRIPTION
hd-idle is a utility program for spinning down external disks after a period
of idle time. Since most external IDE disk enclosures don't support setting
the IDE idle timer, a program like hd-idle is required to spin down idle
disks automatically.
.P
A word of caution: hard disks don't like spinning up too often. Laptop disks
are more robust in this respect than desktop disks but if you set your disks
to spin down after a few seconds you may damage the disk over time due to the
stress the spin-up causes on the spindle motor and bearings. It seems that
manufacturers recommend a minimum idle time of 3-5 minutes, the default in
hd-idle is 10 minutes.
.SH OPTIONS
.TP
.B \-a name
Set device name of disks for subsequent idle-time parameters
.B (-i).
This parameter is optional in the sense that there's a default entry for
all disks which are not named otherwise by using this parameter. This can
also be a symlink (e.g. /dev/disk/by-uuid/...)
.TP
.B \-i idle_time
Idle time in seconds for the currently named disk(s) (-a <name>) or for
all disks.
Setting this value to "0" will never spin down the disk(s).
.TP
.B \-c command_type
Api call to stop the device. Possible values are "scsi" (default value)
and "ata".
.TP
.B \-p power_condition
Power condition to send with the issued SCSI START STOP UNIT command.
Possible values are "0-15" (inclusive). The default value of "0" works fine
for disks accessible via the SCSI layer (USB, IEEE1394, ...), but it will
*NOT* work as intended with real SCSI / SAS disks. A stopped SAS disk will
not start up automatically on access, but requires a startup command for
reactivation. Useful values for SAS disks are "2" for idle and "3" for standby.
.TP
.B \-s symlink_policy
Set the policy to resolve symlinks for devices. If set to "0", symlinks
are resolve only on start. If set to "1", symlinks are also resolved on
runtime until success. By default symlinks are only resolve on start.
If the symlink doesn't resolve to a device, the default configuration
will be applied.
.TP
.B \-l logfile
Name of logfile (written only after a disk has spun up). Please note that
this option might cause the disk which holds the logfile to spin up just
because another disk had some activity. This option should not be used on
systems with more than one disk except for tuning purposes. On single-disk
systems, this option should not cause any additional spinups.
.TP
.B \-t disk
Spin-down the specified disk immediately and exit. It can be used in combination
with
.B \-c
to specify the command type.
.TP
.B \-d
Debug mode. It will print debugging info to stdout/stderr (/var/log/syslog
if started as with systemctl)
.TP
.B \-h
Print usage information.
.SH "DISK SELECTION"
The parameter
.B \-a
can be used to set a filter on the disk's device name (omit /dev/) for
subsequent idle-time settings. The default is all disks:
.P
.TP
.B \1)
A
.B \-i
option before the first
.B \-a
option will set the default idle time.
.TP
.B \2)
In order to disable spin-down of disks per default, and then re-enable
spin-down on selected disks, set the default idle time to 0.
.SH EXAMPLE
hd-idle -i 0 -a sda -i 300 -a sdb -i 1200
.P
This example sets the default idle time to 0 (meaning hd-idle will never
try to spin down a disk) and default "scsi" api command, then sets explicit
idle times for disks which have the string "sda" or "sdb" in their device name.
.SH EXAMPLE
hd-idle -i 0 -c ata -a sda -i 300 -a sdb -i 1200 -c scsi
.P
This example sets the default idle time to 0 (meaning hd-idle will never
try to spin down a disk) and default "ata" api command, then sets explicit
idle times for disks which have the string "sda" or "sdb" in their device name
and sets "sdb" to use "ata" api command.
.P
The option -c allows to set the api call that sends the spindown command.
Possible values are "scsi" (the default value) or "ata".
.SH AUTHOR
hd-idle was written by Andoni del Olmo <andoni.delolmo@gmail> based on Chistian Mueller's <chris@mumac.de> work.
.PP
This manual page was written by Christian Mueller <chris@mumac.de>, for the Debian
project (and may be used by others).
.PP
Modified by Andoni del Olmo <andoni.delolmo@gmail.com>.

View File

@@ -1,15 +1,7 @@
# defaults file for hd-idle
## Debian specific defaults for hd-idle
# In order to make init.d script and systemd service consistent, hd-idle
# defaults file supports only one option - HD_IDLE_OPTS.
# Don't start hd-idle by defaulit. By specifying "-h" in HD_IDEL_OPTS,
# hd-idle daemon will print usage and successfully exit both for systemd
# and systemv scripts
# properly update HD_IDLE_OPTS in order to star hd-idle
HD_IDLE_OPTS="-h"
# start hd-idle automatically?
START_HD_IDLE=false
# hd-idle command line options
# Options are:
@@ -20,6 +12,20 @@ HD_IDLE_OPTS="-h"
# parameter. This can also be a symlink
# (e.g. /dev/disk/by-uuid/...)
# -i <idle_time> Idle time in seconds.
# -c <command_type> Api call to stop the device. Possible values are "scsi"
# (default value) and "ata".
# -p <power_condition>
# Power condition to send with the issued SCSI START STOP UNIT command. Possible values
# are `0-15` (inclusive). The default value of `0` works fine for disks accessible via the
# SCSI layer (USB, IEEE1394, ...), but it will *NOT* work as intended with real SCSI / SAS disks.
# A stopped SAS disk will not start up automatically on access, but requires a startup command for reactivation.
# Useful values for SAS disks are `2` for idle and `3` for standby.
# -s symlink_policy Set the policy to resolve symlinks for devices.
# If set to "0", symlinks are resolve only on start.
# If set to "1", symlinks are also resolved on runtime
# until success. By default symlinks are only resolve on start.
# If the symlink doesn't resolve to a device, the default
# configuration will be applied.
# -l <logfile> Name of logfile (written only after a disk has spun
# up). Please note that this option might cause the
# disk which holds the logfile to spin up just because
@@ -29,9 +35,8 @@ HD_IDLE_OPTS="-h"
# this option should not cause any additional spinups.
#
# Options not exactly useful here:
# -t <disk> Spin-down the specfified disk immediately and exit.
# -d Debug mode. This will prevent hd-idle from
# becoming a daemon and print debugging info to
# stdout/stderr
# -t <disk> Spin-down the specified disk immediately and exit.
# -d Debug mode. It will print debugging info to
# stdout/stderr (/var/log/syslog if started as with systemctl)
# -h Print usage information.
#HD_IDLE_OPTS="-i 180 -l /var/log/hd-idle.log"
#HD_IDLE_OPTS="-i 180 -l /var/log/hd-idle.log"

1
debian/hd-idle.lintian-overrides vendored Normal file
View File

@@ -0,0 +1 @@
hd-idle binary: statically-linked-binary

View File

@@ -1,4 +1,4 @@
/var/log/hd-idle/*log {
/var/log/hd-idle.log {
missingok
notifempty
compress

View File

@@ -1,11 +1,13 @@
[Unit]
Description=hd-idle - spin down idle hard disks
Documentation=man:hd-idle(1)
Documentation=man:hd-idle(8)
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
[Service]
Type=forking
Type=simple
EnvironmentFile=/etc/default/hd-idle
ExecStart=/usr/sbin/hd-idle $HD_IDLE_OPTS
Restart=always
[Install]
WantedBy=multi-user.target

19
debian/rules vendored
View File

@@ -1,16 +1,15 @@
#!/usr/bin/make -f
export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/pkg-info.mk
mandir:= $(CURDIR)/debian/hd-idle/usr/share/man
%:
dh $@
dh $@ --buildsystem=golang --with=golang
override_dh_auto_install:
dh_auto_install
# upstream ships wrong man section, thus the dirty workaround below
mkdir -p $(mandir)/man8
mv $(mandir)/man1/hd-idle.1 \
$(mandir)/man8/hd-idle.8
perl -i -pe 's/\A(\.TH\sHD-IDLE\s)1(.*)\Z/$${1}8$$2/' $(mandir)/man8/hd-idle.8
rm -rf $(mandir)/man1
dh_auto_install -- --no-source
override_dh_install:
mv -vf ${CURDIR}/debian/${DEB_SOURCE}/usr/bin ${CURDIR}/debian/${DEB_SOURCE}/usr/sbin
override_dh_installman:
dh_installman debian/hd-idle.8

7
debian/watch vendored
View File

@@ -1,4 +1,5 @@
version=4
opts=dversionmangle=s/\+ds(@ANY_VERSION@)?$//,repacksuffix=+ds,repack,compression=xz \
https://sf.net/@PACKAGE@/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@
opts="searchmode=plain, dversionmangle=s/\.ds//, \
filenamemangle=s%.*/v?@ANY_VERSION@%@PACKAGE@-$1.tar.xz%,repacksuffix=+ds,repack" \
https://api.github.com/repos/adelolmo/hd-idle/releases?per_page=50 \
https://api.github.com/repos/[^/]+/[^/]+/tarball/v?@ANY_VERSION@