Compare commits

...

2 Commits

Author SHA1 Message Date
geos_one
aab8caab26 Import Upstream version 1.21+ds 2025-08-06 15:51:53 +02:00
geos_one
7527bfa483 Import Upstream version 1.05+ds 2025-08-06 15:48:18 +02:00
11 changed files with 0 additions and 504 deletions

214
debian/changelog vendored
View File

@ -1,214 +0,0 @@
hd-idle (1.21) unstable; urgency=medium
[ Gray Xu ]
* Use GivenName instead of Name in the log
[ Andoni del Olmo ]
* Support Jmicron USB Bridge Controller for ATA command
-- Andoni del Olmo <andoni.delolmo@gmail.com> Sun, 22 Oct 2023 09:55:29 +0200
hd-idle (1.20) unstable; urgency=medium
* Fix force hd-idle into background in init script
* Fix missing man page
-- Andoni del Olmo <andoni.delolmo@gmail.com> Fri, 17 Feb 2023 16:54:38 +0100
hd-idle (1.19) unstable; urgency=medium
[ Benjamin Engele ]
* Support more than 26 disks.
[ Paul Webster ]
* Use explicit uint64
[ Benjamin Engele ]
* Use standby instead of stop command.
* Support configuring power condition.
* Add and describe -p parameter usage.
* Adjusted documentation of power condition.
[ Martin Oemus ]
* fixed poolInterval calculation when using idle intervals of 0
[ Andoni del Olmo ]
* fixed Use UNIX time to calculate skew interval
-- Andoni del Olmo <andoni.delolmo@gmail.com> Thu, 09 Feb 2023 11:55:12 +0100
hd-idle (1.18) unstable; urgency=medium
* fix cross platform compilation
* simplify package generation in rules file
* Complete the list of targets for the service restart
-- Andoni del Olmo <andoni.delolmo@gmail.com> Wed, 17 Aug 2022 13:02:42 +0200
hd-idle (1.17) unstable; urgency=medium
[ Alexander Raab ]
* Readme cosmetics
[ Andoni del Olmo ]
* restart service after suspend
* go mod tidy
* Update readme with instructions to build with golang 17 or higher
* Add Makefile
* build debian package compiling with Makefile
* document usage of LUKS encrypted devices
* Redo explanation of how the log file works. Thanks to rabelux.
* restart service after hibernate
[ Sylvain Pasche ]
* Get statistics from device mapper devices
[ Andoni del Olmo ]
* use /sys/class/block/%s/holders for holderGetter + add test
* add test for statsForDisk
-- Andoni del Olmo <andoni.delolmo@gmail.com> Thu, 28 Jul 2022 18:12:46 +0200
hd-idle (1.16) unstable; urgency=medium
[ Maximilian Bichel ]
* Update help and man page to inform that "i" parameter with value zero never spins down disks.
[ Zhenyu Wu ]
* Try both ATA standby commands before fail.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Sun, 05 Sep 2021 19:45:17 +0200
hd-idle (1.15) unstable; urgency=medium
* Handle disks with no partitions.
Encrypted disks do not have any partitions. In this case, the disk level activity has to be taken into
consideration.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Mon, 05 Apr 2021 09:39:11 +0200
hd-idle (1.14) unstable; urgency=medium
* Add logrotate for log file /var/log/hd-idle.log
* Use partitions read/write to calculate disk activity:
It changes the method to calculate disk activity. Now the disk activity is calculated by watching read/write
changes on partition level instead of disk level.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Sun, 28 Mar 2021 14:34:51 +0200
hd-idle (1.13) unstable; urgency=medium
* Fix crash when required arguments are not given. Now it will fail
gracefully when required arguments are missing.
* Add SystemV init script.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Thu, 04 Mar 2021 20:33:26 +0100
hd-idle (1.12) unstable; urgency=medium
* Fix inconsistent spin down log. The release v1.11 changed the log output on spin down to
"/dev/sda spindown". Now is back to the format "sda spindown".
* Fix typo in help -h flag. This bug prevented showing the help on cli.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Sat, 05 Dec 2020 15:43:05 +0100
hd-idle (1.11) unstable; urgency=medium
* Ignore sense response data for ata command to prevent error on arm64.
* Allow set command type in combination with -t option.
* Remove go-co-op dependency.
* Clean control and man page.
* Add copyright.
* Update readme. No need for GOPATH anymore.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Sat, 31 Oct 2020 21:43:04 +0100
hd-idle (1.10) unstable; urgency=medium
* Check sectors read/write to determine disk activity
* Package. Move debian files to debian dir
* Package. Simplify rules and delete config handle system
* Update readme. Explain logs
* Update readme. Entry to response not ok error
-- Andoni del Olmo <andoni.delolmo@gmail.com> Sun, 09 Aug 2020 10:26:32 +0200
hd-idle (1.9) unstable; urgency=medium
* Improve log on start up and ATA error reporting.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Wed, 11 Mar 2020 10:25:00 +0200
hd-idle (1.8) unstable; urgency=medium
* Allow usage of symlinks that point to partitions. Like: by-label, by-partlabel,
by-partuuid and by-uuid.
* Improve error handling when spin down fails.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Wed, 23 Oct 2019 21:15:00 +0200
hd-idle (1.7) unstable; urgency=medium
* Change package section to admin and priority to optional.
* Fix man page format error.
* Move man page to section 8 (System administration commands and daemons).
* Sign package.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Sun, 8 Sep 2019 08:47:00 +0200
hd-idle (1.6) unstable; urgency=low
* The parameter "-s" allows to resolve symlinks for disk names also in runtime.
It is disable by default, because resolving symlinks causes an overhead.
That means that disk symlinks only get resolved on start up by default.
If the parameter "-s" is set to 1, disk symlinks will be also resolve during
execution until the symlink is resolved.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Wed, 28 Aug 2019 19:33:00 +0100
hd-idle (1.5) unstable; urgency=low
* Monitor the skew between monitoring cycles, on discovery of clock skew
reset the drive spin_down status to "spun up" and reset the time to current
in order to capture potential high loading or (more likely) recovery from
suspend or sleep
-- Andoni del Olmo <andoni.delolmo@gmail.com> Sat, 13 Aug 2019 21:15:00 +0100
hd-idle (1.4) 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.
* Simply log spinup.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Sat, 5 Jan 2019 18:42:00 +0100
hd-idle (1.3) unstable; urgency=low
* Set sleep time to 1/10th of the shortest idle time.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Fri, 5 Oct 2018 20:47:10 +0100
hd-idle (1.2) unstable; urgency=low
* Persist user's config across package upgrades.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Mon, 17 Sep 2018 22:03:10 +0100
hd-idle (1.1) unstable; urgency=low
* Add missing feature to spin-down the specified disk immediately.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Sun, 16 Sep 2018 18:13:10 +0100
hd-idle (1.0) unstable; urgency=low
* Add "ata" api call to stop devices on top of the original functionality.
-- Andoni del Olmo <andoni.delolmo@gmail.com> Sun, 16 Sep 2018 10:01:10 +0100

1
debian/compat vendored
View File

@ -1 +0,0 @@
9

24
debian/control vendored
View File

@ -1,24 +0,0 @@
Source: hd-idle
Section: admin
Priority: optional
Maintainer: Andoni del Olmo <andoni.delolmo@gmail.com>
Build-Depends: debhelper (>=9), golang-go:native (>= 1.3.3), dh-golang
Standards-Version: 4.3.0
Vcs-Browser: https://github.com/adelolmo/hd-idle
Vcs-Git: https://github.com/adelolmo/hd-idle.git
Homepage: https://github.com/adelolmo/hd-idle
Package: hd-idle
Architecture: any
Description: Spin down idle 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
the IDE idle timer, a program like hd-idle is required to spin down idle disks
automatically.
.
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.

12
debian/copyright vendored
View File

@ -1,12 +0,0 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: hd-idle
Source: https://github.com/adelolmo/hd-idle
Files: *
Copyright: 2018 Andoni del Olmo <andoni.delolmo@gmail.com>
Author: Andoni del Olmo <andoni.delolmo@gmail.com>
License: GPL-3
Files: debian/hd-idle.8 debian/hd-idle.default debian/control
Copyright: 2007 Christian Mueller <cm1@mumac.de>
License: GPL-3

127
debian/hd-idle.8 vendored
View File

@ -1,127 +0,0 @@
.\" 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,42 +0,0 @@
# defaults file for hd-idle
# start hd-idle automatically?
START_HD_IDLE=false
# hd-idle command line options
# Options are:
# -a <name> Set device name of disks for subsequent idle-time
# parameters (-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/...)
# -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
# 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.
#
# Options not exactly useful here:
# -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"

50
debian/hd-idle.init vendored
View File

@ -1,50 +0,0 @@
#!/bin/sh
set -e
### BEGIN INIT INFO
# Provides: hd-idle
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start hd-idle daemon
# Description: Start hd-idle daemon (spin down idle hard disks)
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/hd-idle
[ -r /etc/default/hd-idle ] && . /etc/default/hd-idle
# See if the daemon is there
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting the hd-idle daemon" "hd-idle"
start-stop-daemon --start --quiet --oknodo --background --exec $DAEMON -- $HD_IDLE_OPTS
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping the hd-idle daemon" "hd-idle"
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
log_end_msg $?
;;
restart|force-reload)
$0 stop && sleep 2 && $0 start
;;
status)
status_of_proc $DAEMON hd-idle && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/hd-idle start/stop/restart/force-reload"
exit 1
;;
esac

View File

@ -1,6 +0,0 @@
/var/log/hd-idle.log {
missingok
notifempty
compress
delaycompress
}

View File

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

14
debian/rules vendored
View File

@ -1,14 +0,0 @@
#!/usr/bin/make -f
export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh $@
override_dh_auto_build:
override_dh_auto_install:
install -d $(CURDIR)/debian/hd-idle
make install DESTDIR=$(CURDIR)/debian/hd-idle ARCH=$(DEB_HOST_ARCH)
override_dh_strip:

View File

@ -1 +0,0 @@
3.0 (native)