1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-12 19:09:56 +03:00

pmb.netboot: Initialize chroot before checking path in chroot

Otherwise with zapped chroots, the check will fail and pmbootstrap won't
be able to locate the netboot image.

Fixes: d01f6b90 ("pmb.netboot: Only attempt to install nbd after rootfs existance check (MR 2540)")

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2583
This commit is contained in:
Luca Weiss 2025-04-13 11:36:28 +02:00 committed by Oliver Smith
parent 2177271fc8
commit 0bca7555d7
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -20,6 +20,7 @@ def start_nbd_server(device: str, replace: bool, ip: str = "172.16.42.2", port:
"""
chroot = Chroot.native()
pmb.chroot.init(chroot)
rootfs_path = Path("/mnt/pmbootstrap/netboot") / f"{device}.img"
if not (chroot / rootfs_path).exists() or replace: