From: Daniel Dickinson Date: Thu, 7 Jul 2011 02:52:02 +0000 (+0000) Subject: base-files: preinit: Fixed sourcing of diag.sh in /etc/preinit. This caused errors... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1f69f4cf64cb9676cc8ddd6a832221a20659a4b9;p=openwrt%2Fstaging%2Frobimarko.git base-files: preinit: Fixed sourcing of diag.sh in /etc/preinit. This caused errors due to frequent use of /proc/cpuinfo to determine board name to pick led layout. Now diag.sh (which only defines set_state and any helper functions) is sourced by a proper preinit function during preinit_main, which is after /proc has been brought up, unlike in /etc/preinit SVN-Revision: 27501 --- diff --git a/package/base-files/files/etc/preinit b/package/base-files/files/etc/preinit index 9e629ab814..6c6e3b1fe1 100755 --- a/package/base-files/files/etc/preinit +++ b/package/base-files/files/etc/preinit @@ -3,7 +3,6 @@ # Copyright (C) 2010 Vertical Communications export PATH=/bin:/sbin:/usr/bin:/usr/sbin -. /etc/diag.sh pi_ifname= pi_ip=192.168.1.1 diff --git a/package/base-files/files/lib/preinit/02_default_set_state b/package/base-files/files/lib/preinit/02_default_set_state new file mode 100644 index 0000000000..df43395726 --- /dev/null +++ b/package/base-files/files/lib/preinit/02_default_set_state @@ -0,0 +1,7 @@ +#!/bin/sh + +define_default_set_state() { + . /etc/diag.sh +} + +boot_hook_add preinit_main define_default_set_state