From 51072eb40a34ea9a0241a1eaa4cea522b5b4e223 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sat, 24 Nov 2012 01:03:27 +0100 Subject: operations: Added support for initfs version string --- src/operations.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/operations.c') diff --git a/src/operations.c b/src/operations.c index 4a63c09..88a7a59 100644 --- a/src/operations.c +++ b/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 ) -- cgit v1.2.3