26 Commits

Author SHA1 Message Date
9b2e25a669 Update copyright year. 2024-12-19 15:34:27 +00:00
351237ae1e Genera refactor and cleanup. 2024-04-30 15:44:33 +01:00
Daniel Collins
6186813988 Resolve device name symlinks on Linux. (#15)
This is useful for referencing a specific drive on systems with
multiple via /dev/disk/by-id/ or /dev/disk/by-path/ rather than
guessing which order the drives got initialised every reboot.
2023-10-16 20:39:44 +01:00
Daniel Collins
04970bc72a Fix parsing of /sys/block/XXX/device symlinks. (#14)
As of c810bd8d07, I'm not able to use
aaruremote on Linux (5.10). I've tried a few machines and they all have
device sylinks like the following example from my CD dumping machine
(has a mixture of SATA and IDE drives):

/sys/block/sr0/device -> ../../../0:0:0:0
/sys/block/sr1/device -> ../../../0:0:1:0
/sys/block/sr2/device -> ../../../4:0:0:0
/sys/block/sr3/device -> ../../../1:0:0:0
/sys/block/sr4/device -> ../../../3:0:0:0
/sys/block/sr5/device -> ../../../6:0:0:0

I'm not sure how many variants of this symlink exist in Linux, but from
reading the existing code I *think* the intent was to extract the
characters from the start the of last component of the filename up to
the delimeter character (`.` or `:`), so I've reworked the code to do
that without tripping up on the `..` parts of the path.
2023-10-16 20:39:17 +01:00
blitter
c810bd8d07 Find device host_no in Linux 2.6.26. 2022-12-04 15:05:17 -08:00
blitter
27b7e3ddb0 Bail if a device symlink target lacks both a colon and a period delimiter. 2021-07-25 22:17:40 -07:00
blitter
d0bbf0dc05 Find period delimiter when sysfs device symlink target lacks a colon. 2021-07-25 22:02:11 -07:00
9778904dba Update copyright year. 2020-12-31 23:12:05 +00:00
49706b9ea7 Implement OS read command for Linux. 2020-12-14 02:35:12 +00:00
daa549ae55 Implement reopen command for Linux. 2020-12-14 02:32:13 +00:00
3c6906afe9 Code clean-up. 2020-10-24 04:23:01 +01:00
57425ecba4 Fix getting type for SCSI magneto-optical devices in Linux. 2020-10-17 02:34:21 +01:00
dfd56c83df Remove unneeded slim functions. 2020-03-01 19:47:15 +00:00
6b224c60a3 Rename more macros. 2020-03-01 05:50:46 +00:00
e95ceac219 Rename comments. 2020-03-01 05:44:49 +00:00
4c30357650 Update copyright date. 2020-01-03 17:42:13 +00:00
adcd54d992 Use opaque packet for device context. 2019-10-26 16:11:19 +01:00
bcae241162 Add packet to close device. 2019-10-26 15:47:49 +01:00
50f911acdc Fix Linux device type detection when there is no udev. 2019-10-21 22:57:39 +01:00
6c27f82420 Fix misplaced #endif. 2019-10-21 08:11:37 +01:00
beff90faa8 Add conditional for udev presence in Linux. 2019-10-20 16:34:38 +01:00
78d23fce19 General refactor. 2019-10-19 18:30:45 +01:00
62e90e0519 Implement Get SDHCI Registers packet. 2019-10-18 00:25:45 +01:00
0be95c5c70 Implement reading SDHCI registers from sysfs in Linux. 2019-10-17 23:19:06 +01:00
71954fd9fa Implement get device type packet. 2019-10-16 20:18:08 +01:00
81f83b257c Implement open device for Linux. 2019-10-13 22:57:06 +01:00