[Pkg-sysvinit-devel] Bug#348172: halt: please spin down SATA disks
as well
Petter Reinholdtsen
pere at hungry.com
Fri Aug 4 08:50:34 UTC 2006
I had a look at the patch, and it look mostly ok. But I am not too
happy about this part:
static int find_scsidisks(const char **dev, int maxdev, int *count)
{
if (*count < maxdev) dev[(*count)++] = DEV_BASE "/sda";
if (*count < maxdev) dev[(*count)++] = DEV_BASE "/sdb";
if (*count < maxdev) dev[(*count)++] = DEV_BASE "/sdc";
if (*count < maxdev) dev[(*count)++] = DEV_BASE "/sdd";
if (*count < maxdev) dev[(*count)++] = DEV_BASE "/sde";
if (*count < maxdev) dev[(*count)++] = DEV_BASE "/sdf";
if (*count < maxdev) dev[(*count)++] = DEV_BASE "/sdg";
if (*count < maxdev) dev[(*count)++] = DEV_BASE "/sdh";
return 0;
}
Perhaps it could be rewritten into something more dynamic. What about
using the content of /proc/partitions to find disks instead? Or
perhaps /dev/disk/? Perhaps Ubuntu, SuSe, Fedora or any of the other
distributions have a patch for this?
More information about the Pkg-sysvinit-devel
mailing list