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:
parent
18f32efe90
commit
85e6704037
10
network/network-manager-prepare-conf-dir
Executable file
10
network/network-manager-prepare-conf-dir
Executable 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
|
@ -4,6 +4,9 @@ VIFMAC=mac:fe:ff:ff:ff:ff:ff
|
|||||||
if ! grep -q ^plugins.*keyfile $FILE ; then
|
if ! grep -q ^plugins.*keyfile $FILE ; then
|
||||||
sed -i 's/^plugins.*$/&,keyfile/' $FILE
|
sed -i 's/^plugins.*$/&,keyfile/' $FILE
|
||||||
fi
|
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
|
if ! grep -q '^\[keyfile\]$' $FILE ; then
|
||||||
echo '[keyfile]' >> $FILE
|
echo '[keyfile]' >> $FILE
|
||||||
fi
|
fi
|
||||||
|
@ -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_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/qubes_fix_nm_conf.sh $RPM_BUILD_ROOT/usr/lib/qubes
|
||||||
install network/setup_ip $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
|
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
|
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/
|
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_cleanup
|
||||||
/usr/lib/qubes/block_remove
|
/usr/lib/qubes/block_remove
|
||||||
/usr/lib/qubes/meminfo-writer
|
/usr/lib/qubes/meminfo-writer
|
||||||
|
/usr/lib/qubes/network-manager-prepare-conf-dir
|
||||||
/usr/lib/qubes/qfile-agent
|
/usr/lib/qubes/qfile-agent
|
||||||
/usr/lib/qubes/qfile-unpacker
|
/usr/lib/qubes/qfile-unpacker
|
||||||
/usr/lib/qubes/qopen-in-vm
|
/usr/lib/qubes/qopen-in-vm
|
||||||
|
@ -15,6 +15,7 @@ start()
|
|||||||
|
|
||||||
type=$(/usr/bin/xenstore-read qubes_vm_type)
|
type=$(/usr/bin/xenstore-read qubes_vm_type)
|
||||||
if [ "$type" == "NetVM" ]; then
|
if [ "$type" == "NetVM" ]; then
|
||||||
|
/usr/lib/qubes/network-manager-prepare-conf-dir
|
||||||
/sbin/service NetworkManager start
|
/sbin/service NetworkManager start
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
.include /lib/systemd/system/NetworkManager.service
|
.include /lib/systemd/system/NetworkManager.service
|
||||||
[Unit]
|
[Unit]
|
||||||
ConditionPathExists=/var/run/qubes-service/network-manager
|
ConditionPathExists=/var/run/qubes-service/network-manager
|
||||||
|
# For /rw
|
||||||
|
After=qubes-misc-post.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStartPre=/usr/lib/qubes/network-manager-prepare-conf-dir
|
||||||
|
Loading…
Reference in New Issue
Block a user