pistachio: remove custom board detection override
authorFelix Fietkau <nbd@nbd.name>
Fri, 17 Mar 2017 16:02:55 +0000 (17:02 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 22 Mar 2017 10:43:22 +0000 (11:43 +0100)
Use device tree based model string

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/boot/uboot-envtools/files/pistachio
target/linux/pistachio/base-files/lib/pistachio.sh [deleted file]
target/linux/pistachio/base-files/lib/preinit/03_preinit_pistachio.sh [deleted file]
target/linux/pistachio/base-files/lib/upgrade/platform.sh
target/linux/pistachio/image/Makefile

index ac82d9da8bd8b46e12889db91bdbadcf8d672e8d..e4aa7b0cd960bf66c545c69fb28b90ac1e9779f2 100644 (file)
@@ -16,7 +16,7 @@ touch /etc/config/ubootenv
 board=$(board_name)
 
 case "$board" in
-marduk)
+img,pistachio-marduk)
        ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x2000" "0x1000"
        ;;
 esac
diff --git a/target/linux/pistachio/base-files/lib/pistachio.sh b/target/linux/pistachio/base-files/lib/pistachio.sh
deleted file mode 100755 (executable)
index 9390a4c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2017 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-PISTACHIO_BOARD_NAME=
-PISTACHIO_MODEL=
-
-pistachio_board_detect() {
-       local machine
-       local name
-
-       machine=$(cat /proc/device-tree/model)
-
-       case "$machine" in
-       "IMG Marduk (Creator Ci40)")
-               name="marduk"
-               ;;
-       *)
-               name="generic"
-               ;;
-       esac
-
-       [ -z "$PISTACHIO_BOARD_NAME" ] && PISTACHIO_BOARD_NAME="$name"
-       [ -z "$PISTACHIO_MODEL" ] && PISTACHIO_MODEL="$machine"
-
-       [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
-
-       echo "$PISTACHIO_BOARD_NAME" > /tmp/sysinfo/board_name
-       echo "$PISTACHIO_MODEL" > /tmp/sysinfo/model
-}
diff --git a/target/linux/pistachio/base-files/lib/preinit/03_preinit_pistachio.sh b/target/linux/pistachio/base-files/lib/preinit/03_preinit_pistachio.sh
deleted file mode 100755 (executable)
index fda420e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2017 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-do_pistachio() {
-       . /lib/pistachio.sh
-
-       pistachio_board_detect
-}
-
-boot_hook_add preinit_main do_pistachio
index 2ddac783f37a26a4411429126f9e8c04a38749aa..ee5d5066c3417ecaedba96a7e40c39c052e104f5 100755 (executable)
@@ -33,7 +33,7 @@ platform_nand_pre_upgrade() {
        local board=$(board_name)
 
        case "$board" in
-       marduk)
+       img,pistachio-marduk)
                local boot_partition=$(dmesg | grep "ubi0: attached.*" | sed "s/^.*\(firmware[0-1]\).*/\1/g")
 
                echo "Current boot partiton $boot_partition (/dev/mtd$(find_mtd_index $boot_partition))"
index 88210374de8dda27382dba3b75b70fceab7142f0..c1da39e855e041747af1caf33a6a389a9bc41abb 100644 (file)
@@ -24,6 +24,7 @@ define Device/Default
 endef
 
 define Device/marduk
+  BOARD_NAME := img,pistachio-marduk
   DEVICE_DTS := img/pistachio_marduk
   BLOCKSIZE := 256KiB
   PAGESIZE := 4KiB