--- sys-apps/hdparm/files/hdparm-init-8 2016-05-27 11:22:43.968377317 +0200 +++ sys-apps/hdparm/files/hdparm-init-9 2016-05-28 00:23:20.489649494 +0200 @@ -43,11 +43,27 @@ case ${errmsg} in *": No medium found") nomed=0;; esac + args="" if [ -b "${device}" ] && [ "${status}" = "0" -o "${nomed}" = "0" ] ; then local conf_var="${device##*/}_args" eval args=\$${conf_var} - do_hdparm fi + + # allows a disk to be configured using its id (override above) + # we replace all dashes by underscores + for alias in /dev/disk/by-id/* ; do + if [ "${alias}" -ef "${device}" ] ; then + eval args_tmp=\$"$(basename "${alias}" | sed -e 's/-/_/g' -e 's/:/_/g')"_args + if [ -n "${args_tmp}" ]; then + args="${args_tmp}" + fi + break + fi + done + + if [ -n "$args" ]; then + do_hdparm + fi; done }