/lib/udev/hdparm is in hdparm 9.37-0ubuntu3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/bin/sh
set -e
[ -n "$DEVNAME" ] || exit 1
. /lib/hdparm/hdparm-functions
if [ -e /proc/cmdline ]; then #linux only - future proofing against BSD and Hurd :)
if grep -wq nohdparm /proc/cmdline ; then
exit 0
fi
fi
raidstat=OK
if [ -e /proc/mdstat ]; then
if egrep -iq "resync|repair|recover|check" /proc/mdstat; then
raidstat=RESYNC
fi
elif [ -e /proc/rd/status ]; then
raidstat=`cat /proc/rd/status`
fi
if ! [ "$raidstat" = 'OK' ]; then
exit 1
fi
OPTIONS=$(hdparm_options $DEVNAME)
if [ -n "$OPTIONS" ]; then
/sbin/hdparm $OPTIONS $DEVNAME 2>/dev/null
fi
exit 0
|