if ( $ho->{Flags}{'need-uboot-bootscr'} ) {
my $root=target_guest_lv_name($ho,"root");
+ my $console = get_host_native_linux_console($ho);
+ my $consolecmd = "console=$console" unless $console eq "NONE";
preseed_hook_command($ho, 'late_command', $sfx, <<END);
#!/bin/sh
initrd=`readlink \$r/initrd.img | sed -e 's|boot/||'`
cat >\$r/boot/boot <<EOF
-setenv bootargs console=ttyAMA0 root=$root
+setenv bootargs $consolecmd root=$root
mw.l 800000 0 10000
scsi scan
ext2load scsi 0 \\\${kernel_addr_r} \$kernel
contents_make_cpio file_simple_write_contents
selecthost get_hostflags get_host_property
+ get_host_native_linux_console
power_state power_cycle power_cycle_time
serial_fetch_logs
propname_massage
return defined($val) ? $val : $defval;
}
+sub get_host_native_linux_console ($) {
+ my ($ho) = @_;
+
+ my $console = get_host_property($ho, "LinuxSerialConsole", "ttyS0");
+ return $console if $console eq 'NONE';
+
+ return "$console,$c{Baud}n8";
+}
+
sub get_host_method_object ($$$) {
my ($ho, $kind, $meth) = @_;
my (@meth) = split /\s+/, $meth;
push @installcmdline, qw(--);
- my $console = get_host_property($ho, "LinuxSerialConsole", "ttyS0");
- push @installcmdline, "console=$console,$c{Baud}n8"
- unless $console eq "NONE";
+ my $console = get_host_native_linux_console($ho);
+
+ push @installcmdline, "console=$console" unless $console eq "NONE";
my $installcmdline= join ' ', @installcmdline;