diff options
Diffstat (limited to 'conf/tcos-generation-functions.sh')
-rw-r--r-- | conf/tcos-generation-functions.sh | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/conf/tcos-generation-functions.sh b/conf/tcos-generation-functions.sh index 7b6e7a5..a719008 100644 --- a/conf/tcos-generation-functions.sh +++ b/conf/tcos-generation-functions.sh @@ -158,13 +158,13 @@ cpifexists () { if [ -f $DESTDIR/$orig ]; then return 1 fi - - + + if [ $# != 2 ]; then echo " cpifexists(): ERROR: Need 2 arguments: \$1=$orig \$2=$dest" return 1 fi - + if [ ! -f $orig ]; then echo " cpifexits() WARNING: $orig not found, searching with pathof()..." _file=$(pathof $(basename $orig) ) @@ -177,10 +177,10 @@ cpifexists () { else echo " cpifexists(): ERROR: $(basename $orig) no found in PATH, please package that contain $orig" return 1 - fi + fi fi - + if [ ! -d $DESTDIR/$dest ]; then echo " cpifexits() WARNING: $DESTDIR/$dest don't exists" fi @@ -201,7 +201,7 @@ copydir () { #_echo " DEBUG: \$1=$1 \$2=$2" return 1 fi - + #_echo "cp -ra \"${1}\" \"${DESTDIR}/${2}\"" cp -ra "${1}" "${DESTDIR}/${2}" return 0 @@ -247,6 +247,17 @@ force_add_module() { # end of force copy } +tcos_find_module() { + mod=$(find /lib/modules/${TCOS_KERNEL} -name ${1}.ko | tail -1) + if [ "$mod" = "" ] ; then + return 1 + fi + if [ "$(basename $mod .ko)" = "$1" ]; then + return 0 + fi + return 1 +} + parse_pxelinuxcfg() { if [ $TCOS_NETBOOT_MENU ] && [ -z $2 ]; then TEMPLATE=${TCOS_CONF}/${TCOS_PXECFG_MENU} |