diff options
author | dd <dd@wx.tnyzeq.icu> | 2024-09-17 21:00:12 +0200 |
---|---|---|
committer | dd <dd@wx.tnyzeq.icu> | 2024-09-17 21:00:12 +0200 |
commit | 04605ce7fdf0ec3ac2a31f89bfb75ccff04a7a1e (patch) | |
tree | 35cdd9fe100dbb0a8a3aa2b59573cab79facc10e | |
parent | c8d37d769dc34404dd5b22fce01f74709e9ef7a0 (diff) | |
parent | 2a53f210eed9e8c7b862f232c5b5ee825da655dc (diff) | |
download | vyos-build-04605ce7fdf0ec3ac2a31f89bfb75ccff04a7a1e.tar.gz vyos-build-04605ce7fdf0ec3ac2a31f89bfb75ccff04a7a1e.zip |
Merge branch 'vyos:current' into current
-rw-r--r-- | docker/Dockerfile | 3 | ||||
-rwxr-xr-x | scripts/check-qemu-install | 31 |
2 files changed, 10 insertions, 24 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 4b428248..9b937925 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -87,7 +87,8 @@ RUN apt-get update && apt-get install -y \ gosu \ po4a \ openssh-client \ - jq + jq \ + socat # Packages needed for vyos-build RUN apt-get update && apt-get install -y \ diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 71158f18..f9671cd4 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -361,11 +361,15 @@ if args.qemu_cmd: test_timeout = 3 *3600 # 3 hours (in seconds) tpm_process = None try: + # Start TPM emulator + if args.tpmtest: + tpm_process = start_swtpm() + ################################################# # Installing image to disk ################################################# log.info('Installing system') - cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, raid=diskname_raid, iso_img=args.iso, vnc_enabled=args.vnc, secure_boot=args.sbtest) + cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, raid=diskname_raid, tpm=args.tpmtest, iso_img=args.iso, vnc_enabled=args.vnc, secure_boot=args.sbtest) log.debug(f'Executing command: {cmd}') c = pexpect.spawn(cmd, logfile=stl, timeout=60) @@ -490,12 +494,6 @@ try: os.system(f'echo "eject -f drive-cd1" | socat - unix-connect:/tmp/qemu-monitor-socket-{args.disk}') ################################################# - # Powering down installer - ################################################# - if args.tpmtest: - tpm_process = start_swtpm() - - ################################################# # Booting installed system ################################################# log.info('Booting installed system') @@ -590,7 +588,7 @@ try: tpm_timeout = 600 # Give it 10 mins to encrypt # Verify TPM is loaded - c.sendline('ls /dev/tpm0') + c.sendline('find /dev -name tpm0') c.expect('/dev/tpm0') c.expect(op_mode_prompt) @@ -629,21 +627,8 @@ try: c.sendline('exit') c.expect(op_mode_prompt) - # Shutdown VM - shutdownVM(c, log, 'Shutdown VM after TPM encryption') - - # Shutdown kills swtpm - tpm_process.join() - tpm_process.close() - - # Start emulator again - tpm_process = start_swtpm() - - # Booting back into VM - log.info('Booting TPM-backed system') - cmd = get_qemu_cmd(qemu_name, args.uefi, args.disk, raid=diskname_raid, tpm=args.tpmtest, vnc_enabled=args.vnc) - log.debug(f'Executing command: {cmd}') - c = pexpect.spawn(cmd, logfile=stl) + log.info('system installed, rebooting') + c.sendline('reboot now') try: c.expect('The highlighted entry will be executed automatically in', timeout=10) |