Skip to content

Commit

Permalink
Try to fix network manager settings
Browse files Browse the repository at this point in the history
  • Loading branch information
guysoft committed Aug 10, 2024
1 parent d9830ce commit 7260cdb
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# Uncomment everything below this line and set your ssid and password
# [connection]
# id=wifi
# uuid=95b17351-297c-4d9c-90f9-69d3deadbeef
# uuid=593819b8-135a-4a3e-9611-c36cdeadbeef
# type=wifi
# interface-name=wlan0

# [wifi]
# mode=infrastructure
# ssid=put password here
# ssid=set your wifi ssid here

# [wifi-security]
# auth-alg=open
# key-mgmt=wpa-psk
# psk=put password here
# psk=set your password here

# [ipv4]
# method=auto

# [ipv6]
# addr-gen-mode=default
# method=auto

# [proxy]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#### Enable network manager configuration from boot
####
#### Written by Guy Sheffer <guysoft at gmail dot com>
#### Copyright 2024
#### https://github.com/guysoft/CustomPiOS
####
#### This File is distributed under GPLv3

[Unit]
Description=persistent setup on %I
Wants=network-pre.target
Before=network-pre.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device

[Service]
ExecStart=/opt/custompios/copy-network-manager-config %I
Type=oneshot

[Install]
WantedBy=multi-user.target
7 changes: 3 additions & 4 deletions src/modules/network/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ if [ "${NETWORK_WPA_SUPPLICANT}" == "yes" ]; then
fi

if [ "${NETWORK_NETWORK_MANAGER}" == "yes" ]; then
DIST_NETWORK_FILE=/"${BASE_BOOT_MOUNT_PATH}"/${DIST_NAME,,}-wifi.nmconnection
unpack /filesystem/network-manager/boot /"${BASE_BOOT_MOUNT_PATH}"
unpack filesystem/usr/network-manager /opt root
unpack /filesystem/network-manager/opt /"${BASE_BOOT_MOUNT_PATH}"

mv /"${BASE_BOOT_MOUNT_PATH}"/wifi.nmconnection ${DIST_NETWORK_FILE}

ln -s "${DIST_NETWORK_FILE}" /etc/NetworkManager/system-connections/wifi.nmconnection
chmod 600 /etc/NetworkManager/system-connections/wifi.nmconnection
systemctl_if_exists enable copy-network-manager-config.service
fi

if [ "${BASE_DISTRO}" == "raspbian" ]; then
Expand Down

0 comments on commit 7260cdb

Please sign in to comment.