diff options
author | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2016-05-04 15:06:45 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2016-05-24 11:08:15 +1000 |
commit | ed8a3ad086e56fa40c72c531b3f563e35a7c0753 (patch) | |
tree | 1010710412f4fb46e0dd278e1d98f8dd358e1c13 /ui/ncurses/nc-menu.c | |
parent | 27863350496534c1bdd6a2d48661f8973aed0945 (diff) | |
download | petitboot-ed8a3ad086e56fa40c72c531b3f563e35a7c0753.zip petitboot-ed8a3ad086e56fa40c72c531b3f563e35a7c0753.tar.gz |
Extend the "add url" function to allow file:// URLs
This allows URLs of the form file:///path/to/local/file.conf to be used
in nc-add-url, in order to access configuration files relative
to the root directory. This is primarily a debugging tool aimed at
developers rather than an expected use case.
The DEVICE_TYPE_ANY enum is used in this case to represent that a
resulting boot option is not associated with any device in the
traditional sense, and in the UI is represented as a "Custom Local
Option".
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'ui/ncurses/nc-menu.c')
-rw-r--r-- | ui/ncurses/nc-menu.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/ncurses/nc-menu.c b/ui/ncurses/nc-menu.c index dda7626..723d348 100644 --- a/ui/ncurses/nc-menu.c +++ b/ui/ncurses/nc-menu.c @@ -285,6 +285,12 @@ struct pmenu_item *pmenu_find_device(struct pmenu *menu, struct device *dev, _("Network"), intf->name, hwaddr); } break; + case DEVICE_TYPE_ANY: + /* This is an option found from a file:// url, not associated + * with any device */ + snprintf(buf, sizeof(buf), "[Custom Local Options]"); + matched = true; + break; default: /* Assume the device may be able to boot */ |