Prerequisites:
My busybox version is 1.5.0
1. How do I set the time zone?
Set the environment variable tz.
Note the following:
(1) If you want to set the time zone to GMT (CST), you can set TZ to UTC-8 (not including double quotation marks ). UTC-8 indicates that "the local time after-8 is UTC" instead of "the UTC time after-8 is equal to the local time ". According to Info tzset.
(2) If the program is started in the respawn mode in the/etc/inittab, the setting of TZ in the/etc/profile does not work for the program. My solution is to use the code to set the time zone at the beginning of the program and call the setenv function. Info setenv for more help information.
2. busybox/etc/inittab
Format
<ID >:< runlevels >:< action >:< process>
Valid actions include
sysinit,
respawn,
askfirst,
wait,
once,
restart,
ctrlaltdel,
and shutdown.
Execution sequence
Sysinit: init waits for all such processes to complete.
Wait: init waits for the process to complete.
Once: init does not wait for its completion.
Respawn: it is automatically re-run when the process exits.
All actions are executed in the order they appear in the inittab file.
3. How can I enable/disable the core dump function?
Enable: two conditions are required.
During compilation, use make menuconfig to enable config_feature_init_coredumps under the init option.
Create an empty file named. init_enable_core in the root directory of the root file system: Touch/. init_enable_core.
It takes effect after the system is restarted.
Disable the delete/. init_enable_core file.
It takes effect after the system is restarted.
4. pthread_create failed. What is the reason for cannot allocate memory?
This is because the memory is insufficient. We recommend that you use the strace tool to track such issues.
Busybox's default process stack space is 8 Mb. From the perspective of embedded applications, such a large process stack space is too large. In a memory-tight system, it is easy to cause thread creation failure.
The modification method is as follows:
(1) run the ulimit command to adjust the stack space of the process before executing the main process:
Ulimit-S <stack space, in KB>
(2) directly modify the init. c file of busybox. Refer to Info getrlimit Or info setrlimit.
5. Why does Mount-t nfs fail?
Make sure that NFS support is enabled in the mout option.
Location: │
│-> Linux system utilities │
│-> Mount (Mount [= y])
[*] Support mounting NFS file systems