fix: gen_ksymtable does not work on non-English platform
authorMinep <lunaixsky@qq.com>
Sat, 27 Jul 2024 13:50:32 +0000 (14:50 +0100)
committerMinep <lunaixsky@qq.com>
Sat, 27 Jul 2024 13:50:32 +0000 (14:50 +0100)
* the grep based method to access ELF class based on readelf
  output assume the English-language output

* fix lunaconfig do not update the config tree when saving

lunaix-os/arch/LConfig
lunaix-os/kernel.mk
lunaix-os/scripts/build-tools/lcfg/common.py
lunaix-os/scripts/build-tools/luna_build.py
lunaix-os/scripts/gen_ksymtable.sh

index 22f96c0df165370c1a092dc815f2e26d6b5df6da..95403e3624847db5d0ba8e79842d2513872b05b3 100644 (file)
@@ -13,7 +13,7 @@ def architecture_support():
         default("i386")
 
         env_val = env("ARCH")
         default("i386")
 
         env_val = env("ARCH")
-        if env_val is not None:
+        if env_val:
             set_value(env_val)
 
     @Term
             set_value(env_val)
 
     @Term
index 69a16db136fe5d9e61c092a12c15224fb2e526bf..be10da2f40ca622209dd1ba99115de2164031de4 100644 (file)
@@ -45,7 +45,7 @@ $(tmp_kbin): $(klinking) $(ksrc_objs)
 
 $(ksymtable): $(tmp_kbin)
        $(call status_,KSYM,$@)
 
 $(ksymtable): $(tmp_kbin)
        $(call status_,KSYM,$@)
-       @scripts/gen_ksymtable.sh DdRrTtAGg $< > .lunaix_ksymtable.S
+       @ARCH=$(ARCH) scripts/gen_ksymtable.sh DdRrTtAGg $< > .lunaix_ksymtable.S
 
        @$(CC) $(CFLAGS) -c .lunaix_ksymtable.S -o $@
 
 
        @$(CC) $(CFLAGS) -c .lunaix_ksymtable.S -o $@
 
index 25e8d1bb7d5c8755d2a8f7b4b24d04df3e91ab49..383d1ecc9e737366298bfca71be8f5a8c8ad9c35 100644 (file)
@@ -114,7 +114,7 @@ class LConfigEnvironment(Renderable):
         super().__init__()
         
         self.__ws_path = path.abspath(workspace)
         super().__init__()
         
         self.__ws_path = path.abspath(workspace)
-        self.__exec_globl = globals()
+        self.__exec_globl = {}
         self.__eval_stack = []
         self.__lc_modules = []
         self.__config_val = {}
         self.__eval_stack = []
         self.__lc_modules = []
         self.__config_val = {}
index f5893c6e6cb110afd4c947cd525def1c01cac429..e3c6908672b0c148c83bc404b13ae84cae316510 100755 (executable)
@@ -97,6 +97,8 @@ def main():
             do_config(opts, lcfg_env)
         else:
             print("No configuration file detected, skipping...")
             do_config(opts, lcfg_env)
         else:
             print("No configuration file detected, skipping...")
+        
+        lcfg_env.update()
         lcfg_env.save(opts.config_save)
         lcfg_env.export()
     else:
         lcfg_env.save(opts.config_save)
         lcfg_env.export()
     else:
index 1f974bdf0ebb48c455b30160180a4a67238e064e..748678e5e09a1b82207f3273386693bcc76a7400 100755 (executable)
@@ -4,13 +4,13 @@ sym_types=$1
 bin=$2
 
 nm_out=$(nm -nfbsd "$bin")
 bin=$2
 
 nm_out=$(nm -nfbsd "$bin")
-class_info=$(readelf -h "$bin" | grep 'Class:' | awk '{print $2}')
+class_info=$(readelf -h "$bin" | grep 'Class:' | awk '{print $2}')
 
 allsyms=($nm_out)
 allsyms_len=${#allsyms[@]}
 
 dtype="4byte"
 
 allsyms=($nm_out)
 allsyms_len=${#allsyms[@]}
 
 dtype="4byte"
-if [ "$class_info" == 'ELF64' ]; then
+if [ "$ARCH" == 'x86_64' ]; then
     dtype="8byte"
 fi
 
     dtype="8byte"
 fi