const char *vendor;
const char *support_list;
char support_trail;
+ const char *soft_ver;
const struct flash_partition_entry partitions[MAX_PARTITIONS+1];
const char *first_sysupgrade_partition;
const char *last_sysupgrade_partition;
"CPE220(TP-LINK|US|N300-2):1.1\r\n"
"CPE220(TP-LINK|EU|N300-2):1.1\r\n",
.support_trail = '\xff',
+ .soft_ver = NULL,
.partitions = {
{"fs-uboot", 0x00000, 0x20000},
"CPE520(TP-LINK|US|N300-5):1.1\r\n"
"CPE520(TP-LINK|EU|N300-5):1.1\r\n",
.support_trail = '\xff',
+ .soft_ver = NULL,
.partitions = {
{"fs-uboot", 0x00000, 0x20000},
"WBS210(TP-LINK|US|N300-2):1.20\r\n"
"WBS210(TP-LINK|EU|N300-2):1.20\r\n",
.support_trail = '\xff',
+ .soft_ver = NULL,
.partitions = {
{"fs-uboot", 0x00000, 0x20000},
"WBS510(TP-LINK|US|N300-5):1.20\r\n"
"WBS510(TP-LINK|EU|N300-5):1.20\r\n",
.support_trail = '\xff',
+ .soft_ver = NULL,
.partitions = {
{"fs-uboot", 0x00000, 0x20000},
"SupportList:\r\n"
"{product_name:Archer C2600,product_ver:1.0.0,special_id:00000000}\r\n",
.support_trail = '\x00',
+ .soft_ver = NULL,
.partitions = {
{"SBL1", 0x00000, 0x20000},
"{product_name:Archer C59,product_ver:1.0.0,special_id:45550000}\r\n"
"{product_name:Archer C59,product_ver:1.0.0,special_id:55530000}\r\n",
.support_trail = '\x00',
+ .soft_ver = "soft_ver:1.0.0\n",
.partitions = {
{"fs-uboot", 0x00000, 0x10000},
"{product_name:Archer C60,product_ver:1.0.0,special_id:45550000}\r\n"
"{product_name:Archer C60,product_ver:1.0.0,special_id:55530000}\r\n",
.support_trail = '\x00',
+ .soft_ver = "soft_ver:1.0.0\n",
.partitions = {
{"fs-uboot", 0x00000, 0x10000},
"product_ver:2.0.0,"
"special_id:00000000}\r\n",
.support_trail = '\x00',
+ .soft_ver = NULL,
.partitions = {
{"fs-uboot", 0x00000, 0x40000},
"product_ver:1.0.0,"
"special_id:00000000}\n",
.support_trail = '\x00',
+ .soft_ver = NULL,
.partitions = {
{"fs-uboot", 0x00000, 0x40000},
"SupportList:\r\n"
"EAP120(TP-LINK|UN|N300-2):1.0\r\n",
.support_trail = '\xff',
+ .soft_ver = NULL,
.partitions = {
{"fs-uboot", 0x00000, 0x20000},
"{product_name:TL-WA850RE,product_ver:2.0.0,special_id:41550000}\n"
"{product_name:TL-WA850RE,product_ver:2.0.0,special_id:52550000}\n",
.support_trail = '\x00',
+ .soft_ver = NULL,
/**
576KB were moved from file-system to os-image
"SupportList:\n"
"{product_name:TL-WR1043ND,product_ver:4.0.0,special_id:45550000}\n",
.support_trail = '\x00',
+ .soft_ver = NULL,
/**
We use a bigger os-image partition than the stock images (and thus
"{product_name:RE450,product_ver:1.0.0,special_id:4B520000}\r\n"
"{product_name:RE450,product_ver:1.0.0,special_id:55534100}\r\n",
.support_trail = '\x00',
+ .soft_ver = NULL,
/**
The flash partition table for RE450;
return entry;
}
+static struct image_partition_entry make_soft_version_from_string(const char *soft_ver) {
+ /** String length _including_ the terminating zero byte */
+ uint32_t ver_len = strlen(soft_ver) + 1;
+ /** Partition contains 64 bit header, the version string, and one additional null byte */
+ size_t partition_len = 2*sizeof(uint32_t) + ver_len + 1;
+ struct image_partition_entry entry = alloc_image_partition("soft-version", partition_len);
+
+ uint32_t *len = (uint32_t *)entry.data;
+ len[0] = htonl(ver_len);
+ len[1] = 0;
+ memcpy(&len[2], soft_ver, ver_len);
+
+ entry.data[partition_len - 1] = 0;
+
+ return entry;
+}
+
/** Generates the support-list partition */
static struct image_partition_entry make_support_list(const struct device_info *info) {
size_t len = strlen(info->support_list);
struct image_partition_entry parts[6] = {};
parts[0] = make_partition_table(info->partitions);
- parts[1] = make_soft_version(rev);
+ if (info->soft_ver)
+ parts[1] = make_soft_version_from_string(info->soft_ver);
+ else
+ parts[1] = make_soft_version(rev);
+
parts[2] = make_support_list(info);
parts[3] = read_file("os-image", kernel_image, false);
parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof);