boot/lib: Be a bit more resilient outside of stage-1
Mainly allows using the simulator with the error applet
# Handles lazy-loading the configuration, and giving a value for a given key.
module Configuration
def self.[](key)
- @configuration ||= JSON.parse(File.read("/etc/boot/config"));
+ @configuration ||=
+ if File.exist?("/etc/boot/config")
+ JSON.parse(File.read("/etc/boot/config"))
+ else
+ {}
+ end
@configuration[key]
end
end
