diff --git a/CHANGELOG.md b/CHANGELOG.md index c4205cfb..a888d05b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Set dnsmasq to listen to the Warewulf interface to prevent to binding to localhost:53 - Added Ipv6 support to `/etc/hosts` on host and nodes. - Added IPv6 support to wwclient +- `sfdisk` overlay creates a GPT label when wiping disks. #2025 ### Removed diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 657d378a..c9962cdb 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -49,3 +49,4 @@ * Arian Cabrera [@acabrera86](https://github.com/acabrera86) * Dacian Reece-Stremtan [@dacianstremtan](https://github.com/dacianstremtan) * Adrian Reber +* Karker Said diff --git a/overlays/sfdisk/internal/sfdisk_test.go b/overlays/sfdisk/internal/sfdisk_test.go index c8fbdc3e..bc0c9b6a 100644 --- a/overlays/sfdisk/internal/sfdisk_test.go +++ b/overlays/sfdisk/internal/sfdisk_test.go @@ -181,7 +181,7 @@ if ! command -v sfdisk >/dev/null ; then info "warewulf: sfdisk not found, skipping partitioning" else : info "warewulf: sfdisk: partitioning /dev/sda" - sfdisk --wipe "auto" "/dev/sda" < "${PREFIX}/warewulf/sfdisk/device-0" || die "warewulf: sfdisk: failed to partition /dev/sda" + sfdisk --wipe "auto" "/dev/sda" < "${PREFIX}/warewulf/sfdisk/device-0" || die "warewulf: sfdisk: failed to partition /dev/sda" if command -v blockdev >/dev/null ; then info "warewulf: blockdev: re-reading partition table" @@ -238,14 +238,14 @@ if ! command -v sfdisk >/dev/null ; then info "warewulf: sfdisk not found, skipping partitioning" else : info "warewulf: sfdisk: partitioning /dev/sda" - sfdisk --wipe "auto" "/dev/sda" < "${PREFIX}/warewulf/sfdisk/device-0" || die "warewulf: sfdisk: failed to partition /dev/sda" + sfdisk --wipe "auto" "/dev/sda" < "${PREFIX}/warewulf/sfdisk/device-0" || die "warewulf: sfdisk: failed to partition /dev/sda" if command -v blockdev >/dev/null ; then info "warewulf: blockdev: re-reading partition table" blockdev --rereadpt /dev/sda fi info "warewulf: sfdisk: partitioning /dev/sdb" - sfdisk --wipe "always" "/dev/sdb" < "${PREFIX}/warewulf/sfdisk/device-1" || die "warewulf: sfdisk: failed to partition /dev/sdb" + sfdisk --label gpt --wipe "always" "/dev/sdb" < "${PREFIX}/warewulf/sfdisk/device-1" || die "warewulf: sfdisk: failed to partition /dev/sdb" if command -v blockdev >/dev/null ; then info "warewulf: blockdev: re-reading partition table" diff --git a/overlays/sfdisk/rootfs/warewulf/wwinit.d/10-sfdisk.sh.ww b/overlays/sfdisk/rootfs/warewulf/wwinit.d/10-sfdisk.sh.ww index 67d7d211..284302a9 100644 --- a/overlays/sfdisk/rootfs/warewulf/wwinit.d/10-sfdisk.sh.ww +++ b/overlays/sfdisk/rootfs/warewulf/wwinit.d/10-sfdisk.sh.ww @@ -24,6 +24,7 @@ else : {{- $diskDict := dict "device" $disk.Id }} {{- if $disk.WipeTable }} {{- $_ := set $diskDict "wipe" "always" }} +{{- $_ := set $diskDict "labelOption" "--label gpt" }} {{- end }} {{- $disks = append $disks $diskDict }} {{- end }} @@ -33,7 +34,7 @@ else : {{- range $i, $device := $disks }} {{- if $device.device }} info "warewulf: sfdisk: partitioning {{ $device.device }}" - sfdisk --wipe "{{ default "auto" $device.wipe }}" "{{ $device.device }}" < "${PREFIX}/warewulf/sfdisk/device-{{ $i }}" || die "warewulf: sfdisk: failed to partition {{ $device.device }}" + sfdisk {{ default "" $device.labelOption }} --wipe "{{ default "auto" $device.wipe }}" "{{ $device.device }}" < "${PREFIX}/warewulf/sfdisk/device-{{ $i }}" || die "warewulf: sfdisk: failed to partition {{ $device.device }}" if command -v blockdev >/dev/null ; then info "warewulf: blockdev: re-reading partition table"