Swapping replace from sprig for our tr in overlays.
This commit is contained in:
committed by
Christian Goll
parent
cbf9178f10
commit
8877cebf87
@@ -11,15 +11,15 @@ Requisite=ignition-ww4-disks.service
|
||||
# Get the mounts
|
||||
{{- range $fsdevice,$fs := .FileSystems }}
|
||||
{{- $prefix := $fsdevice }}
|
||||
{{- $prefix = tr $fsdevice "-" "\\x2d" }}
|
||||
{{- $prefix = tr $prefix "/" "-" }}
|
||||
{{- $prefix = replace "-" "\\x2d" $fsdevice }}
|
||||
{{- $prefix = replace "/" "-" $prefix }}
|
||||
{{- $prefix = slice $prefix 1 }}{{ $suffix := "mount" }}
|
||||
{{- if eq $fs.Format "swap"}}
|
||||
{{- $prefix = tr $fsdevice "/dev/disk/by-partlabel/" "dev-disk-by\\x2dpartlabel-"}}{{ $suffix = "swap"}}
|
||||
{{- $prefix = replace "/dev/disk/by-partlabel/" "dev-disk-by\\x2dpartlabel-"}}{{ $fsdevice $suffix = "swap"}}
|
||||
{{- else }}
|
||||
{{- if ne $fs.Path "" }}
|
||||
{{- $prefix = tr $fs.Path "-" "\\x2d" }}
|
||||
{{- $prefix = tr $prefix "/" "-" }}
|
||||
{{- $prefix = replace "-" "\\x2d" $fs.Path }}
|
||||
{{- $prefix = replace "/" "-" $prefix }}
|
||||
{{- $prefix = slice $prefix 1 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
{{- $time := .BuildTime }}
|
||||
{{- $source := .BuildSource }}
|
||||
{{- range $fsdevice,$fs := .FileSystems }}
|
||||
{{- $prefix := tr $fs.Path "-" "\\x2d" }}
|
||||
{{- $prefix = tr $prefix "/" "-" }}
|
||||
{{- $prefix := replace "-" "\\x2d" $fs.Path }}
|
||||
{{- $prefix = replace "/" "-" $prefix }}
|
||||
{{- $prefix = slice $prefix 1 }}
|
||||
{{ $suffix := "mount"}}
|
||||
{{- if $fs.Label }}{{ $prefix = $fs.Label }}{{ end }}
|
||||
{{- if eq $fs.Format "swap"}}{{ $prefix = tr $fsdevice "/dev/disk/by-partlabel/" "dev-disk-by\\x2dpartlabel-"}}{{ $suffix = "swap"}}{{ end }}
|
||||
{{- if eq $fs.Format "swap"}}{{ $prefix = replace "/dev/disk/by-partlabel/" "dev-disk-by\\x2dpartlabel-"}}{{ $fsdevice $suffix = "swap"}}{{ end }}
|
||||
{{- $filename := print $prefix "." $suffix }}
|
||||
{{- file $filename }}
|
||||
# This file is autogenerated by warewulf
|
||||
|
||||
Reference in New Issue
Block a user