Commit 5e79390
0
plików
+0
dodanych
-0
usuniętych
@@ -55,7 +55,7 @@ import threading, itertools
55 55 import uuid # serialNumber SBOM (CycloneDX)
56 56
57 57 # Wersja klienta – do porównania z repo.json["pag_version"] (self-update)
58 -PAG_VERSION = "4.0.2"
58 +PAG_VERSION = "4.0.3"
59 59 from urllib.error import URLError, HTTPError
60 60
61 61 # =============================================================================
@@ -5429,6 +5429,22 @@ def cmd_initramfs_update():
5429 5429 return 0 if ok else 1
5430 5430
5431 5431
5432 +def _boot_prefix() -> str:
5433 + """Prefiks ścieżek jądra/initrd w grub.cfg.
5434 +
5435 + Gdy /boot jest OSOBNYM punktem montowania, GRUB ma w `root` partycję
5436 + /boot (tam leży grub.cfg i jądra), więc ścieżki podajemy względem niej:
5437 + "/vmlinuz-…", "/initramfs.img" – BEZ przedrostka /boot. Gdy /boot leży
5438 + na roocie, wymagane jest "/boot/…". Zły przedrostek = "file not found".
5439 + """
5440 + try:
5441 + if os.path.isdir("/boot") and os.path.ismount("/boot"):
5442 + return ""
5443 + except OSError:
5444 + pass
5445 + return "/boot"
5446 +
5447 +
5432 5448 def _update_grub_config():
5433 5449 """
5434 5450 Generuje wpisy GRUB dla wszystkich deploymentów.
@@ -5501,12 +5517,14 @@ def _update_grub_config():
5501 5517 [f for f in os.listdir("/boot") if f.startswith("vmlinuz-")],
5502 5518 reverse=True
5503 5519 ) if os.path.isdir("/boot") else []
5520 + # Osobna partycja /boot => GRUB ma ją w `root`, ścieżki BEZ /boot.
5521 + _bp = _boot_prefix()
5504 5522 lines.append("menuentry 'Pagan Linux – fallback (zwykły root)' {")
5505 5523 if fallback_kernels:
5506 - lines.append(f" linux /boot/{fallback_kernels[0]}{root_arg} rw quiet")
5524 + lines.append(f" linux {_bp}/{fallback_kernels[0]}{root_arg} rw quiet")
5507 5525 else:
5508 5526 lines.append(" # Brak jądra w /boot")
5509 - lines.append(f" initrd /boot/initramfs.img")
5527 + lines.append(f" initrd {_bp}/initramfs.img")
5510 5528 lines.append("}")
5511 5529 lines.append("")
5512 5530