removed static embeded pxe files in wwctl

This commit is contained in:
Christian Goll
2022-01-28 11:39:29 +01:00
parent fb1b04c370
commit 1a1e967aba
5 changed files with 6 additions and 167 deletions

View File

@@ -159,6 +159,12 @@ files: all
install -c -m 0644 include/systemd/warewulfd.service $(DESTDIR)$(SYSTEMDDIR) install -c -m 0644 include/systemd/warewulfd.service $(DESTDIR)$(SYSTEMDDIR)
cp bash_completion.d/warewulf $(DESTDIR)$(BASH_COMPLETION) cp bash_completion.d/warewulf $(DESTDIR)$(BASH_COMPLETION)
cp man_pages/* $(DESTDIR)$(MANDIR)/man1/ cp man_pages/* $(DESTDIR)$(MANDIR)/man1/
install -c -m 0644 internal/pkg/staticfiles/files/tftp/arm64.efi $(DESTDIR)$(TFTPDIR)/warewulf
install -c -m 0644 internal/pkg/staticfiles/files/tftp/i386.efi $(DESTDIR)$(TFTPDIR)/warewulf
install -c -m 0644 internal/pkg/staticfiles/files/tftp/i386.kpxe $(DESTDIR)$(TFTPDIR)/warewulf
install -c -m 0644 internal/pkg/staticfiles/files/tftp/x86.efi $(DESTDIR)$(TFTPDIR)/warewulf
init: init:
systemctl daemon-reload systemctl daemon-reload

View File

@@ -6,7 +6,6 @@ import (
"path" "path"
"github.com/hpcng/warewulf/internal/pkg/buildconfig" "github.com/hpcng/warewulf/internal/pkg/buildconfig"
"github.com/hpcng/warewulf/internal/pkg/staticfiles"
"github.com/hpcng/warewulf/internal/pkg/util" "github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf" "github.com/hpcng/warewulf/internal/pkg/warewulfconf"
"github.com/hpcng/warewulf/internal/pkg/wwlog" "github.com/hpcng/warewulf/internal/pkg/wwlog"
@@ -36,27 +35,6 @@ func Configure(show bool) error {
} }
if !show { if !show {
fmt.Printf("Writing PXE files to: %s\n", path.Join(buildconfig.TFTPDIR(), "warewulf"))
err = staticfiles.WriteData("files/tftp/x86.efi", path.Join(buildconfig.TFTPDIR(), "warewulf/x86.efi"))
if err != nil {
wwlog.Printf(wwlog.ERROR, "%s\n", err)
os.Exit(1)
}
err = staticfiles.WriteData("files/tftp/i386.efi", path.Join(buildconfig.TFTPDIR(), "warewulf/i386.efi"))
if err != nil {
wwlog.Printf(wwlog.ERROR, "%s\n", err)
os.Exit(1)
}
err = staticfiles.WriteData("files/tftp/i386.kpxe", path.Join(buildconfig.TFTPDIR(), "warewulf/i386.kpxe"))
if err != nil {
wwlog.Printf(wwlog.ERROR, "%s\n", err)
os.Exit(1)
}
err = staticfiles.WriteData("files/tftp/arm64.efi", path.Join(buildconfig.TFTPDIR(), "warewulf/arm64.efi"))
if err != nil {
wwlog.Printf(wwlog.ERROR, "%s\n", err)
os.Exit(1)
}
fmt.Printf("Enabling and restarting the TFTP services\n") fmt.Printf("Enabling and restarting the TFTP services\n")
err = util.SystemdStart(controller.Tftp.SystemdName) err = util.SystemdStart(controller.Tftp.SystemdName)

View File

@@ -1,12 +0,0 @@
#!/bin/sh
test -z "$GOPATH" && GOPATH="$HOME/go"
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

File diff suppressed because one or more lines are too long

View File

@@ -1,24 +0,0 @@
package staticfiles
import (
"io/ioutil"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/pkg/errors"
)
func WriteData(source string, dest string) error {
bytes, err := getResource(source)
if err != nil {
return errors.Wrap(err, "failed to get resource")
}
err = ioutil.WriteFile(dest, bytes, 0644)
if err != nil {
// TODO: remove log message if appropriate
wwlog.Printf(wwlog.ERROR, "Failed writing %s to: %s\n", dest, err)
return errors.Wrap(err, "failed to write to file")
}
return nil
}