main/postmarketos-mkinitfs-hook-netboot: use custom IP address if available (MR 4350)
With the recent changes in commit 80fff9242, it's possible that the client IP address is customized. Use the same code as in init_functions.sh to get the this potentially customized IP address to use for the nbd-client. [ci:skip-build]: already built successfully in CI
This commit is contained in:
parent
8cbd19f79d
commit
eb7204df91
@ -1,6 +1,6 @@
|
||||
# Maintainer: Mark <clashclanacc2602@gmail.com>
|
||||
pkgname=postmarketos-mkinitfs-hook-netboot
|
||||
pkgver=4.0.2
|
||||
pkgver=4.0.3
|
||||
pkgrel=0
|
||||
pkgdesc="Netboot postmarketOS using nbd feature"
|
||||
url="https://postmarketos.org"
|
||||
@ -21,6 +21,6 @@ package() {
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
2af13144ef4ba831ebdac1056f9c493ab05f3f7bfe62eb2a8ff3cc6741d225511f1f59a94f33414678bcab9dab35c7b025e5eb728fe6347e3c4b6d6e2d770758 netboot.sh
|
||||
039b6ae08ffb2e24573a5659fef8ff14f70219e06fe6dd6c5ad459f3b54883e17166060813762cdc71b7c774f450956158871fd64c70330d0a661a8cc94666e7 netboot.sh
|
||||
3c9c812a6cd25640e6cf4d722cff6c6356d5666ec6009b4c65f89e62211cc406d2cd09e0fdda6b1c1906ee32c3854988ab701cee8811208e3ef666f09e638568 netboot.modules
|
||||
"
|
||||
|
@ -3,7 +3,6 @@
|
||||
. ./init_functions.sh
|
||||
. /usr/share/misc/source_deviceinfo
|
||||
NBD_PORT=9999
|
||||
NBD_IP=172.16.42.2
|
||||
NBD_BLOCK_SIZE=${deviceinfo_rootfs_image_sector_size:-512}
|
||||
|
||||
setup_usb_network
|
||||
@ -21,12 +20,14 @@ if [ ! -b /dev/nbd0 ]; then
|
||||
pmos_loop_forever
|
||||
fi
|
||||
|
||||
while ! busybox nbd-client $NBD_IP $NBD_PORT /dev/nbd0 -b "$NBD_BLOCK_SIZE"; do
|
||||
client_ip="${unudhcpd_client_ip:-172.16.42.2}"
|
||||
|
||||
while ! busybox nbd-client "$client_ip" $NBD_PORT /dev/nbd0 -b "$NBD_BLOCK_SIZE"; do
|
||||
echo "Connection attempt not successful, continuing..."
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Connected to $NBD_IP!"
|
||||
echo "Connected to $client_ip!"
|
||||
|
||||
# Show "Loading" splash again when continuing
|
||||
show_splash "Loading..."
|
||||
|
Loading…
x
Reference in New Issue
Block a user