RDKEMW-9237: Adding secure mount support. - #354
Conversation
Signed-off-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new systemd configuration file to ensure NetworkManager starts after the securemount.service, and refactors the WiFi bootstrap script to support migration of WiFi credentials from non-secure to secure storage locations. The changes enhance security by handling WiFi configurations through the encrypted filesystem (ECFS).
Key changes:
- New systemd unit configuration to establish a dependency on securemount.service
- Refactored WiFi credential handling to migrate settings from
/opt/NetworkManagerto/opt/secure/NetworkManager - Added logic to use previously configured settings when no SSID is found in the supplicant configuration
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| systemd_units/NetworkManager_ecfs.conf | Adds systemd unit configuration to ensure NetworkManager waits for securemount.service |
| lib/rdk/NM_Bootstrap.sh | Refactors WiFi credential migration logic, adds secure storage handling, and implements fallback to previously configured settings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| rm -rf /opt/NetworkManager/system-connections/* | ||
| fi | ||
| if [ "$RDK_PROFILE" == "TV" ]; then | ||
| echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootsrtap" >> /opt/logs/NMMonitor.log |
There was a problem hiding this comment.
Corrected spelling of 'NM_Bootsrtap' to 'NM_Bootstrap'.
| echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootsrtap" >> /opt/logs/NMMonitor.log | |
| echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootstrap" >> /opt/logs/NMMonitor.log |
| sed -i '/network={/,/}/d' /opt/secure/wifi/wpa_supplicant.conf | ||
| fi | ||
|
|
||
| if [ -z $SSID ]; then |
There was a problem hiding this comment.
Variable $SSID should be quoted to handle empty strings correctly. Use [ -z \"$SSID\" ] instead. Without quotes, the test will fail if SSID is empty or unset.
| if [ -z $SSID ]; then | |
| if [ -z "$SSID" ]; then |
| if [ "$RDK_PROFILE" == "TV" ]; then | ||
| echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootsrtap" >> /opt/logs/NMMonitor.log | ||
| fi | ||
| if [ -z $PSK ]; then |
There was a problem hiding this comment.
Variable $PSK should be quoted to handle empty strings correctly. Use [ -z \"$PSK\" ] instead. Without quotes, the test will fail if PSK is empty or unset.
| if [ -z $PSK ]; then | |
| if [ -z "$PSK" ]; then |
| SSID=$(cat $WIFI_WPA_SUPPLICANT_CONF | grep -w ssid= | cut -d '"' -f 2) | ||
| PSK_LINE=$(grep psk= "$WIFI_WPA_SUPPLICANT_CONF") | ||
|
|
||
| if [ -f $RDKV_SUPP_CONF ]; then |
There was a problem hiding this comment.
Variable $RDKV_SUPP_CONF should be quoted to handle paths with spaces correctly. Use [ -f \"$RDKV_SUPP_CONF\" ] instead.
| if [ -f $RDKV_SUPP_CONF ]; then | |
| if [ -f "$RDKV_SUPP_CONF" ]; then |
No description provided.