Technical data
8. Documentation for Developers
• the variable is active (if it depends on an OPT it has to be set to “yes”),
• the variable was referenced in an opt/<PACKAGE>.txt-file and
• whether a file was copied dependant on the current value.
copy_pending will return “true” if it detects that during the last step no file was copied,
the copy process hence still is “pending”.
A small example of the use of all these functions can be found in check/base.ext:
foreach i in net_drv_%
do
if (copy_pending("%i"))
then
error "No network driver found for %i='$i', check config/base.txt"
fi
done
Alle elements of the array NET_DRV_% are detected for which no copy action has been done
because there is no corresponding entry existing in opt/base.txt.
Comparison of Network Addresses: samenet und subnet
For testing routes from time to time a test is needed whether two networks are identical or if
one is a subnet of the other. The two functions samenet and subnet are of help here.
samenet (netz1, netz2)
returns “true” if both nets are identical and
subnet (net1, net2)
returns “true” if “net1” is a subnet of “net2”.
Expanding the Kernel Command Line
If an OPT must pass other boot parameters to the kernel, in former times the variable
KERNEL_BOOT_OPTION had to be checked whether the required parameter was included, and
if necessary, a warning or error message had to be displayed. With the internal variable
KERNEL_BOOT_OPTION_EXT you may add a necessary but missing option directly in an ext-script.
An Example taken from check/base.ext:
if (powermanagement =~ "apm.*|none")
then
if ( ! kernel_boot_option =~ "acpi=off")
then
set kernel_boot_option_ext="${kernel_boot_option_ext} acpi=off"
fi
fi
This passes “acpi=off” to the kernel if no or “APM”-type power management is desired.
313










