TFTP sub directories not being created


  • Developer

    Upgrading to the latest (6901) I noticed that the two sub dirs ‘efi-i386’ and ‘pxelinux.cfg’ won’t be created in /tftpboot when running the installer because of a screwed check. And even if the check was alright still ‘pxelinux.cfg’ would not be created properly because the awk foo removed the ‘.cfg’ and I ended up with ‘/tftpboot/pxelinux/’… here is a patch proposal (only tested on debian so far):

    diff --git a/lib/common/functions.sh b/lib/common/functions.sh
    index f44598f..313ff6a 100755
    --- a/lib/common/functions.sh
    +++ b/lib/common/functions.sh
    @@ -443,9 +443,8 @@ configureTFTPandPXE() {
         [[ -d $tftpdirdst && ! -d ${tftpdirdst}.prev ]] && mkdir -p ${tftpdirdst}.prev >>$workingdir/error_logs/fog_error_${version}.log 2>&1
         [[ -d ${tftpdirdst}.prev ]] && cp -Rf $tftpdirdst/* ${tftpdirdst}.prev/ >>$workingdir/error_logs/fog_error_${version}.log 2>&1
         cd $tftpdirsrc
    -    tftpdirs=$(find ! -path . ! -path .. -type d | awk -F[./] '{print $3}')
    -    for tftpdir in $tftpdirs; do
    -        [[ ! -d $tftpdir ]] && mkdir -p $tftpdirdst/$tftpdir >>$workingdir/error_logs/fog_error_${version}.log 2>&1
    +    for tftpdir in $(ls -d */); do
    +        [[ ! -d $tftpdirdst/$tftpdir ]] && mkdir -p $tftpdirdst/$tftpdir >>$workingdir/error_logs/fog_error_${version}.log 2>&1
         done
         local findoptions=""
         [[ $notpxedefaultfile == true ]] && findoptions="! -name default"
    

  • Senior Developer

    I was able to confirm the issue of the sub directories not being created and after making the proposed suggestions the installer did indeed create the pxelinux.cfg and i386-efi folders. This issue was present on both Ubuntu and Fedora.

    I’m marking this as solved.


  • Senior Developer

    Edited as suggested.


Log in to reply
 

459
Online

38715
Users

10544
Topics

99817
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.