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

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

The install action will initialise the native chroot, so this way we
don't have to initialise the chroot in this code path. It also gives
users feedback quicker if they haven't already initialised the rootfs
since this way they don't have to wait around for nbd to be installed
before being told that they need to generate the rootfs first.

Closes https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2549
This commit is contained in:
Newbyte 2025-01-28 11:59:35 +01:00 committed by Oliver Smith
parent 06bd8d98a1
commit d01f6b9079
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -18,8 +18,6 @@ def start_nbd_server(device: str, replace: bool, ip: str = "172.16.42.2", port:
:param port: port of nbd server
"""
pmb.chroot.apk.install(["nbd"], Chroot.native())
chroot = Chroot.native()
rootfs_path = Path("/mnt/pmbootstrap/netboot") / f"{device}.img"
@ -41,6 +39,8 @@ def start_nbd_server(device: str, replace: bool, ip: str = "172.16.42.2", port:
f'serve --help" for more options.'
)
pmb.chroot.apk.install(["nbd"], chroot)
logging.info(f"Running nbd server for {device} on {ip} port {port}.")
while True: