mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-03-03 15:30:27 +00:00
构建版本1
This commit is contained in:
21
Kernel.cs
21
Kernel.cs
@@ -43,6 +43,9 @@ namespace CMLeonOS
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.GitCommit.txt")]
|
||||
public static readonly byte[] gitCommitFile;
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.BuildTime.txt")]
|
||||
public static readonly byte[] buildTimeFile;
|
||||
|
||||
public static void ShowError(string message)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
@@ -142,6 +145,24 @@ namespace CMLeonOS
|
||||
_logger.Warning("Kernel", "Git Commit file not found, using 'unknown'");
|
||||
}
|
||||
|
||||
// 读取 Build Time
|
||||
if (buildTimeFile != null && buildTimeFile.Length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
string buildTime = System.Text.Encoding.UTF8.GetString(buildTimeFile);
|
||||
_logger.Info("Kernel", $"Build Time: {buildTime}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logger.Warning("Kernel", "Failed to read Build Time");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Warning("Kernel", "Build Time file not found");
|
||||
}
|
||||
|
||||
// 检查env.dat文件是否存在,如果不存在则创建并设置Test环境变量
|
||||
string envFilePath = @"0:\system\env.dat";
|
||||
if (!System.IO.File.Exists(envFilePath))
|
||||
|
||||
Reference in New Issue
Block a user