|
Embedded Linux Primer: A Practical, Real-World ApproachOf course, it should be noted that without any support for libc and other system libraries, you would face a formidable task implementing your applications. You would have to provide support for all the usual system calls and other library functions that a typical C program relies on. Alternatively, you could statically link your applications against the libraries it depends on, but if you have more than a couple applications using this method, your applications will likely exceed the combined size of linking dynamically and having the shared libraries on your target. 11.3.2. Example rcS Initialization Script Before BusyBox spawns an interactive shell, it tries to execute commands from a script called /etc/init.d/rcS, as shown in Listing 11-7. It is here where your applications come to life in a BusyBox system. A simple rcS initialization script is provided in Listing 11-8. Listing 11-8. Simple rcS BusyBox Startup Script #!/bin/sh echo "Mounting proc" mount -t proc /proc /proc echo "Starting system loggers" syslogd klogd echo "Configuring loopback interface" ifconfig lo 127.0.0.1 echo "Starting inetd" xinetd # start a shell busybox sh This simple script is mostly self-explanatory ...» | Код для вставки книги в блог HTML
phpBB
текст
|
|