On Fri, 17 Dec 2010 20:47:47 +0100 MRK <[email protected]> wrote: > 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.
Are you sure you're loading diag.sh in a function called when the hook functions are executed, and not bare in the file, so that it is attempted during the sourcing of the file? That is these files are processed in two steps: source all files in /lib/preinit ...This defines functions defined in the files AND executes anything not in a function loop through the hooks, executing functions in the order that were added with boot_hook_add in step 1. Regards, Daniel > > > Am 05.12.2010 um 05:24 schrieb Daniel Dickinson: > > > On Sun, 28 Nov 2010 09:12:35 +0100 > > Michael Kämmerer <[email protected]> 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
signature.asc
Description: PGP signature
_______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
