#!/usr/bin/perl # Watch the second stage boot to a password prompt. use strict; use Expect; my $exp = new Expect; #$exp->exp_internal(1); $exp->raw_pty(1); $exp->spawn($ENV{CONSOLECOMMAND}) or die "cannot connect: $!\n"; $exp->expect($ENV{STAGE_2_MAX_TIME}, [ "ogin:" => sub { exit; }], [ "-re", "Service Processor login:" => sub { # My hppa prints this, not to be confused with the linux # login prompt. exp_continue; }], [ "-re", "lo.*gin:" => sub { exit; }], [ "-re", "rting.*[gkx]dm" => sub { exit; }], [ "Unable to mount root fs" => sub { exit 1; }], [ timeout => sub { print STDERR "timeout!\n"; exit 1; }], ); exit;