openkylin.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package fsdriver
  15. import (
  16. deployapi "yunion.io/x/onecloud/pkg/hostman/hostdeployer/apis"
  17. )
  18. type SOpenKylinRootFs struct {
  19. *SUbuntuRootFs
  20. }
  21. func NewOpenKylinRootfs(part IDiskPartition) IRootFsDriver {
  22. return &SOpenKylinRootFs{SUbuntuRootFs: NewUbuntuRootFs(part).(*SUbuntuRootFs)}
  23. }
  24. func (d *SOpenKylinRootFs) GetName() string {
  25. return "OpenKylin"
  26. }
  27. func (d *SOpenKylinRootFs) String() string {
  28. return "OpenKylinRootFs"
  29. }
  30. func (d *SOpenKylinRootFs) RootSignatures() []string {
  31. sig := d.sDebianLikeRootFs.RootSignatures()
  32. return append([]string{"/etc/lsb-release", "/etc/kylin-build", "/etc/ukui-tablet-desktop.conf"}, sig...)
  33. }
  34. func (d *SOpenKylinRootFs) GetReleaseInfo(rootFs IDiskPartition) *deployapi.ReleaseInfo {
  35. info := d.SUbuntuRootFs.GetReleaseInfo(rootFs)
  36. info.Distro = d.GetName()
  37. return info
  38. }
  39. func (d *SOpenKylinRootFs) AllowAdminLogin() bool {
  40. return false
  41. }