From: Luka Perkov Date: Thu, 26 Jun 2014 10:14:13 +0000 (+0000) Subject: imx6: move imx6.sh to /lib/ for consistency X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fa0b9bcceab5a82df39e374da01117f0688508b2;p=openwrt%2Fstaging%2Frobimarko.git imx6: move imx6.sh to /lib/ for consistency Signed-off-by: Luka Perkov SVN-Revision: 41339 --- diff --git a/target/linux/imx6/base-files/etc/uci-defaults/02_network b/target/linux/imx6/base-files/etc/uci-defaults/02_network index 7b8047b728..64e060a8e0 100644 --- a/target/linux/imx6/base-files/etc/uci-defaults/02_network +++ b/target/linux/imx6/base-files/etc/uci-defaults/02_network @@ -8,7 +8,7 @@ touch /etc/config/network . /lib/functions/uci-defaults.sh -. /lib/functions/imx6.sh +. /lib/imx6.sh board=$(imx6_board_name) diff --git a/target/linux/imx6/base-files/lib/functions/imx6.sh b/target/linux/imx6/base-files/lib/functions/imx6.sh deleted file mode 100755 index 0318fb4485..0000000000 --- a/target/linux/imx6/base-files/lib/functions/imx6.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2010-2013 OpenWrt.org -# - -IMX6_BOARD_NAME= -IMX6_MODEL= - -imx6_board_detect() { - local machine - local name - - machine=$(cat /proc/device-tree/model) - - case "$machine" in - "Gateworks Ventana i.MX6 DualLite/Solo GW51XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW51XX") - name="gw51xx" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW52XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW52XX") - name="gw52xx" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW53XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW53XX") - name="gw53xx" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW54XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW54XX" |\ - "Gateworks Ventana GW5400-A") - name="gw54xx" - ;; - - "Wandboard i.MX6 Dual Lite Board") - name="wandboard" - ;; - - *) - name="generic" - ;; - esac - - [ -z "$IMX6_BOARD_NAME" ] && IMX6_BOARD_NAME="$name" - [ -z "$IMX6_MODEL" ] && IMX6_MODEL="$machine" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$IMX6_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$IMX6_MODEL" > /tmp/sysinfo/model -} - -imx6_board_name() { - local name - - [ -f /tmp/sysinfo/board_name ] || imx6_board_detect - [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name) - [ -z "$name" ] && name="unknown" - - echo "$name" -} diff --git a/target/linux/imx6/base-files/lib/imx6.sh b/target/linux/imx6/base-files/lib/imx6.sh new file mode 100755 index 0000000000..0318fb4485 --- /dev/null +++ b/target/linux/imx6/base-files/lib/imx6.sh @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Copyright (C) 2010-2013 OpenWrt.org +# + +IMX6_BOARD_NAME= +IMX6_MODEL= + +imx6_board_detect() { + local machine + local name + + machine=$(cat /proc/device-tree/model) + + case "$machine" in + "Gateworks Ventana i.MX6 DualLite/Solo GW51XX" |\ + "Gateworks Ventana i.MX6 Dual/Quad GW51XX") + name="gw51xx" + ;; + + "Gateworks Ventana i.MX6 DualLite/Solo GW52XX" |\ + "Gateworks Ventana i.MX6 Dual/Quad GW52XX") + name="gw52xx" + ;; + + "Gateworks Ventana i.MX6 DualLite/Solo GW53XX" |\ + "Gateworks Ventana i.MX6 Dual/Quad GW53XX") + name="gw53xx" + ;; + + "Gateworks Ventana i.MX6 DualLite/Solo GW54XX" |\ + "Gateworks Ventana i.MX6 Dual/Quad GW54XX" |\ + "Gateworks Ventana GW5400-A") + name="gw54xx" + ;; + + "Wandboard i.MX6 Dual Lite Board") + name="wandboard" + ;; + + *) + name="generic" + ;; + esac + + [ -z "$IMX6_BOARD_NAME" ] && IMX6_BOARD_NAME="$name" + [ -z "$IMX6_MODEL" ] && IMX6_MODEL="$machine" + + [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" + + echo "$IMX6_BOARD_NAME" > /tmp/sysinfo/board_name + echo "$IMX6_MODEL" > /tmp/sysinfo/model +} + +imx6_board_name() { + local name + + [ -f /tmp/sysinfo/board_name ] || imx6_board_detect + [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name) + [ -z "$name" ] && name="unknown" + + echo "$name" +} diff --git a/target/linux/imx6/base-files/lib/upgrade/platform.sh b/target/linux/imx6/base-files/lib/upgrade/platform.sh index 7f8733a673..c34a47b0de 100755 --- a/target/linux/imx6/base-files/lib/upgrade/platform.sh +++ b/target/linux/imx6/base-files/lib/upgrade/platform.sh @@ -2,7 +2,7 @@ # Copyright (C) 2010 OpenWrt.org # -. /lib/functions/imx6.sh +. /lib/imx6.sh platform_check_image() { local board=$(imx6_board_name)