vm/network: symlink NetworkManager system-connection to /rw (#425)

In FC15, NetworkManager by default uses global connections ("Available to all users"). Save them in /rw instead of /etc, to preserve them across reboots.
This commit is contained in:
Marek Marczykowski 2012-01-30 14:20:02 +01:00
parent 18f32efe90
commit 85e6704037
5 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,10 @@
#!/bin/sh
if [ -d /etc/NetworkManager/system-connections ]; then
mkdir -p /rw/config/NM-system-connections
mv /etc/NetworkManager/system-connections/* /rw/config/NM-system-connections/ 2> /dev/null || true
rmdir /etc/NetworkManager/system-connections
ln -s /rw/config/NM-system-connections /etc/NetworkManager/system-connections
fi
exit 0

View File

@ -4,6 +4,9 @@ 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 ^plugins.*ifcfg-rh $FILE ; then
sed -i 's/^plugins=\(.*\)ifcfg-rh,\(.*\)$/plugins=\1\2/' $FILE
fi
if ! grep -q '^\[keyfile\]$' $FILE ; then
echo '[keyfile]' >> $FILE
fi

View File

@ -119,6 +119,7 @@ install network/qubes_network.rules $RPM_BUILD_ROOT/etc/udev/rules.d/99-qubes_ne
install network/qubes_setup_dnat_to_ns $RPM_BUILD_ROOT/usr/lib/qubes
install network/qubes_fix_nm_conf.sh $RPM_BUILD_ROOT/usr/lib/qubes
install network/setup_ip $RPM_BUILD_ROOT/usr/lib/qubes/
install network/network-manager-prepare-conf-dir $RPM_BUILD_ROOT/usr/lib/qubes/
install -d $RPM_BUILD_ROOT/etc/dhclient.d
ln -s /usr/lib/qubes/qubes_setup_dnat_to_ns $RPM_BUILD_ROOT/etc/dhclient.d/qubes_setup_dnat_to_ns.sh
install -d $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/
@ -342,6 +343,7 @@ rm -rf $RPM_BUILD_ROOT
/usr/lib/qubes/block_cleanup
/usr/lib/qubes/block_remove
/usr/lib/qubes/meminfo-writer
/usr/lib/qubes/network-manager-prepare-conf-dir
/usr/lib/qubes/qfile-agent
/usr/lib/qubes/qfile-unpacker
/usr/lib/qubes/qopen-in-vm

View File

@ -15,6 +15,7 @@ start()
type=$(/usr/bin/xenstore-read qubes_vm_type)
if [ "$type" == "NetVM" ]; then
/usr/lib/qubes/network-manager-prepare-conf-dir
/sbin/service NetworkManager start
fi

View File

@ -1,3 +1,8 @@
.include /lib/systemd/system/NetworkManager.service
[Unit]
ConditionPathExists=/var/run/qubes-service/network-manager
# For /rw
After=qubes-misc-post.service
[Service]
ExecStartPre=/usr/lib/qubes/network-manager-prepare-conf-dir