From d0d03abe1dd6c19b27a7f86c27dadfe17dcba8ad Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Fri, 24 Jun 2022 17:20:47 +0200 Subject: [PATCH 1/3] fix nil map for networks --- internal/pkg/node/constructors.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/pkg/node/constructors.go b/internal/pkg/node/constructors.go index 6dd00bb1..ab846281 100644 --- a/internal/pkg/node/constructors.go +++ b/internal/pkg/node/constructors.go @@ -256,6 +256,9 @@ func (config *nodeYaml) FindAllNodes() ([]NodeInfo, error) { n.NetDevs[devname].OnBoot.SetAlt(netdev.OnBoot, p) n.NetDevs[devname].Primary.SetAlt(netdev.Primary, p) if len(netdev.Tags) != 0 { + if len(n.NetDevs[devname].Tags) == 0 { + n.NetDevs[devname].Tags = make(map[string]*Entry) + } for keyname, key := range netdev.Tags { if _, ok := n.NetDevs[devname].Tags[keyname]; !ok { var keyVar Entry From bc8aa06673597488962a0d78983f564183111f38 Mon Sep 17 00:00:00 2001 From: Ingo Meyer Date: Thu, 21 Jul 2022 17:35:56 +0200 Subject: [PATCH 2/3] Fix the boot process for Legacy BIOS machines GitHub PR #235 adds an advanced boot mechanism for UEFI machines which causes old Legacy BIOS nodes to hit the 3 GB RAM barrier in 32 Bit iPXE very quickly. Therefore, detect if an EFI or Legacy BIOS is loaded and fall back to the old boot path in the second case. This commit fixes GitHub issue #497. --- etc/ipxe/default.ipxe | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/etc/ipxe/default.ipxe b/etc/ipxe/default.ipxe index 279f2295..0786a0e4 100644 --- a/etc/ipxe/default.ipxe +++ b/etc/ipxe/default.ipxe @@ -19,6 +19,15 @@ echo Warewulf Controller: {{.Ipaddr}} echo Downloading Kernel Image: kernel --name kernel ${uri_base}&stage=kernel || goto reboot +# imgextract causes RAM space problems on non-EFI systems (because of the 3GB barrier +# in 32-Bit mode). +# -> Use the old initrd method with a compressed image to save as much RAM as possible +# in this early boot stage. +# See for more details. +iseq ${platform} efi && goto efi || goto noefi + +:efi + # try extracting compressed images first # NOTE: system overlay tends to be the smallest, so failure here is the cheapest echo Downloading Container Image: @@ -56,6 +65,27 @@ echo Downloading Kernel Modules: initrd --name kmods ${uri_base}&stage=kmods || goto reboot {{- end}} +goto imoktogo + +:noefi + +echo +echo Use legacy initrd mode with compressed images + +echo Downloading Container Image: +initrd --name container ${uri_base}&stage=container&compress=gz || goto reboot + +echo Downloading System Overlay: +initrd --name system ${uri_base}&stage=system&compress=gz || goto reboot + +echo Downloading Runtime Overlay: +initrd --name runtime ${uri_base}&stage=runtime&compress=gz || goto reboot + +{{if ne .KernelOverride "" -}} +echo Downloading Kernel Modules: +initrd --name kmods ${uri_base}&stage=kmods&compress=gz || goto reboot +{{- end}} + :imoktogo From 8dc016841214b18b8f674ccf5b4d0caef2ff5d1b Mon Sep 17 00:00:00 2001 From: jason yang Date: Fri, 17 Mar 2023 09:01:51 +0000 Subject: [PATCH 3/3] changing a profile always adds an empty default interface Signed-off-by: jason yang --- CHANGELOG.md | 1 + internal/pkg/api/profile/profile.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c89fd35..a8dbdb79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Boolean attributes now correctly account for profile and default values. #630 - Kernvel version is shown correctly +- Changing a profile always adds an empty default interface. #661 ## [4.4.0rc3] 2022-12-23 diff --git a/internal/pkg/api/profile/profile.go b/internal/pkg/api/profile/profile.go index 57aa40b7..15fc4512 100644 --- a/internal/pkg/api/profile/profile.go +++ b/internal/pkg/api/profile/profile.go @@ -15,7 +15,6 @@ import ( // NodeSet is the wwapiv1 implmentation for updating nodeinfo fields. func ProfileSet(set *wwapiv1.NodeSetParameter) (err error) { - if set == nil { return fmt.Errorf("NodeAddParameter is nil") } @@ -85,6 +84,10 @@ func ProfileSetParameterCheck(set *wwapiv1.NodeSetParameter, console bool) (node for _, p := range profiles { if util.InSlice(set.NodeNames, p.Id.Get()) { wwlog.Verbose("Evaluating profile: %s", p.Id.Get()) + // Fix issue: https://github.com/hpcng/warewulf/issues/661 + if p.Id.Get() == "default" && len(p.NetDevs) == 0 { + set.NetdevDelete = p.Id.Get() + } p.SetFrom(&pConf) if set.NetdevDelete != "" { if _, ok := p.NetDevs[set.NetdevDelete]; !ok {