The scripts controlling the booting procedure were previously quite difficult to read and understand.
In addition, some routines were repetitive and the algorithms they represented quite confusing depending on the context.
Another limitation that this pull-request tries to lift is the ease with which brands, logos and menus can be drawn and colorized.
Prior to this new theming system being introduced, colors on logos, brands etc... had to be manually set using fixed strings that contained TERMINAL ESCAPE SEQUENCES. These control characters instruct the terminal on where and how to display colors. The new system reduces the mechanical aspect of the colorization by introducing
a set of libraries that take care of the colorization automatically. With this new system in place the bootloader menu composed of three main
sections ('the brand', 'the menu' and 'the logo' sections) can be completely or partially themed/colorized. Each section has a separate
bootloader variable that allows its independent manipulation/control.
The new bootloader variables introduced are:
- loader_menu_theme : controls the colorization ability of the menu
- loader_brand_theme : controls the colorization ability of the brand
- loader_logo_theme : controls the colorization ability of the logo
On top of these important variables, the scripts responsible for the display have been extended and certain parts rewritten to accommodate this theming system.The library now makes it very easy to add and remove logos, brands etc...
Work is in progress to theme the terminal after the operating system has successfully booted to provide a complete environment. The same concept applies but within the operating system we have a lot more control so interesting ideas are being explored.
Some but not all the benefits that these features aim to provide are:
- Good utilization of your terminal capabilities. One benefit of the theming system is that it tries to make good utilization of your terminal capabilities.
- Flexibility in the color code system. This feature also has the purpose to help the administrator visually separate, represent and identify environments, localities, regions, system functions (QA, Test, Production environment).
- Environments separation, representation and identification through a flexible color code system ( theming system )
Note:
This change extends the commit represented by this hash ( 546f18f3dadc ). One new feature that needs both attention and discussion is the place where the loader looks for scripts and the naming convention used in the process. For the naming convention, The old method was to look for file names that started with either 'logo-' or 'brand-'. The commit mentioned above added modifications that changed the naming convention to 'gfx-' for both logos and brands. One of the disadvantages of this naming convention arises when there are several brands and/or logos; for this test about 20 'gfx-files' were used. When there are this many files, as a developer, it becomes quite difficult to work with these files because you have to remember them by name and mentally match the name to the content (logo or brand). When coding, this convention makes tracing and debugging a bit tedious; error messages are a little to generic. So to solve the problem, at least for developers, this commit re-implements the old naming convention in a completely new way so as to make both naming conventions compatible. Now file names can be prefixed with either 'logo-','brand-' or 'gfx-' without an issue. In addition, another functionality that this commit includes is the ability to go through a list of predefined directories in search for potential loader script files.
The current convention keeps all the script files in /boot/lua. To help extend the convention keep the tree a bit organized, two sub-directories (/boot/lua/logo/ and /boot/lua/brand) were added and the new functionality now looks in these three directories for bootloader scripts by convention.
A final point of discussion is the rewording of the menu. This commit tries to help clarify some of the menu options by adding few words that help in that sense.