Removed old unused code from appvm/qubes_core.
This commit is contained in:
parent
1b59b440e4
commit
034e654268
@ -10,24 +10,6 @@ start()
|
|||||||
{
|
{
|
||||||
echo -n $"Executing Qubes Core scripts:"
|
echo -n $"Executing Qubes Core scripts:"
|
||||||
|
|
||||||
if ! [ -d /rw/home ] ; then
|
|
||||||
echo
|
|
||||||
echo "--> Virgin boot of the VM: Linking /home to /rw/home"
|
|
||||||
mv /home /home.orig
|
|
||||||
mkdir -p /rw/config
|
|
||||||
mkdir -p /rw/home
|
|
||||||
ln -s /rw/home/ /home
|
|
||||||
# chcon --reference /home.orig /rw/home
|
|
||||||
cp -a /home.orig/user /home
|
|
||||||
touch /rw/config/rc.local
|
|
||||||
rm -fr /home.orig
|
|
||||||
touch /var/lib/qubes/first_boot_completed
|
|
||||||
else
|
|
||||||
mv /home /home.tmpl
|
|
||||||
ln -s /rw/home/ /home
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if ! [ -x /usr/bin/xenstore-read ] ; then
|
if ! [ -x /usr/bin/xenstore-read ] ; then
|
||||||
echo "ERROR: /usr/bin/xenstore-read not found!"
|
echo "ERROR: /usr/bin/xenstore-read not found!"
|
||||||
exit 1
|
exit 1
|
||||||
@ -38,38 +20,35 @@ start()
|
|||||||
|
|
||||||
vmtype=$(/usr/bin/xenstore-read qubes_vm_type)
|
vmtype=$(/usr/bin/xenstore-read qubes_vm_type)
|
||||||
|
|
||||||
if [ $vmtype == 'NetVM' ] ; then
|
|
||||||
# Setup gateway for all the VMs this netVM is serviceing...
|
if ! [ "X"$vmtype = XAppVM ] ; then
|
||||||
brctl addbr br0
|
echo "ERROR: vmtype=$vmtype"
|
||||||
gateway=$(/usr/bin/xenstore-read qubes_netvm_gateway)
|
exit 1
|
||||||
netmask=$(/usr/bin/xenstore-read qubes_netvm_netmask)
|
fi
|
||||||
network=$(/usr/bin/xenstore-read qubes_netvm_network)
|
|
||||||
ifconfig br0 $gateway netmask $netmask up
|
ip=$(/usr/bin/xenstore-read qubes_ip)
|
||||||
echo "1" > /proc/sys/net/ipv4/ip_forward
|
netmask=$(/usr/bin/xenstore-read qubes_netmask)
|
||||||
dnsmasq
|
gateway=$(/usr/bin/xenstore-read qubes_gateway)
|
||||||
iptables -t nat -A POSTROUTING -s $network/$netmask -j MASQUERADE
|
secondary_dns=$(/usr/bin/xenstore-read qubes_secondary_dns)
|
||||||
else
|
if [ x$ip != x ]; then
|
||||||
ip=$(/usr/bin/xenstore-read qubes_ip)
|
/sbin/ifconfig eth0 $ip netmask $netmask up
|
||||||
netmask=$(/usr/bin/xenstore-read qubes_netmask)
|
/sbin/route add default gw $gateway
|
||||||
gateway=$(/usr/bin/xenstore-read qubes_gateway)
|
echo "nameserver $gateway" > /etc/resolv.conf
|
||||||
secondary_dns=$(/usr/bin/xenstore-read qubes_secondary_dns)
|
echo "nameserver $secondary_dns" >> /etc/resolv.conf
|
||||||
if [ x$ip != x ]; then
|
fi
|
||||||
/sbin/ifconfig eth0 $ip netmask $netmask up
|
if ! [ -L /home ] ; then
|
||||||
/sbin/route add default gw $gateway
|
mv /home /home.orig
|
||||||
echo "nameserver $gateway" > /etc/resolv.conf
|
ln -s /rw/home /home
|
||||||
echo "nameserver $secondary_dns" >> /etc/resolv.conf
|
fi
|
||||||
fi
|
if ! [ -L /usr/local ] ; then
|
||||||
if ! [ -L /usr/local ] ; then
|
|
||||||
mv /usr/local /usr/local.orig
|
mv /usr/local /usr/local.orig
|
||||||
ln -s /rw/usrlocal /usr/local
|
ln -s /rw/usrlocal /usr/local
|
||||||
fi
|
fi
|
||||||
if ! [ -d /rw/usrlocal ] ; then
|
#make it last, we want all above to work without /rw mounted
|
||||||
|
if ! [ -d /rw/usrlocal ] ; then
|
||||||
cp -a /usr/local.orig /rw/usrlocal
|
cp -a /usr/local.orig /rw/usrlocal
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
[ -x /rw/config/rc.local ] && /rw/config/rc.local
|
[ -x /rw/config/rc.local ] && /rw/config/rc.local
|
||||||
success
|
success
|
||||||
echo ""
|
echo ""
|
||||||
|
Loading…
Reference in New Issue
Block a user