Add a dummy vendor menu entry on the main welcome menu. Vendors can override
this in their local.lua file to create whatever sub-menu they need for their
products.
Details
Details
- Reviewers
kevans - Group Reviewers
manpages - Commits
- rGe7ccd5b4187d: loader: create a generic vendor sub-menu place holder
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 38234 Build 35123: arc lint + arc unit
Event Timeline
stand/lua/menu.lua.8 | ||
---|---|---|
204 | Kyle pointed out in email something that makes me want to retract this entire paragraph. |
Comment Actions
+1 in advance for the idea of creating a vendor entry and changing the example to just reference using the vendor entry. I'll likely come back through after and add an example of modifying a submenu or something (e.g., adding another boot option) just to have one of those covered.
Comment Actions
Actually, you can go ahead and tack this on there after the vendor example; I suspect the vendor example will be more useful to folks and the below is just for informational purposes.
local color = require('color') local core = require('core') local menu = require('menu') -- This is a silly example that rotates local_option through the values -- 0 to 4. local_option would still need to be used elsewhere. local local_option = 0 -- The `entries` of a menu may either be a table or a function. In this -- example we're augmenting a menu that just has a static table, but if we -- wanted to be more robust then we would need to instead check the type -- of `stock_options` here to determine our next move. -- -- If `entries` is a table, then the stock menu system won't be changing it -- so we can just add our menu option as we do below. -- -- If `entries` is a function, then we would need to provide a new function to -- replace `entries` that does a core.deepCopyTable() of the result and adds -- the below item to it. The deep copy is necessary to avoid duplicating our -- new menu item and allowing the menu to alter its behavior however it pleases. local stock_options = menu.boot_options.entries stock_options[#stock_options + 1] = { entry_type = core.MENU_ENTRY, name = function() return color.highlight('L') .. "ocal Option : " .. local_option end, func = function() local_option = (local_option + 1) % 5 end, alias= {"l", "L"} }
Comment Actions
Update with the suggestions from Kyle.
I didn't do the rename / redirect thing you suggested in email, though... should I?