grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How one is supposed to write kind-of-library cfg files?


From: adrian15
Subject: Re: How one is supposed to write kind-of-library cfg files?
Date: Sun, 16 Mar 2014 05:21:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.3.0

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/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]