-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rock Qu
committed
Jun 13, 2019
1 parent
6489648
commit 1ce7412
Showing
6 changed files
with
60 additions
and
21 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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
#! /bin/bash | ||
|
||
target=$1 | ||
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
sudo cp $script_dir/wpa_ap.service $target/lib/systemd/system | ||
sudo cp -r $script_dir/wpa_ap $target/usr/local/share/ | ||
sudo mkdir $target/wilc_bld | ||
sudo mkdir -p $target/lib/firmware/mchp | ||
sudo mkdir -p $target/lib/modules/4.14.0-xilinx-v2018.3/extra | ||
sudo cp $script_dir/wilc-sdio.ko $target/lib/modules/4.14.0-xilinx-v2018.3/extra/ | ||
sudo cp $script_dir/ap_v2.sh $target/usr/local/share/wpa_ap/ | ||
|
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 |
---|---|---|
@@ -1,29 +1,49 @@ | ||
#! /bin/bash | ||
#!/bin/bash | ||
|
||
set -x | ||
set -e | ||
|
||
cd /wilc_bld | ||
set -x | ||
|
||
# Install firmware files on root filesystem | ||
cd /wilc_bld | ||
git clone https://github.com/linux4wilc/firmware | ||
cd firmware | ||
git checkout tags/wilc_linux_15_2 | ||
cp /wilc_bld/firmware/wilc3000_wifi_firmware.bin /lib/firmware/mchp/ | ||
cp /wilc_bld/firmware/wilc3000_ble_firmware.bin /lib/firmware/mchp/ | ||
|
||
cd / | ||
rm -rf wilc_bld | ||
|
||
# Register wifi driver (depmod doesn't work here) | ||
# depmod -a | ||
|
||
# Start module on bootup | ||
echo "wilc-sdio" >> /etc/modules | ||
|
||
# Wilc cannot do wlan1 only wlan0 and p2p0, so fix that for host ap | ||
echo "INTERFACES=\"usb0 p2p0\"" > /etc/default/isc-dhcp-server | ||
cp /usr/local/share/wpa_ap/ap.sh /usr/local/share/wpa_ap/ap_v1.sh | ||
cp /usr/local/share/wpa_ap/ap_v2.sh /usr/local/share/wpa_ap/ap.sh | ||
chmod a+x /usr/local/share/wpa_ap/ap.sh | ||
|
||
if [ -f /etc/default/isc-dhcp-server ] && \ | ||
grep -q "INTERFACES=" /etc/default/isc-dhcp-server; then | ||
if ! grep -q "p2p0" /etc/default/isc-dhcp-server; then | ||
sed -i 's/\(INTERFACES=\)"\(.*\)"/\1"\2 p2p0"/g' \ | ||
/etc/default/isc-dhcp-server | ||
fi | ||
else | ||
echo 'INTERFACES="p2p0"' > /etc/default/isc-dhcp-server | ||
fi | ||
|
||
cat - >> /etc/dhcp/dhcpd.conf <<EOT | ||
subnet 192.168.2.0 netmask 255.255.255.0 { | ||
option subnet-mask 255.255.255.0; | ||
option broadcast-address 192.168.2.0; | ||
range 192.168.2.2 192.168.2.100; | ||
} | ||
EOT | ||
|
||
cat - > /etc/network/interfaces.d/wlan0 <<EOT | ||
iface wlan0 inet dhcp | ||
wireless_mode managed | ||
wireless_essid any | ||
wpa-driver wext | ||
wpa-conf /etc/wpa_supplicant.conf | ||
EOT | ||
|
||
# Uncomment the following line to enable wireless access point by default | ||
# systemctl enable wpa_ap.service |
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,11 @@ | ||
[Unit] | ||
Description=Wifi Access Point for U96-V2 | ||
Before=network-online.service isc-dhcp-server.service | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=/usr/local/share/wpa_ap/ap.sh | ||
|
||
[Install] | ||
WantedBy=basic.target |
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,10 @@ | ||
ctrl_interface=/var/run/wpa_supplicant | ||
ctrl_interface_group=0 | ||
update_config=1 | ||
|
||
network={ | ||
ssid="pynq" | ||
mode=2 | ||
key_mgmt=NONE | ||
frequency=2437 | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
ARCH_Ultra96 := aarch64 | ||
BSP_Ultra96 := sensors96b_v2.bsp | ||
|
||
STAGE4_PACKAGES_Ultra96 := pynq mraa upm usbgadget wpa_ap usb-eth0 sensorconf wilc3000 | ||
STAGE4_PACKAGES_Ultra96 := pynq mraa upm usbgadget usb-eth0 sensorconf | ||
STAGE4_PACKAGES_Ultra96 += wilc3000 |