diff options
author | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2018-09-16 20:04:38 +0200 |
---|---|---|
committer | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2018-09-16 20:07:19 +0200 |
commit | 37fdcd5a407dfdee27a9bf201dac3cdff1e4ab88 (patch) | |
tree | 5f9583b75516dbfb22a38f321b78be98116b7140 /package | |
parent | c0ce88c586a467665b35d93c2f6962cac8e8dc27 (diff) | |
download | mtk-20170518-37fdcd5a407dfdee27a9bf201dac3cdff1e4ab88.zip mtk-20170518-37fdcd5a407dfdee27a9bf201dac3cdff1e4ab88.tar.gz mtk-20170518-37fdcd5a407dfdee27a9bf201dac3cdff1e4ab88.tar.bz2 |
package/base-files: hack for mt7623 SoC boot, drop other boards
Diffstat (limited to 'package')
-rwxr-xr-x | package/base-files/files/bin/board_detect | 14 | ||||
-rwxr-xr-x | package/base-files/files/etc/init.d/boot | 1 | ||||
-rwxr-xr-x | package/base-files/files/etc/init.d/done | 10 | ||||
-rw-r--r-- | package/base-files/files/etc/rc.local | 21 | ||||
-rw-r--r-- | package/base-files/files/lib/preinit/80_mount_root | 7 | ||||
-rwxr-xr-x | package/base-files/files/sbin/firstboot | 8 |
6 files changed, 44 insertions, 17 deletions
diff --git a/package/base-files/files/bin/board_detect b/package/base-files/files/bin/board_detect deleted file mode 100755 index ee04b9e..0000000 --- a/package/base-files/files/bin/board_detect +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -[ -d "/etc/board.d/" -a ! -f "/etc/board.json" ] && { - for a in `ls /etc/board.d/*`; do - [ -x $a ] || continue; - $(. $a) - done -} - -[ -f "/etc/board.json" ] || return 1 -[ -f "/etc/config/network" ] || { - touch /etc/config/network - /bin/config_generate -} diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index f10db13..b1272f4 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -46,7 +46,6 @@ boot() { } rm -f /tmp/wireless.tmp - /bin/board_detect uci_apply_defaults # temporary hack until configd exists diff --git a/package/base-files/files/etc/init.d/done b/package/base-files/files/etc/init.d/done index b254aff..04d1b5d 100755 --- a/package/base-files/files/etc/init.d/done +++ b/package/base-files/files/etc/init.d/done @@ -3,7 +3,15 @@ START=95 boot() { - [ -d /tmp/root ] && mount_root done + [ -d /tmp/root ] && { + cat /proc/cpuinfo | grep 7623 + if [ "$?" == "0" ]; then + mount_root2 done; + else + mount_root done; + fi + } + block mount # process user commands [ -f /etc/rc.local ] && { diff --git a/package/base-files/files/etc/rc.local b/package/base-files/files/etc/rc.local index 5639477..e392d53 100644 --- a/package/base-files/files/etc/rc.local +++ b/package/base-files/files/etc/rc.local @@ -1,4 +1,25 @@ # Put your custom commands here that should be executed once # the system init finished. By default this file does nothing. +case `cat /proc/cpuinfo | grep MT76` in + *7621*) + CONFIG_RALINK_MT7621=y + ;; + *7623*) + CONFIG_ARCH_MT7623=y + ;; +esac +if [ "$CONFIG_RALINK_MT7621" = "y" ]; then +echo 2048 > /proc/sys/vm/min_free_kbytes +#echo 2 > /proc/sys/vm/overcommit_memory +#echo 50 > /proc/sys/vm/overcommit_ratio +fi +block mount + +# add nat rule manually + +smp.sh wifi +hwnat-enable.sh +bridge-add.sh + exit 0 diff --git a/package/base-files/files/lib/preinit/80_mount_root b/package/base-files/files/lib/preinit/80_mount_root index 0292d82..88128bd 100644 --- a/package/base-files/files/lib/preinit/80_mount_root +++ b/package/base-files/files/lib/preinit/80_mount_root @@ -3,7 +3,12 @@ # Copyright (C) 2010 Vertical Communications do_mount_root() { - mount_root + cat /proc/cpuinfo | grep 7623 + if [ "$?" == "0" ]; then + mount_root2 + else + mount_root + fi boot_run_hook preinit_mount_root [ -f /sysupgrade.tgz ] && { echo "- config restore -" diff --git a/package/base-files/files/sbin/firstboot b/package/base-files/files/sbin/firstboot index 081febb..04976a3 100755 --- a/package/base-files/files/sbin/firstboot +++ b/package/base-files/files/sbin/firstboot @@ -1,3 +1,11 @@ #!/bin/sh /sbin/jffs2reset + +cat /proc/cmdline | grep block2mtd > /dev/null +emmc=$? +echo $emmc +[ "$emmc" == "0" ] && { + echo "emmc board, need reboot"; + reboot -f; +} |