On Wed, Jan 20, 2021 at 05:13:05PM +0800, Liu Yinsi wrote:
[error] when no job now, $initrds is null, execute my-qemu.sh will hangs. lys@crystal ~/compass-ci/providers% ./my-qemu.sh hostname: vm-2p8g.lys-3917841 mac: 0a-4b-33-a0-96-69 DoneDone % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 79 100 79 0 0 19750 0 --:--:-- --:--:-- --:--:-- 19750
lys@crystal ~/compass-ci/providers/qemu% cat --help cat Copy standard input to standard output.
when input is null, script will hang to waiting for input.
[how] before: execute cat command, then judge $initrds is null or not after: judge $initrds is null or not, if not null, execute cat command
when no job, the $kernel not exists and will exit, no judge initrd
Thanks, Shenwei
Signed-off-by: Liu Yinsi liuyinsi@163.com
providers/qemu/kvm.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/providers/qemu/kvm.sh b/providers/qemu/kvm.sh index 4d05964..0c58d94 100755 --- a/providers/qemu/kvm.sh +++ b/providers/qemu/kvm.sh @@ -68,16 +68,17 @@ check_option_value() # debian has both qemu-system-x86_64 and qemu-system-riscv64 command [[ $kernel =~ 'riscv64' ]] && qemu=qemu-system-riscv64
- [ -n "$initrds" ] || {
- if [ -n "$initrds" ]; then
cat $initrds > $initrd
- else log_error "The current initrds is null." exit 1
- }
- fi
}
set_initrd() { initrd=initrd
- cat $initrds > $initrd
}
set_bios()
2.23.0