grub-devel
[Top][All Lists]
Advanced

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

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


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

( 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.


  Here below you will find the overall idea in an theoric example.
Attached you will find an actual code (although you are missing some pieces from Super Grub2 Disk).


When selecting the "Boot manually..." submenu (not when trying to run one of their options) I am getting these errors:

BEGIN

error: syntax error
error: Incorrect command.
error: syntax error
error: Incorrect command.
error: syntax error
error: syntax error
error: Incorrect command.
error: syntax error
error: can't find command `searchindevice'
FATAL: int13_cdrom: function 42. Can't use 64bits lba

END

searchindevice is a function which it's sourced in main.cfg so it should be detected ok.

But anyways... the run_option function is being interpreted while I do not want it !!!

I have also tried to replace source command by extract_entries_source. I get different output but the same problem, the sourced file is being interpreted (I mean it is being run).

Thank you.


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

function process_option {

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

}

process_option ${prefix}/called.cfg
process_option ${prefix}/option2.cfg

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

set option_title="My title"



function run_option {

  function aux_lib {

  }

  function aux_lib2 {

  }

  aux_lib
  aux_lib2

  do_interesting_stuff

}


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

Attachment: main.cfg
Description: Text document

Attachment: osdetect.cfg
Description: Text document


reply via email to

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