Skip to content

Commit

Permalink
Merge pull request #46 from quadraticat/45-branch
Browse files Browse the repository at this point in the history
[45] Updated GUID fetch logic.
  • Loading branch information
elibosley authored Aug 8, 2024
2 parents 6722952 + 9179b2e commit 3eb038e
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ debian/rpi-imager/**
debian/.debhelper**
debian/files
debian/*.substvars
debian/debhelper**
debian/debhelper**.DS_Store
4 changes: 2 additions & 2 deletions debian/unraid-usb-creator/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: unraid-usb-creator
Version: 1.0
Architecture: amd64
Maintainer: Floris Bos <[email protected]>
Installed-Size: 2962
Maintainer: Unraid Developers [email protected]
Installed-Size: 2970
Depends: libarchive13 (>= 3.0.4), libc6 (>= 2.34), libcurl3-gnutls (>= 7.16.2), libgcc-s1 (>= 3.3.1), libgnutls30 (>= 3.7.0), liblzma5 (>= 5.1.1alpha+20110809), libqt5core5a (>= 5.15.1), libqt5dbus5 (>= 5.14.1), libqt5gui5 (>= 5.10.0) | libqt5gui5-gles (>= 5.10.0), libqt5network5 (>= 5.12.2), libqt5qml5 (>= 5.10.0), libqt5widgets5 (>= 5.0.2), libstdc++6 (>= 12), qml-module-qtquick2, qml-module-qtquick-controls2, qml-module-qtquick-layouts, qml-module-qtquick-templates2, qml-module-qtquick-window2, qml-module-qtgraphicaleffects, dosfstools, fdisk
Recommends: udisks2
Section: admin
Expand Down
2 changes: 1 addition & 1 deletion debian/unraid-usb-creator/DEBIAN/md5sums
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
00402ea2d83f2dc8bf56b12036a133bc usr/bin/unraid-usb-creator
d2af054930493926471278d11433cf84 usr/bin/unraid-usb-creator
56dbceb5198ff7545c315f9a812e3484 usr/share/applications/com.limetech.unraid-usb-creator.desktop
cf8cee94e0a222f252e30701d87be77b usr/share/doc/unraid-usb-creator/changelog.gz
9cc7fd7ca7041b8d8b8335041ad0fe75 usr/share/doc/unraid-usb-creator/copyright
Expand Down
Binary file modified debian/unraid-usb-creator/usr/bin/unraid-usb-creator
Binary file not shown.
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ OPTION (DRIVELIST_FILTER_SYSTEM_DRIVES "Filter System drives from displayed driv
project(unraid-usb-creator LANGUAGES CXX C)
set(IMAGER_VERSION_MAJOR 1)
set(IMAGER_VERSION_MINOR 0)
set(IMAGER_VERSION_STR "${IMAGER_VERSION_MAJOR}.${IMAGER_VERSION_MINOR}.0")
set(IMAGER_VERSION_CSV "${IMAGER_VERSION_MAJOR},${IMAGER_VERSION_MINOR},0,0")
set(IMAGER_VERSION_STR "${IMAGER_VERSION_MAJOR}.${IMAGER_VERSION_MINOR}.1")
set(IMAGER_VERSION_CSV "${IMAGER_VERSION_MAJOR},${IMAGER_VERSION_MINOR},1,0")
add_definitions(-DIMAGER_VERSION_STR="${IMAGER_VERSION_STR}")
add_definitions(-DIMAGER_VERSION_CSV=${IMAGER_VERSION_CSV})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
Expand Down
10 changes: 8 additions & 2 deletions src/dependencies/drivelist/src/darwin/list.mm
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,16 @@ void GetDeviceVidPidSerialNumber(const std::string& diskBsdName, DeviceDescripto
s = (NSString *) serialNumberAsCFTypeRef;
device_descriptor->serialNumber = std::string([s UTF8String]);
NSNumber * n = (NSNumber *) vendorIdAsCFTypeRef;
s = [NSString stringWithFormat:@"%04X", [n intValue]];
s = [NSString stringWithFormat:@"%X", [n intValue]];
while ([s length] < 4) {
s = [@"0" stringByAppendingString:s];
}
device_descriptor->vid = std::string([s UTF8String]);
n = (NSNumber *) productIdAsCFTypeRef;
s = [NSString stringWithFormat:@"%04X", [n intValue]];
s = [NSString stringWithFormat:@"%X", [n intValue]];
while ([s length] < 4) {
s = [@"0" stringByAppendingString:s];
}
device_descriptor->pid = std::string([s UTF8String]);
}
if(serialNumberAsCFTypeRef) CFRelease(serialNumberAsCFTypeRef);
Expand Down
2 changes: 1 addition & 1 deletion src/dependencies/drivelist/src/windows/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ bool GetDeviceVidPidSerialNumber(HDEVINFO hDeviceInfo, PSP_DEVINFO_DATA deviceIn

std::string deviceId_usb{wbuffer};
std::smatch vid_pid_sn_match;
std::regex vid_pid_sn_regex("USB\\\\VID_([0-9A-Za-z]{4})&PID_([0-9A-Za-z]{4})\\\\([0-9A-Za-z]+)");
std::regex vid_pid_sn_regex("USB\\\\VID_([0-9A-Za-z]{4})(?:.*)&PID_([0-9A-Za-z]{4})(?:.*)\\\\([0-9A-Za-z]+)");
if (std::regex_search(deviceId_usb, vid_pid_sn_match, vid_pid_sn_regex) && vid_pid_sn_match.size() == 4)
{
VID = vid_pid_sn_match[1];
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/linux/linuxdrivelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace Drivelist
}


QRegularExpression vidRegExp("VENDOR_ID=([0-9A-Za-z]{4})"), pidRegExp("MODEL_ID=([0-9A-Za-z]{4})"), snRegExp("SERIAL_SHORT=([0-9A-Za-z]+)");
QRegularExpression vidRegExp("VENDOR_ID=([0-9A-Za-z]{4})(?:.*)"), pidRegExp("MODEL_ID=([0-9A-Za-z]{4})(?:.*)"), snRegExp("SERIAL_SHORT=([0-9A-Za-z]+)");

QJsonDocument d = QJsonDocument::fromJson(output);
const QJsonArray a = d.object()["blockdevices"].toArray();
Expand Down
Binary file removed src/unraid/icons/.DS_Store
Binary file not shown.

0 comments on commit 3eb038e

Please sign in to comment.