udev
This commit is contained in:
parent
8a74720fb5
commit
1ec4b47da6
13
Makefile
13
Makefile
@ -106,7 +106,7 @@ spirilink-driver:
|
||||
.PHONY: configure-spirilink
|
||||
configure-spirilink:
|
||||
@echo "Configuring SpiriLink interface as spir0..."
|
||||
spirilink_iface=$$(iw dev | awk '$$1=="Interface"{print $$2}' | head -n 1); \
|
||||
@spirilink_iface=$$(iw dev | awk '$$1=="Interface"{print $$2}' | head -n 1); \
|
||||
if [ -z "$$spirilink_iface" ]; then \
|
||||
echo "Error: SpiriLink interface not detected."; \
|
||||
exit 1; \
|
||||
@ -114,23 +114,24 @@ configure-spirilink:
|
||||
echo "Detected SpiriLink interface: $$spirilink_iface"; \
|
||||
mac_address=$$(cat /sys/class/net/$$spirilink_iface/address); \
|
||||
echo "Detected MAC address: $$mac_address"; \
|
||||
echo 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="'$$mac_address'", NAME="spir0"' | $(SUDO) tee /etc/udev/rules.d/99-spirilink.rules; \
|
||||
echo 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="'$$mac_address'", NAME="spir0"' | $(SUDO) tee /etc/udev/rules.d/99-spirilink.rules > /dev/null; \
|
||||
$(SUDO) udevadm control --reload-rules; \
|
||||
$(SUDO) udevadm trigger;
|
||||
@echo "Adding spir0 to unmanaged devices in NetworkManager..."
|
||||
$(SUDO) mkdir -p /etc/NetworkManager
|
||||
$(SUDO) touch /etc/NetworkManager/NetworkManager.conf
|
||||
@$(SUDO) mkdir -p /etc/NetworkManager
|
||||
@$(SUDO) touch /etc/NetworkManager/NetworkManager.conf
|
||||
@if ! grep -q "\[keyfile\]" /etc/NetworkManager/NetworkManager.conf; then \
|
||||
echo "[keyfile]" | $(SUDO) tee -a /etc/NetworkManager/NetworkManager.conf > /dev/null; \
|
||||
fi
|
||||
@if ! grep -q "unmanaged-devices=interface-name:spir0" /etc/NetworkManager/NetworkManager.conf; then \
|
||||
echo "unmanaged-devices=interface-name:spir0" | $(SUDO) tee -a /etc/NetworkManager/NetworkManager.conf > /dev/null; \
|
||||
fi
|
||||
$(SUDO) systemctl restart NetworkManager
|
||||
@$(SUDO) systemctl restart NetworkManager
|
||||
@echo "Configuring wifibroadcast default interface..."
|
||||
$(SUDO) bash -c 'echo "WFB_NICS=\"spir0\"" > /etc/default/wifibroadcast'
|
||||
@$(SUDO) bash -c 'echo "WFB_NICS=\"spir0\"" > /etc/default/wifibroadcast'
|
||||
@echo "SpiriLink configuration complete."
|
||||
|
||||
|
||||
# Install SpiriLink software
|
||||
.PHONY: spirilink-software
|
||||
spirilink-software:
|
||||
|
Loading…
Reference in New Issue
Block a user