From 525c012d9ce0d29b0dcfd3d5f95f059bb323279c Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Mon, 25 Oct 2021 20:45:23 +0200 Subject: [PATCH] cmd_image_inspect(): add --shell/-s --- image.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/image.py b/image.py index ddc303c..dfd4bd9 100644 --- a/image.py +++ b/image.py @@ -195,7 +195,8 @@ def cmd_build(): @cmd_image.command(name='inspect') -def cmd_inspect(): +@click.option('--shell', '-s', is_flag=True) +def cmd_inspect(shell: bool = False): device, flavour = get_device_and_flavour() image_name = get_image_name(device, flavour) @@ -204,4 +205,9 @@ def cmd_inspect(): logging.info(f'Inspect the rootfs image at {rootfs_mount}') - pause() + if shell: + chroot.initialized = True + chroot.activate() + chroot.run_cmd('/bin/bash') + else: + pause()