Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Advanced menu and advanced string parsing in iso image?
2018-01-04, 23:22
Post: #4
RE: Advanced menu and advanced string parsing in iso image?
when you change a value that is set immediately, so to have save/cancel options you would have to have temporary variables, I see 2 alternatives here:
1. set temp vars, modify temp vars, when save is pressed copy the temp vars to the real values (and possibly cleanup to save memory)
2. set temp vars, modify real values, if canceled restore the real values from the temp vars. (and possibly cleanup to save memory)
I would go with 1. since that is the more safe approach.
You might be able to make use of the settings hierarchy that iPXE supports to do this in smart ways.

and it seems you might even be able to use the hierarchy to limit the configuration menu to what it should display values from (but it seems a bit buggy)

Code:
set myconfig/ip:ipv4 ${ip:ipv4}
set myconfig/netmask:ipv4 ${netmask:ipv4}
set myconfig/hostname ${hostname}
set myconfig/gateway:ipv4 ${gateway:ipv4}
config myconfig

there is also the login command which gives input fields as well.
I think what you want to do should be possible, but will need some specifications before being implemented, here is my take:
  • There needs to be a item --prompt to provide for editing settings
  • I also think there should be some kind of way of setting help text on items, or even settings, so at least something like item --helptext
  • You also wanted some kind of buttons, which will take a bit more work, but as a first step maybe it can be implemented like the ctrl-d and ctrl-x at the bottom of the screen. (further on maybe this can be extended to be buttons which you can switch between with left and right arrow keys)
Do you think that would cover your use-case?
(please don't misunderstand, I'm not going to be implement this so no promises on if/when or even how)

Just as a prof of concept you could try and use config, and even change the code in setting_ui.c to disable so it only shows the settings that you want it to show (that destroys the config command but might be ok as a test)

@mcb30 if you are reading this, it seems that config limits it scopes such as in builtin and smbios and netX/dhcp,
however in netX, or myconfig, for example unixtime shows up as well (but without any value) which makes those levels very long to go thru.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Advanced menu and advanced string parsing in iso image? - NiKiZe - 2018-01-04 23:22



User(s) browsing this thread: 1 Guest(s)