From 5c105d9f3fd086aff195d3849dcf847d6b0bd927 Mon Sep 17 00:00:00 2001 From: blogic Date: Fri, 5 Oct 2012 10:12:53 +0000 Subject: branch Attitude Adjustment git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@33625 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../files/lib/preinit/10_indicate_preinit | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 package/base-files/files/lib/preinit/10_indicate_preinit (limited to 'package/base-files/files/lib/preinit/10_indicate_preinit') diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit new file mode 100644 index 000000000..ab6930518 --- /dev/null +++ b/package/base-files/files/lib/preinit/10_indicate_preinit @@ -0,0 +1,52 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2010 Vertical Communications + +preinit_ip() { + # if the preinit interface isn't specified and ifname is set in + # preinit.arch use that interface + if [ -z "$pi_ifname" ]; then + pi_ifname=$ifname + fi + + [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { + ifconfig $pi_ifname $pi_ip netmask $pi_netmask broadcast $pi_broadcast up + } +} + +preinit_ip_deconfig() { + [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { + ifconfig $pi_ifname 0.0.0.0 down + } +} + +preinit_net_echo() { + [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { + { + [ "$pi_preinit_net_messages" = "y" ] || { + [ "$pi_failsafe_net_message" = "true" ] && + [ "$pi_preinit_no_failsafe_netmsg" != "y" ] + } + + } && netmsg $pi_broadcast "$1" + } +} + +preinit_echo() { + preinit_net_echo $1 + echo $1 +} + +pi_indicate_led() { + set_state preinit +} + +pi_indicate_preinit() { + echo "- preinit -" + preinit_net_echo "Doing OpenWRT Preinit\n" + pi_indicate_led +} + +boot_hook_add preinit_main preinit_ip +boot_hook_add preinit_main pi_indicate_preinit + -- cgit v1.2.3