github.com/u-root/u-root@v7.0.1-0.20200915234505-ad7babab0a8e+incompatible/pkg/boot/systembooter/booter.go (about)

     1  // Copyright 2017-2019 the u-root 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 systembooter
     6  
     7  import "log"
     8  
     9  // Booter is an interface that defines custom boot types. Implementations can be
    10  // like network boot, local boot, etc.
    11  type Booter interface {
    12  	Boot() error
    13  	TypeName() string
    14  }
    15  
    16  // NullBooter is a booter that does nothing. It is used when no other booter
    17  // has been found.
    18  type NullBooter struct {
    19  }
    20  
    21  // TypeName returns the name of the booter type
    22  func (nb *NullBooter) TypeName() string {
    23  	return "null"
    24  }
    25  
    26  // Boot will run the boot procedure. In the case of this NullBooter it will do
    27  // nothing
    28  func (nb *NullBooter) Boot() error {
    29  	log.Printf("Null booter does nothing")
    30  	return nil
    31  }