Skip to content

Commit

Permalink
Update scsi id boot from slof for ppc64le
Browse files Browse the repository at this point in the history
New device serial will be added which caused the scsi device id
changed from 5 to 7. Got the scsi id from devalias command.
  • Loading branch information
openQA web UI committed Apr 27, 2022
1 parent 5b066dd commit d9f9b76
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion lib/bootloader_setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ our @EXPORT = qw(
mimic_user_to_import
tianocore_disable_secureboot
prepare_disks
get_scsi_id
);

our $zkvm_img_path = "/var/lib/libvirt/images";
Expand Down Expand Up @@ -227,6 +228,22 @@ sub boot_grub_item {
grub_key_enter;
}

sub get_scsi_id {
my $sid;
type_string_very_slow "devalias";
send_key 'ret';
save_screenshot;
my $file = './serial0';
open(my $fh, '<', $file) or die("Could not open log file: $file");
while (my $line = <$fh>) {
if ($line =~ /^disk : \/pci/) {
$sid = ($line =~ m/scsi@(\d+)/)[0];
last;
}
}
close($fh);
return $sid;
}

sub boot_local_disk {
if (get_var('OFW')) {
Expand All @@ -249,7 +266,7 @@ sub boot_local_disk {
if (match_has_tag 'inst-slof') {
diag 'specifying local disk for boot from slof';
my $slof = 5;
$slof += 1 if get_var('VIRTIO_CONSOLE');
$slof = get_scsi_id if (get_var('VIRTIO_CONSOLE'));
type_string_very_slow "boot /pci\t/sc\t$slof";
save_screenshot;
}
Expand Down

0 comments on commit d9f9b76

Please sign in to comment.