This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 118
Use NetworkManager #241
Merged
Merged
Use NetworkManager #241
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
54c70c5
conf: Allow wireless-tools back into image
zehortigoza eea5e48
intel-aero-image: Install NetworkManager and ModemManager
zehortigoza 40d7760
networkmanager: Configure networks
zehortigoza 1b492b9
modemmanager: Add runtime dependency that Intel modems have
zehortigoza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 @@ | ||
RDEPENDS_${PN} += "glibc-gconv-utf-16" |
3 changes: 3 additions & 0 deletions
3
recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf
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 @@ | ||
|
||
[keyfile] | ||
unmanaged-devices=interface-name:usb0 |
50 changes: 50 additions & 0 deletions
50
recipes-connectivity/networkmanager/networkmanager/firstboot-networkmanager-setup
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,50 @@ | ||
#!/bin/bash | ||
|
||
FILECONDITION="/etc/sysconfig/networkmanager" | ||
WIFI_AP_DEFAULTPASSWORD="1234567890" | ||
|
||
# This is the APN name for AT&T HSPA+, user should change this with: | ||
# nmcli con modify Modem gsm.apn <name> | ||
MODEM_APN_NAME="phone" | ||
|
||
while [ 1 ]; do | ||
read xx MAC xx <<<$(ip link | grep -A1 -e "^[0-9]*: wl" | grep link/ether) | ||
# poor's man "wait for device to appear" | ||
if [ -z "$MAC" ]; then | ||
sleep 1 | ||
continue | ||
fi | ||
|
||
# remove : | ||
SSID=${MAC//:} | ||
# make it uppercase | ||
SSID=${SSID^^} | ||
# prefix "Aero-" | ||
SSID="Aero-$SSID" | ||
break | ||
done | ||
|
||
# Let NetworkManager start dnsmasq with the right configuration file | ||
systemctl disable dnsmasq | ||
systemctl stop dnsmasq | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be a bbappend on dnsmasq recipe to not enable it. |
||
|
||
# SystemD is creating this file as symbolic link and taking care of if, not | ||
# letting netowrkmanager update it with dns from modem of wifi client mode. | ||
rm /etc/resolv.conf | ||
|
||
# Wifi | ||
nmcli con add type wifi ifname '*' con-name Wifi-hostspot autoconnect yes ssid $SSID | ||
nmcli con modify Wifi-hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared | ||
nmcli con modify Wifi-hostspot wifi-sec.key-mgmt wpa-psk | ||
nmcli con modify Wifi-hostspot wifi-sec.psk "$WIFI_AP_DEFAULTPASSWORD" | ||
nmcli con modify Wifi-hostspot ipv4.addresses 192.168.8.1/24 | ||
nmcli con up Wifi-hostspot | ||
|
||
# Modem | ||
nmcli con add type gsm ifname '*' con-name Modem apn $MODEM_APN_NAME autoconnect yes | ||
nmcli con up Modem | ||
|
||
# Make sure this script just run once | ||
mkdir -p $(dirname $FILECONDITION) | ||
touch $FILECONDITION | ||
echo "First boot configuration succesful" |
14 changes: 14 additions & 0 deletions
14
recipes-connectivity/networkmanager/networkmanager/firstboot-networkmanager.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,14 @@ | ||
[Unit] | ||
Description=NetworkManager service default configuration | ||
Requisite=NetworkManager.service | ||
After=NetworkManager.service | ||
Before=network.target multi-user.target | ||
Wants=network.target | ||
ConditionPathExists=!/etc/sysconfig/networkmanager | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/sbin/firstboot-networkmanager-setup | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
20 changes: 20 additions & 0 deletions
20
recipes-connectivity/networkmanager/networkmanager_%.bbappend
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,20 @@ | ||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
|
||
SRC_URI += "file://firstboot-networkmanager.service" | ||
SRC_URI += "file://firstboot-networkmanager-setup" | ||
SRC_URI += "file://NetworkManager.conf" | ||
|
||
PACKAGECONFIG += "modemmanager" | ||
PACKAGECONFIG += "ppp" | ||
PACKAGECONFIG += "wifi" | ||
PACKAGECONFIG += "systemd" | ||
|
||
DEPENDS += "nss" | ||
|
||
SYSTEMD_SERVICE_${PN} += "firstboot-networkmanager.service" | ||
|
||
do_install_append() { | ||
install -D -m 0755 ${WORKDIR}/firstboot-networkmanager-setup ${D}/usr/sbin | ||
install -D -m 0644 ${WORKDIR}/firstboot-networkmanager.service ${D}${systemd_unitdir}/system | ||
install -D -m 0644 ${WORKDIR}/NetworkManager.conf ${D}${sysconfdir}/NetworkManager | ||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These PACKAGE_EXCLUDE, RDEPENDS_packagegroup-xyz should be moved to the images bb files. RDEPENDS_packagegroup_xyz lines remain the same, PACKAGE_EXCLUDE lines becomes IMAGE_INSTALL_remove.