diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-20 03:21:48 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-20 03:21:48 -0500 |
commit | 76ee6ed55a653356f861c0a7c757938eed0578cc (patch) | |
tree | c232b8c827f92a228bf956272e3416182830931d | |
parent | 755b4024270dcc7a70d0269a9e39c9455139ccb1 (diff) | |
download | horizon-76ee6ed55a653356f861c0a7c757938eed0578cc.tar.gz horizon-76ee6ed55a653356f861c0a7c757938eed0578cc.tar.bz2 horizon-76ee6ed55a653356f861c0a7c757938eed0578cc.tar.xz horizon-76ee6ed55a653356f861c0a7c757938eed0578cc.zip |
hscript: diskid: Use syspath, not devpath
-rw-r--r-- | hscript/disk.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hscript/disk.cc b/hscript/disk.cc index 7773467..890ff34 100644 --- a/hscript/disk.cc +++ b/hscript/disk.cc @@ -76,6 +76,8 @@ bool DiskId::execute(ScriptOptions options) const { struct udev *udev; struct udev_device *device; const char *serial; + /* XXX this is *horrible* */ + const char *syspath = ("/sys/block/" + _block.substr(5)).c_str(); udev = udev_new(); if(!udev) { @@ -84,11 +86,11 @@ bool DiskId::execute(ScriptOptions options) const { "cannot read disk information"); return false; } - device = udev_device_new_from_syspath(udev, _block.c_str()); + device = udev_device_new_from_syspath(udev, syspath); if(!device) { udev_unref(udev); output_error("installfile:" + std::to_string(line), - "diskid: failed to communicate with udevd", + "diskid: failed to retrieve disk from udevd", "cannot read disk information"); return false; } |