@@ -660,6 +660,8 @@ END
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
@@ -671,7 +673,7 @@ kernel=`readlink \$r/vmlinuz | sed -e 's|boot/||'`
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
@@ -65,6 +65,7 @@ BEGIN {
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
@@ -863,6 +864,15 @@ sub get_host_property ($$;$) {
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;
@@ -210,9 +210,9 @@ END
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;