Hello community,
here is the log from the commit of package yast2-installation
checked in at Fri Apr 11 22:12:04 CEST 2008.
--------
--- yast2-installation/yast2-installation.changes 2008-04-10 16:47:03.000000000 +0200
+++ yast2-installation/yast2-installation.changes 2008-04-11 17:56:47.000000000 +0200
@@ -1,0 +2,12 @@
+Fri Apr 11 17:55:32 CEST 2008 - locilka@suse.cz
+
+- Added another per-image progress into the Installation images
+ deployment (it requires details.xml).
+- 2.13.33
+
+-------------------------------------------------------------------
+Fri Apr 11 15:33:17 CEST 2008 - juhliarik@suse.cz
+
+- Added loading kernel via kexec (fate #303395)
+
+-------------------------------------------------------------------
Old:
----
yast2-installation-2.16.32.tar.bz2
New:
----
yast2-installation-2.16.33.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-installation.spec ++++++
--- /var/tmp/diff_new_pack.U15801/_old 2008-04-11 22:11:32.000000000 +0200
+++ /var/tmp/diff_new_pack.U15801/_new 2008-04-11 22:11:32.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-installation (Version 2.16.32)
+# spec file for package yast2-installation (Version 2.16.33)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,12 +12,12 @@
Name: yast2-installation
-Version: 2.16.32
+Version: 2.16.33
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-installation-2.16.32.tar.bz2
+Source0: yast2-installation-2.16.33.tar.bz2
Prefix: /usr
BuildRequires: docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer sgml-skel update-desktop-files yast2-core-devel yast2-devtools yast2-testsuite
# anyxml -> barexml (bnc #366867)
@@ -106,7 +106,7 @@
Lukas Ocilka
%prep
-%setup -n yast2-installation-2.16.32
+%setup -n yast2-installation-2.16.33
%build
%{prefix}/bin/y2tool y2autoconf
@@ -172,6 +172,12 @@
%exclude %{prefix}/share/doc/packages/yast2-installation/COPYING
%exclude %{prefix}/share/doc/packages/yast2-installation/README
%changelog
+* Fri Apr 11 2008 locilka@suse.cz
+- Added another per-image progress into the Installation images
+ deployment (it requires details.xml).
+- 2.13.33
+* Fri Apr 11 2008 juhliarik@suse.cz
+- Added loading kernel via kexec (fate #303395)
* Thu Apr 10 2008 locilka@suse.cz
- Filtering installation imagesets using the default architecture.
- Installation from images sets the download area (SourceManager).
++++++ yast2-installation-2.16.32.tar.bz2 -> yast2-installation-2.16.33.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.16.32/src/clients/inst_deploy_image.ycp new/yast2-installation-2.16.33/src/clients/inst_deploy_image.ycp
--- old/yast2-installation-2.16.32/src/clients/inst_deploy_image.ycp 2008-04-10 16:34:36.000000000 +0200
+++ new/yast2-installation-2.16.33/src/clients/inst_deploy_image.ycp 2008-04-11 17:13:39.000000000 +0200
@@ -34,7 +34,7 @@
UI::ChangeWidget (
`id ("deploying_progress"),
`Label,
- sformat (_("Deploying Image (%1/%2)..."), (image + 1), size (images))
+ sformat (_("Deploying Images (%1/%2)..."), (image + 1), size (images))
);
}
}
@@ -46,17 +46,54 @@
);
}
+integer _last_progress = -1;
+string _last_image_id = nil;
+
+void SetOneImageProgress (integer current_progress) {
+ map current_image = ImageInstallation::GetCurrentImageDetails();
+ integer max_progress = current_image["max_progress"]:0;
+
+ // another file
+ if (current_image["file"]:"" != _last_image_id) {
+ _last_image_id = current_image["file"]:"";
+ _last_progress = -1;
+ }
+
+ if (max_progress == nil || max_progress == 0) {
+ y2milestone ("Can't find max_progress: %1", current_image);
+ return;
+ }
+
+ integer x_progress = (100 * current_progress / max_progress);
+ if (x_progress > 100) x_progress = 100;
+
+ if (x_progress > _last_progress) {
+ UI::ChangeWidget (`id ("deploying_image"), `Value, x_progress);
+ _last_progress = x_progress;
+ }
+}
+
+ImageInstallation::SetDeployTarImageProgress (SetOneImageProgress);
+
ImageInstallation::StoreAllChanges();
Pkg::TargetFinish ();
Wizard::SetContents (
_("Deploying Installation Images"),
- `ProgressBar (
- `id ("deploying_progress"),
- _("Deploying Images..."),
- size(images),
- 0
+ `VBox (
+ `ProgressBar (
+ `id ("deploying_image"),
+ _("Deploying image..."),
+ 100,
+ 0
+ ),
+ `ProgressBar (
+ `id ("deploying_progress"),
+ _("Deploying Images..."),
+ size(images),
+ 0
+ )
),
"",
false, false
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.16.32/src/clients/inst_finish.ycp new/yast2-installation-2.16.33/src/clients/inst_finish.ycp
--- old/yast2-installation-2.16.32/src/clients/inst_finish.ycp 2008-04-07 11:46:25.000000000 +0200
+++ new/yast2-installation-2.16.33/src/clients/inst_finish.ycp 2008-04-11 15:40:56.000000000 +0200
@@ -6,7 +6,7 @@
* Arvin Schnell
* Jiri Srain
*
- * $Id: inst_finish.ycp 46173 2008-04-07 09:46:25Z locilka $
+ * $Id: inst_finish.ycp 46415 2008-04-11 13:33:19Z juhliarik $
*
* Writes:
* [target] /var/lib/YaST2/runme_at_boot run yast2 after initial boot
@@ -73,7 +73,6 @@
"proxy",
"pkg",
"driver_update1",
- "yast_inf",
// bnc #340733
"system_settings",
],
@@ -89,6 +88,7 @@
// progress stage
"label" : _("Save installation settings"),
"steps" : [
+ "yast_inf",
"network",
"ntp-client",
"ssh_settings",
@@ -291,74 +291,17 @@
// run new kernel via kexec instead of reboot
// command for reading kernel_params
-string cmd = sformat("ls '%1/kernel_params'", String::Quote (Directory::vardir));
-y2milestone("Checking existing file kernel_params via command %1", cmd);
+string cmd = sformat("ls '%1/kexec_done' |tr -d '\n'", String::Quote (Directory::vardir));
+y2milestone("Checking flag of successful loading kernel via command %1", cmd);
map out = (map)WFM::Execute(.local.bash_output, cmd);
-// check output
-if (out["stdout"]:"" != "kernel_params")
-{
- y2milestone ("File kernel_params was not found, output: %1", out);
- return `next;
-}
-
-// command for reading kernel_params
-cmd = sformat("cat '%1/kernel_params' |tr -d '\n'", String::Quote (Directory::vardir));
-y2milestone("Reading kernel arguments via command %1", cmd);
-// read data from /var/lib/YaST2/kernel_params
-out = (map)WFM::Execute(.local.bash_output, cmd);
-// check output
-if (out["exit"]:nil != 0)
-{
- y2error ("Reading kernel arguments failed, output: %1", out);
- return `next;
-}
-string kernel_args = out["stdout"]:"";
-// check if kernel_params contains any data
-if (size(kernel_args) <2)
-{
- y2error ("%1/kernel_params is empty, kernel_params=%2 ", Directory::vardir, kernel_args);
- return `next;
-}
+cmd = sformat("%1/kexec_done",Directory::vardir);
-// command for finding initrd file
-cmd = sformat ("ls %1 |grep initrd- |tr -d '\n'", Directory::vardir);
-y2milestone("Finding initrd file via command: %1", cmd);
-// find inird file
-out = (map)WFM::Execute(.local.bash_output, cmd);
// check output
-if (out["exit"]:nil != 0)
+if (out["stdout"]:"" != cmd)
{
- y2error ("Finding initrd file failed, output: %1", out);
- return `next;
-}
-
-string initrd = out["stdout"]:"";
-// check if initrd (string) contains any data
-if (size(initrd) <2)
-{
- y2error ("initrd was not found: %1", initrd);
- return `next;
-}
-
-// command for finding vmlinuz file
-cmd = sformat ("ls %1/vmlinuz-* |tr -d '\n'", Directory::vardir);
-y2milestone("Finding vmlinuz file via command: %1", cmd);
-// find inird file
-out = (map)WFM::Execute(.local.bash_output, cmd);
-// check output
-if (out["exit"]:nil != 0)
-{
- y2error ("Finding vmlinuz file failed, output: %1", out);
- return `next;
-}
-
-string vmlinuz = out["stdout"]:"";
-// check if initrd (string) contains any data
-if (size(vmlinuz) <2)
-{
- y2error ("vmlinuz was not found: %1", vmlinuz);
+ y2milestone ("File kexec_done was not found, output: %1", out);
return `next;
}
@@ -374,27 +317,8 @@
return `next;
}
-// waiting 2s for switching...
-sleep(2000);
-
-// command for calling kexec
-cmd = sformat("kexec -l --command-line='%1' --initrd='%2/%3' '%2/%4'",
- String::Quote (kernel_args), String::Quote (Directory::vardir), String::Quote (initrd), String::Quote (vmlinuz));
-y2milestone("Calling kexec via command: %1", cmd);
-
-// call kexec
-out = (map)WFM::Execute(.local.bash_output, cmd);
-// check output
-if (out["exit"]:nil != 0)
-{
- y2error ("Calling kexec failed, output: %1", out);
- return `next;
-}
-// command for loading kernel
-cmd = sformat("kexec -e");
-y2milestone("Loading new kernel via command: %1", cmd);
-// call loading kernel via kexec
-out = (map) WFM::Execute(.local.bash_output, cmd);
+// waiting s for switching...
+sleep(1000);
return `next;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.16.32/src/clients/yast_inf_finish.ycp new/yast2-installation-2.16.33/src/clients/yast_inf_finish.ycp
--- old/yast2-installation-2.16.32/src/clients/yast_inf_finish.ycp 2008-03-14 15:09:22.000000000 +0100
+++ new/yast2-installation-2.16.33/src/clients/yast_inf_finish.ycp 2008-04-11 15:40:56.000000000 +0200
@@ -8,7 +8,7 @@
* Authors:
* Jiri Srain
*
- * $Id: yast_inf_finish.ycp 45467 2008-03-14 14:09:21Z locilka $
+ * $Id: yast_inf_finish.ycp 46415 2008-04-11 13:33:19Z juhliarik $
*
*/
@@ -23,6 +23,7 @@
import "Language";
import "Keyboard";
import "Directory";
+import "String";
include "installation/misc.ycp";
@@ -30,6 +31,106 @@
string func = "";
map param = $[];
+// fate #303395: Use kexec to avoid booting between first and second stage
+// run new kernel via kexec instead of reboot
+
+define boolean LoadKexec()
+{
+
+ // command for reading kernel_params
+ string cmd = sformat("ls '%1/kernel_params' |tr -d '\n'", String::Quote (Directory::vardir));
+ y2milestone("Checking existing file kernel_params via command %1", cmd);
+
+ map out = (map)WFM::Execute(.local.bash_output, cmd);
+
+ cmd = sformat("%1/kernel_params",Directory::vardir);
+ // check output
+ if (out["stdout"]:"" != cmd)
+ {
+ y2milestone ("File kernel_params was not found, output: %1", out);
+ return false;
+ }
+
+ // command for reading kernel_params
+ cmd = sformat("cat '%1/kernel_params' |tr -d '\n'", String::Quote (Directory::vardir));
+ y2milestone("Reading kernel arguments via command %1", cmd);
+ // read data from /var/lib/YaST2/kernel_params
+ out = (map)WFM::Execute(.local.bash_output, cmd);
+ // check output
+ if (out["exit"]:nil != 0)
+ {
+ y2error ("Reading kernel arguments failed, output: %1", out);
+ return false;
+ }
+
+ string kernel_args = out["stdout"]:"";
+ // check if kernel_params contains any data
+ if (size(kernel_args) <2)
+ {
+ y2error ("%1/kernel_params is empty, kernel_params=%2 ", Directory::vardir, kernel_args);
+ return false;
+ }
+
+ // command for finding initrd file
+ cmd = sformat ("ls %1/initrd-* |tr -d '\n'", Directory::vardir);
+ y2milestone("Finding initrd file via command: %1", cmd);
+ // find inird file
+ out = (map)WFM::Execute(.local.bash_output, cmd);
+ // check output
+ if (out["exit"]:nil != 0)
+ {
+ y2error ("Finding initrd file failed, output: %1", out);
+ return false;
+ }
+
+ string initrd = out["stdout"]:"";
+ // check if initrd (string) contains any data
+ if (size(initrd) <2)
+ {
+ y2error ("initrd was not found: %1", initrd);
+ return false;
+ }
+
+ // command for finding vmlinuz file
+ cmd = sformat ("ls %1/vmlinuz-* |tr -d '\n'", Directory::vardir);
+ y2milestone("Finding vmlinuz file via command: %1", cmd);
+ // find inird file
+ out = (map)WFM::Execute(.local.bash_output, cmd);
+ // check output
+ if (out["exit"]:nil != 0)
+ {
+ y2error ("Finding vmlinuz file failed, output: %1", out);
+ return false;
+ }
+
+ string vmlinuz = out["stdout"]:"";
+ // check if initrd (string) contains any data
+ if (size(vmlinuz) <2)
+ {
+ y2error ("vmlinuz was not found: %1", vmlinuz);
+ return false;
+ }
+
+ // command for calling kexec
+ cmd = sformat("kexec -l --command-line='%1' --initrd='%2' '%3'",
+ String::Quote (kernel_args), String::Quote (initrd), String::Quote (vmlinuz));
+ y2milestone("Calling kexec via command: %1", cmd);
+
+ // call kexec
+ out = (map)WFM::Execute(.local.bash_output, cmd);
+ // check output
+ if (out["exit"]:nil != 0)
+ {
+ y2error ("Calling kexec failed, output: %1", out);
+ return false;
+ }
+
+ y2milestone("Loading new kernel was succesful");
+ return true;
+
+}
+
+
/* Check arguments */
if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
func = (string)WFM::Args(0);
@@ -60,6 +161,10 @@
// correctly. but no reboot message form linuxrc.
linuxrc["Root"] = "reboot";
linuxrc["RebootMsg"] = "0";
+
+ if (LoadKexec())
+ linuxrc["Root"] = "kexec";
+
// Override linuxrc settings in autoinst mode
if ( Mode::autoinst () )
{
@@ -77,6 +182,14 @@
}
}
+ if (linuxrc["Root"]:"" == "kexec")
+ {
+ // flag for inst_finish -> kerel was successful loaded by kexec
+ string cmd = sformat ("touch \"%1/kexec_done\"", Directory::vardir);
+ // call command
+ WFM::Execute(.local.bash_output, cmd);
+ }
+
linuxrc["Language"] = Language::language;
linuxrc["Keytable"] = Keyboard::keymap;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.16.32/src/modules/ImageInstallation.ycp new/yast2-installation-2.16.33/src/modules/ImageInstallation.ycp
--- old/yast2-installation-2.16.32/src/modules/ImageInstallation.ycp 2008-04-10 16:23:24.000000000 +0200
+++ new/yast2-installation-2.16.33/src/modules/ImageInstallation.ycp 2008-04-11 17:31:27.000000000 +0200
@@ -57,6 +57,33 @@
list<string> _mounted_images = [];
/**
+ * @struct $[
+ * "image_filaname" : $[
+ * // size of an unpacked image in bytes
+ * "size" : integer,
+ * // number of files and directories in an image
+ * "files" : integer,
+ * ]
+ * ]
+ */
+map > images_details = $[];
+
+/**
+ * Image currently being deployed
+ */
+map _current_image = $[];
+
+/**
+ * display progress messages every NUMBERth record
+ */
+integer _checkpoint = 400;
+
+/**
+ * NUMBER of bytes per record, multiple of 512
+ */
+integer _record_size = 10240;
+
+/**
* Set the repository to get images from
* @param repo integer the repository identification
*/
@@ -118,7 +145,7 @@
*/
void RemoveTemporaryImage (string image) {
map out = (map) SCR::Execute (
- .target.bash_ouptut,
+ .target.bash_output,
sformat ("test -w '%1' && echo -n writable", String::Quote (image))
);
@@ -153,6 +180,9 @@
return false;
}
+ if (tar_image_progress != nil)
+ tar_image_progress (0);
+
y2milestone ("Creating target directory");
string cmd = sformat ("test -d %1 || mkdir -p %1", target);
map out = (map)SCR::Execute (.target.bash_output, cmd);
@@ -160,19 +190,55 @@
y2milestone ("Untarring the image");
- // TODO: Progress `tar --checkpoint`
-
// lzma
if (regexpmatch (image, "\.lzma$")) {
- cmd = sformat ("lzmadec < '%1' | tar --totals -C '%2' -xf -", String::Quote (image), String::Quote (target));
+ cmd = sformat (
+ "lzmadec < '%1' | tar --totals --checkpoint=%3 --record-size=%4 -C '%2' -xf -",
+ String::Quote (image), String::Quote (target), _checkpoint, _record_size
+ );
// bzip2, gzip
} else {
- cmd = sformat ("tar --totals -C '%2' -xf '%1'", String::Quote (image), String::Quote (target));
+ cmd = sformat (
+ "tar --checkpoint=%3 --record-size=%4 --totals -C '%2' -xf '%1'",
+ String::Quote (image), String::Quote (target), _checkpoint, _record_size
+ );
}
y2milestone ("Calling: %1", cmd);
- out = (map)SCR::Execute (.target.bash_output, cmd);
- y2milestone ("Returned %1", out);
+ integer pid = (integer) SCR::Execute(.process.start_shell, cmd);
+
+ string newline = "";
+
+ string read_checkpoint_str = "^tar: Read checkpoint ([0123456789]+)$";
+
+ // Otherwise it will never make 100%
+ integer better_feeling_constant = _checkpoint;
+
+ while (SCR::Read (.process.running, pid) == true) {
+ newline = (string) SCR::Read (.process.read_line_stderr, pid);
+
+ if (newline != nil) {
+ if (! regexpmatch (newline, read_checkpoint_str)) {
+ y2milestone ("Deploying image: %1", newline);
+ continue;
+ }
+
+ newline = regexpsub (newline, read_checkpoint_str, "\\1");
+
+ if (newline == nil || newline == "")
+ continue;
+
+ if (tar_image_progress != nil)
+ tar_image_progress (tointeger (newline) + better_feeling_constant);
+ } else {
+ // FIXME: UI::PollInput
+ sleep (200);
+ }
+ }
+ y2milestone ("Finished");
+
+ if (tar_image_progress != nil)
+ tar_image_progress (100);
RemoveTemporaryImage (image);
@@ -256,6 +322,25 @@
// FIXME unmounting
}
+void SetCurrentImageDetails (map img) {
+ if (size (images_details) == 0) {
+ y2warning ("Images details are empty");
+ }
+
+ _current_image = $[
+ "file" : img["file"]:"",
+ "name" : img["name"]:"",
+ "size" : images_details[img["file"]:"","size"]:0,
+ "files" : images_details[img["file"]:"","files"]:0,
+ // 100% progress
+ "max_progress" : tointeger (images_details[img["file"]:"","size"]:0 / _record_size),
+ ];
+}
+
+global map GetCurrentImageDetails () {
+ return _current_image;
+}
+
/**
* Deploy an image (internal implementation)
* @param id string the id of the image
@@ -272,6 +357,8 @@
string type = img["type"]:"";
+ SetCurrentImageDetails (img);
+
if (type == "fs")
return temporary
? MountFsImage (id, target)
@@ -325,12 +412,56 @@
}
/**
+ * Loads non-mandatory details for every single selected image.
+ */
+global boolean FillUpImagesDetails () {
+ string filename = Pkg::SourceProvideOptionalFile (_repo, 1, sformat (_image_path, "details.xml"));
+ if (filename == nil) {
+ y2milestone ("No image installation details found");
+ return false;
+ }
+
+ map read_details = XML::XMLToYCPFile (filename);
+ if (read_details == nil) {
+ y2error ("Cannot parse imagesets details");
+ return false;
+ }
+
+ if (! haskey (read_details, "details")) {
+ y2warning ("No images details in details.xml");
+ return false;
+ }
+
+ images_details = $[];
+
+ foreach (map image_detail, read_details["details"]:[], {
+ string file = image_detail["file"]:"";
+
+ if (file == nil || file == "") return;
+
+ integer files = tointeger (image_detail["files"]:"0");
+ integer isize = tointeger (image_detail["size"]:"0");
+
+ images_details[file] = $[
+ "files" : files,
+ "size" : isize,
+ ];
+ });
+
+ // FIXME: y2debug
+ y2milestone ("Details: %1", images_details);
+ return true;
+}
+
+/**
* Deploy all images
* @param images a list of images to deploy
* @param target string directory where to deploy the images
* @param progress a function to report overal progress
*/
global boolean DeployImages (list<string> images, string target, void(integer,integer) progress) {
+ FillUpImagesDetails();
+
integer num = -1;
foreach (string img, images, {
@@ -382,7 +513,7 @@
_metadata_image = "";
// checking whether images are supported
- string filename = Pkg::SourceProvideOptionalFile (_repo, 1, "/images/images.xml");
+ string filename = Pkg::SourceProvideOptionalFile (_repo, 1, sformat (_image_path, "images.xml"));
if (filename == nil)
{
Installation::image_installation = false;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.16.32/VERSION new/yast2-installation-2.16.33/VERSION
--- old/yast2-installation-2.16.32/VERSION 2008-04-10 16:47:18.000000000 +0200
+++ new/yast2-installation-2.16.33/VERSION 2008-04-11 17:55:23.000000000 +0200
@@ -1 +1 @@
-2.16.32
+2.16.33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org