-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- to build EEM module - to install only EEM feature on RPI Zero or ZeroW RPI usb0 interface config relies now on dhcpcd service (allows avahi to work)
- Loading branch information
Showing
6 changed files
with
69 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# check rpi-source | ||
if [ -z "$(which rpi-source)" ]; then | ||
sudo apt install bc | ||
wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update | ||
fi | ||
|
||
# around 150 Mo | ||
rpi-source --nomake | ||
cd /lib/modules/$(uname -r)/source | ||
|
||
# enabling USB EEM module in config | ||
sed -i "s/# CONFIG_USB_ETH_EEM is not set/CONFIG_USB_ETH_EEM=y/" .config | ||
|
||
# building module | ||
make drivers/usb/gadget/function/usb_f_eem.ko | ||
# installing module | ||
sudo mv drivers/usb/gadget/function/usb_f_eem.ko /lib/modules/$(uname -r)/kernel/drivers/usb/gadget/function/ | ||
sudo depmod | ||
cd - | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
if [ "`whoami`" != "root" ]; | ||
then | ||
echo "This script needs to be run as root. Please use sudo." | ||
exit 1 | ||
fi | ||
|
||
if [ "`grep ^dtoverlay=dwc2 /boot/config.txt`" = "" ]; then | ||
echo dtoverlay=dwc2 >> /boot/config.txt | ||
fi | ||
|
||
echo "Installing USB gadget script..." | ||
# Installing as a system service to enable it on boot | ||
mkdir /usr/lib/systemd/system | ||
cp resources/myusbgadget /usr/local/bin/myusbgadget | ||
chmod +x /usr/local/bin/myusbgadget | ||
cp resources/myusbgadget.service /usr/lib/systemd/system/ | ||
systemctl enable myusbgadget | ||
|
||
echo "Installing network related files..." | ||
# USB gadget configuration file | ||
cat resources/dhcpcd.conf >> /etc/dhcpcd.conf | ||
#cp resources/usb0 /etc/network/interfaces.d/ | ||
|
||
echo "Setting up the read-only filesystem..." | ||
# We need to setup filesystems as readonly because the RPi will be shut down without notice | ||
cp /etc/fstab /etc/fstab.bak | ||
sed 's/^\(PARTUUID.*defaults\)/\1,ro/' < /etc/fstab.bak > /etc/fstab | ||
# Add some folders as tmpfs (logs, tmp...) | ||
cat resources/fstab.tmp >> /etc/fstab | ||
# this remount script can be called to mount root filesystem as read-write again | ||
cp resources/remount /usr/sbin/remount | ||
chmod +x /usr/sbin/remount | ||
mv /etc/resolv.conf /tmp/resolv.conf | ||
ln -s /tmp/resolv.conf /etc/resolv.conf | ||
|
||
echo "Installation is done! You can reboot to apply the configuration," | ||
echo "then plug the key into your car's USB port and navigate to the Internet application." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
interface usb0 | ||
static ip_address=192.168.0.2/24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.