Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into bnc893586
Browse files Browse the repository at this point in the history
  • Loading branch information
jsrain committed Jan 30, 2015
2 parents a829fe7 + 36f3e77 commit d662e72
Show file tree
Hide file tree
Showing 17 changed files with 126 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -5,7 +5,7 @@ before_install:
# disable rvm, use system Ruby
- rvm reset
- wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh
- sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2 yast2-storage yast2-xml yast2-transfer yast2-services-manager yast2-installation-control" -g "rspec:2.14.1 yast-rake gettext"
- sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2 yast2-storage yast2-xml yast2-transfer yast2-services-manager yast2-installation-control yast2-packager" -g "rspec:2.14.1 yast-rake gettext"
script:
- rake check:syntax
- rake check:pot
Expand Down
1 change: 0 additions & 1 deletion modconfig/files.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=files

X-SuSE-YaST-Group=Misc
Expand Down
1 change: 0 additions & 1 deletion modconfig/general.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=general

X-SuSE-YaST-Group=System
Expand Down
1 change: 0 additions & 1 deletion modconfig/partitioning.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=partitioning

X-SuSE-YaST-Group=Hardware
Expand Down
1 change: 0 additions & 1 deletion modconfig/report.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=report

X-SuSE-YaST-Group=System
Expand Down
1 change: 0 additions & 1 deletion modconfig/scripts.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=scripts

X-SuSE-YaST-Group=Misc
Expand Down
1 change: 0 additions & 1 deletion modconfig/software.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=software

X-SuSE-YaST-Group=Software
Expand Down
41 changes: 41 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,44 @@
-------------------------------------------------------------------
Tue Jan 20 09:54:23 CET 2015 - schubi@suse.de

- Clone_system in autoyast2-installation should call some modules
(e.g. storage, software) which are defined in autoyast2 package.
So if needed the user has to install autoyast2 package at first.

-------------------------------------------------------------------
Mon Jan 19 09:10:15 CET 2015 - schubi@suse.de

- Checking if the disk is -partitionable- instead of checking if it
is a real disk. Needed for Multipath disks. (bnc#909349)
- autoyast=file:///<autoinst.xml> : Mount the installation source
in order to copy AutoYaST configuration file into inst_sys.
(bnc#908271)

-------------------------------------------------------------------
Tue Dec 30 13:46:52 CET 2014 - schubi@suse.de

- Selecting needed yast packages for the second stage correctly.
(bnc#909751)
- 3.1.72

-------------------------------------------------------------------
Tue Dec 23 10:56:30 CET 2014 - schubi@suse.de

- Setting normal mode while applying single module settings to
system. (bnc#909223)
- 3.1.71

-------------------------------------------------------------------
Thu Dec 18 10:54:01 CET 2014 - schubi@suse.de

- Removed code which will be already done by service_manager.
(bnc#909745)

-------------------------------------------------------------------
Thu Dec 4 09:49:27 UTC 2014 - jreidinger@suse.com

- remove X-KDE-Library from desktop file (bnc#899104)

-------------------------------------------------------------------
Fri Nov 28 15:12:56 CET 2014 - schubi@suse.de

Expand Down
3 changes: 2 additions & 1 deletion package/autoyast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: autoyast2
Version: 3.1.69
Version: 3.1.72
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand All @@ -36,6 +36,7 @@ BuildRequires: yast2-storage
BuildRequires: yast2-xml
BuildRequires: yast2-transfer
BuildRequires: yast2-services-manager
BuildRequires: yast2-packager

# %%{_unitdir} macro definition is in a separate package since 13.1
%if 0%{?suse_version} >= 1310
Expand Down
46 changes: 22 additions & 24 deletions src/bin/fetch_image.sh
Expand Up @@ -14,29 +14,27 @@ if [ -f /tmp/fetch_image ]; then
exit $?
fi;

# catch http, https, ftp and tftp
if [[ "x$LOCATION" =~ ^x..?tp ]]; then
wget -O - $LOCATION 2>/dev/null | tar xfz - -C /mnt
fi;

if [[ "$LOCATION" =~ ^nfs ]]; then
# FIXME
mkdir -p /tmp/image_mount
fi;

if [[ "x$LOCATION" =~ ^xfile ]]; then
LOCATION=`echo $LOCATION|sed 's|file://||'`;
if [ ! -e "$LOCATION" ]; then
DEVICE=`grep ^Device: /etc/install.inf | awk '{ print $2 }'`
mkdir -p /tmp/instsource
mount /dev/$DEVICE /tmp/instsource
tar xfz /tmp/instsource/$LOCATION -C /mnt
umount /tmp/instsource
else
tar xfz /tmp/instsource/$LOCATION -C /mnt
fi;
fi;

case "$LOCATION" in
# catch http, https, ftp and tftp
http:*|https:*|ftp:*|tftp:*)
wget -O - $LOCATION 2>/dev/null | tar xfz - -C /mnt
;;
nfs:*)
# FIXME
mkdir -p /tmp/image_mount
;;
file:*)
LOCATION=`echo $LOCATION|sed 's|file://||'`
if [ ! -e "$LOCATION" ]; then
DEVICE=`grep ^Device: /etc/install.inf | awk '{ print $2 }'`
mkdir -p /tmp/instsource
mount /dev/$DEVICE /tmp/instsource
tar xfz /tmp/instsource/$LOCATION -C /mnt
umount /tmp/instsource
else
tar xfz /tmp/instsource/$LOCATION -C /mnt
fi
;;
esac

mv /tmp/fstab /mnt/etc

20 changes: 20 additions & 0 deletions src/clients/clone_system.rb
Expand Up @@ -23,11 +23,31 @@ def main
Yast.import "Y2ModuleConfig"
Yast.import "Mode"
Yast.import "FileUtils"
Yast.import "Report"
Yast.import "Installation"
Yast.import "PackageSystem"

textdomain "autoinst"

@moduleList = ""

if Mode.normal
if !PackageSystem.Installed("autoyast2")
ret = PackageSystem.InstallAll(["autoyast2"])
# The modules/clients has to be reloaded. So the export
# will be restarted.
if ret
SCR.Execute(
path(".target.bash"),
"touch #{Installation.restart_file}"
)
end
return
elsif FileUtils.Exists(Installation.restart_file)
SCR.Execute(path(".target.remove"), Installation.restart_file)
end
end

Builtins.foreach(Y2ModuleConfig.ModuleMap) do |def_resource, resourceMap|
clonable = resourceMap["X-SuSE-YaST-AutoInstClonable"] == "true"

Expand Down
34 changes: 9 additions & 25 deletions src/clients/inst_autosetup.rb
Expand Up @@ -42,6 +42,7 @@ def main
Yast.import "LanUdevAuto"
Yast.import "Language"
Yast.import "Console"
Yast.import "ServicesManager"

Yast.include self, "bootloader/routines/autoinstall.rb"
Yast.include self, "autoinstall/ask.rb"
Expand Down Expand Up @@ -356,34 +357,17 @@ def main

Progress.NextStage

#still supporting old format "runlevel"
if Profile.current['runlevel']
if Profile.current['runlevel']['default']
default_runlevel = Profile.current['runlevel']['default'].to_i
@default_target = default_runlevel == 5 ? Target::GRAPHICAL : Target::MULTIUSER
Builtins.y2milestone("Accepting runlevel '#{default_runlevel}' as default target '#{@default_target}'")
elsif Profile.current['runlevel']['default_target']
@default_target = Profile.current['runlevel']['default_target'].to_s
end
elsif Profile.current['services-manager'] &&Profile.current['services-manager']['default_target']
@default_target = Profile.current['services-manager']['default_target'].to_s
end

Builtins.y2milestone("autoyast - configured default target: '#{@default_target}'")

if @default_target && !@default_target.empty?
ServicesManagerTarget.default_target = @default_target
if Profile.current.has_key? ('runlevel')
# still supporting old format "runlevel"
ServicesManager.import(Profile.current['runlevel'])
elsif Profile.current.has_key? ('services-manager')
ServicesManager.import(Profile.current['services-manager'])
else
ServicesManagerTarget.default_target = Installation.x11_setup_needed &&
Arch.x11_setup_needed &&
Pkg.IsSelected("xorg-x11-server") ? Target::GRAPHICAL : Target::MULTIUSER
# We will have to set default entries which are defined
# in the import call of ServicesManager
ServicesManager.import({})
end

Builtins.y2milestone(
"autoyast - setting default target to: #{ServicesManagerTarget.default_target}"
)

# AutoInstall::PXELocalBoot();
Progress.Finish

@ret = ProductControl.RunFrom(
Expand Down
1 change: 0 additions & 1 deletion src/desktop/autoyast.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=autoyast

X-SuSE-YaST-Group=Misc
Expand Down
5 changes: 5 additions & 0 deletions src/include/autoinstall/conftree.rb
Expand Up @@ -572,7 +572,12 @@ def MainDialog
modulename
)
)
oldMode = Mode.mode
# The settings will be written in a running system.
# So we are switching to "normal" mode. (bnc#909223)
Mode.SetMode("normal")
Call.Function(module_auto, ["Write"])
Mode.SetMode(oldMode)
end
end
elsif ret == :read
Expand Down
9 changes: 6 additions & 3 deletions src/include/autoinstall/io.rb
Expand Up @@ -19,6 +19,7 @@ def initialize_autoinstall_io(include_target)
Yast.import "TFTP"
Yast.import "AutoinstConfig"
Yast.import "Storage"
Yast.import "InstURL"

@GET_error = ""
end
Expand Down Expand Up @@ -177,9 +178,11 @@ def Get(_Scheme, _Host, _Path, _Localfile)
"Trying to find file on installation media: %1",
Installation.boot
)
cdrom = Convert.to_string(SCR.Read(path(".etc.install_inf.Cdrom")))
if Installation.boot == "cd" && cdrom
cdrom_device = Ops.add("/dev/", cdrom)
# The Cdrom entry in install.inf is obsolete. So we are using the
# entry which is defined in InstUrl module. (bnc#908271)
install_url = InstURL.installInf2Url("")
cdrom_device = install_url ? Builtins.regexpsub(install_url, "devices=(.*)$", "\\1") : ""
if Installation.boot == "cd" && !cdrom_device.empty?
already_mounted = Ops.add(
Ops.add("grep ", cdrom_device),
" /proc/mounts ;"
Expand Down
26 changes: 18 additions & 8 deletions src/modules/AutoinstSoftware.rb
Expand Up @@ -11,6 +11,7 @@

module Yast
class AutoinstSoftwareClass < Module
include Yast::Logger
def main
Yast.import "UI"
Yast.import "Pkg"
Expand All @@ -30,6 +31,7 @@ def main
Yast.import "Mode"
Yast.import "Misc"
Yast.import "Directory"
Yast.import "Y2ModuleConfig"

Yast.include self, "autoinstall/io.rb"

Expand Down Expand Up @@ -200,17 +202,25 @@ def Import(settings)
end

def AddYdepsFromProfile( entries )
Builtins.y2milestone("AddYdepsFromProfile entries %1", entries)
ign = [ "software", "partitioning", "general", "report", "scripts", "suse_register",
"files", "bootloader", "add-on", "dasd", "zfcp", "timezone" ]
map = { "networking" => "yast2-network" }
entries.reject! { |e| ign.include?(e) }
Builtins.y2milestone("AddYdepsFromProfile entries %1", entries)
pkglist = []
entries.each do |e|
name = map.has_key?(e) ? map[e] : "yast2-"+e
Builtins.y2milestone("AddYdepsFromProfile name %1 from %2", name, e)
pkglist.push(name) if !pkglist.include?(name)
yast_module, _entry = Y2ModuleConfig.ModuleMap.find do |module_name, entry|
module_name == e ||
entry["X-SuSE-YaST-AutoInstResource"] == e ||
(entry["X-SuSE-YaST-AutoInstMerge"] && entry["X-SuSE-YaST-AutoInstMerge"].split(",").include?(e))
end
yast_module ||= e # if needed taking default because no entry has been defined in the *.desktop file
provide = "application(YaST2/#{yast_module}.desktop)"

packages = Pkg.PkgQueryProvides( provide )
unless packages.empty?
name = packages[0][0]
log.info "AddYdepsFromProfile add package #{name} for entry #{e}"
pkglist.push(name) if !pkglist.include?(name)
else
log.info "No package provides: #{provide}"
end
end
Builtins.y2milestone("AddYdepsFromProfile pkglist %1", pkglist)
pkglist.each do |p|
Expand Down
4 changes: 2 additions & 2 deletions src/modules/AutoinstStorage.rb
Expand Up @@ -1079,7 +1079,7 @@ def Write
result = false
changed = false
Builtins.foreach(@AutoTargetMap) do |device, data|
if Storage.IsRealDisk(data) && data.fetch("initialize", false)
if Storage.IsPartitionable(data) && data.fetch("initialize", false)
Ops.set(initial_target_map, [device, "delete"], true)
changed = true
if data.has_key?("disklabel")
Expand Down Expand Up @@ -1124,7 +1124,7 @@ def Write
)
Builtins.y2milestone("device %1 not found in TargetMap", device)
end
if Storage.IsRealDisk(data)
if Storage.IsPartitionable(data)
@ZeroNewPartitions = data.fetch("zero_new_partitions",true)
# that's not really nice. Just an undocumented fallback which should never be used
Builtins.y2milestone("Creating partition plans for %1", device)
Expand Down

0 comments on commit d662e72

Please sign in to comment.