use perl instead of (g)awk to clean /proc/cmdline

this awk line only works with gawk because of implementation differences
between awk alternatives.
debian has mawk installed by default, and mawk does not implement word
boundary regex. to avoid having to depend on gawk, we can just use perl
instead.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
This commit is contained in:
Oguz Bektas 2019-11-08 13:47:22 +01:00 committed by Thomas Lamprecht
parent 25c1475040
commit cd42dbfb99

View File

@ -51,7 +51,7 @@ update_esps() {
else
warn "No /etc/kernel/cmdline found - falling back to /proc/cmdline"
# remove initrd entries
CMDLINE="$(awk '{ gsub(/\yinitrd=([0-9a-zA-Z\/\\._-])*\s*/, ""); print $0 }' /proc/cmdline)"
CMDLINE="$(perl -pe 's/\binitrd=([0-9a-zA-Z\\\/.-])*\s*//g;' /proc/cmdline)"
fi
loop_esp_list update_esp_func