El 16/03/14 04:49, adrian15 escribió:
( Using 2.02~beta2-7 from Debian Unstable  )

   I have tried to write some cfg files to kind of organise them as
libraries but it does not work as expected.

   It seems as the sourced cfg files are being interpreted.

I have managed to write a minimal working example. It would seem that the problem is having a function inside another function.


Is it perhaps not officially supported?

The problem happens when one selects: "This is a submenu..." .

error: syntax error
error: Incorrect command.
error: syntax error
...
can't find command thisisanunknowncommand
...
error: syntax error



Thank you.

############### caller.cfg

function process_option {

  set option_cfg="$1"
  source "${option_cfg}"
  menuentry "${option_title}" {
    source "${option_cfg}"
    run_option
  }

}

menuentry $"Languages..." {
  configfile "${prefix}/language_select.cfg"
}

submenu $"This is a submenu..." {

  process_option "${prefix}/called.cfg"

}

menuentry $"Everything" {
  configfile "${prefix}/everything.cfg"
}

################ called.cfg

set option_title=$"The called option"

function run_option {

    function freebsd_ufs_variants {
        set device=$1
        set fstype=$2
        set uuid=$3

menuentry "${finaloption_tab_str}FreeBSD ($fstype $device) (Default boot loader)" $device $uuid {
            set root=$2

            kfreebsd /boot/loader
        }
    }

  thisisanunknowncommand
  menuentry "menuinsideoption" {
    source "${prefix}/topbootmenu.cfg"
    set root="(hd0,0)"
    chainloader +1
  }

}



adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to