From 0cfc5d05b3335c2cc2281f9440120253b532e4ce Mon Sep 17 00:00:00 2001 From: juhosg Date: Tue, 18 Sep 2012 14:30:57 +0000 Subject: ar71xx: revert DIR-825-B1 wholeflash image support. It should be implemmented in a cleaner way. This reverts the following commits: [ar71xx] dir-825-b1: Fix wholeflash images [ar71xx] dir825b1: Add image for DIR-825-B1 that uses the whole flash" git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33459 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../base-files/etc/uci-defaults/caldata-migration | 68 ---------------------- 1 file changed, 68 deletions(-) delete mode 100644 target/linux/ar71xx/base-files/etc/uci-defaults/caldata-migration (limited to 'target/linux/ar71xx/base-files/etc/uci-defaults/caldata-migration') diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/caldata-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/caldata-migration deleted file mode 100644 index 486e4ed7b..000000000 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/caldata-migration +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011 OpenWrt.org -# - -. /lib/functions/uci-defaults.sh -. /lib/ar71xx.sh - -board=$(ar71xx_board_name) - -findmtd() { - local partname="$1" - grep "\"$partname\"" /proc/mtd | awk -F: '{ print $1 }' -} - -getcalmac() { - local partname="$1" - local offset="$2" - - hexdump -e '17/1 "%c"' -s $offset -n 17 /dev/$(findmtd $partname) | tr -d : | tr 'A-Z' 'a-z' -} - -calcmacX() { - local mac="$1" - local X="$2" - - local oui="$(expr substr "$mac" 1 6)" - local end="$(expr substr "$mac" 7 12)" - - echo -n $oui - expr substr "$(printf "%6lx" "$(($(printf "%lu" 0x${end}) + $X))")" 1 6 -} - -getifmac() { - local ifname="$1" - - local ifmac - - ifmac="$(ifconfig "$ifname" | grep HWaddr)" - ifmac="${ifmac#*HWaddr }" - ifmac="${ifmac%% *}" - - echo "$ifmac" | tr -d : | tr 'A-Z' 'a-z' -} - -case "$board" in -dir-825-b1-towholeflash) - mac1="$(getcalmac caldata 65440)" - mac1="$(calcmacX "$mac1" 2)" - mac2="$(calcmacX "$mac1" 1)" - - if grep -q '"owrt_caldata"' /proc/mtd && [ "$mac1" = "$(getifmac eth0)" ] && [ "$mac2" = "$(getifmac eth1)" ]; then - mtd erase owrt_caldata - dd if=/dev/$(findmtd caldata) of=/dev/$(findmtd owrt_caldata) bs=65536 count=1 - fi - ;; -dir-825-b1-tostock) - mac1="$(getcalmac owrt_caldata 65440)" - mac1="$(calcmacX "$mac1" 2)" - mac2="$(calcmacX "$mac1" 1)" - if grep -q '"owrt_caldata"' /proc/mtd && [ "$mac1" = "$(getifmac eth0)" ] && [ "$mac2" = "$(getifmac eth1)" ]; then - mtd erase caldata - dd if=/dev/$(findmtd owrt_caldata) of=/dev/$(findmtd caldata) bs=65536 count=1 - fi - ;; -esac - -return 0 -- cgit v1.2.3