From b9f64576cc9da49fdb662fbe3f52030ccb369f3c Mon Sep 17 00:00:00 2001 From: Marcel Alexandru Nitan Date: Sat, 2 Sep 2023 11:51:05 +0300 Subject: [PATCH] Use configfs first if available, else try sysfs --- README.md | 10 +++++----- src/main.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 673a9c2..add2098 100644 --- a/README.md +++ b/README.md @@ -13,17 +13,17 @@ * `sudo make install` (optional) ## Usage - ```bash +Usage: isodrive [FILE]... [OPTION]... Mounts the given FILE as a bootable device using configfs. Run without any arguments to unmount any mounted files and display this help message. Optional arguments: --rw Mounts the file in read write mode. --cdrom Mounts the file as a cdrom. --configfs Forces the app to use configfs. --usbgadget Forces the app to use usb_gadget. +-rw Mounts the file in read write mode. +-cdrom Mounts the file as a cdrom. +-configfs Forces the app to use configfs. +-usbgadget Forces the app to use sysfs. ``` ### Examples diff --git a/src/main.cpp b/src/main.cpp index 89abc57..f146b65 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,7 +15,7 @@ int print_help() { printf("-rw\t\t Mounts the file in read write mode.\n"); printf("-cdrom\t\t Mounts the file as a cdrom.\n"); printf("-configfs\t Forces the app to use configfs.\n"); - printf("-usbgadget\t Forces the app to use usb_gadget.\n\n"); + printf("-usbgadget\t Forces the app to use sysfs.\n\n"); return 1; } @@ -44,7 +44,7 @@ void configs(char *iso_target, char *cdrom, char *ro) { } void usb(char *iso_target, char *cdrom, char *ro) { - printf("Using usb_gadget!\n"); + printf("Using sysfs!\n"); if (!usb_supported()) { printf("usb_gadget is not supported!\n"); @@ -101,10 +101,10 @@ int main(int argc, char *argv[]) { { usb(iso_target, cdrom, ro); } - else if (usb_supported()) - usb(iso_target, cdrom, ro); else if (supported()) configs(iso_target, cdrom, ro); + else if (usb_supported()) + usb(iso_target, cdrom, ro); else printf("Device does not support isodrive\n"); return 0;