diff --git a/common/qubes_fix_nm_conf.sh b/common/qubes_fix_nm_conf.sh index 5a6bb305..613fa159 100755 --- a/common/qubes_fix_nm_conf.sh +++ b/common/qubes_fix_nm_conf.sh @@ -3,6 +3,8 @@ FILE=/etc/NetworkManager/NetworkManager.conf VIFMAC=mac:fe:ff:ff:ff:ff:ff if ! grep -q ^plugins.*keyfile $FILE ; then sed -i 's/^plugins.*$/&,keyfile/' $FILE +fi +if ! grep -q '^\[keyfile\]$' $FILE ; then echo '[keyfile]' >> $FILE fi if ! grep -q ^unmanaged-devices $FILE ; then diff --git a/rpm_spec/core-netvm.spec b/rpm_spec/core-netvm.spec index 026ea0fb..f806b821 100644 --- a/rpm_spec/core-netvm.spec +++ b/rpm_spec/core-netvm.spec @@ -68,6 +68,12 @@ cp ../common/vif-route-qubes $RPM_BUILD_ROOT/etc/xen/scripts %post +# Create NetworkManager configuration if we do not have it +if ! [ -e /etc/NetworkManager/NetworkManager.conf ]; then +echo '[main]' > /etc/NetworkManager/NetworkManager.conf +echo 'plugins = keyfile' >> /etc/NetworkManager/NetworkManager.conf +echo '[keyfile]' >> /etc/NetworkManager/NetworkManager.conf +fi /usr/lib/qubes/qubes_fix_nm_conf.sh chkconfig --add qubes_core_netvm || echo "WARNING: Cannot add service qubes_core!"