Help us shape the future of Go! Take the 2026 Go Developer Survey

goefibootmgr

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2019 License: MIT Imports: 6 Imported by: 0

README

goefibootmgr

Simple wrapper for efibootmgr command.

Installation

Run:

go get github.com/jkirkwood/goefibootmgr

Docs

GoDoc

Usage

package main

import "github.com/jkirkwood/goefibootmgr"

func main() {
  info, err := goefibootmgr.BootInfo()

  if err != nil {
    panic(err)
  }

  err = goefibootmgr.SetBootOrder(1, 3, 2)

  if err != nil {
    panic(err)
  }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteBootNext

func DeleteBootNext() error

DeleteBootNext deletes the EFI BootNext variable

func SetBootNext

func SetBootNext(b uint16) (err error)

SetBootNext sets the EFI BootNext variable to the bootnum passed to it

func SetBootOrder

func SetBootOrder(bo ...uint16) (err error)

SetBootOrder sets the EFI BootOrder variable using a list of args containing boot numbers

Types

type BootEntry

type BootEntry struct {
	Num    uint16
	Active bool
	Label  string
}

BootEntry represents and EFI boot number entry

func (*BootEntry) Activate

func (b *BootEntry) Activate() error

Activate activates the given boot entry

func (*BootEntry) Deactivate

func (b *BootEntry) Deactivate() error

Deactivate deactivates the given boot entry

type BootManagerInfo

type BootManagerInfo struct {
	// BootEntry stored in the EFI BootCurrent variable
	BootCurrent *BootEntry
	// BootEntry stored in the EFI BootNext variable
	BootNext *BootEntry
	// Slice containing BootEntrys in order they will boot
	BootOrder []BootEntry
	// Slice containing all detected boot entries
	BootEntries []BootEntry
}

BootManagerInfo holds all info returned from the efibootmgr command

func BootInfo

func BootInfo() (*BootManagerInfo, error)

BootInfo runs the efibootmanager command and returns an BootInfo struct containing all the info that was returned

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL