This overrides GRUB_CMDLINE_LINUX(_DEFAULT) which we were previously
editing but only for the Xen entries, meaning that we don't switch to
console=hvc0 for the native cases (i.e. don't break them).
We do however want to edit GRUB_CMDLINE_LINUX(_DEFAULT) to remove
"quiet" if present, since it is useful to people, especially those
using standalone mode as a provisioning tool, wanting to e.g. compare
a boot under Xen with the native case.
This has been supported since Wheezy but in any case we supply our own
20_linux_xen grub generator based on Wheezy which supports this.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
$v =~ s/^\s*([\'\"])(.*)\1\s*$/$2/;
$k{$k}= $v;
}
- next if m/^GRUB_CMDLINE_(?:XEN|LINUX).*\=|^GRUB_DEFAULT.*\=/;
+ next if m/^GRUB_CMDLINE_(?:XEN|LINUX(?:_XEN_REPLACE)?(?:_DEFAULT)?).*\=|^GRUB_DEFAULT.*\=/;
print ::EO;
}
print ::EO <<END or die $!;
END
foreach my $k (qw(GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT)) {
my $v= $k{$k};
+
+ # Tailor native case
$v =~ s/\bquiet\b//;
+ print ::EO "$k=\"$v\"\n" or die $!;
+
+ # Xen overrides
$v =~ s/\b(?:console|xencons)=[0-9A-Za-z,]+//;
$v .= " $xenkopt" if $k eq 'GRUB_CMDLINE_LINUX';
- print ::EO "$k=\"$v\"\n" or die $!;
- }
+ # Ensure variable isn't zero length, or 20_linux_xen will ignore it.
+ $v .= " ";
+ my $rk = $k;
+ $rk =~ s/LINUX/LINUX_XEN_REPLACE/;
+ print ::EO "$rk=\"$v\"\n" or die $!;
+ }
});
};