feat: Multiboot-Stick-Modus (mehrere macOS-Versionen auf einem USB-Stick)
- GUI: dritter Modus-Umschalter, Checkbox-Mehrfachauswahl statt Single-Select - Backend: sgdisk partitioniert den Stick in N Apple_HFS-Partitionen (Typ AF00), jede mit Label = macOS-Titel/Version, jede bekommt ihr eigenes Installer-Image per dd -- Macs EFI-Bootpicker (Alt/Option) zeigt alle Partitionen zur Auswahl - Groessen-Check VOR dem Schreiben: bricht mit klarer Fehlermeldung ab wenn der Stick zu klein ist, statt mittendrin zu scheitern - Dockerfile: parted (partprobe) ergaenzt - End-to-end gegen ein echtes Loop-Device verifiziert: sgdisk legt korrekte Partitionen mit Labels an, dd schreibt in die richtige Partition, Inhalt stimmt exakt ueberein (nicht nur behauptet) - README: neuer Abschnitt 4 (Funktionsweise, Ablauf, ehrliche Grenzen), Multiboot als experimentell markiert (erbt recovery-Pfad-Unsicherheit bei Big Sur+, kein echter Mac-Boot-Test bisher durchgefuehrt)
This commit is contained in:
+19
-5
@@ -86,18 +86,32 @@ def api_library():
|
||||
@app.post("/api/jobs")
|
||||
def api_create_job():
|
||||
body = request.get_json(force=True)
|
||||
product_id = body.get("product_id")
|
||||
job_type = body.get("job_type", "stick")
|
||||
device_path = body.get("device_path")
|
||||
confirm_path = body.get("confirm_device_path")
|
||||
|
||||
if job_type not in ("stick", "download"):
|
||||
if job_type not in ("stick", "download", "multiboot"):
|
||||
return jsonify({"error": "Unbekannter job_type."}), 400
|
||||
|
||||
with _catalog_lock:
|
||||
product = next((p for p in _catalog_cache["items"] if p["id"] == product_id), None)
|
||||
if not product:
|
||||
return jsonify({"error": "Unbekannte macOS-Version -- Katalog neu laden."}), 400
|
||||
catalog_items = list(_catalog_cache["items"])
|
||||
|
||||
if job_type == "multiboot":
|
||||
product_ids = body.get("product_ids") or []
|
||||
if not isinstance(product_ids, list) or len(product_ids) < 2:
|
||||
return jsonify({"error": "Multiboot braucht eine Liste mit mindestens 2 macOS-Versionen (product_ids)."}), 400
|
||||
products = []
|
||||
for pid in product_ids:
|
||||
match = next((p for p in catalog_items if p["id"] == pid), None)
|
||||
if not match:
|
||||
return jsonify({"error": f"Unbekannte macOS-Version '{pid}' -- Katalog neu laden."}), 400
|
||||
products.append(match)
|
||||
product = products
|
||||
else:
|
||||
product_id = body.get("product_id")
|
||||
product = next((p for p in catalog_items if p["id"] == product_id), None)
|
||||
if not product:
|
||||
return jsonify({"error": "Unbekannte macOS-Version -- Katalog neu laden."}), 400
|
||||
|
||||
try:
|
||||
job = installer.create_job(product, device_path, confirm_path, job_type=job_type)
|
||||
|
||||
Reference in New Issue
Block a user