Skip to content
Snippets Groups Projects
Commit c198b895 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 50106d85
No related branches found
No related tags found
No related merge requests found
Pipeline #215836 failed
# Maintainer: Caleb Connolly <caleb@postmarketos.org>
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-initramfs
pkgver=3.7.3
pkgver=3.7.4
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
9f581b8ba94a2f9e4ca005c195c3ebbcfb4ffab6a89f376a27bcf316942b9246a8e7f47c8282c7033041e673d5409ad4df0b2bfd5b99a957e11e53f7b4513bf0 init_functions.sh
5e2e76c4eaba04c2779a2dff14327e1a0432cfe2f093f29656b043363f1fb3faa29e4aac3eb2ececd529d92c0ee03038eb34ced4a430387e5b8139c66fa89ce1 init_functions.sh
2d531177a7310ab95910379b3ab816ab8ba75520e1c11adf295f5ff8247d74553fe3a325c56c66aba4e41e33f0e813b0360c45b847983c1df448d5fb176e02cb init_2nd.sh
1d3e3ca37a14c7e3d4b600cb0bcd389e467bd4e08aa33990b589ec5a3e42a59ffc38b2c2ed18972095ca96b14e8abe6df296f1a6615e8bb0dabfbd20fabe17e1 init_functions_2nd.sh
675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf
......
......@@ -670,6 +670,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
......@@ -701,6 +702,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