Thank You, I did not realized, that there is a split between preinit_essentials 
and preinint_main.

Nevertheless, although diag.sh is called though preinit_main,
it *is* faster then the regular procfs mount via preinit_essentails.

By now, I mount procfs for myself in diag.sh, but this should not be the 
solution.


Am 05.12.2010 um 05:24 schrieb Daniel Dickinson:

> On Sun, 28 Nov 2010 09:12:35 +0100
> Michael Kämmerer <m...@h3c.de> wrote:
> 
>> I'm trying to realize a "diag.sh" file for signaling the router state
>> via led flashing.
>> 
>> My problem is, that when I try to read out the file "/proc/cpuinfo",
>> I get an error on serial console, that there is no file cpuinfo.
> 
> You need to do it via a file in lib/preinit that happens during hook
> preinit_main, and in a function that is called by the hook, not when
> sourced.  This is because when the files are source /proc doesn't exist
> yet.
> 
>> 
>> A look in base-files - lib/preinit shows:
>> 
>>      10_check_for_mtd 
>>      10_essential_fs
>>      10_indicate_failsafe
>>      10_indicate_preinit
>> 
>> that "10_essential_fs", which is mounting proc 
>> and "10_indicate_preinit" have the same numbering and in my case, they
>> are executed in the wrong order.
> 
> These don't actually happen all at the same time.  They happen at point
> *for the hook they are part of*.  If you look at the bottom of the file
> you can see the hook they are added to.  You will see that some are
> part of preinit_essential, which happen before anything in
> preinit_main.  See /etc/preinit to see the overall controlling script.
> 
> There is some information at
> http://wiki.openwrt.org/doc/techref/preinit_mount that might help you.
> -- 
> <erno> hm. I've lost a machine.. literally _lost_. it responds to ping, 
> it works completely, I just can't figure out where in my apartment it
> is. GnuPG Key Fingerprint 86 F5 81 A5 D4 2E 1F 1C      http://gnupg.org
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to