discstation 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/discstation.py +7 -0
- package/src/discstation_host.py +13 -6
package/package.json
CHANGED
package/src/discstation.py
CHANGED
|
@@ -2752,6 +2752,13 @@ def burn_data_flow(ser):
|
|
|
2752
2752
|
if not files_to_burn:
|
|
2753
2753
|
raise RuntimeError("No files to burn")
|
|
2754
2754
|
|
|
2755
|
+
# A single .iso (loose, a local path, or an upload folder holding just
|
|
2756
|
+
# the .iso) is written verbatim as a bootable image, not repackaged.
|
|
2757
|
+
if len(files_to_burn) == 1 and files_to_burn[0].is_dir():
|
|
2758
|
+
inner = [p for p in files_to_burn[0].iterdir() if p.is_file()]
|
|
2759
|
+
if len(inner) == 1 and inner[0].suffix.lower() == ".iso":
|
|
2760
|
+
files_to_burn = inner
|
|
2761
|
+
|
|
2755
2762
|
total_bytes = sum(f.stat().st_size for f in files_to_burn if f.is_file())
|
|
2756
2763
|
for d in files_to_burn:
|
|
2757
2764
|
if d.is_dir():
|
package/src/discstation_host.py
CHANGED
|
@@ -295,23 +295,30 @@ def build_data_image(source_paths, output_path, label, video=False):
|
|
|
295
295
|
# xorriso's mkisofs emulation is the same lineage as Linux's
|
|
296
296
|
# genisoimage/growisofs; -dvd-video gives a set-top-compatible
|
|
297
297
|
# VIDEO_TS layout (the arg is the dir *containing* VIDEO_TS).
|
|
298
|
+
# xorriso's mkisofs emulation does NOT accept `-udf`; -dvd-video alone
|
|
299
|
+
# gives a DVD-Video-compliant ISO9660 layout set-top players read.
|
|
298
300
|
command = [tool("xorriso"), "-as", "mkisofs", "-V", label, "-o", str(output_path)]
|
|
299
301
|
if video:
|
|
300
|
-
command += ["-dvd-video",
|
|
302
|
+
command += ["-dvd-video", str(source_paths[0])]
|
|
301
303
|
else:
|
|
302
|
-
command += ["-iso-level", "3", "-J", "-R",
|
|
303
|
-
*[str(path) for path in source_paths]]
|
|
304
|
+
command += ["-iso-level", "3", "-J", "-R", *[str(path) for path in source_paths]]
|
|
304
305
|
else:
|
|
305
306
|
raise RuntimeError("Image building is only used by non-Linux optical backends")
|
|
306
|
-
subprocess.run(command,
|
|
307
|
+
result = subprocess.run(command, capture_output=True, text=True)
|
|
308
|
+
if result.returncode != 0:
|
|
309
|
+
lines = [ln.strip() for ln in (result.stderr or result.stdout).splitlines() if ln.strip()]
|
|
310
|
+
tail = next((ln for ln in reversed(lines) if "FAILURE" in ln.upper()),
|
|
311
|
+
lines[-1] if lines else f"exit {result.returncode}")
|
|
312
|
+
raise RuntimeError(f"xorriso: {tail[:200]}")
|
|
307
313
|
return output_path
|
|
308
314
|
|
|
309
315
|
|
|
310
316
|
def iso_burn_command(device, image_path):
|
|
311
317
|
system = system_name()
|
|
312
318
|
if system == "darwin":
|
|
313
|
-
# -puppetstrings emits machine-readable PERCENT: / MESSAGE: lines
|
|
314
|
-
|
|
319
|
+
# -puppetstrings emits machine-readable PERCENT: / MESSAGE: lines;
|
|
320
|
+
# -nosynth writes the image verbatim so a bootable ISO stays bootable.
|
|
321
|
+
return [tool("hdiutil"), "burn", "-puppetstrings", "-nosynth", str(image_path)]
|
|
315
322
|
if system == "windows":
|
|
316
323
|
return [tool("isoburn.exe"), "/Q", device, str(image_path)]
|
|
317
324
|
raise RuntimeError("ISO command requested on Linux; use growisofs backend")
|