| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
The code for calculating the CRC32 signatures for RedBoot FIS partitions
was already included, but for unknown reasons, it was never invoked. Some
bootloaders enforce checking these for loaded kernels, so they should be
written. This patch does so.
Tested-by: Brian Gonyer <bgonyer@gmail.com>
Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds an option to set the recovery flag of newer TP-Link MediaTek
boards and remove it after a successful write.
To make use of this feature, add the '-t' option to mtd-write.
The '-t' option takes the mtd partition containing the recovery flag
(usually 'romfile') as an argument. Make sure this partition is not
flagged as read-only!
Example:
> mtd -t romfile write owrt.bin firmware
This command writes the recovery-flag before it begins writing the image
to the firmware partition. After the image-write has been successful,
the recovery flag is removed.
This way, the TP-Link web-recovery is automatically enabled on an
unsucessful flash (e.g. power loss).
This option is only available if the mtd package is compiled for the
ramips target.
Signed-off-by: David Bauer <mail@david-bauer.net>
|
|
|
|
|
|
|
|
| |
When a partition offset is given, it is used in an lseek call, which
affects write, but not erase. Add it to the offset for erase calls as
well
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
|
|
|
|
| |
Add a command to fix WRG headers, based on wrgg.c.
Signed-off-by: George Hopkins <george-hopkins@null.net>
|
|
|
|
|
|
|
| |
Based on fixseama.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: John Crispin <john@phrozen.org>
|
|
|
|
|
| |
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: John Crispin <john@phrozen.org>
|
|
|
|
|
|
| |
Minor fix in the usage message on the explanation of the -p option.
Signed-off-by: Paul Wassi <p.wassi@gmx.at>
|
|
|
|
|
|
| |
remove the "Error fixing up TRX header" message which is misleading.
Signed-off-by: John Crispin <john@phrozen.org>
|
|
|
|
| |
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
|
|
|
| |
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
|
|
|
| |
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far fixtrx was calculating checksum over amount of data matching
partition erase size. It was mostly a workaround of checksum problem
after changing anything in initial TRX content (e.g. formatting JFFS2).
Its main purpose was to make bootloader accept modified TRX. This didn't
provide much protection of flash data against corruption.
This new option lets caller request calculating checksum over a bigger
amount of data. It may be used e.g. to include whole kernel data for
checksum and hopefully make bootloader go info failsafe mode if
something goes wrong.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
|
|
|
|
|
|
| |
On platforms supporting both: TRX and Seama calling "fixtrx" was
resulting in trying to fix Seama as well.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
|
|
|
|
|
| |
This makes code style consistent across the whole file.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The image_check currently fails when it cannot read all magic bytes in a
single chunk. But this can happen when the data are read from a pipe. This
currently breaks the openmesh.sh upgrade script with musl because it uses
dd with a blocksize of 1 to copy the image file to the mtd process.
The read can simply be repeated until enough bytes are read for the magic
byte check. It only stops when either an error was returned or 0 bytes were
read.
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
SVN-Revision: 48891
|
|
|
|
|
|
|
|
|
|
| |
Seama header has MD5 similarly to TRX and its CRC32. We need to update
it after replacing anything in Seama entity content to make bootloader
accept it.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
SVN-Revision: 48688
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recently TRX checking code was changed to detect Seama format and don't
abort whole writing operation because of it. This isn't a good long-term
solution. It's a poor idea to teach every format handler recognizing all
possible formats. Instead it should be handled in a generic code which
should run check depending on the detected format.
This will also allow further improvements like fixing formats other than
TRX after replacing JFFS2.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
SVN-Revision: 48639
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The u-boot boot counter was never reset after a successful boot,
which sometimes could make some variables become out of sync.
This patch adds support for the boot counter and enables
auto_recovery unconditionally.
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: Rob Mosher <nyt-openwrt@countercultured.net>
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
SVN-Revision: 46690
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In mtd_verify(), the return value of md5sum() has been
interpreted as error if nonzero, while the function
returns number of processed bytes, which caused
mtd_verify() to always fail.
This patch fixes error checking to interpret only
negative values as errors.
Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
SVN-Revision: 44605
|
|
|
|
|
|
| |
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 43512
|
|
|
|
|
|
| |
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 43503
|
|
|
|
|
|
|
|
|
| |
this can be used on nand flashes and will skip bad blocks and run ecc on the
read data before dumping it.
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 43500
|
|
|
|
|
|
|
|
|
| |
mtd.c:544:7: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘ssize_t’ [-Wformat]
mtd.c:602:1: warning: label ‘done’ defined but not used [-Wunused-label]
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 43383
|
|
|
|
|
|
| |
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40819
|
|
|
|
|
|
| |
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 40301
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NAND flash is very likely to contain bad blocks.
Currently, mtd and therefore sysupgrade fails when it encounters a single bad block, potentially leaving an unbootable system.
This patch allows the mtd utility to skip bad blocks in NAND flash and complete sysupgrade successfully.
Patch by: Matthew Redfearn <matt.redfearn@nxp.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40021
|
|
|
|
|
|
| |
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 38871
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current implementation of mtd will not append the backup
file created by sysupgrade to the correct partition, as mtd will append
the data to first jffs2 partition it finds. As the kernel is also
stored on a jffs2 partition (which resides before the overlay
partition), the data will be appended to this partition.
To fix this problem, a new option
-s <number> skip the first n bytes when appending data to the jffs2 partiton, defaults to "0"
is added to mtd.
Signed-off-by: Peter Wagner <tripolar@gmx.at>
SVN-Revision: 38807
|
|
|
|
|
|
|
|
| |
it is no longer used anywhere
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 37282
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 37007
|