1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-23 19:57:21 +01:00

fixed #1851 "no need to check for modprobe when host OS is "dd-wrt"

and possibly other embedded Linux systems". Generated script does not
use modprobe utility when host OS is set to "DD-WRT" or "OpenWRT" and
should not try to find this utility on the system. This is also
related to the SourceForge bug 3032293
This commit is contained in:
Vadim Kurland 2010-11-16 21:08:47 -08:00
parent 450f6e5224
commit 9085201840
2 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,50 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/linux24/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
## Known variables:
##
## need_iptables_restore
## need_ip6tables_restore
## need_modprobe : set to true if "load modules" option is on, or
## script needs to manage vlan or bonding interfaces.
## See configlets for vlan and bonding interfaces to find
## how modprobe is used to load corresponding modules
## need_vconfig : set to true if script manages vlans
## need_brctl : set to true if script manages bridge ports
## need_ifenslave : set to true if script manages bonding interfaces
## need_ipset : set to true if ipset is used for run-time address tables
## load_modules : set to true if "load modules" option is on
##
## These variables are set in OSConfigurator_linux24::printShellFunctions()
find_program() {
PGM=$1
## if shell can not find the program in any of the directories listed
## in PATH it returns exit code 127
$PGM </dev/null >/dev/null 2>&1; test $? = 127 && {
echo "$PGM not found"
exit 1
}
}
check_tools() {
find_program $IPTABLES
{{if need_iptables_restore}} find_program $IPTABLES_RESTORE{{endif}}
{{if need_ip6tables_restore}} find_program $IP6TABLES_RESTORE{{endif}}
find_program $IP
{{if need_vconfig}} find_program $VCONFIG {{endif}}
{{if need_brctl}} find_program $BRCTL {{endif}}
{{if need_ifenslave}} find_program $IFENSLAVE {{endif}}
{{if need_ipset}} find_program $IPSET {{endif}}
}

View File

@ -0,0 +1,50 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/linux24/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
## Known variables:
##
## need_iptables_restore
## need_ip6tables_restore
## need_modprobe : set to true if "load modules" option is on, or
## script needs to manage vlan or bonding interfaces.
## See configlets for vlan and bonding interfaces to find
## how modprobe is used to load corresponding modules
## need_vconfig : set to true if script manages vlans
## need_brctl : set to true if script manages bridge ports
## need_ifenslave : set to true if script manages bonding interfaces
## need_ipset : set to true if ipset is used for run-time address tables
## load_modules : set to true if "load modules" option is on
##
## These variables are set in OSConfigurator_linux24::printShellFunctions()
find_program() {
PGM=$1
## if shell can not find the program in any of the directories listed
## in PATH it returns exit code 127
$PGM </dev/null >/dev/null 2>&1; test $? = 127 && {
echo "$PGM not found"
exit 1
}
}
check_tools() {
find_program $IPTABLES
{{if need_iptables_restore}} find_program $IPTABLES_RESTORE{{endif}}
{{if need_ip6tables_restore}} find_program $IP6TABLES_RESTORE{{endif}}
find_program $IP
{{if need_vconfig}} find_program $VCONFIG {{endif}}
{{if need_brctl}} find_program $BRCTL {{endif}}
{{if need_ifenslave}} find_program $IFENSLAVE {{endif}}
{{if need_ipset}} find_program $IPSET {{endif}}
}