Skip to content

Commit

Permalink
feature: NewDefaultContext: mimic efivar EFIVARFS_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
0x5a17ed committed May 7, 2022
1 parent c20b7b0 commit 2f6fba2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion efi/efivario/context_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package efivario

import (
"os"

"github.com/spf13/afero"
)

Expand All @@ -29,5 +31,9 @@ func NewContext(path string) Context {
}

func NewDefaultContext() Context {
return NewContext(DefaultEfiPath)
dir := os.Getenv("EFIVARFS_PATH")
if dir == "" {
dir = DefaultEfiPath
}
return NewContext(dir)
}

0 comments on commit 2f6fba2

Please sign in to comment.