Skip to content

Releases: DarkMatterCore/libusbhsfs

v0.2.9

24 Feb 09:04
Compare
Choose a tag to compare
  • lib:
    • Implement a callback-based population system, which can be used as an alternative to the event-based system that has been available up until now. For more information, please read the How to use section from the README.
    • Add a reimplementation of libnx's usbHsEpPostBuffer(), called usbHsFsRequestEndpointDataXfer(), which calls usbHsEpPostBufferAsync() with a hardcoded timeout value of 10 seconds (using the USB_POSTBUFFER_TIMEOUT define).
    • Port log handler QoL improvements from nxdumptool.
    • Log result codes in unpadded hexadecimal notation.
    • Reorganize UsbHsFsMountFlags enum.
    • SCSI INQUIRY strings now have prevalence over USB device descriptor strings, which affects the manufacturer, product_name and serial_number strings from UsbHsFsDevice elements.
    • Add LIB_ASSERT macro and update all static assertions throughout the codebase to use it.
    • Use NX_IGNORE_ARG macro where needed throughout the codebase.
    • SCSI driver:
      • Reorganize structs and enums.
      • Add missing comments/references.
      • Add ScsiInquiryVitalProductDataPageCode enum and rework usbHsFsScsiSendInquiryCommand() to make it possible to request Vital Product Data pages from attached LUNs.
      • Update ScsiInquiryStandardData struct to also retrieve serial number data from attached LUNs.
      • Add ScsiInquiryUnitSerialNumberPageHeader struct.
      • Update usbHsFsScsiStartDriveLogicalUnit() to make it read serial number information from the Unit Serial Number VPD page. Fallbacks to the serial number returned by the standard SCSI Inquiry command if not available.
      • Overhaul usbHsFsScsiTransferCommand() to make it handle both unexpected CSWs and CSW data residue values in a better way.
  • fs-libs: remove all build scripts for both NTFS-3G and lwext4, as well as the fs-libs Makefile target. Please use the now available devkitPro pacman packages switch-ntfs-3g and switch-lwext4. The How to install section of the README has been updated to reflect this change.
  • fat: calls to ftruncate() on FAT filesystems now restore the current file position after truncation.

P.S.: remember to remove previous installations of NTFS-3G and lwext4 *before* installing the official devkitPro pacman packages by running:

sudo (dkp-)pacman -R switch-libntfs-3g switch-lwext4

Resources from this release:

  • libusbhsfs_0.2.9-main-b1ff881-src.tar.bz2: full libusbhsfs source code.
  • libusbhsfs_0.2.9-main-b1ff881_ISC.tar.bz2: ISC licensed build of libusbhsfs. Only offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT).
  • libusbhsfs_0.2.9-main-b1ff881_GPLv2+.tar.bz2: GPLv2+ licensed build of libusbhsfs. Offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT), NTFS and EXT filesystems (EXT2, EXT3, EXT4). Applications using this build must also be linked against NTFS-3G and lwext4 - please check the README for further information.

Both ISC and GPLv2+ archives also hold the example test application NRO linked against that version of the library with debugging enabled.

v0.2.8

02 Jan 16:50
Compare
Choose a tag to compare
  • lib: add usbHsFsGetPhysicalDeviceCount(), which returns the number of physical UMS devices currently connected to the console with at least one underlying filesystem mounted as a virtual device.
  • fs-libs:
    • Update FatFs to R0.15 w/patch2.
      • Furthermore, FatFs is now modified to check a runtime read-only flag for any mounted filesystems, making it possible to use the UsbHsFsMountFlags_ReadOnly mount flag on FAT volumes for write-free access.
    • Update NTFS-3G to 2022.10.3.
    • Update lwext4 to 58bcf89a121b72d4fb66334f1693d3b30e4cb9c5 with cherrypicked patches.
    • Improve Makefile scripts for both NTFS-3G and lwext4 by checking if makepkg and (dkp-)pacman binaries are actually available, as well as automatically removing pkg-config if its available and installing dkp-toolchain-vars as part of the required dependencies.

A note to all developers using the GPL-licensed version of the library: update the NTFS-3G and lwext4 portlibs by running make fs-libs in your libusbhsfs clone before building your project.


Resources from this release:

  • libusbhsfs_0.2.8-main-014c925-src.tar.bz2: full libusbhsfs source code.
  • libusbhsfs_0.2.8-main-014c925_ISC.tar.bz2: ISC licensed build of libusbhsfs. Only offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT).
  • libusbhsfs_0.2.8-main-014c925_GPLv2+.tar.bz2: GPLv2+ licensed build of libusbhsfs. Offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT), NTFS and EXT filesystems (EXT2, EXT3, EXT4). Applications using this build must also be linked against NTFS-3G and lwext4 - please check the README for further information.

Both ISC and GPLv2+ archives also hold the example test application NRO linked against that version of the library with debugging enabled.

v0.2.7

21 Jul 01:39
Compare
Choose a tag to compare
  • log: use UTC timestamp generated at build time instead of __DATE__ and __TIME__ macros.
  • fs-libs: add missing Windows-specific dependencies to the Makefiles.
  • fat: update FatFs to latest patch from 2022-04-04.
  • ntfs:
    • Update NTFS-3G to 2022.5.17.
    • Create LRU caches while mounting new NTFS volumes.
    • Use ntfs_volume_get_free_space() while mounting new NTFS volumes to speed up subsequent calls to statvfs() made by the user.
    • Let NTFS-3G take care of filtering system files and hidden files using ntfs_set_shown_files(), instead of filtering them in the library's dirnext() implementation.
    • Use NVolFreeSpaceKnown() in the library's statvfs() implementation to check if the number of free NTFS clusters has already been retrieved.
  • ext: apply cherrypicked bugfixes to lwext4 (cyyynthia/lwext4@bf68d17, wzx-ipads/lwext4@06b64aa and mudita/lwext4@2869807).

Resources from this release:

  • libusbhsfs_0.2.7-main-4d109af-src.tar.bz2: full libusbhsfs source code.
  • libusbhsfs_0.2.7-main-4d109af_ISC.tar.bz2: ISC licensed build of libusbhsfs. Only offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT).
  • libusbhsfs_0.2.7-main-4d109af_GPLv2.tar.bz2: GPLv2+ licensed build of libusbhsfs. Offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT), NTFS and EXT filesystems (EXT2, EXT3, EXT4). Applications using this build must also be linked against NTFS-3G and lwext4 - please check the README for further information.

Both ISC and GPLv2+ archives also hold the example test application NRO linked against that version of the library.

v0.2.6

16 Dec 07:36
Compare
Choose a tag to compare
  • Updated codebase to use localtime_r() instead of localtime() to avoid possible race conditions with other threads.
  • Fixed fs-libs building under Linux distros with pacman. Thanks to ITotalJustice for reporting this issue!
  • Implemented support for UMS devices that don't byteswap the Command Status Wrapper signature before sending back SCSI command responses.Thanks to rdmrocha for reporting this issue!

Resources from this release:

  • libusbhsfs_0.2.6-main-de50aeb-src.tar.bz2: full libusbhsfs source code.
  • libusbhsfs_0.2.6-main-de50aeb_ISC.tar.bz2: ISC licensed build of libusbhsfs. Only offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT).
  • libusbhsfs_0.2.6-main-de50aeb_GPLv2.tar.bz2: GPLv2+ licensed build of libusbhsfs. Offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT), NTFS and EXT filesystems (EXT2, EXT3, EXT4). Applications using this build must also be linked against NTFS-3G and lwext4 - please check the README for further information.

Both ISC and GPLv2+ archives also hold the example test application NRO linked against that version of the library.

v0.2.5

19 Jun 17:24
Compare
Choose a tag to compare
  • Updated lwext4 patch to fix mountpoint corruption issues if a mountpoint name is reused after a previous call to ext4_mount failed.
    • This fixes a data abort discovered by phisch. Thanks for the report!
    • The fix is based on HenriChataing's pull request in lwext4's repository, but also adds an additional memset call to ext4_umount to fully clear every unmounted mountpoint.
    • A note to all developers using the GPL-licensed version of the library: update the switch-lwext4 package by running make fs-libs in your libusbhsfs clone before building your project.

Resources from this release:

  • libusbhsfs_0.2.5-main-782aa51-src.tar.bz2: full libusbhsfs source code.
  • libusbhsfs_0.2.5-main-782aa51_ISC.tar.bz2: ISC licensed build of libusbhsfs. Only offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT).
  • libusbhsfs_0.2.5-main-782aa51_GPLv2.tar.bz2: GPLv2+ licensed build of libusbhsfs. Offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT), NTFS and EXT filesystems (EXT2, EXT3, EXT4). Applications using this build must also be linked against NTFS-3G and lwext4 - please check the README for further information.

Both ISC and GPLv2+ archives also hold the example test application NRO linked against that version of the library.

v0.2.4

03 Jun 03:46
Compare
Choose a tag to compare
  • Updated FatFs to R0.14b.
  • The backup GPT header from a drive is now retrieved and used if the main GPT header is corrupted, as long as it's available.
  • Slightly improved debug logging code.
  • Rewrote mutex handling throughout the code to use a small, macro-based scoped lock implementation whenever possible.
  • Removed superfluous memory operations by using dynamic pointer arrays to manage logical unit / filesystem contexts.
  • Added missing splInitialize / splExit calls while checking if a service is running.
    • Furthermore, the Exosphère API version, which is used to determine if TIPC serialization is needed instead of CMIF, is now saved during the first service check.

Resources from this release:

  • libusbhsfs_0.2.4-main-ead3651-src.tar.bz2: full libusbhsfs source code.
  • libusbhsfs_0.2.4-main-ead3651_ISC.tar.bz2: ISC licensed build of libusbhsfs. Only offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT).
  • libusbhsfs_0.2.4-main-ead3651_GPLv2.tar.bz2: GPLv2+ licensed build of libusbhsfs. Offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT), NTFS and EXT filesystems (EXT2, EXT3, EXT4). Applications using this build must also be linked against NTFS-3G and lwext4 - please check the README for further information.

Both ISC and GPLv2+ archives also hold the example test application NRO linked against that version of the library.

v0.2.3

21 Apr 04:32
Compare
Choose a tag to compare
  • Improvements to the USB manager:
    • Refactored USB control request functions to work with libnx USB datatypes instead of drive / logical unit contexts.
    • Implemented GET_DESCRIPTOR control requests for configuration and string descriptors.
  • Improvements to the BOT driver:
    • If usbHsEpPostBuffer() fails, only the endpoint the library is currently working with will be cleared. Furthermore, the result from this operation no longer affects the return code.
    • If usbHsFsRequestPostBuffer() fails, the library now tries to retrieve a CSW right away - if it succeeds, a Request Sense command will be issued immediately to the block device.
    • Mode Sense (6) / Mode Sense (10) command success is no longer mandatory in usbHsFsScsiStartDriveLogicalUnit().
    • SPC standard version is now validated.
  • Improvements to the PKGBUILD scripts for NTFS-3G and lwext4:
    • Made it possible to build and install all three libraries using the Makefile - for more information, please refer to the How to install section from the README.
    • Proper library path is now forced while building NTFS-3G. Fixes issues in some Linux systems. Thanks to sigmaboy for the correction.
    • Other minor improvements.
  • Library API changes:
    • Added vid and pid fields to UsbHsFsDevice. Useful if the application needs to implement a device filter on its own.
    • vendor_id, product_id and product_revision fields in UsbHsFsDevice have been replaced with manufacturer, product_name and serial_number fields, which represent UTF-8 conversions of string descriptors referenced by the USB device descriptor.
      • Strings from SCP INQUIRY data are still used as a fallback method for manufacturer and product_name fields if the USB device descriptor holds no references to string descriptors.
  • Miscellaneous changes:
    • Renamed ff_rename() from FatFs to avoid issues fix conflicts in applications linked against FFmpeg. Thanks to Cpasjuste for letting us know.
    • The has_journal flag from the superblock in EXT filesystems is now verified before calling journal-related functions.
    • EXT filesystem version is now retrieved only once, while mounting the volume.
    • The AtmosphereHasService sm API extension available in Atmosphère and Atmosphère-based CFWs is now being used to check if a specific service is running.
      • HOS 12.0.x / AMS 0.19.x support is provided by using TIPC serialization to dispatch the IPC request, if needed.
    • Improved logfile code and simplified binary data logging throughout the codebase.
  • Changes under the hood (currently unused, but may change in the future):
    • Implemented SYNCHRONIZE CACHE (10) and SYNCHRONIZE CACHE (16) SCP commands.
    • Modified drive and logical unit contexts to prepare for UASP support.
    • Added extra code to handle USB Attached SCSI Protocol (UASP) interface descriptors under both USB 2.0 and 3.0 modes.

Resources from this release:

  • libusbhsfs_0.2.3-main-c5d8e12-src.tar.bz2: full libusbhsfs source code.
  • libusbhsfs_0.2.3-main-c5d8e12_ISC.tar.bz2: ISC licensed build of libusbhsfs. Only offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT).
  • libusbhsfs_0.2.3-main-c5d8e12_GPLv2.tar.bz2: GPLv2+ licensed build of libusbhsfs. Offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT), NTFS and EXT filesystems (EXT2, EXT3, EXT4). Applications using this build must also be linked against NTFS-3G and lwext4 - please check the README for further information.

Both ISC and GPLv2+ archives also hold the example test application NRO linked against that version of the library.

v0.2.2

26 Dec 23:52
Compare
Choose a tag to compare
  • By popular demand, the NTFS journal is now rebuilt by default for NTFS volumes that have not been properly unmounted, which lets the library mount them right away without having to use a Windows PC. Please bear in mind this process may cause inconsistencies - always try to safely remove your storage devices.
    • Nonetheless, this should be a relatively safe operation - default behaviour in NTFS-3G changed some years ago.
    • This change also affects EXT volume mounting. The EXT journal will now always try be recovered - if the process fails, the EXT volume won't be mounted.

Resources from this release:

  • libusbhsfs_0.2.2-main-e600835-src.tar.bz2: full libusbhsfs source code.
  • libusbhsfs_0.2.2-main-e600835_ISC.tar.bz2: ISC licensed build of libusbhsfs. Only offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT).
  • libusbhsfs_0.2.2-main-e600835_GPLv2.tar.bz2: GPLv2+ licensed build of libusbhsfs. Offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT), NTFS and EXT filesystems (EXT2, EXT3, EXT4). Applications using this build must also be linked against NTFS-3G and lwext4 - please check the README for further information.

Both ISC and GPLv2+ archives also hold the example test application NRO linked against that version of the library.

v0.2.1 - Bugfix release

24 Dec 11:00
Compare
Choose a tag to compare
  • Bugfix: mount name IDs are now properly freed while destroying filesystem contexts.
  • Library API: added a helper preprocessor macro to generate strings based on the supported filesystem type values.
  • Makefile: branch name is now retrieved using rev-parse instead of symbolic-ref. Fixes ref HEAD is not a symbolic ref errors while building the library when the repository is used as a git submodule.

Resources from this release:

  • libusbhsfs_0.2.1-main-fd75dbc-src.tar.bz2: full libusbhsfs source code.
  • libusbhsfs_0.2.1-main-fd75dbc_ISC.tar.bz2: ISC licensed build of libusbhsfs. Only offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT).
  • libusbhsfs_0.2.1-main-fd75dbc_GPLv2.tar.bz2: GPLv2+ licensed build of libusbhsfs. Offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT), NTFS and EXT filesystems (EXT2, EXT3, EXT4). Applications using this build must also be linked against NTFS-3G and lwext4 - please check the README for further information.

Both ISC and GPLv2+ archives also hold the example test application NRO linked against that version of the library.

v0.2.0

23 Dec 06:09
Compare
Choose a tag to compare

Changelog:

  • Built using libnx v4.0.0.
  • Implemented EXT2/3/4 support (GPL build only).
    • This means applications using the GPL build of the library must now be linked against libusbhsfs, NTFS-3G and lwext4. Please read the How to build section from the README to know how to build both NTFS-3G and lwext4 and install them into the portlibs directory from devkitPro.
    • Certain limitations apply. Please read the Limitations section from the README for more information.
  • Dot directory entries "." and ".." are now filtered in NTFS volumes. They are no longer displayed as part of the output from readdir().
  • Minor code cleanup.
  • The example test application is now linked against lwext4 as well.

Resources from this release:

  • libusbhsfs_0.2.0-main-2c6eaf1-src.tar.bz2: full libusbhsfs source code.
  • libusbhsfs_0.2.0-main-9605c9e_ISC.tar.bz2: ISC licensed build of libusbhsfs. Only offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT).
  • libusbhsfs_0.2.0-main-9605c9e_GPLv2.tar.bz2: GPLv2+ licensed build of libusbhsfs. Offers support for FAT filesystems (FAT12, FAT16, FAT32, exFAT), NTFS and EXT filesystems (EXT2, EXT3, EXT4). Applications using this build must also be linked against NTFS-3G and lwext4 - please check the README for further information.

Both ISC and GPLv2+ archives also hold the example test application NRO linked against that version of the library.