🎨 启动进度详情中加入版本信息

This commit is contained in:
Liang Ding 2022-08-01 09:54:10 +08:00
parent 16574e27e8
commit 1275a4bf16
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 13 additions and 8 deletions

View file

@ -110,11 +110,15 @@ func Boot() {
go cleanOld()
}
func setBootDetails(details string) {
bootDetails = "v" + Ver + " " + details
}
func SetBootDetails(details string) {
if 100 <= bootProgress {
return
}
bootDetails = details
setBootDetails(details)
}
func IncBootProgress(progress float64, details string) {
@ -122,7 +126,7 @@ func IncBootProgress(progress float64, details string) {
return
}
bootProgress += progress
bootDetails = details
setBootDetails(details)
}
func IsBooted() bool {
@ -138,7 +142,7 @@ func GetBootProgress() float64 {
}
func SetBooted() {
bootDetails = "Finishing boot..."
setBootDetails("Finishing boot...")
bootProgress = 100
logging.LogInfof("kernel booted")
}