pistachio: remove custom board detection override
Use device tree based model string Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
c0e8108b70
commit
ca44b9a0d4
5 changed files with 3 additions and 51 deletions
|
@ -16,7 +16,7 @@ touch /etc/config/ubootenv
|
||||||
board=$(board_name)
|
board=$(board_name)
|
||||||
|
|
||||||
case "$board" in
|
case "$board" in
|
||||||
marduk)
|
img,pistachio-marduk)
|
||||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x2000" "0x1000"
|
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x2000" "0x1000"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -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
|
|
||||||
}
|
|
|
@ -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
|
|
|
@ -33,7 +33,7 @@ platform_nand_pre_upgrade() {
|
||||||
local board=$(board_name)
|
local board=$(board_name)
|
||||||
|
|
||||||
case "$board" in
|
case "$board" in
|
||||||
marduk)
|
img,pistachio-marduk)
|
||||||
local boot_partition=$(dmesg | grep "ubi0: attached.*" | sed "s/^.*\(firmware[0-1]\).*/\1/g")
|
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))"
|
echo "Current boot partiton $boot_partition (/dev/mtd$(find_mtd_index $boot_partition))"
|
||||||
|
|
|
@ -24,6 +24,7 @@ define Device/Default
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Device/marduk
|
define Device/marduk
|
||||||
|
BOARD_NAME := img,pistachio-marduk
|
||||||
DEVICE_DTS := img/pistachio_marduk
|
DEVICE_DTS := img/pistachio_marduk
|
||||||
BLOCKSIZE := 256KiB
|
BLOCKSIZE := 256KiB
|
||||||
PAGESIZE := 4KiB
|
PAGESIZE := 4KiB
|
||||||
|
|
Loading…
Reference in a new issue