Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions mkosi/burn.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later

import logging
import os
import sys

Expand All @@ -21,6 +22,25 @@ def run_burn(args: Args, config: Config) -> None:
if len(args.cmdline) != 1:
die("Expected device argument.")

device = args.cmdline[0]
lsblk_command = [
"lsblk",
"-o",
"PATH,LABEL,PARTLABEL,FSTYPE,SIZE,HOTPLUG,MOUNTPOINTS",
Comment thread
estebanpuyanas marked this conversation as resolved.
Outdated
"--paths",
device,
]

logging.info(f"About to burn image to device: {device}")
logging.info("The following block device layout will be overwritten:")
run(lsblk_command)

sys.stderr.write("Do you want to continue? [y/N] ")
sys.stderr.flush()
reply = sys.stdin.readline().strip().lower()
if reply not in ("y", "yes"):
die("Aborting burning image to device.")
Comment thread
estebanpuyanas marked this conversation as resolved.
Outdated

cmd = [
"systemd-repart",
"--no-pager",
Expand Down
Loading