Bloggers are now doing the development of a platform for a Realtek SDK. For some needs, add/usr/local/bin to the PATH environment variable.
The embedded Linux file system does not have/etc/profile similar files, only/etc/rcs. Bo Master found in the/etc/rcs add ' path= $PATH:/usr/local/bin ' did not make it in the serial terminal to take effect.
Bo Master Reasoning, why the system default PATH is: '/bin:/sbin/:/usr/bin '? Where did you specify that?
Bloggers finally found the BusyBox in the original. Because the init command called after the embedded Linux system is started is actually a subcommand in busybox.
In the init command, the system is initialized. The PATH environment variable is included.
In BUSYBOX/LIBBB/MESSAGES.C, there are the following:
As you can see, if we want to add another path, we should change the Bb_additional_path macro.
And this macro is defined in Busybox/include/platform.h:
This seems to be just for Android platforms.
If the ' Bb_additional_path ' is not defined above, it is defined by default in BUSYBOX/LIBBB/MESSAGES.C, but is empty by default.
Let's change it here:
So, after the system starts, the value of path is: "/sbin:/usr/sbin/:/bin:/usr/bin:/usr/local/bin".
Embedded Linux Setup Path