Skip to content
Snippets Groups Projects
Commit 014fc147 authored by David Furey's avatar David Furey
Browse files

Allow the USB network host address to be configured rather than random

The USB network host address is used by some hosts to define the interface
name. Making the host address deterministic can simplify host network
configuration.
parent 4baacf94
No related branches found
No related tags found
No related merge requests found
Pipeline #215837 passed
# Maintainer: Caleb Connolly <caleb@postmarketos.org>
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-initramfs
pkgver=3.7.5
pkgver=3.7.6
pkgrel=0
pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra"
url="https://postmarketos.org"
......@@ -109,7 +109,7 @@ sha512sums="
c0233d22858a5901db64e1d2fe1f6d39a2e2cfd1b94a10932483f55fed9461e9b8aa2d73b154b9d99a7a8b49ee02abfbddfe917ce0c6d7576601ba2668589c01 00-initramfs-base.files
d0f35562365756d93066ce45924d17fb347b54095179c3262daa2f073e12743505cd5d9372ad30485915ca754d95a8edba9a74314e7949e0b3cf6978a87d03a5 00-initramfs-extra-base.files
c497ace6f3d183c48722b9e4fd2b6fed21338d68a9e729c1423d3c3de3eaae7366d8dd75a11f78b7072a6795dcc5380c10d8b390738372ede6dc78074ae87a76 init.sh
b7fe2fb320831c2b482ed6f8299b3fd8bfe993cdf437c6d2d6161bc3f37d93d1959224809e776db6a3017737b97c4a7250c8a4f9eb0f57bbd42c3f21b1d34abd init_functions.sh
0e19952e580ede6653517f96bccce4672df4df02774c82d280c74e6c554a8a1e107f11e865fe00541f27560514a6e080b043d07292a7e23d37f8f8cab708dbe2 init_functions.sh
1edba1de85505cf74f1d1639d8dc0f79764397643aa58b63e0beb7b97d8b67a4f604d90c4efafff0e75e36a3a88bf9d590eb5c29bce5711fc0fc6ffd4d4b617b init_2nd.sh
3f750f2d963bdff97b662d220e9dc8092ce482b799695d27ae038f2c8b39ed442082931dfd19ed4833ec3e754f8877860df724f3d860845dc8793353b289e750 init_functions_2nd.sh
675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf
......
......@@ -653,6 +653,7 @@ setup_usb_network_configfs() {
usb_serialnumber="${deviceinfo_usb_serialnumber:-postmarketOS}"
usb_network_function="${deviceinfo_usb_network_function:-ncm.usb0}"
usb_network_function_fallback="rndis.usb0"
usb_network_host_addr="${deviceinfo_usb_network_host_addr:-}"
echo " Setting up USB gadget through configfs"
# Create an usb gadet configuration
......@@ -684,6 +685,11 @@ setup_usb_network_configfs() {
|| echo " Couldn't create $CONFIGFS/g1/configs/c.1/strings/0x409"
echo "USB network" > $CONFIGFS/g1/configs/c.1/strings/0x409/configuration \
|| echo " Couldn't write configration name"
if [ -n "$usb_network_host_addr" ]; then
echo "$usb_network_host_addr" > $CONFIGFS/g1/functions/"$usb_network_function"/host_addr \
|| echo " Couldn't write host addr"
fi
# Link the network instance to the configuration
ln -s $CONFIGFS/g1/functions/"$usb_network_function" $CONFIGFS/g1/configs/c.1 \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment