github.com/linuxboot/fiano@v1.2.0/pkg/intel/metadata/common/examples/cmd/bpmdump/main.go (about)

     1  // Copyright 2017-2021 the LinuxBoot Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"fmt"
     9  	"log"
    10  	"os"
    11  
    12  	"github.com/linuxboot/fiano/pkg/intel/metadata/cbnt/cbntbootpolicy"
    13  )
    14  
    15  func assertNoError(err error) {
    16  	if err != nil {
    17  		log.Fatal(err)
    18  	}
    19  }
    20  
    21  func main() {
    22  	f, err := os.Open(os.Args[1])
    23  	assertNoError(err)
    24  
    25  	m := &cbntbootpolicy.Manifest{}
    26  	_, err = m.ReadFrom(f)
    27  	assertNoError(err)
    28  
    29  	fmt.Printf("%s", m.PrettyString(0, true))
    30  }