mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-03-09 15:40:20 +00:00
Remove not needed files for RUTX
This commit is contained in:
parent
85d847a12e
commit
b66beeb1e2
20 changed files with 1 additions and 1275 deletions
|
@ -1,36 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
CFG=/etc/board.json
|
||||
SLP=30
|
||||
|
||||
check_modem() {
|
||||
json_select "$2"
|
||||
json_get_vars id
|
||||
|
||||
[ -z "$id" ] && {
|
||||
json_select ..
|
||||
return 0
|
||||
}
|
||||
|
||||
ttys=$(ls -d /sys/bus/usb/devices/$id/${id}*/tty?*)
|
||||
|
||||
[ -n "$ttys" ] || { #FAILED TO FIND MODEM
|
||||
mctl -s
|
||||
sleep 1
|
||||
mctl -p
|
||||
json_select ..
|
||||
return 1
|
||||
}
|
||||
|
||||
#MODEM UP
|
||||
json_select ..
|
||||
}
|
||||
|
||||
board_config_update
|
||||
while true; do
|
||||
json_for_each_item check_modem modems
|
||||
sleep $SLP
|
||||
[ $SLP -lt 300 ] && SLP=$((SLP+30))
|
||||
done
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
sig="/tmp/.$(cat /proc/sys/kernel/random/uuid).sig"
|
||||
|
||||
check() {
|
||||
local ipk="$1"
|
||||
[ -z "$ipk" ] && return 1
|
||||
|
||||
tar -xzOf "$ipk" ./control+data.sig > $sig || return 2
|
||||
|
||||
tar -xzOf "$ipk" ./control.tar.gz ./data.tar.gz | usign -V -m - -P /etc/opkg/keys -x $sig || return 3
|
||||
}
|
||||
|
||||
check $1
|
||||
status=$?
|
||||
rm -f $sig
|
||||
return $status
|
|
@ -193,9 +193,7 @@ setup_json() {
|
|||
}
|
||||
|
||||
#~ Get model name for RUTX products
|
||||
if ! model="$(mnf_info --name)" 2>/dev/null; then
|
||||
model="$(mnf_info --prod-code)" 2>/dev/null
|
||||
fi
|
||||
model="$(mnf_info --name)" 2>/dev/null
|
||||
|
||||
platform="$(cat /proc/device-tree/platform)" 2>/dev/null
|
||||
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2021 Teltonika Networks
|
||||
|
||||
START=96
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
PROG=/bin/board_track
|
||||
NAME=board_track
|
||||
PIDCOUNT=1
|
||||
|
||||
start_service() {
|
||||
config_load system
|
||||
|
||||
config_get modem_track system modem_track 1
|
||||
|
||||
[ "$modem_track" != 0 ] || return
|
||||
|
||||
local pid_file="/var/run/${NAME}.${PIDCOUNT}.pid"
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param file /etc/config/system
|
||||
|
||||
procd_set_param respawn
|
||||
|
||||
procd_set_param stdout 1
|
||||
procd_set_param pidfile $pid_file
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "system"
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/board.sh
|
||||
|
||||
|
||||
set_pin() {
|
||||
local sim="$1"
|
||||
local modem position num builtin
|
||||
|
||||
config_get modem "$sim" modem
|
||||
builtin=$(is_builtin_modem "$modem")
|
||||
[ "$builtin" = "0" ] && return
|
||||
|
||||
config_get position "$sim" position
|
||||
#If modem builtin and primary then position num 3 or 4 else 1 or 2
|
||||
[ "$builtin" = "2" ] && num=$((position + 2)) || num=$position
|
||||
|
||||
pin=`/sbin/mnf_info --simpin $num`
|
||||
[ -z "$pin" ] && return
|
||||
|
||||
uci -q set "simcard"."$sim"."pincode"="$pin"
|
||||
}
|
||||
|
||||
config_load simcard
|
||||
config_foreach set_pin sim
|
||||
uci commit simcard
|
||||
|
||||
exit 0
|
|
@ -1,119 +0,0 @@
|
|||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
|
||||
CONFIG="widget"
|
||||
MOBILE_CONFIG="/etc/config/simcard"
|
||||
RMS_CONFIG="/etc/config/rms_connect_mqtt"
|
||||
WIFI_CONFIG="/etc/config/wireless"
|
||||
ETHERNET=$(uci -q get network.@switch[0].name)
|
||||
ethernet_widget_exists=0
|
||||
mobile_widget_exists=0
|
||||
system_widget_exists=0
|
||||
wifi_widget_exists=0
|
||||
rms_widget_exists=0
|
||||
position=1
|
||||
radio0_network=1
|
||||
radio1_network=1
|
||||
|
||||
check_for_widgets() {
|
||||
local widget="$1"
|
||||
local type
|
||||
config_get type "$widget" type
|
||||
|
||||
if [ "$type" = "ethernet" ]; then
|
||||
ethernet_widget_exists=1
|
||||
elif [ "$type" = "mobile" ]; then
|
||||
mobile_widget_exists=1
|
||||
elif [ "$type" = "system" ]; then
|
||||
system_widget_exists=1
|
||||
elif [ "$type" = "wifi" ]; then
|
||||
wifi_widget_exists=1
|
||||
elif [ "$type" = "rms" ]; then
|
||||
rms_widget_exists=1
|
||||
fi
|
||||
}
|
||||
|
||||
setup_wifi_fields() {
|
||||
local iface_section="$1"
|
||||
local device
|
||||
config_get device "$iface_section" device
|
||||
|
||||
section=$(uci -q add widget widget)
|
||||
|
||||
if [ "$device" == "radio0" ]; then
|
||||
uci -q set $CONFIG."${section}.id"=$device."network${radio0_network}"
|
||||
let "radio0_network=radio0_network + 1"
|
||||
elif [ "$device" == "radio1" ]; then
|
||||
uci -q set $CONFIG."${section}.id"=$device."network${radio1_network}"
|
||||
let "radio1_network=radio1_network + 1"
|
||||
fi
|
||||
uci -q set $CONFIG."${section}.type=wifi"
|
||||
uci -q set $CONFIG."${section}.position=${position}"
|
||||
uci -q set $CONFIG."${section}.enabled=1"
|
||||
let "position=position + 1"
|
||||
}
|
||||
|
||||
check_if_config_exists() {
|
||||
if [ ! -f "/etc/config/${CONFIG}" ]; then
|
||||
touch "/etc/config/${CONFIG}"
|
||||
fi
|
||||
}
|
||||
|
||||
setup_side_widget() {
|
||||
config_load widget
|
||||
config_foreach check_for_widgets widget
|
||||
|
||||
if [ $ethernet_widget_exists -eq 0 -a -n "$ETHERNET" ]; then
|
||||
check_if_config_exists
|
||||
section=$(uci -q add widget widget)
|
||||
uci -q set $CONFIG."${section}.id=widget1"
|
||||
uci -q set $CONFIG."${section}.type=ethernet"
|
||||
uci -q set $CONFIG."${section}.position=${position}"
|
||||
uci -q set $CONFIG."${section}.enabled=1"
|
||||
let "position=position + 1"
|
||||
fi
|
||||
|
||||
if [ $mobile_widget_exists -eq 0 -a -s "$MOBILE_CONFIG" -a -f "$MOBILE_CONFIG" ]; then
|
||||
check_if_config_exists
|
||||
modem_count=$(jsonfilter -q -i /etc/board.json -e '@["modems"][*]' | wc -l)
|
||||
for i in $(seq $modem_count)
|
||||
do
|
||||
section=$(uci -q add widget widget)
|
||||
uci -q set $CONFIG."${section}.id=mobile-widget$i"
|
||||
uci -q set $CONFIG."${section}.type=mobile"
|
||||
uci -q set $CONFIG."${section}.position=${position}"
|
||||
uci -q set $CONFIG."${section}.enabled=1"
|
||||
let "position=position + 1"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $system_widget_exists -eq 0 ]; then
|
||||
check_if_config_exists
|
||||
section=$(uci -q add widget widget)
|
||||
uci -q set $CONFIG."${section}.id=widget3"
|
||||
uci -q set $CONFIG."${section}.type=system"
|
||||
uci -q set $CONFIG."${section}.position=${position}"
|
||||
uci -q set $CONFIG."${section}.enabled=1"
|
||||
let "position=position + 1"
|
||||
fi
|
||||
|
||||
if [ $wifi_widget_exists -eq 0 -a -f "$WIFI_CONFIG" ]; then
|
||||
check_if_config_exists
|
||||
config_load wireless
|
||||
config_foreach setup_wifi_fields wifi-iface
|
||||
fi
|
||||
|
||||
if [ $rms_widget_exists -eq 0 -a -f "$RMS_CONFIG" ]; then
|
||||
check_if_config_exists
|
||||
section=$(uci -q add widget widget)
|
||||
uci -q set $CONFIG."${section}.id=widget5"
|
||||
uci -q set $CONFIG."${section}.type=rms"
|
||||
uci -q set $CONFIG."${section}.position=${position}"
|
||||
uci -q set $CONFIG."${section}.enabled=1"
|
||||
let "position=position + 1"
|
||||
fi
|
||||
|
||||
uci -q commit $CONFIG
|
||||
}
|
||||
setup_side_widget
|
||||
exit 0
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ -n "$(uci -q get system.modem.disable)" ] || {
|
||||
for m in /sys/class/gpio/modem*_power; do
|
||||
local label="$(basename $m | awk -F_ '{print $1}')"
|
||||
uci set "system.${label}=mctl"
|
||||
uci set "system.${label}.disable=0"
|
||||
|
||||
# modem is turned on in preinit but others are not
|
||||
[ "${label}" != "modem" ] && /sbin/mctl -p -m "${label}"
|
||||
done
|
||||
|
||||
uci commit system
|
||||
}
|
||||
|
||||
exit 0
|
|
@ -1,35 +0,0 @@
|
|||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
|
||||
CONFIG="/etc/config/user_groups"
|
||||
|
||||
migrate_tel_list() {
|
||||
local tel="$1"
|
||||
local new_section="$2"
|
||||
|
||||
uci -q add_list user_groups."$new_section".tel="$tel"
|
||||
}
|
||||
|
||||
migrate_group() {
|
||||
local group="$1"
|
||||
local name
|
||||
|
||||
config_get name "$group" name ""
|
||||
local new_section=`uci -q add user_groups phone`
|
||||
uci -q set user_groups."$new_section".name="$name"
|
||||
config_list_foreach "$group" tel migrate_tel_list "$new_section"
|
||||
|
||||
uci -q delete sms_utils."$group"
|
||||
}
|
||||
|
||||
if [ ! -e "$CONFIG" ]; then
|
||||
touch "$CONFIG"
|
||||
fi
|
||||
|
||||
config_load sms_utils
|
||||
config_foreach migrate_group group
|
||||
|
||||
uci -q commit user_groups
|
||||
uci -q commit sms_utils
|
||||
|
||||
exit 0
|
|
@ -1,140 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ -e /etc/config/strongswan ] || exit 0
|
||||
|
||||
. /lib/functions.sh
|
||||
ENABLED=0
|
||||
|
||||
move_config() {
|
||||
|
||||
local name=$1
|
||||
|
||||
#get old config
|
||||
config_get_bool enabled "$1" "enabled" "0"
|
||||
config_get keyexchange "$1" "keyexchange"
|
||||
config_get aggressive "$1" "aggressive"
|
||||
config_get ipsec_type "$1" "ipsec_type"
|
||||
config_get my_identifier_type "$1" "my_identifier_type"
|
||||
config_get my_identifier "$1" "my_identifier"
|
||||
config_get leftfirewall "$1" "leftfirewall"
|
||||
config_get forceencaps "$1" "forceencaps"
|
||||
config_get dpdaction "$1" "dpdaction" "none"
|
||||
config_get dpddelay "$1" "dpddelay"
|
||||
config_get dpdtimeout "$1" "dpdtimeout"
|
||||
config_get psk_key "$1" "psk_key"
|
||||
config_get right "$1" "right"
|
||||
config_get rightfirewall "$1" "rightfirewall"
|
||||
config_get ike_encryption_algorithm "$1" "ike_encryption_algorithm"
|
||||
config_get ike_authentication_algorithm "$1" "ike_authentication_algorithm"
|
||||
config_get ike_dh_group "$1" "ike_dh_group"
|
||||
config_get ikelifetime "$1" "ikelifetime"
|
||||
config_get esp_encryption_algorithm "$1" "esp_encryption_algorithm"
|
||||
config_get esp_hash_algorithm "$1" "esp_hash_algorithm"
|
||||
config_get esp_pfs_group "$1" "esp_pfs_group"
|
||||
config_get keylife "$1" "keylife"
|
||||
config_get leftsubnet "$1" "leftsubnet"
|
||||
config_get rightsubnet "$1" "rightsubnet"
|
||||
config_get leftprotoport "$1" "leftprotoport"
|
||||
config_get rightprotoport "$1" "rightprotoport"
|
||||
|
||||
[ "$enabled" = 1 ] && ENABLED=1
|
||||
#set new config structure
|
||||
|
||||
config_set
|
||||
uci_add "ipsec" "proposal" "${name}_ph1"
|
||||
uci_set "ipsec" $CONFIG_SECTION "encryption_algorithm" "$ike_encryption_algorithm"
|
||||
uci_set "ipsec" $CONFIG_SECTION "hash_algorithm" "$ike_authentication_algorithm"
|
||||
uci_set "ipsec" $CONFIG_SECTION "dh_group" "$ike_dh_group"
|
||||
|
||||
uci_add "ipsec" "proposal" "${name}_ph2"
|
||||
uci_set "ipsec" $CONFIG_SECTION "encryption_algorithm" "$esp_encryption_algorithm"
|
||||
uci_set "ipsec" $CONFIG_SECTION "hash_algorithm" "$esp_hash_algorithm"
|
||||
uci_set "ipsec" $CONFIG_SECTION "dh_group" "$esp_pfs_group"
|
||||
|
||||
uci_add "ipsec" "connection" "${name}_c"
|
||||
uci_set "ipsec" $CONFIG_SECTION "mode" "start"
|
||||
uci_set "ipsec" $CONFIG_SECTION "type" "$ipsec_type"
|
||||
uci_set "ipsec" $CONFIG_SECTION "local_subnet" "$leftsubnet"
|
||||
uci_set "ipsec" $CONFIG_SECTION "remote_subnet" "$rightsubnet"
|
||||
uci_set "ipsec" $CONFIG_SECTION "remote_firewall" "$rightfirewall"
|
||||
uci_set "ipsec" $CONFIG_SECTION "keyexchange" "$keyexchange"
|
||||
uci_set "ipsec" $CONFIG_SECTION "aggressive" "$aggressive"
|
||||
uci_set "ipsec" $CONFIG_SECTION "ikelifetime" "$ikelifetime"
|
||||
uci_set "ipsec" $CONFIG_SECTION "lifetime" "$lifetime"
|
||||
[ -n "$dpdaction" ] && {
|
||||
uci_set "ipsec" $CONFIG_SECTION "_dpd" "1"
|
||||
uci_set "ipsec" $CONFIG_SECTION "dpdaction" "$dpdaction"
|
||||
uci_set "ipsec" $CONFIG_SECTION "dpddelay" "$dpddelay"
|
||||
}
|
||||
uci_set "ipsec" $CONFIG_SECTION "crypto_proposal" "${name}_ph2"
|
||||
uci_set "ipsec" $CONFIG_SECTION "leftprotoport" "$leftprotoport"
|
||||
uci_set "ipsec" $CONFIG_SECTION "rightprotoport" "$rightprotoport"
|
||||
uci_set "ipsec" $CONFIG_SECTION "lifetime" "$keylife"
|
||||
uci_set "ipsec" $CONFIG_SECTION "forceencaps" "$forceencaps"
|
||||
|
||||
uci_add "ipsec" "remote" "${name}"
|
||||
uci_set "ipsec" $CONFIG_SECTION "enabled" "$enabled"
|
||||
uci_set "ipsec" $CONFIG_SECTION "gateway" "$right"
|
||||
uci_set "ipsec" $CONFIG_SECTION "remote_identifier" "%any"
|
||||
uci_set "ipsec" $CONFIG_SECTION "authentication_method" "psk"
|
||||
uci_set "ipsec" $CONFIG_SECTION "pre_shared_key" "$psk_key"
|
||||
uci_set "ipsec" $CONFIG_SECTION "local_identifier" "$my_identifier"
|
||||
uci_set "ipsec" $CONFIG_SECTION "crypto_proposal" "${name}_ph1"
|
||||
|
||||
[ "$ipsec_type" = "tunnel" ] && uci -q add_list "ipsec"."${CONFIG_SECTION}"."tunnel"="${name}_c"
|
||||
[ "$ipsec_type" = "transport" ] && uci -q add_list "ipsec"."${CONFIG_SECTION}"."transport"="${name}_c"
|
||||
|
||||
uci_commit "ipsec"
|
||||
}
|
||||
|
||||
config_load 'strongswan'
|
||||
config_foreach move_config 'conn'
|
||||
|
||||
[ "$ENABLED" = 1 ] && {
|
||||
uci_add firewall rule
|
||||
uci_set firewall "$CONFIG_SECTION" src 'wan'
|
||||
uci_set firewall "$CONFIG_SECTION" name 'Allow-IPsec-ESP'
|
||||
uci_set firewall "$CONFIG_SECTION" target 'ACCEPT'
|
||||
uci_set firewall "$CONFIG_SECTION" vpn_type 'IPsec'
|
||||
uci_set firewall "$CONFIG_SECTION" proto 'esp'
|
||||
|
||||
uci_add firewall rule
|
||||
uci_set firewall "$CONFIG_SECTION" dest_port '4500'
|
||||
uci_set firewall "$CONFIG_SECTION" src 'wan'
|
||||
uci_set firewall "$CONFIG_SECTION" name 'Allow-IPsec-NAT-T'
|
||||
uci_set firewall "$CONFIG_SECTION" target 'ACCEPT'
|
||||
uci_set firewall "$CONFIG_SECTION" vpn_type 'IPsec'
|
||||
uci_set firewall "$CONFIG_SECTION" proto 'udp'
|
||||
|
||||
uci_add firewall rule
|
||||
uci_set firewall "$CONFIG_SECTION" dest_port '500'
|
||||
uci_set firewall "$CONFIG_SECTION" src 'wan'
|
||||
uci_set firewall "$CONFIG_SECTION" name 'Allow-IPsec-IKE'
|
||||
uci_set firewall "$CONFIG_SECTION" target 'ACCEPT'
|
||||
uci_set firewall "$CONFIG_SECTION" vpn_type 'IPsec'
|
||||
uci_set firewall "$CONFIG_SECTION" proto 'udp'
|
||||
|
||||
uci_add firewall rule
|
||||
uci_set firewall "$CONFIG_SECTION" src 'wan'
|
||||
uci_set firewall "$CONFIG_SECTION" name 'Allow-IPsec-Forward'
|
||||
uci_set firewall "$CONFIG_SECTION" extra '-m policy --dir in --pol ipsec'
|
||||
uci_set firewall "$CONFIG_SECTION" target 'ACCEPT'
|
||||
uci_set firewall "$CONFIG_SECTION" vpn_type 'IPsec'
|
||||
uci_set firewall "$CONFIG_SECTION" dest '*'
|
||||
uci_set firewall "$CONFIG_SECTION" proto 'all'
|
||||
|
||||
uci_add firewall redirect
|
||||
uci_set firewall "$CONFIG_SECTION" proto any
|
||||
uci_set firewall "$CONFIG_SECTION" name Exclude-IPsec-from-NAT
|
||||
uci_set firewall "$CONFIG_SECTION" extra '-m policy --dir out --pol ipsec'
|
||||
uci_set firewall "$CONFIG_SECTION" vpn_type IPsec
|
||||
uci_set firewall "$CONFIG_SECTION" target ACCEPT
|
||||
uci_set firewall "$CONFIG_SECTION" dest wan
|
||||
uci_set firewall "$CONFIG_SECTION" enabled 1
|
||||
|
||||
uci_commit firewall
|
||||
}
|
||||
|
||||
rm -f /etc/config/strongswan
|
||||
|
||||
exit 0
|
|
@ -1,82 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
#this script move configuration from 1.x firmware
|
||||
#it should rename some sections and add option disabled to network config
|
||||
|
||||
move_config() {
|
||||
local section="$1"
|
||||
local file="$2"
|
||||
|
||||
config_get_bool enabled "$1" "enabled" "0"
|
||||
config_get _name "$1" "_name"
|
||||
config_get _type "$1" "_type"
|
||||
[ -z "$_type" ] && config_get _type "$1" "type"
|
||||
[ "$enabled" -eq 1 ] && [ "$_type" = "client" ] && {
|
||||
uci set network."$1".auto=1
|
||||
uci_commit "${config}"
|
||||
}
|
||||
[ "${_type}_${_name}" = "$section" ] && return
|
||||
uci_rename "$file" "$section" "${_type:+${_type}_}${_name}"
|
||||
uci_commit "${config}"
|
||||
}
|
||||
|
||||
move_network() {
|
||||
local section="$1"
|
||||
local net_proto net_name net_type net_enabled
|
||||
|
||||
config_get net_proto "$section" "proto"
|
||||
|
||||
case "$net_proto" in
|
||||
pptp|\
|
||||
l2tp)
|
||||
config_get net_name "$1" "_name"
|
||||
config_get_bool net_enabled "$1" "enabled"
|
||||
[ "client_${net_name}" = "$section" ] && return
|
||||
[ -n "$net_enabled" ] && {
|
||||
[ "$net_enabled" = "1" ] && uci_set network "$section" disabled 0 || uci_set network "$section" disabled 1
|
||||
uci_remove network "$section" enabled
|
||||
}
|
||||
uci_rename network "$section" "${net_type:+${net_type}_}${net_name}"
|
||||
uci_commit network
|
||||
|
||||
;;
|
||||
sstp)
|
||||
config_get_bool net_enabled "$1" "enabled"
|
||||
[ -z "$net_enabled" ] && return
|
||||
[ "$net_enabled" = "1" ] && uci_set network "$section" disabled 0 || uci_set network "$section" disabled 1
|
||||
uci_remove network "$section" enabled
|
||||
uci_commit network
|
||||
;;
|
||||
*)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# removes client configurations, because they reside in network and with vuci became unncessary
|
||||
remove_network() {
|
||||
local section="$1"
|
||||
local current_config="$2"
|
||||
local sectionType
|
||||
config_get sectionType "$1" "type"
|
||||
if [ "$sectionType" = "client" ]; then
|
||||
uci_remove "$current_config" "$section"
|
||||
uci_commit "$current_config"
|
||||
fi
|
||||
}
|
||||
|
||||
configs="pptpd xl2tpd"
|
||||
|
||||
for config in $configs; do
|
||||
[ -s /etc/config/${config} ] || continue
|
||||
config_load "$config"
|
||||
config_foreach move_config "service" "$config"
|
||||
config_foreach remove_network "service" "$config"
|
||||
done
|
||||
|
||||
[ -s /etc/config/network ] || exit 0
|
||||
config_load "network"
|
||||
config_foreach move_network "interface"
|
||||
|
||||
exit 0
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
do_stm32_autoflash() {
|
||||
# launch STM32 flash utility
|
||||
[ -e "/sys/r2ec/reset" -a -f /usr/bin/autoflash ] && {
|
||||
/usr/bin/autoflash
|
||||
}
|
||||
}
|
||||
|
||||
[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_stm32_autoflash
|
|
@ -1,21 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
# Copyright (C) 2010 Vertical Communications
|
||||
|
||||
do_check_version() {
|
||||
version="$(uci -q get system.@system[0].device_fw_version)"
|
||||
[ -z "$version" ] && {
|
||||
return 0
|
||||
}
|
||||
|
||||
numeric_version="${version##*_}"
|
||||
client_removed="${numeric_version#*.}"
|
||||
major="${client_removed%%.*}"
|
||||
|
||||
[ -f /sysupgrade.tgz ] && [ -n "$major" ] && [ "$major" -lt 2 ] && {
|
||||
echo "- migration work -"
|
||||
cp /rom/etc/inittab /etc/inittab
|
||||
}
|
||||
}
|
||||
|
||||
[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_check_version
|
Loading…
Add table
Add a link
Reference in a new issue