File: types_boot_option.go

package info (click to toggle)
golang-github-bougou-go-ipmi 0.7.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,880 kB
  • sloc: makefile: 38
file content (130 lines) | stat: -rw-r--r-- 3,793 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package ipmi

type BootInfoAcknowledgeBy uint8

const (
	BootInfoAcknowledgeByBIOSPOST           BootInfoAcknowledgeBy = 1 << 0
	BootInfoAcknowledgeByOSLoader           BootInfoAcknowledgeBy = 1 << 1
	BootInfoAcknowledgeByOSServicePartition BootInfoAcknowledgeBy = 1 << 2
	BootInfoAcknowledgeBySMS                BootInfoAcknowledgeBy = 1 << 3
	BootInfoAcknowledgeByOEM                BootInfoAcknowledgeBy = 1 << 4
)

type BIOSVerbosity uint8 // only 2 bits, occupied 0-3

const (
	BIOSVerbosityDefault BIOSVerbosity = 0
	BIOSVerbosityQuiet   BIOSVerbosity = 1
	BIOSVerbosityVerbose BIOSVerbosity = 2
)

func (v BIOSVerbosity) String() string {
	switch v {
	case 0:
		return "System Default"
	case 1:
		return "Request Quiet Display"
	case 2:
		return "Request Verbose Display"
	default:
		return "Flag error"
	}
}

type BIOSBootType bool

const (
	BIOSBootTypeLegacy BIOSBootType = false // PC compatible boot (legacy)
	BIOSBootTypeEFI    BIOSBootType = true  // Extensible Firmware Interface Boot (EFI)
)

func (t BIOSBootType) String() string {
	if t {
		return "BIOS EFI boot"
	}
	return "BIOS PC Compatible (legacy) boot"
}

type BootDeviceSelector uint8 // only 4 bits occupied

const (
	BootDeviceSelectorNoOverride               BootDeviceSelector = 0x00
	BootDeviceSelectorForcePXE                 BootDeviceSelector = 0x01
	BootDeviceSelectorForceHardDrive           BootDeviceSelector = 0x02
	BootDeviceSelectorForceHardDriveSafe       BootDeviceSelector = 0x03
	BootDeviceSelectorForceDiagnosticPartition BootDeviceSelector = 0x04
	BootDeviceSelectorForceCDROM               BootDeviceSelector = 0x05
	BootDeviceSelectorForceBIOSSetup           BootDeviceSelector = 0x06
	BootDeviceSelectorForceRemoteFloppy        BootDeviceSelector = 0x07
	BootDeviceSelectorForceRemoteCDROM         BootDeviceSelector = 0x08
	BootDeviceSelectorForceRemoteMedia         BootDeviceSelector = 0x09
	BootDeviceSelectorForceRemoteHardDrive     BootDeviceSelector = 0x0b
	BootDeviceSelectorForceFloppy              BootDeviceSelector = 0x0f
)

func (s BootDeviceSelector) String() string {
	switch s {
	case 0x00:
		return "No override"
	case 0x01:
		return "Force PXE"
	case 0x02:
		return "Force Boot from default Hard-Drive"
	case 0x03:
		return "Force Boot from default Hard-Drive, request Safe-Mode"
	case 0x04:
		return "Force Boot from Diagnostic Partition"
	case 0x05:
		return "Force Boot from CD/DVD"
	case 0x06:
		return "Force Boot into BIOS Setup"
	case 0x07:
		return "Force Boot from remotely connected Floppy/primary removable media"
	case 0x08:
		return "Force Boot from remotely connected CD/DVD"
	case 0x09:
		return "Force Boot from primary remote media"
	case 0x0b:
		return "Force Boot from remotely connected Hard-Drive"
	case 0x0f:
		return "Force Boot from Floppy/primary removable media"
	default:
		return "Flag error"
	}
}

type ConsoleRedirectionControl uint8

const (
	ConsoleRedirectionControl_Default ConsoleRedirectionControl = 0
	ConsoleRedirectionControl_Skip    ConsoleRedirectionControl = 1
	ConsoleRedirectionControl_Enable  ConsoleRedirectionControl = 2
)

func (c ConsoleRedirectionControl) String() string {
	switch c {
	case 0:
		return "Console redirection occurs per BIOS configuration setting (default)"
	case 1:
		return "Suppress (skip) console redirection if enabled"
	case 2:
		return "Request console redirection be enabled"
	default:
		return "Flag error"
	}
}

type BIOSMuxControl uint8

func (b BIOSMuxControl) String() string {
	switch b {
	case 0:
		return "BIOS uses recommended setting of the mux at the end of POST"
	case 1:
		return "Requests BIOS to force mux to BMC at conclusion of POST/start of OS boot"
	case 2:
		return "Requests BIOS to force mux to system at conclusion of POST/start of OS boot"
	default:
		return "Flag error"
	}
}