diff -Nru 0xffff-0.8/config.mk 0xffff-0.9/config.mk --- 0xffff-0.8/config.mk 2018-07-08 10:23:18.000000000 +0000 +++ 0xffff-0.9/config.mk 2021-01-05 18:19:22.000000000 +0000 @@ -1,4 +1,4 @@ -VERSION = 0.8 +VERSION = 0.9 PREFIX = /usr/local # NetBSD stuff diff -Nru 0xffff-0.8/debian/changelog 0xffff-0.9/debian/changelog --- 0xffff-0.8/debian/changelog 2018-07-19 18:47:25.000000000 +0000 +++ 0xffff-0.9/debian/changelog 2021-01-05 20:40:00.000000000 +0000 @@ -1,3 +1,22 @@ +0xffff (0.9-1) unstable; urgency=medium + + [ Debian Janitor ] + * Re-export upstream signing key without extra signatures. + * Set upstream metadata fields: Repository. + * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, + Repository-Browse. + + [ Sebastian Reichel ] + * New upstream release + * Update Debian Standards Version to 4.5.1 + * Switch to compat level 13 + * Remove upstream signing key, upstream no longer signs releases + * Add 'Rules-Requires-Root: no' + * Install documentation files directly into /usr/share/doc/0xffff + without the extra subdirectory + + -- Sebastian Reichel Tue, 05 Jan 2021 21:40:00 +0100 + 0xffff (0.8-1) unstable; urgency=medium * New upstream version diff -Nru 0xffff-0.8/debian/compat 0xffff-0.9/debian/compat --- 0xffff-0.8/debian/compat 2018-07-19 18:47:25.000000000 +0000 +++ 0xffff-0.9/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru 0xffff-0.8/debian/control 0xffff-0.9/debian/control --- 0xffff-0.8/debian/control 2018-07-19 18:47:25.000000000 +0000 +++ 0xffff-0.9/debian/control 2021-01-05 20:40:00.000000000 +0000 @@ -2,8 +2,9 @@ Section: misc Priority: optional Maintainer: Sebastian Reichel -Standards-Version: 4.1.5 -Build-Depends: debhelper (>= 11~), +Standards-Version: 4.5.1 +Rules-Requires-Root: no +Build-Depends: debhelper-compat (= 13), libusb-dev Homepage: https://github.com/pali/0xFFFF Vcs-Git: https://salsa.debian.org/debian/0xffff.git diff -Nru 0xffff-0.8/debian/docs 0xffff-0.9/debian/docs --- 0xffff-0.8/debian/docs 2018-07-19 18:47:25.000000000 +0000 +++ 0xffff-0.9/debian/docs 2021-01-05 20:40:00.000000000 +0000 @@ -1,3 +1,3 @@ -doc/ +doc/* TODO README diff -Nru 0xffff-0.8/debian/rules 0xffff-0.9/debian/rules --- 0xffff-0.8/debian/rules 2018-07-19 18:47:25.000000000 +0000 +++ 0xffff-0.9/debian/rules 2021-01-05 20:40:00.000000000 +0000 @@ -3,8 +3,9 @@ DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk +include /usr/share/dpkg/pkg-info.mk -export BUILD_DATE = $(shell LC_ALL=C date -u --date="`dpkg-parsechangelog -SDate`" +'%b %e %Y') +export BUILD_DATE = $(shell LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH}" +'%b %e %Y') %: dh $@ diff -Nru 0xffff-0.8/debian/upstream/metadata 0xffff-0.9/debian/upstream/metadata --- 0xffff-0.8/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ 0xffff-0.9/debian/upstream/metadata 2021-01-05 20:40:00.000000000 +0000 @@ -0,0 +1,4 @@ +Bug-Database: https://github.com/pali/0xFFFF/issues +Bug-Submit: https://github.com/pali/0xFFFF/issues/new +Repository: https://github.com/pali/0xFFFF.git +Repository-Browse: https://github.com/pali/0xFFFF diff -Nru 0xffff-0.8/debian/upstream/signing-key.asc 0xffff-0.9/debian/upstream/signing-key.asc --- 0xffff-0.8/debian/upstream/signing-key.asc 2018-07-19 18:47:25.000000000 +0000 +++ 0xffff-0.9/debian/upstream/signing-key.asc 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 - -mQGiBEc+7j4RBADYPTqznflExRHwCUnn2TqwsiNvM/yRyS9ADKOsb2lFA7oVp9vJ -y+J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IvwyT0D -5ENSvFcAoKFkp/+wOAdUd9Tvsd9LF767uPr/AKDIaXmjqcEyIB1Rq0Q7QEpiu3pl -0w== -=XCiD ------END PGP PUBLIC KEY BLOCK----- diff -Nru 0xffff-0.8/debian/watch 0xffff-0.9/debian/watch --- 0xffff-0.8/debian/watch 2018-07-19 18:47:25.000000000 +0000 +++ 0xffff-0.9/debian/watch 2021-01-05 20:40:00.000000000 +0000 @@ -1,4 +1,3 @@ -version=3 +version=4 -opts=pgpsigurlmangle=s/$/.asc/ \ - https://github.com/pali/0xFFFF/releases .*/0x[Ff][Ff][Ff][Ff][-_](\d\S+?)\.(?:orig\.tar\.gz|tar\.gz) +https://github.com/pali/0xFFFF/releases .*/0x[Ff][Ff][Ff][Ff][-_](\d\S+?)\.(?:orig\.tar\.gz|tar\.gz) diff -Nru 0xffff-0.8/README 0xffff-0.9/README --- 0xffff-0.8/README 2018-07-08 10:23:18.000000000 +0000 +++ 0xffff-0.9/README 2021-01-05 18:19:22.000000000 +0000 @@ -10,24 +10,24 @@ _/ ___|_.|__| '` -0xFFFF is Open Free Fiasco Firmware Flasher for Maemo devices. It support -generating and unpacking FIASCO images on local computer. Useful for editing -Maemo firmware package for future flash. It support via USB flashing any image -type to Maemo device and also \"cold\" flashing which means flashing dead device -with erased bootloader. There is support for booting kernel via USB without -flashing to NAND and also changing configuration of Maemo device (enable/disable -R&D mode, changing HW revision strings, ...). - -0xFFFF is alternative tool to proprietary Nokia flasher-3.5 and fiasco-gen. -0xFFFF generate compatible FIASCO images and also accept FIASCO images generated -by Nokia fiasco-gen. +0xFFFF is the Open Free Fiasco Firmware Flasher for Maemo devices. It supports +generating and unpacking FIASCO images. It is useful for editing Maemo firmware +packages before flashing. It supports flashing via USB any image type to a +Maemo device and also \"cold\" flashing which means flashing dead device with +erased bootloader. There is support for booting kernel via USB without flashing +to NAND and also changing configuration of Maemo device (enable/disable R&D +mode, changing HW revision strings, ...). + +0xFFFF is an alternative tool to proprietary Nokia flasher-3.5 and fiasco-gen. +0xFFFF generates compatible FIASCO images and also accepts FIASCO images +generated by Nokia fiasco-gen. Use it with CARE. This is an experimental tool and it can brick your device. -It's not supposed to be stable, so nokia will probably release incompatible +It's not supposed to be stable, so Nokia will probably release incompatible bootloaders to break this tool. USE IT AT YOUR OWN RISK. -PLEASE. Read carefully all the documentation inside doc/* for more information -before building or using the flasher to avoid questions, problems or so. +PLEASE. Read all the documentation inside doc/* carefully before building or +using the flasher to avoid questions, problems or so. https://github.com/pali/0xFFFF diff -Nru 0xffff-0.8/src/cold-flash.c 0xffff-0.9/src/cold-flash.c --- 0xffff-0.8/src/cold-flash.c 2018-07-08 10:23:18.000000000 +0000 +++ 0xffff-0.9/src/cold-flash.c 2021-01-05 18:19:22.000000000 +0000 @@ -191,14 +191,14 @@ if ( ret != sizeof(omap_peripheral_msg) ) ERROR_RETURN("Sending OMAP peripheral boot message failed", -1); - SLEEP(5000); + MSLEEP(5); printf("Sending 2nd X-Loader image size...\n"); ret = usb_bulk_write(udev, USB_WRITE_EP, (char *)&image->size, 4, WRITE_TIMEOUT); if ( ret != 4 ) ERROR_RETURN("Sending 2nd X-Loader image size failed", -1); - SLEEP(5000); + MSLEEP(5); printf("Sending 2nd X-Loader image...\n"); printf_progressbar(0, image->size); @@ -217,7 +217,7 @@ printf_progressbar(sent, image->size); } - SLEEP(50000); + MSLEEP(50); return 0; } @@ -237,7 +237,7 @@ ERROR_RETURN("Sending X-Loader init message failed", -1); printf("Waiting for X-Loader response...\n"); - SLEEP(5000); + MSLEEP(5); ret = usb_bulk_read(udev, USB_READ_EP, (char *)&buffer, 4, READ_TIMEOUT); /* 4 bytes - dummy value */ if ( ret != 4 ) ERROR_RETURN("No response", -1); @@ -260,7 +260,7 @@ } printf("Waiting for X-Loader response...\n"); - SLEEP(5000); + MSLEEP(5); ret = usb_bulk_read(udev, USB_READ_EP, (char *)&buffer, 4, READ_TIMEOUT); /* 4 bytes - dummy value */ if ( ret != 4 ) ERROR_RETURN("No response", -1); @@ -296,7 +296,7 @@ break; } - SLEEP(5000); + MSLEEP(5); --try_read; } @@ -413,7 +413,7 @@ if ( ret != sizeof(omap_memory_msg) ) ERROR_RETURN("Sending OMAP memory boot message failed", -1); - SLEEP(1000000); + MSLEEP(250); return 0; } diff -Nru 0xffff-0.8/src/disk.c 0xffff-0.9/src/disk.c --- 0xffff-0.8/src/disk.c 2018-07-08 10:23:18.000000000 +0000 +++ 0xffff-0.9/src/disk.c 2021-01-05 18:19:22.000000000 +0000 @@ -270,6 +270,11 @@ size = read(fd, global_buf, need); if ( size == 0 ) break; + if ( size < 0 ) { + PRINTF_ERROR("Reading from block device failed"); + close(fd2); + return -1; + } if ( write(fd2, global_buf, size) != size ) { PRINTF_ERROR("Dumping image failed"); close(fd2); @@ -409,8 +414,8 @@ /* TODO: change 1 to 0 when disk_flash_dev will be implemented */ - /* RX-51 and RM-680 export MyDocs in first usb device and just first partion, so host system see whole device without MBR table */ - if ( dev->device == DEVICE_RX_51 || dev->device == DEVICE_RM_680 ) + /* RX-51, RM-680 and RM-696 export MyDocs in first usb device and just first partion, so host system see whole device without MBR table */ + if ( dev->device == DEVICE_RX_51 || dev->device == DEVICE_RM_680 || dev->device == DEVICE_RM_696 ) fd = disk_open_dev(maj1, min1, -1, 1); /* Other devices can export SD card as first partition and export whole mmc device, so host system will see MBR table */ else if ( maj2 != -1 && min2 != -1 ) diff -Nru 0xffff-0.8/src/global.h 0xffff-0.9/src/global.h --- 0xffff-0.8/src/global.h 2018-07-08 10:23:18.000000000 +0000 +++ 0xffff-0.9/src/global.h 2021-01-05 18:19:22.000000000 +0000 @@ -22,7 +22,7 @@ #define ALLOC_ERROR() do { ERROR("Cannot allocate memory"); } while (0) #define ALLOC_ERROR_RETURN(...) do { ALLOC_ERROR(); return __VA_ARGS__; } while (0) -#define SLEEP(usec) do { struct timespec _t = { 0, (usec) }; nanosleep(&_t, NULL); } while (0) +#define MSLEEP(msec) do { nanosleep(&(struct timespec){ (msec / 1000), (1000L * 1000L * (msec % 1000)) }, NULL); } while (0) static inline void * MEMMEM(void *haystack, size_t haystacklen, const void *needle, size_t needlelen) { for ( size_t i = 0; i < haystacklen; ++i ) { diff -Nru 0xffff-0.8/src/main.c 0xffff-0.9/src/main.c --- 0xffff-0.8/src/main.c 2018-07-08 10:23:18.000000000 +0000 +++ 0xffff-0.9/src/main.c 2021-01-05 18:19:22.000000000 +0000 @@ -421,6 +421,8 @@ enum device detected_device = DEVICE_UNKNOWN; int16_t detected_hwrev = -1; + struct stat st; + int i; char buf[512]; char * ptr = NULL; @@ -1259,7 +1261,7 @@ for ( i = 0; i < IMAGE_COUNT; ++i ) { - if ( ! image_tmp_name(i) ) + if ( ! image_tmp_name(i) || ( stat(image_tmp_name(i), &st) < 0 && errno == ENOENT ) ) continue; buf[0] = 0; diff -Nru 0xffff-0.8/src/mkii.c 0xffff-0.9/src/mkii.c --- 0xffff-0.8/src/mkii.c 2018-07-08 10:23:18.000000000 +0000 +++ 0xffff-0.9/src/mkii.c 2021-01-05 18:19:22.000000000 +0000 @@ -361,6 +361,11 @@ if ( ret != 1 || msg->data[0] != 0 ) ERROR_RETURN("Cannot send reboot command", -1); + if (dev->data & MKII_UPDATE_MODE) + MSLEEP(100); + else + MSLEEP(3000); + return 0; } diff -Nru 0xffff-0.8/src/nolo.c 0xffff-0.9/src/nolo.c --- 0xffff-0.8/src/nolo.c 2018-07-08 10:23:18.000000000 +0000 +++ 0xffff-0.9/src/nolo.c 2021-01-05 18:19:22.000000000 +0000 @@ -541,7 +541,7 @@ } - SLEEP(0xc350); // 0.5s + MSLEEP(50); } diff -Nru 0xffff-0.8/src/usb-device.c 0xffff-0.9/src/usb-device.c --- 0xffff-0.8/src/usb-device.c 2018-07-08 10:23:18.000000000 +0000 +++ 0xffff-0.9/src/usb-device.c 2021-01-05 18:19:22.000000000 +0000 @@ -46,16 +46,21 @@ #endif static struct usb_flash_device usb_devices[] = { - { 0x0421, 0x0096, -1, -1, -1, FLASH_DISK, { DEVICE_RX_44, 0 } }, - { 0x0421, 0x0105, 2, 1, -1, FLASH_NOLO, { DEVICE_SU_18, DEVICE_RX_34, DEVICE_RX_44, DEVICE_RX_48, DEVICE_RX_51, DEVICE_RM_680, DEVICE_RM_696, 0 } }, - { 0x0421, 0x0106, 0, -1, -1, FLASH_COLD, { DEVICE_RX_51, DEVICE_RM_680, DEVICE_RM_696, 0 } }, - { 0x0421, 0x0189, -1, -1, -1, FLASH_DISK, { DEVICE_RX_48, 0 } }, - { 0x0421, 0x01c7, -1, -1, -1, FLASH_DISK, { DEVICE_RX_51, 0 } }, - { 0x0421, 0x01c8, 1, 1, -1, FLASH_MKII, { DEVICE_RX_51, DEVICE_RM_680, 0 } }, - { 0x0421, 0x03d1, -1, -1, -1, FLASH_DISK, { DEVICE_RM_680, 0 } }, - { 0x0421, 0x0431, -1, -1, -1, FLASH_DISK, { DEVICE_SU_18, DEVICE_RX_34, 0 } }, - { 0x0421, 0x04c3, -1, -1, -1, FLASH_DISK, { DEVICE_RX_34, 0 } }, - { 0x0421, 0x3f00, 2, 1, -1, FLASH_NOLO, { DEVICE_RX_34, 0 } }, + /* vend prod i a protocol devices */ + { 0x0421, 0x0096, -1, -1, FLASH_DISK, { DEVICE_RX_44, 0 } }, + { 0x0421, 0x0105, 2, 1, FLASH_NOLO, { DEVICE_SU_18, DEVICE_RX_34, DEVICE_RX_44, DEVICE_RX_48, DEVICE_RX_51, DEVICE_RM_680, DEVICE_RM_696, 0 } }, + { 0x0421, 0x0106, 0, 0, FLASH_COLD, { DEVICE_RX_51, DEVICE_RM_680, DEVICE_RM_696, 0 } }, + { 0x0421, 0x0189, -1, -1, FLASH_DISK, { DEVICE_RX_48, 0 } }, + { 0x0421, 0x01c7, -1, -1, FLASH_DISK, { DEVICE_RX_51, 0 } }, + { 0x0421, 0x01c8, 1, 1, FLASH_MKII, { DEVICE_RX_51, DEVICE_RM_680, 0 } }, + { 0x0421, 0x01c8, 1, 0, FLASH_UNKN, { DEVICE_RX_51, 0 } }, /* U-Boot mode (TTY via USB) */ + { 0x0421, 0x03d1, -1, -1, FLASH_DISK, { DEVICE_RM_680, 0 } }, + { 0x0421, 0x03d2, 1, 1, FLASH_MKII, { DEVICE_RM_680, 0 } }, + { 0x0421, 0x0431, -1, -1, FLASH_DISK, { DEVICE_SU_18, DEVICE_RX_34, 0 } }, + { 0x0421, 0x04c3, -1, -1, FLASH_DISK, { DEVICE_RX_34, 0 } }, + { 0x0421, 0x0518, -1, -1, FLASH_DISK, { DEVICE_RM_696, 0 } }, + { 0x0421, 0x0519, -1, -1, FLASH_UNKN, { DEVICE_RM_696, 0 } }, /* RNDIS/Ethernet mode */ + { 0x0421, 0x051a, 2, 1, FLASH_UNKN, { DEVICE_RM_696, 0 } }, /* Sync mode (ADL protocol) */ }; static const char * usb_flash_protocols[] = { @@ -134,7 +139,7 @@ buf[0] = 0; for ( i = 0; i < ret; i+=2 ) { sscanf(buf+i, "%2x", &x); - if ( x > 32 && x < 128 ) + if ( x > 31 && x < 127 ) buf2[i/2] = x; else { buf2[0] = 0; @@ -150,14 +155,29 @@ static struct usb_device_info * usb_device_is_valid(struct usb_device * dev) { - int i; + size_t i; char product[1024]; struct usb_device_info * ret = NULL; - for ( i = 0; usb_devices[i].vendor; ++i ) { + for ( i = 0; i < sizeof(usb_devices)/sizeof(usb_devices[0]); ++i ) { if ( dev->descriptor.idVendor == usb_devices[i].vendor && dev->descriptor.idProduct == usb_devices[i].product ) { + if ( usb_devices[i].protocol == FLASH_UNKN ) + continue; + + if ( dev->descriptor.bNumConfigurations < 1 ) + continue; + + if ( usb_devices[i].interface != -1 ) { + if ( usb_devices[i].interface >= dev->config[0].bNumInterfaces ) + continue; + if ( usb_devices[i].alternate != -1 ) { + if ( usb_devices[i].alternate >= dev->config[0].interface[usb_devices[i].interface].num_altsetting ) + continue; + } + } + printf("\b\b "); PRINTF_END(); PRINTF_ADD("Found "); @@ -195,18 +215,7 @@ if ( usb_devices[i].alternate >= 0 ) { PRINTF_LINE("Setting alternate USB interface..."); if ( usb_set_altinterface(udev, usb_devices[i].alternate) < 0 ) { - PRINTF_ERROR("usb_claim_interface failed"); - fprintf(stderr, "\n"); - usb_reattach_kernel_driver(udev, usb_devices[i].interface); - usb_close(udev); - return NULL; - } - } - - if ( usb_devices[i].configuration >= 0 ) { - PRINTF_LINE("Setting USB configuration..."); - if ( usb_set_configuration(udev, usb_devices[i].configuration) < 0 ) { - PRINTF_ERROR("usb_set_configuration failed"); + PRINTF_ERROR("usb_set_altinterface failed"); fprintf(stderr, "\n"); usb_reattach_kernel_driver(udev, usb_devices[i].interface); usb_close(udev); @@ -230,13 +239,13 @@ ret->device = DEVICE_RX_44; else if ( strcmp(product, "Nokia N810 Internet Tablet WiMAX Edition") == 0 || strcmp(product, "Nokia-RX48 (Update mode)") == 0 ) ret->device = DEVICE_RX_48; - else if ( strcmp(product, "N900 (Storage Mode)") == 0 || strcmp(product, "Nokia N900 (Update mode)") == 0 || strcmp(product, "N900 (PC-Suite Mode)") == 0 ) + else if ( strcmp(product, "N900 (Storage Mode)") == 0 || strcmp(product, "Nokia N900 (Update mode)") == 0 || strcmp(product, "N900 (PC-Suite Mode)") == 0 || strcmp(product, "N900 (U-Boot)") == 0 ) ret->device = DEVICE_RX_51; - else if ( strcmp(product, "Nokia N950") == 0 || strcmp(product, "Sync Mode") == 0 || strcmp(product, "N950 (Update mode)") == 0 ) + else if ( strcmp(product, "Nokia N950") == 0 || strcmp(product, "N950 (Update mode)") == 0 ) ret->device = DEVICE_RM_680; - else if ( strcmp(product, "N9 (Update mode)") == 0 || strcmp(product, "Nxy (Update mode)") == 0 ) + else if ( strcmp(product, "Nokia N9") == 0 || strcmp(product, "N9 (Update mode)") == 0 || strcmp(product, "Nokia N9 RNDIS/Ethernet") == 0 ) ret->device = DEVICE_RM_696; - else if ( strcmp(product, "Nokia USB ROM") == 0 ) + else if ( strcmp(product, "Nokia USB ROM") == 0 || strcmp(product, "Sync Mode") == 0 || strcmp(product, "Nxy (Update mode)") == 0 ) ret->device = DEVICE_ANY; else ret->device = DEVICE_UNKNOWN; @@ -361,7 +370,7 @@ if ( ret ) break; - SLEEP(0xc350); // 0.5s + MSLEEP(50); } diff -Nru 0xffff-0.8/src/usb-device.h 0xffff-0.9/src/usb-device.h --- 0xffff-0.8/src/usb-device.h 2018-07-08 10:23:18.000000000 +0000 +++ 0xffff-0.9/src/usb-device.h 2021-01-05 18:19:22.000000000 +0000 @@ -49,7 +49,6 @@ uint16_t product; int interface; int alternate; - int configuration; enum usb_flash_protocol protocol; enum device devices[DEVICE_COUNT]; }; diff -Nru 0xffff-0.8/.travis.yml 0xffff-0.9/.travis.yml --- 0xffff-0.8/.travis.yml 2018-07-08 10:23:18.000000000 +0000 +++ 0xffff-0.9/.travis.yml 2021-01-05 18:19:22.000000000 +0000 @@ -2,6 +2,10 @@ language: c +arch: + - AMD64 + - ppc64le + compiler: - gcc - clang