2 # Copyright (C) 2006 OpenWrt.org
3 # Copyright (C) 2010 Vertical Communications
6 # if the preinit interface isn't specified and ifname is set in
7 # preinit.arch use that interface
8 if [ -z "$pi_ifname" ]; then
12 [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc
/net
/dev
>/dev
/null
&& {
13 ifconfig
$pi_ifname $pi_ip netmask
$pi_netmask broadcast
$pi_broadcast up
17 preinit_ip_deconfig
() {
18 [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc
/net
/dev
>/dev
/null
&& {
19 ifconfig
$pi_ifname 0.0.0.0 down
24 [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc
/net
/dev
>/dev
/null
&& {
26 [ "$pi_preinit_net_messages" = "y" ] ||
{
27 [ "$pi_failsafe_net_message" = "true" ] &&
28 [ "$pi_preinit_no_failsafe_netmsg" != "y" ]
31 } && netmsg
$pi_broadcast "$1"
44 pi_indicate_preinit
() {
46 preinit_net_echo
"Doing OpenWRT Preinit\n"
50 boot_hook_add preinit_main preinit_ip
51 boot_hook_add preinit_main pi_indicate_preinit