summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/base-files/files/lib/upgrade/common.sh23
-rw-r--r--package/system/mtd/src/mtd.c38
2 files changed, 5 insertions, 56 deletions
diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index 6bb36db489..7e6e5fc015 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -175,10 +175,6 @@ get_magic_long() {
get_image "$@" | dd bs=4 count=1 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
}
-refresh_mtd_partitions() {
- mtd refresh rootfs
-}
-
jffs2_copy_config() {
if grep rootfs_data /proc/mtd >/dev/null; then
# squashfs+jffs2
@@ -191,7 +187,7 @@ jffs2_copy_config() {
default_do_upgrade() {
sync
- if [ "$SAVE_CONFIG" -eq 1 -a -z "$USE_REFRESH" ]; then
+ if [ "$SAVE_CONFIG" -eq 1 ]; then
get_image "$1" | mtd -j "$CONF_TAR" write - "${PART_NAME:-image}"
else
get_image "$1" | mtd write - "${PART_NAME:-image}"
@@ -206,19 +202,10 @@ do_upgrade() {
default_do_upgrade "$ARGV"
fi
- [ "$SAVE_CONFIG" -eq 1 -a -n "$USE_REFRESH" ] && {
- v "Refreshing partitions"
- if type 'platform_refresh_partitions' >/dev/null 2>/dev/null; then
- platform_refresh_partitions
- else
- refresh_mtd_partitions
- fi
- if type 'platform_copy_config' >/dev/null 2>/dev/null; then
- platform_copy_config
- else
- jffs2_copy_config
- fi
- }
+ if [ "$SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then
+ platform_copy_config
+ fi
+
v "Upgrade completed"
[ -n "$DELAY" ] && sleep "$DELAY"
ask_bool 1 "Reboot" && {
diff --git a/package/system/mtd/src/mtd.c b/package/system/mtd/src/mtd.c
index bdbaab51a4..a660486283 100644
--- a/package/system/mtd/src/mtd.c
+++ b/package/system/mtd/src/mtd.c
@@ -44,10 +44,6 @@
#include "fis.h"
#include "mtd.h"
-#ifndef MTDREFRESH
-#define MTDREFRESH _IO('M', 50)
-#endif
-
#define MAX_ARGS 8
#define JFFS2_DEFAULT_DIR "" /* directory name without /, empty means root dir */
@@ -248,33 +244,6 @@ mtd_erase(const char *mtd)
}
-static int
-mtd_refresh(const char *mtd)
-{
- int fd;
-
- if (quiet < 2)
- fprintf(stderr, "Refreshing mtd partition %s ... ", mtd);
-
- fd = mtd_check_open(mtd);
- if(fd < 0) {
- fprintf(stderr, "Could not open mtd device: %s\n", mtd);
- exit(1);
- }
-
- if (ioctl(fd, MTDREFRESH, NULL)) {
- fprintf(stderr, "Failed to refresh the MTD device\n");
- close(fd);
- exit(1);
- }
- close(fd);
-
- if (quiet < 2)
- fprintf(stderr, "\n");
-
- return 0;
-}
-
static void
indicate_writing(const char *mtd)
{
@@ -575,7 +544,6 @@ int main (int argc, char **argv)
CMD_ERASE,
CMD_WRITE,
CMD_UNLOCK,
- CMD_REFRESH,
CMD_JFFS2WRITE,
CMD_FIXTRX,
CMD_FIXSEAMA,
@@ -658,9 +626,6 @@ int main (int argc, char **argv)
if ((strcmp(argv[0], "unlock") == 0) && (argc == 2)) {
cmd = CMD_UNLOCK;
device = argv[1];
- } else if ((strcmp(argv[0], "refresh") == 0) && (argc == 2)) {
- cmd = CMD_REFRESH;
- device = argv[1];
} else if ((strcmp(argv[0], "erase") == 0) && (argc == 2)) {
cmd = CMD_ERASE;
device = argv[1];
@@ -739,9 +704,6 @@ int main (int argc, char **argv)
mtd_unlock(device);
mtd_write_jffs2(device, imagefile, jffs2dir);
break;
- case CMD_REFRESH:
- mtd_refresh(device);
- break;
case CMD_FIXTRX:
if (mtd_fixtrx) {
mtd_fixtrx(device, offset);