Изменена инициализация системы для lxc и livecd

* исправлено добавление net.* служб
develop 3.6.0_alpha2
parent f0cfadc55f
commit 5575c18520

@ -19,7 +19,7 @@ depend() {
need localmount root fsck modules
before keymaps consolefont dbus xdm
use swap hostname
keyword -timeout -docker -lxc -systemd-nspawn -vserver
keyword -timeout -docker -systemd-nspawn -vserver
}
check_install_ability()
@ -135,9 +135,10 @@ setup_alsautils() {
}
start() {
local roottype=`variable_value main.os_root_type`
if rc-config list boot | grep -q -e "calculate " -e "calculate$"
then
local roottype=`variable_value main.os_root_type`
local subsystem=`variable_value main.os_subsystem`
local rootflash=`variable_value main.os_root_flash_dev`
if [[ $roottype != "livecd" ]] || grep "video:nvidia" /proc/cmdline &>/dev/null
then
@ -145,23 +146,29 @@ start() {
fi
setup_alsautils
LANG=C create_nonroot_user
LANG=C /usr/sbin/cl-core --method setup_system --no-progress --usenew-conf --live on
if [[ $subsystem == "lxc" ]] || [[ $roottype == "livecd" ]]
then
LANG=C /usr/sbin/cl-core --method setup_system --no-progress --usenew-conf --live on --network on
else
LANG=C /usr/sbin/cl-core --method setup_system --no-progress --usenew-conf --live on
fi
LANG=C configure_users
[[ -n $rootflash ]] && mount -o remount,rw $rootflash
rc-update del calculate boot
# reinit net.* services
local rootdev=`variable_value main.os_root_dev`
if [[ $roottype == "livecd" ]]
if [[ $roottype == "livecd" ]] || [[ $subsystem == "lxc" ]]
then
if [[ $rootdev == "/dev/nfs" ]]
then
touch /* /bin/* /sbin/*
udevadm trigger --action="add" --subsystem-match=net
fi
udevadm trigger --action="add" --subsystem-match=net
/sbin/rc-update --update
fi
rc-update del calculate boot
if ! [[ -f /var/calculate/server/ca/server.key ]]
then
LANG=C /usr/sbin/cl-core --bootstrap

@ -68,16 +68,19 @@ class VariableClNetworkConfigureSet(ReadonlyVariable):
Выполнять ли настройку сети шаблонами
"""
type = "bool"
opt = ["--network"]
def init(self):
self.label = _("Reconfigure network")
self.help = _("reconfigure network")
def get(self):
if (self.Get('os_root_type_ext') in RootType.Live and
self.GetBool('cl_system_boot_set')):
return "on"
if self.GetBool("cl_network_migrate_set"):
return "off"
else:
return "on"
class VariableClNetworkMigrateSet(Variable):
"""
Использовать миграцию для переноса настроек

@ -275,7 +275,8 @@ class Wsdl(WsdlBase):
'setvars': {'cl_action!': 'merge', 'cl_live': 'off'},
'groups': [
lambda group: group(_("Update system settings"),
normal=('cl_live',),
normal=('cl_live',
'cl_network_configure_set'),
expert=(
'cl_templates_locate',
'cl_dispatch_conf',

Loading…
Cancel
Save