mirror of https://github.com/hak5/openwrt.git
parent
8f854e27c8
commit
c202ef57b1
|
@ -75,14 +75,12 @@ static int create_mtd_partitions(struct mtd_info *master,
|
|||
printk(KERN_INFO "TRX on WRT160NL detected\n");
|
||||
|
||||
header = (struct trx_header *)(buf + 32);
|
||||
|
||||
if (le32_to_cpu(header->magic) != TRX_MAGIC) {
|
||||
printk(KERN_WARNING "TRX messed up\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uheader = (struct uimage_header *)(buf + 60);
|
||||
|
||||
if (uheader->ih_magic != IH_MAGIC) {
|
||||
printk(KERN_WARNING "uImage messed up\n");
|
||||
return 0;
|
||||
|
@ -91,6 +89,7 @@ static int create_mtd_partitions(struct mtd_info *master,
|
|||
kernel_len = uheader->ih_size / master->erasesize;
|
||||
if (uheader->ih_size % master->erasesize)
|
||||
kernel_len++;
|
||||
|
||||
kernel_len++;
|
||||
kernel_len *= master->erasesize;
|
||||
|
||||
|
@ -112,9 +111,9 @@ static int create_mtd_partitions(struct mtd_info *master,
|
|||
trx_parts[3].name = "nvram";
|
||||
trx_parts[3].offset = master->size - 2 * master->erasesize;
|
||||
trx_parts[3].size = master->erasesize;
|
||||
trx_parts[3].mask_flags = 0;
|
||||
trx_parts[3].mask_flags = MTD_WRITEABLE;
|
||||
|
||||
trx_parts[4].name = "ART";
|
||||
trx_parts[4].name = "art";
|
||||
trx_parts[4].offset = master->size - master->erasesize;
|
||||
trx_parts[4].size = master->erasesize;
|
||||
trx_parts[4].mask_flags = MTD_WRITEABLE;
|
||||
|
|
Loading…
Reference in New Issue