Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

operations: Added support for initfs version string

  • Loading branch information...
commit 51072eb40a34ea9a0241a1eaa4cea522b5b4e223 1 parent bd54b19
@pali pali authored
Showing with 40 additions and 0 deletions.
  1. +37 −0 src/operations.c
  2. +3 −0  src/operations.h
View
37 src/operations.c
@@ -490,6 +490,43 @@ int dev_set_kernel_ver(struct device_info * dev, const char * ver) {
}
+int dev_get_initfs_ver(struct device_info * dev, char * ver, size_t size) {
+
+ if ( dev->method == METHOD_LOCAL )
+ return local_get_initfs_ver(ver, size);
+
+ if ( dev->method == METHOD_USB ) {
+
+ if ( dev->usb->flash_device->protocol == FLASH_NOLO )
+ return nolo_get_initfs_ver(dev->usb, ver, size);
+
+ }
+
+ return -1;
+
+}
+
+int dev_set_initfs_ver(struct device_info * dev, const char * ver) {
+
+ if ( dev->method == METHOD_LOCAL )
+ return local_set_initfs_ver(ver);
+
+ if ( dev->method == METHOD_USB ) {
+
+ if ( dev->usb->flash_device->protocol == FLASH_NOLO )
+ return nolo_set_initfs_ver(dev->usb, ver);
+
+ if ( dev->usb->flash_device->protocol == FLASH_COLD ) {
+ usb_switch_to_nolo(dev->usb);
+ return -EAGAIN;
+ }
+
+ }
+
+ return -1;
+
+}
+
int dev_get_nolo_ver(struct device_info * dev, char * ver, size_t size) {
if ( dev->method == METHOD_LOCAL )
View
3  src/operations.h
@@ -68,6 +68,9 @@ int dev_set_hwrev(struct device_info * dev, int16_t hwrev);
int dev_get_kernel_ver(struct device_info * dev, char * ver, size_t size);
int dev_set_kernel_ver(struct device_info * dev, const char * ver);
+int dev_get_initfs_ver(struct device_info * dev, char * ver, size_t size);
+int dev_set_initfs_ver(struct device_info * dev, const char * ver);
+
int dev_get_nolo_ver(struct device_info * dev, char * ver, size_t size);
int dev_set_nolo_ver(struct device_info * dev, const char * ver);
Please sign in to comment.
Something went wrong with that request. Please try again.