device-samsung-dream: use minimal initfs-hook (MR 1843)

Instead of running the entire setup_usb_network_configfs function we
run the parts that are actually necessary for
setup_usb_network_android to succeed when it is run afterwards.
This commit is contained in:
Henrik Grimler 2020-12-16 08:23:44 +01:00 committed by Alexey Min
parent b4760587b7
commit 4d327313e4
No known key found for this signature in database
GPG key ID: 0B19D2A65870B448
2 changed files with 22 additions and 7 deletions

View file

@ -2,7 +2,7 @@
pkgname=device-samsung-dream
pkgdesc="Samsung Galaxy S8/S8+"
pkgver=0.1
pkgrel=0
pkgrel=1
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
@ -43,4 +43,4 @@ nonfree_firmware() {
}
sha512sums="8fdfb5715a3eb4d757c53995875841b1fe6d9e98878b97a30e0ec8a86e8486487cf88c4d068448d1004eeec10c6196a387d113b490856b45336b27d431c374f9 deviceinfo
36868de8bbdcad55413ca455580c42848ba4ce07814b140eece2241e9656adfed4986da0aa0ec6ed04d478aeeab417be583b0fbcc79c90557798004c99e25d0e initfs-hook.sh"
73eb760c6e29c7500b3a2090310f467bb906f7bef2556b80e00e57c25a5fdb1089e86438e67744861a5d43096d8733b812efe39e90a83584816a79d9024a2ec4 initfs-hook.sh"

View file

@ -1,7 +1,22 @@
#!/bin/sh
# shellcheck disable=SC1091
. /etc/deviceinfo
. ./init_functions.sh
# Device requires usb network initialization through configfs first
setup_usb_network_configfs
# This is a trimmed down version of setup_usb_network_configfs from
# pmOS's init_functions.sh
# See: https://www.kernel.org/doc/Documentation/usb/gadget_configfs.txt
CONFIGFS=/config/usb_gadget
# Create an usb gadet configuration
mkdir $CONFIGFS/g1 || echo "initfs-hook: Couldn't create $CONFIGFS/g1"
# Create rndis function.
mkdir $CONFIGFS/g1/functions/rndis.usb0 \
|| echo "initfs-hook: Couldn't create $CONFIGFS/g1/functions/rndis.usb0"
# Create configuration instance for the gadget
mkdir $CONFIGFS/g1/configs/c.1 \
|| echo "initfs-hook: Couldn't create $CONFIGFS/g1/configs/c.1"
# Link the rndis instance to the configuration
ln -s $CONFIGFS/g1/functions/rndis.usb0 $CONFIGFS/g1/configs/c.1 \
|| echo "initfs-hook: Couldn't symlink rndis.usb0"