main/postmarketos-mkinitfs: rename usb_rndis_function variable (MR 3669)

The variable describes the configfs function name to use, no matter if
it's rndis, ncm, ecm or any other function. So change the name of the
variable, the string we write to the configuration file and some
comments.
This commit is contained in:
Luca Weiss 2022-11-26 19:09:45 +01:00 committed by Oliver Smith
parent a3ae92f0ff
commit f60539ea18
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 10 additions and 10 deletions

View file

@ -2,7 +2,7 @@
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-mkinitfs
pkgver=1.5.1
pkgrel=1
pkgrel=2
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org"
depends="
@ -68,5 +68,5 @@ sha512sums="
d28802b17d7912a58d23c02fbdddfdb6f74489e712d61a59472f7f000a4429786f69ba2fca59d321c55c277ff79edb6f47c939a9e973b31f694aeca0167354ff postmarketos-mkinitfs-1.5.1.tar.gz
20f110337113e8de8999cf2a064a93fea36821d5c216bfa4ba46ec1f83825638262b92fd7be29eee0a85a54a108b7315a96cbe30da8ae4419f54c2ed53bb08c7 00-default.modules
ccdceaa710d97d6f57d8d66bfcbec448486d08083341712303f62123039f729229b88528308e411a308a2b90b81b60de89fe91143a6facbb11cbc9b4055eeaec init.sh
260f7be8a199d5a3b64975441f7a3c62908b2e36b406341d858f90efd5d713e5559df1ecf465d7d61f5ebd009f61c34ba28e5db81f184ec8d857ceebffc985d9 init_functions.sh
9397e448c3397f48497cabc07472e6950a7e630834e019b2e37b7c8580015aff55bafdc093b3ae79939d14962b8825f15e6946003c89a4f871a0d71121443997 init_functions.sh
"

View file

@ -466,7 +466,7 @@ setup_usb_network_configfs() {
usb_idVendor="${deviceinfo_usb_idVendor:-0x18D1}" # default: Google Inc.
usb_idProduct="${deviceinfo_usb_idProduct:-0xD001}" # default: Nexus 4 (fastboot)
usb_serialnumber="${deviceinfo_usb_serialnumber:-postmarketOS}"
usb_rndis_function="${deviceinfo_usb_rndis_function:-rndis.usb0}"
usb_network_function="${deviceinfo_usb_network_function:-rndis.usb0}"
echo " Setting up an USB gadget through configfs"
# Create an usb gadet configuration
@ -483,21 +483,21 @@ setup_usb_network_configfs() {
# shellcheck disable=SC2154
echo "$deviceinfo_name" > "$CONFIGFS/g1/strings/0x409/product"
# Create rndis function. The function can be named differently in downstream kernels.
mkdir $CONFIGFS/g1/functions/"$usb_rndis_function" \
|| echo " Couldn't create $CONFIGFS/g1/functions/$usb_rndis_function"
# Create network function.
mkdir $CONFIGFS/g1/functions/"$usb_network_function" \
|| echo " Couldn't create $CONFIGFS/g1/functions/$usb_network_function"
# Create configuration instance for the gadget
mkdir $CONFIGFS/g1/configs/c.1 \
|| echo " Couldn't create $CONFIGFS/g1/configs/c.1"
mkdir $CONFIGFS/g1/configs/c.1/strings/0x409 \
|| echo " Couldn't create $CONFIGFS/g1/configs/c.1/strings/0x409"
echo "rndis" > $CONFIGFS/g1/configs/c.1/strings/0x409/configuration \
echo "USB network" > $CONFIGFS/g1/configs/c.1/strings/0x409/configuration \
|| echo " Couldn't write configration name"
# Link the rndis instance to the configuration
ln -s $CONFIGFS/g1/functions/"$usb_rndis_function" $CONFIGFS/g1/configs/c.1 \
|| echo " Couldn't symlink $usb_rndis_function"
# Link the network instance to the configuration
ln -s $CONFIGFS/g1/functions/"$usb_network_function" $CONFIGFS/g1/configs/c.1 \
|| echo " Couldn't symlink $usb_network_function"
# Check if there's an USB Device Controller
if [ -z "$(ls /sys/class/udc)" ]; then