[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Fully suspending/spinning down a device, inc. OS layers...
- From: sur-behoffski <sur_behoffski@...>
- Date: Wed, 21 Sep 2022 20:35:03 +0930
Forgive a brief lapse into /bin/bash, but I have kludged a script
called "spindown-device" that fully quietens an hotplug-capable
device. Yan Li (mentioned below) wrote the original.
The script is GPL3.
I'll just post the first dozen lines or so here, and will send
more if the list gives its approval.
It uses (GNU/Linux?) sg3_utils to manipulate the low SCSI layer,
and also udevadm ("udevadm settle") [? from systemd?] to also
flush udev actions.
--- (cut here) ---
# spindown-device: an easy-to-use script to properly put an USB
# device into suspend mode that can then be unplugged safely
# (Originally named suspend-usb-device.)
# Copyright (C) 2009, Yan Li <firstname.lastname@example.org>
# 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 3 of the License, or
# (at your option) any later version.