Include infrastructure for static files to be included in binary
This commit is contained in:
11
internal/pkg/staticfiles/build.sh
Normal file
11
internal/pkg/staticfiles/build.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
|
if ! test -x $GOPATH/bin/implant; then
|
||||||
|
IMPLANT_GIT="https://github.com/skx/implant"
|
||||||
|
(mkdir -p $HOME/git; cd $HOME/git; git clone $IMPLANT_GIT; cd implant; go install)
|
||||||
|
fi
|
||||||
|
|
||||||
|
$GOPATH/bin/implant -verbose -package staticfiles -input files
|
||||||
|
|
||||||
|
|
||||||
BIN
internal/pkg/staticfiles/files/tftp/i386.efi
Normal file
BIN
internal/pkg/staticfiles/files/tftp/i386.efi
Normal file
Binary file not shown.
BIN
internal/pkg/staticfiles/files/tftp/i386.kpxe
Normal file
BIN
internal/pkg/staticfiles/files/tftp/i386.kpxe
Normal file
Binary file not shown.
BIN
internal/pkg/staticfiles/files/tftp/x86.efi
Normal file
BIN
internal/pkg/staticfiles/files/tftp/x86.efi
Normal file
Binary file not shown.
103
internal/pkg/staticfiles/static.go
Normal file
103
internal/pkg/staticfiles/static.go
Normal file
File diff suppressed because one or more lines are too long
16
internal/pkg/staticfiles/staticfiles.go
Normal file
16
internal/pkg/staticfiles/staticfiles.go
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package staticfiles
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/hpcng/warewulf/internal/pkg/wwlog"
|
||||||
|
"io/ioutil"
|
||||||
|
)
|
||||||
|
|
||||||
|
func WriteData(source string, dest string) error {
|
||||||
|
bytes, err := getResource(source)
|
||||||
|
err = ioutil.WriteFile(dest, bytes, 0644)
|
||||||
|
if err != nil {
|
||||||
|
wwlog.Printf(wwlog.ERROR, "Failed writing %s to: %s\n", dest, err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user