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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discstation",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "DiscStation optical-media appliance host — one cross-OS installer",
5
5
  "bin": {
6
6
  "discstation-setup": "scripts/setup.mjs",
@@ -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():
@@ -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", "-udf", str(source_paths[0])]
302
+ command += ["-dvd-video", str(source_paths[0])]
301
303
  else:
302
- command += ["-iso-level", "3", "-J", "-R", "-udf",
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, check=True, capture_output=True, text=True)
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
- return [tool("hdiutil"), "burn", "-puppetstrings", str(image_path)]
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")