- incomplete
The /etc/init.d/tc-functions script consists of almost 400 lines of code. It contains numerous functions and is utilized heavily by both Tiny Core and dCore. This review references older tc-functions source code, which has likely received updates since the review.
start out with various variables for colors and, notably, “CMDLINE” for the full boot stanza
set aliases to the Busybox commands (as opposed to possibly installed extensions providing the same commands)
return the argument
do what the name says (returns 1 or 0)
ditto
test if a boot code is set (returns 1 or 0). If the code is associated with a value (e.g. “waitusb=5”) then the value is echoed
(?!) something similar with the boot stanza replaced by a second argument
test if a boot parameter is set
(?!) echo the basename with some chosable number of fields
check if a partition is mounted. Sets variables BASENAME, FIELDS, INFO.
check if a device is mounted. The argument maybe of the form “nfs”, “UUID=…”, “LABEL=…”, “/dev/tcvd” (a virtual disk, cf. the respective boot-code). Sets variables MOUNTPOINT, MOUNTED.
check if any physical partition contains the specified file (or directory) in it root. The type of file is specified by a second argument whose syntax is taken from the test command (shell built-in); so “d” for directory, “f” for a regular file etc. Calls '/usr/bin/autoscan-devices'.
first define 'readpassword()' which does what it says until the password is between 8 and 56 characters long. That is applied until the password has been re-typed correctly. Sets variables PASSWD.
depending on the value of “$?” (return value of calling process ?!) print either [OK] or [Failed] in suitable colors to the console
print a sequence of dots over the width of the console screen, indicating a waiting period
check it is called with root privileges; exit with error otherwise
check it is called not with root privileges; exit with error otherwise
check if an X desktop is available
make sure there is a user home directory with sub-directories '.X.d/' and '.local/bin/' and minimal structure taken from '/etc/skel/'. Group ownership is “staff”.
(?!)
(?!)
(?!)
(?!) should probably do what it says (I failed AWK-class!)
echoes architecture (one of “armv6”, “armv7”, “x86”, “x86_64”)
sets variable MIRROR according to build (cf. above) to something like “http://repo.tinycorelinux.net/dCore/x86”
checks if an extension is installed
(?!) does what it says, returns some device under '/dev/input/'
(?!) probably returns the desired process ID
(?!) probably returns the desired process ID
(?!) uses '.desktop'-files, sets variable FREEDESKTOP.
> Return to the dCore wiki welcome page