summaryrefslogtreecommitdiff
path: root/usr/src/boot
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2022-11-02 12:36:15 +0200
committerToomas Soome <tsoome@me.com>2022-11-08 15:44:39 +0200
commitab4969f8ab0fdee71bced8aced6cd4db6cbed1ca (patch)
tree01a203dc2efcc754da772057c613c68ef929d459 /usr/src/boot
parentd56b5f9f1e06794379c22afb6e6ba0ac704e4214 (diff)
downloadillumos-gate-ab4969f8ab0fdee71bced8aced6cd4db6cbed1ca.tar.gz
15139 loader: avoid duplicate load for environment and console-font
Reviewed by: Andy Stormont <andyjstormont@gmail.com> Reviewed-by: Igor Kozhukhov <igor@dilos.org> Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Diffstat (limited to 'usr/src/boot')
-rw-r--r--usr/src/boot/Makefile.version2
-rw-r--r--usr/src/boot/common/module.c14
2 files changed, 13 insertions, 3 deletions
diff --git a/usr/src/boot/Makefile.version b/usr/src/boot/Makefile.version
index 67ca14987c..05c0684bc6 100644
--- a/usr/src/boot/Makefile.version
+++ b/usr/src/boot/Makefile.version
@@ -34,4 +34,4 @@ LOADER_VERSION = 1.1
# Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes.
# The version is processed from left to right, the version number can only
# be increased.
-BOOT_VERSION = $(LOADER_VERSION)-2022.09.04.1
+BOOT_VERSION = $(LOADER_VERSION)-2022.11.02.1
diff --git a/usr/src/boot/common/module.c b/usr/src/boot/common/module.c
index 481c07eb58..df4a2d0744 100644
--- a/usr/src/boot/common/module.c
+++ b/usr/src/boot/common/module.c
@@ -458,12 +458,17 @@ build_environment_module(void)
vm_offset_t laddr;
/* We can't load first */
- if ((file_findfile(NULL, NULL)) == NULL) {
+ if (file_findfile(NULL, NULL) == NULL) {
printf("Can not load environment module: %s\n",
"the kernel is not loaded");
return;
}
+ if (file_findfile(name, name) != NULL) {
+ printf("warning: '%s' is already loaded\n", name);
+ return;
+ }
+
tem_save_state(); /* Ask tem to save it's state in env. */
size = env_get_size();
@@ -522,12 +527,17 @@ build_font_module(void)
return;
/* We can't load first */
- if ((file_findfile(NULL, NULL)) == NULL) {
+ if (file_findfile(NULL, NULL) == NULL) {
printf("Can not load font module: %s\n",
"the kernel is not loaded");
return;
}
+ if (file_findfile(name, name) != NULL) {
+ printf("warning: '%s' is already loaded\n", name);
+ return;
+ }
+
/* helper pointers */
bd = NULL;
STAILQ_FOREACH(fl, &fonts, font_next) {