summaryrefslogtreecommitdiff
path: root/target/linux/mvebu/base-files/lib
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/mvebu/base-files/lib')
-rwxr-xr-xtarget/linux/mvebu/base-files/lib/mvebu.sh58
-rw-r--r--target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac20
-rw-r--r--target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg27
-rw-r--r--target/linux/mvebu/base-files/lib/upgrade/linksys.sh83
-rwxr-xr-xtarget/linux/mvebu/base-files/lib/upgrade/platform.sh50
5 files changed, 0 insertions, 238 deletions
diff --git a/target/linux/mvebu/base-files/lib/mvebu.sh b/target/linux/mvebu/base-files/lib/mvebu.sh
deleted file mode 100755
index e8985b4..0000000
--- a/target/linux/mvebu/base-files/lib/mvebu.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2013 OpenWrt.org
-#
-
-MVEBU_BOARD_NAME=
-MVEBU_MODEL=
-
-mvebu_board_detect() {
- local machine
- local name
-
- machine=$(cat /proc/device-tree/model)
-
- case "$machine" in
- *"Marvell Armada 370 Evaluation Board")
- name="armada-370-db"
- ;;
- *"Globalscale Mirabox")
- name="mirabox"
- ;;
- *"Marvell Armada 370 Reference Design")
- name="armada-370-rd"
- ;;
- *"Marvell Armada XP Evaluation Board")
- name="armada-xp-db"
- ;;
- *"PlatHome OpenBlocks AX3-4 board")
- name="openblocks-ax3-4"
- ;;
- *"Marvell Armada XP GP Board")
- name="armada-xp-gp"
- ;;
- *"Linksys WRT1900AC (Mamba)")
- name="armada-xp-mamba"
- ;;
- esac
-
- [ -z "$name" ] && name="unknown"
-
- [ -z "$MVEBU_BOARD_NAME" ] && MVEBU_BOARD_NAME="$name"
- [ -z "$MVEBU_MODEL" ] && MVEBU_MODEL="$machine"
-
- [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
-
- echo "$MVEBU_BOARD_NAME" > /tmp/sysinfo/board_name
- echo "$MVEBU_MODEL" > /tmp/sysinfo/model
-}
-
-mvebu_board_name() {
- local name
-
- [ -f /tmp/sysinfo/board_name ] || mvebu_board_detect
- [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
- [ -z "$name" ] && name="unknown"
-
- echo "$name"
-}
diff --git a/target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac b/target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac
deleted file mode 100644
index 30f1370..0000000
--- a/target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-
-preinit_set_mac_address() {
- local mac
-
- . /lib/functions.sh
- . /lib/mvebu.sh
-
- case $(mvebu_board_name) in
- armada-xp-mamba)
- mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
- ifconfig eth0 hw ether $mac 2>/dev/null
- ifconfig eth1 hw ether $mac 2>/dev/null
- ;;
- esac
-}
-
-boot_hook_add preinit_main preinit_set_mac_address
diff --git a/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg b/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
deleted file mode 100644
index 54aff7d..0000000
--- a/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-
-preinit_mount_syscfg() {
-
- . /lib/functions.sh
- . /lib/mvebu.sh
-
- case $(mvebu_board_name) in
- armada-xp-mamba)
- mkdir /tmp/syscfg
- ubiattach -p /dev/mtd8
- mount -t ubifs ubi1:syscfg /tmp/syscfg
- [ -f /tmp/syscfg/sysupgrade.tgz ] && {
- echo "- config restore -"
- cd /
- mv /tmp/syscfg/sysupgrade.tgz /tmp
- tar xzf /tmp/sysupgrade.tgz
- rm -f /tmp/sysupgrade.tgz
- sync
- }
- ;;
- esac
-}
-
-boot_hook_add preinit_main preinit_mount_syscfg
diff --git a/target/linux/mvebu/base-files/lib/upgrade/linksys.sh b/target/linux/mvebu/base-files/lib/upgrade/linksys.sh
deleted file mode 100644
index f37831b..0000000
--- a/target/linux/mvebu/base-files/lib/upgrade/linksys.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-
-linksys_get_target_firmware() {
- cur_boot_part=`/usr/sbin/fw_printenv -n boot_part`
- target_firmware=""
- if [ "$cur_boot_part" = "1" ]
- then
- # current primary boot - update alt boot
- target_firmware="kernel2"
- fw_setenv boot_part 2
- fw_setenv bootcmd "run altnandboot"
- elif [ "$cur_boot_part" = "2" ]
- then
- # current alt boot - update primary boot
- target_firmware="kernel1"
- fw_setenv boot_part 1
- fw_setenv bootcmd "run nandboot"
- fi
-
- echo "$target_firmware"
-}
-
-linksys_get_root_magic() {
- (get_image "$@" | dd skip=786432 bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2>/dev/null
-}
-
-platform_do_upgrade_linksys() {
- local magic_long="$(get_magic_long "$1")"
-
- mkdir -p /var/lock
- local part_label="$(linksys_get_target_firmware)"
- touch /var/lock/fw_printenv.lock
-
- if [ ! -n "$part_label" ]
- then
- echo "cannot find target partition"
- exit 1
- fi
-
- local target_mtd=$(find_mtd_part $part_label)
-
- [ "$magic_long" = "73797375" ] && {
- CI_KERNPART="$part_label"
- if [ "$part_label" = "kernel1" ]
- then
- CI_UBIPART="rootfs1"
- else
- CI_UBIPART="rootfs2"
- fi
-
- nand_upgrade_tar "$1"
- }
- [ "$magic_long" = "27051956" ] && {
- # check firmwares' rootfs types
- local target_mtd=$(find_mtd_part $part_label)
- local oldroot="$(linksys_get_root_magic $target_mtd)"
- local newroot="$(linksys_get_root_magic "$1")"
-
- if [ "$newroot" = "55424923" -a "$oldroot" = "55424923" ]
- # we're upgrading from a firmware with UBI to one with UBI
- then
- # erase everything to be safe
- mtd erase $part_label
- get_image "$1" | mtd -n write - $part_label
- else
- get_image "$1" | mtd write - $part_label
- fi
- }
-}
-
-linksys_preupgrade() {
- export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /usr/sbin/fw_printenv /usr/sbin/fw_setenv"
- export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /bin/mkdir /bin/touch"
- export RAMFS_COPY_DATA="${RAMFS_COPY_DATA} /etc/fw_env.config /var/lock/fw_printenv.lock"
-
- [ -f /tmp/sysupgrade.tgz ] && {
- cp /tmp/sysupgrade.tgz /tmp/syscfg/sysupgrade.tgz
- }
-}
-
-append sysupgrade_pre_upgrade linksys_preupgrade
diff --git a/target/linux/mvebu/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/base-files/lib/upgrade/platform.sh
deleted file mode 100755
index f5e44c3..0000000
--- a/target/linux/mvebu/base-files/lib/upgrade/platform.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-
-. /lib/mvebu.sh
-
-RAMFS_COPY_DATA=/lib/mvebu.sh
-
-platform_check_image() {
- local board=$(mvebu_board_name)
- local magic_long="$(get_magic_long "$1")"
-
- [ "$#" -gt 1 ] && return 1
-
- case "$board" in
- armada-xp-mamba )
- [ "$magic_long" != "27051956" -a "$magic_long" != "73797375" ] && {
- echo "Invalid image type."
- return 1
- }
- return 0;
- ;;
- esac
-
- echo "Sysupgrade is not yet supported on $board."
- return 1
-}
-
-platform_do_upgrade() {
- local board=$(mvebu_board_name)
-
- case "$board" in
- armada-xp-mamba)
- platform_do_upgrade_linksys "$ARGV"
- ;;
- *)
- default_do_upgrade "$ARGV"
- ;;
- esac
-}
-
-disable_watchdog() {
- killall watchdog
- ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
- echo 'Could not disable watchdog'
- return 1
- }
-}
-
-append sysupgrade_pre_upgrade disable_watchdog