This commit is contained in:
Tiger Wang 2022-10-13 19:33:18 -04:00
parent df0f015944
commit 8908c39969

View file

@ -11,18 +11,13 @@
package main package main
import ( import (
"strings"
interfaces "github.com/IceWhaleTech/CasaOS-Common" interfaces "github.com/IceWhaleTech/CasaOS-Common"
"github.com/IceWhaleTech/CasaOS-Common/utils/version" "github.com/IceWhaleTech/CasaOS-Common/utils/version"
"github.com/IceWhaleTech/CasaOS/pkg/config"
"github.com/IceWhaleTech/CasaOS/service"
) )
type migrationTool struct{} type migrationTool struct{}
func (u *migrationTool) IsMigrationNeeded() (bool, error) { func (u *migrationTool) IsMigrationNeeded() (bool, error) {
majorVersion, minorVersion, patchVersion, err := version.DetectLegacyVersion() majorVersion, minorVersion, patchVersion, err := version.DetectLegacyVersion()
if err != nil { if err != nil {
if err == version.ErrLegacyVersionNotFound { if err == version.ErrLegacyVersionNotFound {
@ -46,22 +41,13 @@ func (u *migrationTool) IsMigrationNeeded() (bool, error) {
_logger.Info("Migration is needed for a CasaOS version 0.3.5 and older...") _logger.Info("Migration is needed for a CasaOS version 0.3.5 and older...")
return true, nil return true, nil
} }
func (u *migrationTool) PreMigrate() error { func (u *migrationTool) PreMigrate() error {
return nil return nil
} }
func (u *migrationTool) Migrate() error { func (u *migrationTool) Migrate() error {
if service.MyService.System().GetSysInfo().KernelArch == "aarch64" && config.ServerInfo.USBAutoMount != "True" && strings.Contains(service.MyService.System().GetDeviceTree(), "Raspberry Pi") {
service.MyService.System().UpdateUSBAutoMount("False")
service.MyService.System().ExecUSBAutoMountShell("False")
}
_logger.Info("update done")
return nil return nil
} }