[go: up one dir, main page]

Skip to content

Commit

Permalink
Modification script USB Gadget pour supporter le mode Clé USB (MAJ au…
Browse files Browse the repository at this point in the history
…to des ZAR ?)
  • Loading branch information
Mwyann committed Jul 2, 2019
1 parent be436b4 commit 06a7f82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Binary file not shown.
9 changes: 5 additions & 4 deletions resources/myusbgadget
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

echo "Configuring USB Gadget..."

#remount
modprobe libcomposite

cd /sys/kernel/config/usb_gadget/
mkdir g && cd g

if [ -f /media/xfer/.EEM ]; then
USBMODE="EEM"

if [ "$USBMODE" == "EEM" ]; then
echo 0x243a > idVendor # Peugeot
echo 0x0001 > idProduct # Connect Apps
echo 0x0226 > bcdDevice # v2.26
Expand Down Expand Up @@ -42,15 +43,15 @@ fi

echo "Enabling MassStorage function..."
mkdir -p functions/mass_storage.usb0 # mass storage
if [ -f /media/xfer/.EEM ]; then
if [ "$USBMODE" == "EEM" ]; then
echo "Enabling EEM function..."
mkdir -p functions/eem.usb0 # network
fi

mkdir -p configs/c.1
echo 500 > configs/c.1/MaxPower
ln -s functions/mass_storage.usb0 configs/c.1/
if [ -f /media/xfer/.EEM ]; then
if [ "$USBMODE" == "EEM" ]; then
ln -s functions/eem.usb0 configs/c.1/
fi

Expand Down
6 changes: 3 additions & 3 deletions resources/myusbgadget.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Description=USB Gadget Service
After=systemd-modules-load.service
Before=networking.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/usbgadget_enable.sh
ExecStop=/usr/local/bin//usbgadget_disable.sh
ExecStop=/usr/local/bin/usbgadget_disable.sh

[Install]
WantedBy=sysinit.target

0 comments on commit 06a7f82

Please sign in to comment.