Author: jsuchome
Date: Tue Jul 8 16:28:12 2008
New Revision: 48925
URL: http://svn.opensuse.org/viewcvs/yast?rev=48925&view=rev
Log:
backporting 11.0 to SP2...
Added:
branches/tmp/jsuchome/product-creator/
- copied from r48913, branches/SuSE-SLE-10-SP2-Branch/product-creator/
branches/tmp/jsuchome/product-creator/agents/ag_anyxml (with props)
branches/tmp/jsuchome/product-creator/agents/anyxml.scr
branches/tmp/jsuchome/product-creator/src/kiwi.ycp (with props)
Modified:
branches/tmp/jsuchome/product-creator/VERSION
branches/tmp/jsuchome/product-creator/agent-kiwi/ag_kiwi
branches/tmp/jsuchome/product-creator/agents/Makefile.am
branches/tmp/jsuchome/product-creator/package/yast2-product-creator.changes
branches/tmp/jsuchome/product-creator/scripts/y2mkiso
branches/tmp/jsuchome/product-creator/src/Kiwi.ycp
branches/tmp/jsuchome/product-creator/src/ProductCreator.ycp
branches/tmp/jsuchome/product-creator/src/commandline.ycp
branches/tmp/jsuchome/product-creator/src/complex.ycp
branches/tmp/jsuchome/product-creator/src/data/Makefile.am
branches/tmp/jsuchome/product-creator/src/data/isolinux.cfg
branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/iso/config.xml
branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/xen/config.xml
branches/tmp/jsuchome/product-creator/src/dialogs.ycp
branches/tmp/jsuchome/product-creator/src/helps.ycp
branches/tmp/jsuchome/product-creator/src/image-creator.ycp
branches/tmp/jsuchome/product-creator/src/kiwi_dialogs.ycp
branches/tmp/jsuchome/product-creator/src/product-creator.ycp
branches/tmp/jsuchome/product-creator/src/wizards.ycp
branches/tmp/jsuchome/product-creator/yast2-product-creator.spec.in
Modified: branches/tmp/jsuchome/product-creator/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/VERSION?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/VERSION (original)
+++ branches/tmp/jsuchome/product-creator/VERSION Tue Jul 8 16:28:12 2008
@@ -1 +1 @@
-2.13.32
+2.13.33
Modified: branches/tmp/jsuchome/product-creator/agent-kiwi/ag_kiwi
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/agent-kiwi/ag_kiwi?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/agent-kiwi/ag_kiwi (original)
+++ branches/tmp/jsuchome/product-creator/agent-kiwi/ag_kiwi Tue Jul 8 16:28:12 2008
@@ -114,10 +114,12 @@
my $name = $element -> getAttribute ("name");
my $pwd = $element -> getAttribute ("pwd");
my $home = $element -> getAttribute ("home");
+ my $realname = $element -> getAttribute ("realname");
if (defined $name) {
$retmap{"users"}{$name}{group} = $group if (defined $group);
$retmap{"users"}{$name}{home} = $home if (defined $home);
$retmap{"users"}{$name}{pwd} = $pwd if (defined $pwd);
+ $retmap{"users"}{$name}{realname} = $realname if (defined $realname);
}
}
}
Modified: branches/tmp/jsuchome/product-creator/agents/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/agents/Makefile.am?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/agents/Makefile.am (original)
+++ branches/tmp/jsuchome/product-creator/agents/Makefile.am Tue Jul 8 16:28:12 2008
@@ -2,8 +2,8 @@
# Makefile.am for devtools/devtools/skeletons/config/agents
#
-agent_SCRIPTS =
+agent_SCRIPTS = ag_anyxml
-scrconf_DATA = cfg_product-creator.scr
+scrconf_DATA = cfg_product-creator.scr anyxml.scr
EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)
Added: branches/tmp/jsuchome/product-creator/agents/ag_anyxml
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/agents/ag_anyxml?rev=48925&view=auto
==============================================================================
--- branches/tmp/jsuchome/product-creator/agents/ag_anyxml (added)
+++ branches/tmp/jsuchome/product-creator/agents/ag_anyxml Tue Jul 8 16:28:12 2008
@@ -0,0 +1,133 @@
+#!/usr/bin/perl -w
+
+#
+# Name: ag_anyxml
+# Authors: Jiri Suchomel
+# Summary: Agent for reading and writing simple XML files using
+# XML::Simple. Write is supported, but see the limitations
+# at XML-Simple page (e.g. order of elements is lost in the
+# maps)
+#
+# Example of usage:
+#
+# map config = (map)SCR::Read (.anyxml, file);
+#
+# Alternative way of reading is using the map as an argument. This way it is
+# possible to specify non-default read options in the "args" submap:
+#
+# map config = (map)SCR::Read (.anyxml, $[
+# "file" : "/tmp/in.xml",
+# "args" : $[
+# "ForceArray" : 0,
+# "KeepRoot" : 1
+# ]
+# ]);
+#
+# Writing with the default options:
+#
+# SCR::Write (.anyxml, $[
+# "file" : "/tmp/config.xml",
+# "xml" : config,
+# ]);
+#
+# Non-default write options could be used by passing extra submap with
+# "args" key in the write map:
+#
+# SCR::Write (.anyxml, $[ "file": "c.xml", "xml" : conf, "args: $[
+# "XMLDecl" : <?xml version="123456789"?>,
+# "RootName" : "test"
+# ]);
+#
+# See http://search.cpan.org/dist/XML-Simple/lib/XML/Simple.pm
+# for the description of the arguments.
+
+
+use strict;
+use lib "/usr/lib/YaST2/agents_non_y2";
+use ycp;
+use XML::Simple;
+
+while (<STDIN>) {
+ my ($command, $path, $arg) = ycp::ParseCommand ($_);
+
+ if ($command eq "Read") {
+
+ my $file = $arg;
+
+ # Default read arguments
+ my %in_args = (
+ ForceContent => 1,
+ ForceArray => 1,
+ KeepRoot => 1,
+ KeyAttr => [],
+ );
+ if (ref ($arg) eq "HASH") {
+ $file = $arg->{"file"};
+ if (defined $arg->{"args"} && ref ($arg->{"args"}) eq "HASH") {
+ %in_args = %{$arg->{"args"}};
+ }
+ }
+ if (! defined $file || $file eq "") {
+ y2error ("No file defined!");
+ ycp::Return (undef);
+ next;
+ } elsif (! -e $file) {
+ y2error ("File ".$file." doesn't exist!");
+ ycp::Return (undef);
+ next;
+ }
+
+ my $xml = new XML::Simple (%in_args);
+ my $root = $xml->XMLin ($file);
+ undef $xml;
+
+ ycp::Return ($root);
+ } elsif ($command eq "Write") {
+ if (ref ($arg) ne "HASH") {
+ y2error ("argument must be a hash");
+ ycp::Return ("false");
+ next;
+ }
+ my $file = $arg->{"file"};
+ if (! defined $file || $file eq "") {
+ y2error ("No file defined!");
+ ycp::Return ("false");
+ next;
+ }
+ my $content = $arg->{"xml"};
+ if (! defined $content || ref ($content) ne "HASH") {
+ y2error ("XML content not defined or not a hash");
+ ycp::Return ("false");
+ next;
+ }
+
+ my $o = open my $fh, "> $file";
+ if (!defined $o) {
+ y2error ("$file cannot be opened for writing!");
+ ycp::Return ("false");
+ next;
+ }
+
+ # Default write arguments
+ my %out_args = (
+ ForceContent => 1,
+ ForceArray => 1,
+ KeepRoot => 1,
+ KeyAttr => [],
+ XMLDecl => '<?xml version="1.0"?>'
+ );
+ if (defined $arg->{"args"} && ref ($arg->{"args"}) eq "HASH") {
+ %out_args = %{$arg->{"args"}};
+ }
+ my $xml = new XML::Simple (%out_args);
+ $xml->XMLout ($content, OutputFile => $fh);
+ close $fh;
+ undef $xml;
+ ycp::Return ("true");
+ } elsif ($command eq "result") {
+ exit 0;
+ } else {
+ my $return_value = sprintf( "Unknown instruction %s", $command);
+ ycp::Return ($return_value);
+ }
+}
Added: branches/tmp/jsuchome/product-creator/agents/anyxml.scr
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/agents/anyxml.scr?rev=48925&view=auto
==============================================================================
--- branches/tmp/jsuchome/product-creator/agents/anyxml.scr (added)
+++ branches/tmp/jsuchome/product-creator/agents/anyxml.scr Tue Jul 8 16:28:12 2008
@@ -0,0 +1,15 @@
+/**
+ * File: anyxml.scr
+ *
+ * Summary: Agent for reading any XML files.
+ *
+ * Authors: Jiri Suchomel
+ *
+ * Example: SCR::Read (.anyxml, "/root/some_file.xml")
+ *
+ * $Id:$
+ */
+
+.anyxml
+
+`ag_anyxml ()
Modified: branches/tmp/jsuchome/product-creator/package/yast2-product-creator.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/package/yast2-product-creator.changes?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/package/yast2-product-creator.changes (original)
+++ branches/tmp/jsuchome/product-creator/package/yast2-product-creator.changes Tue Jul 8 16:28:12 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Jul 8 15:47:00 CEST 2008 - jsuchome@suse.cz
+
+- backported changes from version 2.16.19 released in openSUSE11.0
+- 2.13.33
+
+-------------------------------------------------------------------
Thu Apr 3 14:30:16 CEST 2008 - jsuchome@suse.cz
- write the full URL into config.xml for https sources (bnc#376666)
Modified: branches/tmp/jsuchome/product-creator/scripts/y2mkiso
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/scripts/y2mkiso?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/scripts/y2mkiso (original)
+++ branches/tmp/jsuchome/product-creator/scripts/y2mkiso Tue Jul 8 16:28:12 2008
@@ -28,18 +28,28 @@
DEST=$2
BOOT_ARCH=$3
+HFS_BLESS=
+
function usage()
{
-echo "This script creates an ISO image from an existing directory containing a SuSE source."
-echo "The directory has to have files according to the SuSE media specification. This script"
-echo "will also search for the needed files to make a bootable CD and will create one if "
-echo "all files are available"
+echo "This script creates an ISO image from an existing directory containing"
+echo "a SUSE source. The directory has to have files according to the SUSE"
+echo "media specification. This script will also search for the needed files"
+echo "to make a bootable CD and will create one if all files are available."
+echo
+echo "$0 <directory> []"
echo
-echo "$0 <directory> <iso file name>"
+echo " directory - path to the source directory"
+echo " iso_file_name - output file name (e.g. /tmp/product.iso)"
+echo " boot_architecture - name of the target architecture, set to"
+echo " the directory name in /boot, e.g. i386, x86_64, ppc..."
+echo " If it's missing the old layout (plain /boot directory)"
+echo " is used."
}
if [ -z "$SOURCE" -o -z "$DEST" ]; then
- echo "Missing parameters."
+ echo "ERROR: Missing parameters."
+ echo
usage
exit 1
fi
@@ -212,7 +222,8 @@
# use netatalk and macbinary filename translation
# bless a directory named suseboot, mark it bootable
echo using suseboot for hfs boot
- PARAMS="$PARAMS -part --netatalk --macbin -hfs-bless $SOURCE/suseboot"
+ PARAMS="$PARAMS -part --netatalk --macbin"
+ HFS_BLESS="suseboot"
FILE_MAPPING="/usr/share/YaST2/data/product-creator/HFS_mapping"
if [ -f $FILE_MAPPING ] ; then
echo using $FILE_MAPPING for hfs mapping
@@ -246,7 +257,8 @@
# use netatalk and macbinary filename translation
# bless a directory named suseboot, mark it bootable
echo using suseboot for hfs boot
- PARAMS="$PARAMS -part --netatalk --macbin -hfs-bless $SOURCE/suseboot"
+ PARAMS="$PARAMS -part --netatalk --macbin"
+ HFS_BLESS="suseboot"
FILE_MAPPING="/usr/share/YaST2/data/product-creator/HFS_mapping"
if [ -f $FILE_MAPPING ] ; then
echo using $FILE_MAPPING for hfs mapping
@@ -340,13 +352,22 @@
fi
fi
-set -x
-mkisofs \
- -p "$CD_PREPARER" \
- $PUB_OPT "$CD_PUBLISHER" \
- $PARAMS -o "$DEST" $XPARAMS "$SOURCE"
-set +x
-
+if [ -z "$HFS_BLESS" ] ; then
+ set -x
+ mkisofs \
+ -p "$CD_PREPARER" \
+ $PUB_OPT "$CD_PUBLISHER" \
+ $PARAMS -o "$DEST" $XPARAMS "$SOURCE"
+ set +x
+else
+ set -x
+ mkisofs \
+ -p "$CD_PREPARER" \
+ $PUB_OPT "$CD_PUBLISHER" \
+ -hfs-bless "$SOURCE/$HFS_BLESS" \
+ $PARAMS -o "$DEST" $XPARAMS "$SOURCE"
+ set +x
+fi
if [ -d "$SOURCE2" ] ; then
echo removing $SOURCE2
Modified: branches/tmp/jsuchome/product-creator/src/Kiwi.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/Kiwi.ycp?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/Kiwi.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/Kiwi.ycp Tue Jul 8 16:28:12 2008
@@ -59,16 +59,12 @@
// map with image templates (to base new projects on)
global map Templates = $[];
- // repository schemes unsupported by kiwi
- // (= not to be offered as new sources, to be deleted
- // from current system sources)
- global list<string> unsupported_schemes = [ "iso", "cd", "dvd", "nfs", "smb" ];
-
/**
* crypt given user password with current encryption algorithm
*/
string crypt_password (string pw)
{
+ if (pw == "") return pw;
if (encryption_method == nil)
{
boolean progress = Progress::set (false);
@@ -172,7 +168,6 @@
list<map> get_type_values (map config, string task) {
string boot_image = sformat ("%1boot/%2", task, config[task + "boot"]:"suse-10.2");
- boolean task_included = false;
list<map> retlist = maplist (
string type, map typemap, (map)config["type"]:$[], {
@@ -193,45 +188,30 @@
if (type == "vmx" && ret["format"]:"" == "")
ret["format"] = "vmdk";
if (type == task)
- {
ret["primary"] = "true";
- task_included = true;
- }
return ret;
});
- if (retlist == [] || !task_included)
+ // create default values for new project
+ if (retlist == [])
{
map ret = $[
"__key" : "type",
"__value" : task,
- "boot" : sformat ("%1boot/%2", task, config[task + "boot"]:"suse-10.2"),
+ "boot" : boot_image,
"primary" : "true"
];
if (task != "iso")
ret["filesystem"] = "ext3";
if (task == "vmx")
ret["format"] = "vmdk";
- retlist = add (retlist, ret);
+ if (task == "iso" || task == "oem")
+ ret["flags"] = "unified";
+ retlist = [ ret ];
}
return retlist;
}
/**
- * generate the list of packages/patterns for image
- */
- map get_image_packages (map config, list packages, list patterns,list ignored)
- {
- map ret = $[
- "__key" : "packages",
- "type" : "image",
- "__children": union (union (packages, patterns), ignored)
- ];
- if (config["image_patternType"]:"" != "")
- ret["patternType"] = config["image_patternType"]:"";
- return ret;
- }
-
- /**
* which keys in config.xml are not unique
*/
map non_unique_key = $[
@@ -241,6 +221,7 @@
"user" : true,
"source" : true,
"file" : true, // for drivers section
+ "profile" : true,
];
/**
@@ -254,7 +235,7 @@
integer i = 0;
while (i < level) {
i = i + 1;
- tab = tab + "\t";
+ tab = tab + " ";
}
string key = descr["__key"]:"";
if (key == "") return "";
@@ -267,7 +248,7 @@
});
else if (subkey == "__value")
value = String::EscapeTags (sformat ("%1", val));
- else if (is (val, string))
+ else if (is (val, string) || is (val, integer))
ret = sformat ("%1 %2=\"%3\"",
ret, subkey, String::EscapeTags (tostring (val)));
});
@@ -279,10 +260,59 @@
ret = ret + ">";
if (children != "")
ret = ret + children + "\n";
+
+ if (level == 0 && key == "image") // ugly hack
+ return ret;
ret = sformat ("%1%2%3>", ret, haskey (descr, "__value") ? "" : tab, key);
return ret;
}
+ // argument for any_xml agent: key indicating content of element without
+ // attributes
+ string content_key = "__yast_content__";
+
+ /**
+ * convert YCP map (of type read from any_xml agent) to XML
+ */
+ string MapAny2XML (string item_key, map item_descr, integer level) {
+
+ string tab = "";
+ integer i = 0;
+ while (i < level) {
+ i = i + 1;
+ tab = tab + " ";
+ }
+ string ret = tab + "<" + item_key;
+ string attr = "";
+ string subret = "";
+ string content = "";
+ foreach (string key, any value, (map) item_descr, {
+
+ if (is (value, list))
+ {
+ foreach (map it_map, (list<map>) value, {
+ subret = subret + "\n" + MapAny2XML (key, it_map, level + 1);
+ });
+ }
+ else if (is (value,string) || is (value,integer) || is (value,boolean))
+ {
+ if (key == content_key)
+ content = String::EscapeTags (tostring (value));
+ else
+ attr = attr + sformat (" %1=\"%2\"",
+ key, String::EscapeTags (tostring (value))
+ );
+ }
+ });
+ ret = ret + attr;
+ ret = ret + ((subret == "" && content == "")? "/>" : ">");
+ if (content != "")
+ ret = ret + content + sformat ("%1>", item_key);
+ else if (subret != "")
+ ret = ret + subret + "\n" + tab + sformat ("%1>", item_key);
+ return ret;
+ }
+
/**
* import the data from given config.xml
* @param directory where to look for config.xml
@@ -298,36 +328,7 @@
if (config == nil)
return ret;
map packages = config["packages"]:$[];
- // rest parts of "packages" are saved in product-creator map
- ret["ignore"] = maplist (map p,
- (list<map>)packages["image","ignore"]:[], ``(p["name"]:""));
- // value of "arch" is currently ignored...
- foreach (string section, [ "boot", "xen" ], {
- ret[section + "_packages"] = maplist (map p,
- (list<map>)packages[section, "package"]:[], ``(p["name"]:""));
- ret[section + "_patterns"] = maplist (map p,
- (list<map>)packages[section,"opensusePattern"]:[],``(p["name"]:""));
- ret[section + "_ignore"] = maplist (map p,
- (list<map>)packages[section, "ignore"]:[], ``(p["name"]:""));
- });
- // list of packages and patterns is needed for import, not for new image
- ret["addons"] = maplist (map p,
- (list<map>)packages["image","opensusePattern"]:[], ``(p["name"]:""));
- ret["packages"] = maplist (map p,
- (list<map>)packages["image","package"]:[], ``(p["name"]:""));
-
- if (haskey (packages, "delete"))
- {
- ret["delete_packages"] = maplist (map p,
- (list<map>)packages["delete", "package"]:[], ``(p["name"]:""));
- }
-
- if (packages["image","patternType"]:"" != "")
- ret["image_patternType"] = packages["image","patternType"]:"";
- if (packages["xen","disk"]:"" != "")
- ret["xen_disk"] = packages["xen","disk"]:"";
- if (packages["xen","memory"]:"" != "")
- ret["xen_memory"] = tointeger (packages["xen","memory"]:"512");
+
foreach (string key, [ "author", "contact", "image_type", "specification",
"packagemanager", "version", "rpm-check-signatures", "rpm-force",
"sizeunit", "type", "name", "repository", "defaultdestination",
@@ -344,16 +345,25 @@
foreach (string user, map usermap, (map) config["users"]:$[], {
if (!haskey (ret, "users"))
ret["users"] = $[];
- string pwd = usermap["pwd"]:"";
- boolean crypted = (pwd != "");
+ any pwd = usermap["pwd"]:nil;
+ boolean crypted = (pwd != nil);
ret["users",user] = $[
"home" : usermap["home"]:sformat ("/home/%1", user),
- "pwd" : (pwd == "") ? user : pwd,
+ "pwd" : (pwd == nil) ? user : pwd,
"encrypted" : crypted,
"group" : usermap["group"]:"",
"username" : user,
];
+ //FIXME save this, show in UI...
+ if (usermap["realname"]:"" != "")
+ ret["users",user,"realname"] = usermap["realname"]:"";
});
+
+ map anyxml = (map) SCR::Read (.anyxml, base_path + "/config.xml");
+ map image = anyxml["image",0]:$[];
+ ret["packages"] = image["packages"]:[];
+ ret["profiles"] = image["profiles"]:[];
+ ret["split"] = image["split"]:[];
return ret;
}
@@ -374,77 +384,6 @@
KiwiConfig["defaultroot"] = chroot_dir;
}
- list packages_list = [];
- list patterns_list = [];
- list ignored_list = [];
- list packages_boot_list = [];
- list patterns_boot_list = [];
- list ignored_boot_list = [];
-
- list packages_xen_list = [];
- list patterns_xen_list = [];
- list ignored_xen_list = [];
-
- foreach (string package, (list<string>) KiwiConfig["packages"]:[], {
- packages_list = add (packages_list, $[
- "__key" : "package",
- "name" : package,
- ]);
- });
- foreach (string pattern, (list<string>) KiwiConfig["addons"]:[], {
- patterns_list = add (patterns_list, $[
- "__key" : "opensusePattern",
- "name" : pattern,
- ]);
- });
- foreach (string package, (list<string>) KiwiConfig["ignore"]:[], {
- ignored_list = add (ignored_list, $[
- "__key" : "ignore",
- "name" : package,
- ]);
- });
- list<string> boot_packages =
- KiwiConfig["boot_packages"]:["filesystem", "glibc-locale", "kernel-default", "devs" ];
- foreach (string package, boot_packages, {
- packages_boot_list = add (packages_boot_list, $[
- "__key" : "package",
- "name" : package,
- ]);
- });
- foreach (string ignore, KiwiConfig["boot_ignore"]:[], {
- ignored_boot_list = add (ignored_boot_list, $[
- "__key" : "ignore",
- "name" : ignore,
- ]);
- });
-
-
- foreach (string package, KiwiConfig["xen_packages"]:[], {
- packages_xen_list = add (packages_xen_list, $[
- "__key" : "package",
- "name" : package,
- ]);
- });
- foreach (string pattern, KiwiConfig["xen_patterns"]:[], {
- patterns_xen_list = add (patterns_xen_list, $[
- "__key" : "pattern",
- "name" : pattern,
- ]);
- });
- foreach (string ignore, KiwiConfig["xen_ignore"]:[], {
- ignored_xen_list = add (ignored_xen_list, $[
- "__key" : "ignore",
- "name" : ignore,
- ]);
- });
-
- list packages_delete_list = maplist (string package,
- KiwiConfig["delete_packages"]:[], ``($[
- "__key" : "package",
- "name" : package,
- ])
- );
-
// for the order of keys in preferences section, see bug 355568
map preferences = $[
"__key" : "preferences",
@@ -494,7 +433,7 @@
list write_list = [ $[
"__key" : "image",
"name" : KiwiConfig["name"]:"",
- "schemeversion" : KiwiConfig["schemeversion"]:"1.4",
+ "schemeversion" : KiwiConfig["schemeversion"]:"2.0",
"__children" : [
$[
"__key" : "description",
@@ -519,6 +458,16 @@
]];
if (KiwiConfig["inherit"]:"" != "")
write_list[0,"inherit"] = KiwiConfig["inherit"]:"";
+ if (size (KiwiConfig["profiles"]:[]) > 0)
+ {
+ write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
+ "__key" : "profiles",
+ "__children" : maplist (
+ map profile, KiwiConfig["profiles",0,"profile"]:[], {
+ return union ($[ "__key" : "profile"], profile);
+ })
+ ]);
+ }
if (haskey (KiwiConfig, "users"))
{
map groups2users = $[];
@@ -534,14 +483,17 @@
write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
"__key" : "users",
"group" : group,
- "__children" : maplist (map usermap, (list<map>) userlist, ``(
- $[
+ "__children" : maplist (map usermap, (list<map>) userlist, {
+ map u = $[
"__key" : "user",
"name" : usermap["username"]:"",
"pwd" : (usermap["encrypted"]:false) ? usermap["pwd"]:"" : crypt_password (usermap["pwd"]:""),
"home" : usermap["home"]:"",
- ]
- ))
+ ];
+ if (usermap["realname"]:"" != "")
+ u["realname"] = usermap["realname"]:"";
+ return u;
+ })
]);
});
}
@@ -550,37 +502,83 @@
``(get_source_value (source, KiwiConfig))
)
);
- write_list[0,"__children"] = union (write_list[0,"__children"]:[], [
- get_image_packages (
- KiwiConfig, packages_list, patterns_list, ignored_list),
+ map image_packages = $[];
+ list<map> profiles_packages = [];
+ map bootstrap_packages = $[];
+ foreach (map packagemap, KiwiConfig["packages"]:[], {
+ /* example of packagemap:
$[
- "__key" : "packages",
- "type" : "boot",
- "__children": union (union (packages_boot_list, patterns_boot_list), ignored_boot_list)
- ],
- ]);
- if (task == "xen")
- {
- write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
- "__key" : "packages",
- "type" : "xen",
- // FIXME disk and memory not configurable
- "disk" : KiwiConfig["xen_disk"]:"/dev/sda",
- "memory" : sformat ("%1", KiwiConfig["xen_memory"]:512),
- "__children": union (union (packages_xen_list, patterns_xen_list), ignored_xen_list)
+ "opensusePattern" : [
+ $[ "name":"base" ],
+ $[ "name":"x11" ]
+ ],
+ "package" : [ $[ "name":"zypper" ] ],
+ "type" : "image",
+ "profiles" : "KDE"
+ ]*/
+ map pmap = union (packagemap, $[
+ "__key" : "packages",
]);
- }
+ string type = pmap["type"]:"";
+ pmap["__children"] = maplist (map p, pmap["package"]:[], ``(
+ union (p, $[ "__key" : "package"]))
+ );
+ if (haskey (pmap, "package"))
+ pmap = remove (pmap,"package");
+ if (haskey (pmap, "ignore"))
+ {
+ pmap["__children"] = union (pmap["__children"]:[],
+ maplist (map p, pmap["ignore"]:[], ``(
+ union (p, $[ "__key" : "ignore"]))
+ )
+ );
+ pmap = remove (pmap, "ignore");
+ }
+ if (haskey (pmap, "opensusePattern"))
+ {
+ pmap["__children"] = union (pmap["__children"]:[],
+ maplist (map p, pmap["opensusePattern"]:[], ``(
+ union (p, $[ "__key" : "opensusePattern"]))
+ )
+ );
+ pmap = remove (pmap,"opensusePattern");
+ }
+ if (type == "bootstrap")
+ bootstrap_packages = pmap;
+ else if (type == "image" && pmap["profiles"]:"" == "")
+ {
+ image_packages = pmap;
+ }
+ else if (size (pmap["__children"]:[]) > 0)
+ {
+ profiles_packages = add (profiles_packages, pmap);
+ }
+ });
+ if (image_packages != $[])
+ write_list[0,"__children"] =
+ add (write_list[0,"__children"]:[], image_packages);
+ if (profiles_packages != [])
+ write_list[0,"__children"] =
+ union (write_list[0,"__children"]:[], profiles_packages);
+ if (bootstrap_packages != $[])
+ write_list[0,"__children"] =
+ add (write_list[0,"__children"]:[], bootstrap_packages);
+
+ // generate the XML using current Map2XML function
+ string write_string = "<?xml version=\"1.0\"?>\n" +
+ Map2XML (write_list[0]:$[], 0);
- if (packages_delete_list != [])
+ // now, add the rest, created using more generic MapAny2XML function
+ if (haskey (KiwiConfig, "split") && size (KiwiConfig["split"]:[]) > 0)
{
- write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
- "__key" : "packages",
- "type" : "delete",
- "__children": packages_delete_list
- ]);
+ string split = MapAny2XML ("split", KiwiConfig["split",0]:$[], 1);
+ if (split != "")
+ {
+ write_string = write_string + split + "\n";
+ }
}
+ write_string = write_string + "</image>";
- string write_string = Map2XML (write_list[0]:$[], 0);
config_dir = tmp_dir + "/" + KiwiConfig["name"]:"";
SCR::Execute (.target.mkdir, config_dir);
SCR::Write (.target.string, config_dir + "/config.xml", write_string);
@@ -616,7 +614,7 @@
}
// run kiwi to finally create the live iso image
- global boolean PrepareAndCreate (string out_dir) {
+ global boolean PrepareAndCreate (string out_dir, string selected_profiles) {
if (config_dir == "" || !FileUtils::Exists (config_dir))
return false;
@@ -632,11 +630,6 @@
SCR::Execute (.target.bash, sformat ("rm -rf %1", chroot_dir));
}
- integer height = 8;
- map display_info = UI::GetDisplayInfo ();
- // reduce the height with small resolutions (#342046)
- if (display_info["TextMode"]:false || display_info["Height"]:0 < 600)
- height = 6;
// construct the dialog
UI::OpenDialog(`opt(`decorated), `HBox(`HSpacing(1.5),
`VBox(
@@ -646,11 +639,11 @@
// label
`ReplacePoint (`id (`rpl), `Left (`Label(_("Preparing for Image Creation")))),
`VSpacing(0.5),
- `LogView (`id (`log), "", height, 0)
+ `LogView (`id (`log), "", 8, 0)
)),
`VWeight (1, `VBox (
`VSpacing(0.5),
- `LogView (`id (`errlog), "", height / 2, 0),
+ `LogView (`id (`errlog), "", 8, 0),
`VSpacing(0.5),
`ReplacePoint (`id (`rp), `PushButton (`id(`cancel),`opt(`key_F9), Label::CancelButton ())),
`VSpacing(0.5)
@@ -673,7 +666,9 @@
});
}
- string cmd = sformat ("ZYPP_READONLY_HACK=1 kiwi --root %1 --prepare %2 --logfile terminal", chroot_dir, config_dir);
+ string cmd = sformat ("ZYPP_READONLY_HACK=1 kiwi --nocolor --root %1 --prepare %2 --logfile terminal", chroot_dir, config_dir);
+ if (selected_profiles != "" && selected_profiles != nil)
+ cmd = cmd + selected_profiles;
y2milestone ("calling '%1'", cmd);
@@ -711,10 +706,10 @@
// now continue with creating
UI::ChangeWidget (`id(`log), `LastLine, "\n");
- cmd = sformat ("ZYPP_READONLY_HACK=1 kiwi --create %1 -d %2 --logfile terminal", chroot_dir, out_dir);
+ cmd = sformat ("ZYPP_READONLY_HACK=1 kiwi --nocolor --create %1 -d %2 --logfile terminal", chroot_dir, out_dir);
y2milestone ("calling '%1'", cmd);
// label
- UI::ReplaceWidget (`id (`rpl), `Left (`Label (_("Creating Image..."))));
+ UI::ReplaceWidget (`id (`rpl), `Left (`Label (_("Creating Image"))));
SCR::Execute (.background.run_output_err, cmd);
ret = nil;
continue;
@@ -732,27 +727,12 @@
}
if (ret == `cancel)
{
- integer pid = (integer)SCR::Read (.background.pid);
- if (pid != -1)
- {
- // first, send a sigterm
- SCR::Execute (.target.bash, sformat ("kill %1", pid));
- // busy popup message
- Popup::ShowFeedback (_("Closing kiwi..."),
- // busy popup message
- _("This will take a while..."));
- sleep (5000);
- if ((boolean)SCR::Read(.background.isrunning))
- // .background.kill sends a sigkill after another second
- SCR::Execute(.background.kill);
- Popup::ClearFeedback ();
- }
+ SCR::Execute(.background.kill);
}
sleep (100);
} while (ret == nil);
- if ((boolean)SCR::Read(.background.isrunning))
- SCR::Execute(.background.kill);
+ SCR::Execute(.background.kill);
UI::CloseDialog ();
return ret == `ok;
}
@@ -818,18 +798,15 @@
integer srcid = source["SrcId"]:-1;
map data = Pkg::SourceGeneralData (srcid);
string url = data["url"]:"";
+ string full_url = url;
map parsed = URL::Parse(url);
- if (! contains (unsupported_schemes, parsed["scheme"]:""))
- {
- string full_url = url;
- if (parsed["scheme"]:"" == "https")
- full_url = Pkg::SourceURL (srcid);
- current_repositories[url] = $[
- "url" : url,
- "plaindir" : data["type"]:"" == "Plaindir",
- "full_url" : full_url,
- ];
- }
+ if (parsed["scheme"]:"" == "https")
+ full_url = Pkg::SourceURL (srcid);
+ current_repositories[url] = $[
+ "url" : url,
+ "plaindir" : data["type"]:"" == "Plaindir",
+ "full_url" : full_url,
+ ];
});
return current_repositories;
}
@@ -891,6 +868,5 @@
supported_boot_images = "";
return ReadImageTemplates ();
}
-
}
Modified: branches/tmp/jsuchome/product-creator/src/ProductCreator.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/ProductCreator.ycp?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/ProductCreator.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/ProductCreator.ycp Tue Jul 8 16:28:12 2008
@@ -32,6 +32,8 @@
import "GPGWidgets";
import "Mode";
import "CommandLine";
+import "FileUtils";
+import "PackageCallbacks";
global define void enableSources();
@@ -333,7 +335,7 @@
global define boolean Read() ``{
/* ProductCreator read dialog caption */
- string caption = _("Initializing CD Creator Configuration");
+ string caption = _("Initializing Product Creator Configuration");
integer steps = 1;
@@ -421,7 +423,7 @@
global define boolean Write() ``{
/* ProductCreator read dialog caption */
- string caption = _("Saving CD Creator Configuration");
+ string caption = _("Saving Product Creator Configuration");
integer steps = 2;
@@ -737,16 +739,6 @@
return ret;
}
-global boolean UpdateMD5File(string directory)
-{
- string command = sformat("/usr/bin/create_md5sums '%1'", String::Quote(directory));
- boolean ret = SCR::Execute(.target.bash, command) == 0;
-
- y2milestone("MD5SUMS updated: %1", ret);
-
- return ret;
-}
-
// execute a command
boolean Exec(string command)
{
@@ -765,6 +757,16 @@
return ret == 0;
}
+global boolean UpdateMD5File(string directory)
+{
+ string command = sformat("/bin/sh /usr/bin/create_md5sums '%1'", String::Quote(directory));
+ boolean ret = Exec(command);
+
+ y2milestone("MD5SUMS updated: %1", ret);
+
+ return ret;
+}
+
boolean CopyFile(integer srcid, integer mid, string src, string target)
{
string local_file = Pkg::SourceProvideFile(srcid, mid, src);
@@ -790,7 +792,7 @@
return true;
}
-boolean CopyDirectoryRec(integer srcid, integer mid, string src, string target)
+boolean CopyDirectoryR(integer srcid, integer mid, string src, string target, boolean optional)
{
y2milestone("CopyDirectoryRec: srcid: %1, mid: %2, src: %3, target: %4", srcid, mid, src, target);
@@ -799,29 +801,55 @@
if (local_dir == nil || local_dir == "")
{
- // an error message, %1 is the directory, %2 is URL of the source
- Report::Error(sformat(_("Cannot read directory %1\nfrom source %2."), src, Pkg::SourceGeneralData(srcid)["url"]:""));
+ if (!optional)
+ {
+ // an error message, %1 is the directory, %2 is URL of the source
+ Report::Error(sformat(_("Cannot read directory %1\nfrom source %2."), src, Pkg::SourceGeneralData(srcid)["url"]:""));
+ }
+
return false;
}
return Exec(sformat("/bin/cp -a -f -- '%1' '%2'", String::Quote(local_dir), String::Quote(target)));
}
-boolean CopyDirectoryNonRec(integer srcid, integer mid, string src, string target)
+boolean CopyDirectoryRec(integer srcid, integer mid, string src, string target)
+{
+ return CopyDirectoryR(srcid, mid, src, target, false);
+}
+
+boolean CopyDirectoryRecOpt(integer srcid, integer mid, string src, string target)
+{
+ return CopyDirectoryR(srcid, mid, src, target, true);
+}
+
+list<string> GetList(integer srcid, integer mid, string dir)
{
// get file list from directory.yast
- string file_list = Pkg::SourceProvideOptionalFile(srcid, 1, "directory.yast");
+ string file_list = Pkg::SourceProvideOptionalFile(srcid, mid, sformat("%1/directory.yast", dir));
if (file_list == nil || file_list == "")
{
y2error("directory.yast was not found, a YUM source?");
- return false;
+ return nil;
}
string f = (string)SCR::Read(.target.string, file_list);
list<string> files = splitstring(f, "\n");
y2milestone("Remote objects: %1", files);
+ return files;
+}
+
+boolean CopyDirectoryNonRec(integer srcid, integer mid, string src, string target)
+{
+ // get file list from directory.yast
+ list<string> files = GetList(srcid, mid, "");
+ if (files == nil)
+ {
+ files = [];
+ }
+
files = filter(string file, files, {return !regexpmatch(file, "/$") && file != "";});
y2milestone("Remote files: %1", files);
@@ -835,11 +863,126 @@
return true;
}
+boolean CopyDocu(integer srcid, string target)
+{
+ list<string> lst = GetList(srcid, 1, "");
+ if (lst == nil)
+ {
+ lst = [];
+ }
+
+ boolean ret = true;
+
+ if (contains(lst, "docu/"))
+ {
+ y2milestone("Copying /docu subdirectory");
+ Exec(sformat("/bin/mkdir -p '%1/docu'", String::Quote(target)));
+
+ boolean r = CopyDirectoryRecOpt(srcid, 1, "/docu", target);
+
+ if (!r)
+ {
+ list<string> files = [
+ "docu/RELEASE-NOTES.en.html", "docu/RELEASE-NOTES.en.rtf"
+ ];
+
+ y2milestone("Directory listing may be missing using fixed list: %1", files);
+
+ foreach(string f, files,
+ {
+ CopyFile(srcid, 1, f, target + f);
+ }
+ );
+ }
+
+ ret = ret && r;
+ }
+
+ return ret;
+}
+
boolean CopyPPCBoot(integer srcid, string target)
{
- return CopyDirectoryRec(srcid, 1, "/ppc", target)
- && CopyDirectoryRec(srcid, 1, "/etc", target)
- && CopyDirectoryRec(srcid, 1, "/suseboot", target);
+ y2milestone("Copying PPC boot files");
+
+ list<string> lst = GetList(srcid, 1, "");
+ if (lst == nil)
+ {
+ lst = [];
+ }
+
+ boolean ret = true;
+
+ if (contains(lst, "ppc/"))
+ {
+ y2milestone("Copying /ppc subdirectory");
+ boolean r = CopyDirectoryRecOpt(srcid, 1, "/ppc", target);
+
+ if (!r)
+ {
+ y2milestone("Directory listing may be missing, copying /ppc/bootinfo.txt");
+ CopyFile(srcid, 1, "/ppc/bootinfo.txt", target + "/ppc");
+ }
+
+ ret = ret && r;
+ }
+
+ if (contains(lst, "PS3/"))
+ {
+ y2milestone("Copying /ppc subdirectory");
+ boolean r = CopyDirectoryRecOpt(srcid, 1, "/PS3", target);
+
+ if (!r)
+ {
+ y2milestone("Directory listing may be missing, copying /ppc/bootinfo.txt");
+ Exec(sformat("/bin/mkdir -p '%1/PS3/otheros'", String::Quote(target)));
+ CopyFile(srcid, 1, "/PS3/otheros/otheros.bld", target + "/PS3/otheros");
+ }
+
+ ret = ret && r;
+ }
+
+ if (contains(lst, "suseboot/"))
+ {
+ y2milestone("Copying /suseboot subdirectory");
+ boolean r = CopyDirectoryRecOpt(srcid, 1, "/suseboot", target);
+ y2milestone("Result: %1", r);
+
+ if (!r)
+ {
+ list<string> files = [
+ "/suseboot/inst32", "/suseboot/inst64", "/suseboot/os-chooser",
+ "/suseboot/yaboot", "/suseboot/yaboot.cnf", "/suseboot/yaboot.ibm",
+ "/suseboot/yaboot.txt"
+ ];
+
+ y2milestone("Directory listing may be missing using fixed list: %1", files);
+
+ foreach(string f, files,
+ {
+ CopyFile(srcid, 1, f, target + f);
+ }
+ );
+ }
+
+ ret = ret && r;
+ }
+
+ if (contains(lst, "etc/"))
+ {
+ y2milestone("Copying /etc subdirectory");
+ boolean r = CopyDirectoryRecOpt(srcid, 1, "/etc", target);
+
+ if (!r)
+ {
+ y2milestone("Directory listing may be missing, copying /etc/yaboot.conf");
+ CopyFile(srcid, 1, "/etc/yaboot.conf", target + "/etc");
+ }
+
+ ret = ret && r;
+ }
+
+ return ret;
}
string UpDir(string input)
@@ -943,60 +1086,97 @@
list<integer> sources = UrlToId(Config["sources"]:[]);
- // we have to sort the products according to requires to get the base product
- string tsort_input = "";
+ if (size(sources) == 1)
+ {
+ y2milestone("Only one source selected");
+ return sources[0]:-1;
+ }
- map provide_map = $[];
+ // the products must be in the pool
+ Pkg::SourceLoad();
- string base_product_name = "";
+ list<map> product_deps = Pkg::ResolvableDependencies("", `product, "");
+ y2milestone("found products: %1", product_deps);
- foreach(integer id , sources, ``{
+ // filter out unused products
+ product_deps = filter(map prod, product_deps, {return contains(sources, prod["source"]:-1);});
- map general_info = Pkg::SourceGeneralData(id);
+ y2milestone("used products: %1", product_deps);
- // a YUM source cannot contain base product
- // only YaST source is supported
- if (general_info["type"]:"" == "YaST")
+ // we have to sort the products according to requires to get the base product
+ string tsort_input = "";
+
+ foreach(map prod, product_deps,
{
- map content_file = ReadContentFile(id);
+ list<string> provides = [];
+ list<string> requires = [];
- string requires = content_file["REQUIRES"]:"";
- string provides = content_file["PROVIDES"]:"";
+ // collect provides and requires dependencies
+ foreach(map dep, (list<map>)prod["dependencies"]:[],
+ {
+ string kind = dep["dep_kind"]:"";
+ // replace ' ' -> '_' (tsort uses space as a separator)
+ string name = String::Replace(dep["name"]:"", " ", "_");
- if (provides == "")
- {
- //provides = sformat("%1-%2", productData["productname"]:"", productData["productversion"]:"" );
- provides = sformat("%1-%2", content_file["PRODUCT"]:"", content_file["VERSION"]:"" );
- }
+ if (name != "")
+ {
+ if (kind == "provides")
+ {
+ provides = add(provides, name);
+ }
+ else if (kind == "requires")
+ {
+ requires = add(requires, name);
+ }
+ }
+ }
+ );
- string provides_tsort = String::Replace(provides, " ", "_");
+ integer src = prod["source"]:-1;
- base_product_name = provides;
+ y2milestone("Source %1: provides: %2, requires: %3", src, provides, requires);
- tsort_input = tsort_input + provides_tsort + " " + String::Replace(requires, " ", "_") + "\n";
- provide_map[provides_tsort] = id;
+ string src_str = sformat("@repository_id:%1@", src);
+
+ // add requires dependencies to the tsort input
+ foreach(string r, requires,
+ {
+ tsort_input = tsort_input + sformat("%1 %2\n", src_str, r);
+ }
+ );
+
+ // add provides dependencies to the tsort input
+ foreach(string p, provides,
+ {
+ tsort_input = tsort_input + sformat("%1 %2\n", p, src_str);
+ }
+ );
}
- });
+ );
- integer base = sources[0]:0;
+ y2milestone("tsort input: %1", tsort_input);
- if (size(sources) > 1)
- {
- y2debug("tsort_input: %1", tsort_input);
- // run tsort
- map sorted = (map)SCR::Execute(.target.bash_output, sformat("echo '%1' | tsort | tac", String::Quote(tsort_input)));
- list<string> sorted_prods = splitstring(sorted["stdout"]:"", "\n");
+ // run tsort
+ map sorted = (map)SCR::Execute(.target.bash_output, sformat("echo '%1' | tsort | tac", String::Quote(tsort_input)));
+ list<string> sorted_prods = splitstring(sorted["stdout"]:"", "\n");
+ y2milestone("Sorted products: %1", sorted_prods);
- // remove requires
- sorted_prods = filter(string p, sorted_prods, {return haskey(provide_map, p);});
- y2milestone("Sorted products: %1", sorted_prods);
+ integer base_source = sources[0]:-1;
- base = provide_map[sorted_prods[0]:""]:0;
- }
+ foreach(string line, sorted_prods,
+ {
+ string src_id = regexpsub(line, "@repository_id:([0-9]*)@", "\\1");
- y2milestone("Found base source: id: %1, %2", base, Pkg::SourceGeneralData(base));
+ if (src_id != nil)
+ {
+ base_source = tointeger(src_id);
+ y2milestone("Found base source: %1", base_source);
+ break;
+ }
+ }
+ );
- return base;
+ return base_source;
}
global string CreateAddonFile(map products)
@@ -1014,7 +1194,7 @@
ret = ret + "\n";
}
- ret = ret + "cd:///" + subdir;
+ ret = ret + "relurl://./" + subdir;
}
}
);
@@ -1059,13 +1239,19 @@
skel_root = sformat("%1/%2", Config["iso-directory"]:"", Config["name"]:"");
SCR::Execute(.target.mkdir, skel_root);
+ string base_url = Config["base_repo"]:"";
+ y2milestone("Configured base repository: %1", base_url);
+
// detect the base source
- integer base_source = checkProductDependency();
+ integer base_source = (base_url != "") ? (UrlToId([base_url])[0]:-1) : checkProductDependency();
boolean bootable_product = isBootSource(base_source);
- if (bootable_product)
+ // ppc64 has /boot/ppc
+ string boot_architecture = (arch == "ppc64") ? "ppc" : arch;
+
+ if (bootable_product && Config["code10"]:false)
{
- Exec(sformat("/bin/mkdir -p '%1/boot/%2'", String::Quote(skel_root), String::Quote(arch)));
+ Exec(sformat("/bin/mkdir -p '%1/boot/%2'", String::Quote(skel_root), String::Quote(boot_architecture)));
}
list<integer> enabled = Pkg::SourceGetCurrent(true);
@@ -1091,7 +1277,7 @@
}
else if (Arch::ppc() || Arch::ppc64())
{
- Exec(sformat("/bin/mkdir -p '%1/etc'", String::Quote(skel_root)));
+ Exec(sformat("/bin/mkdir -p '%1/PS3'", String::Quote(skel_root)));
Exec(sformat("/bin/mkdir -p '%1/ppc'", String::Quote(skel_root)));
Exec(sformat("/bin/mkdir -p '%1/suseboot'", String::Quote(skel_root)));
}
@@ -1129,6 +1315,9 @@
if (source == "")
return false;
+ // copy /docu (release notes) when present
+ CopyDocu(id, skel_root);
+
y2milestone("source: %1", source);
descr_dir = this_source["productData","descrdir"]:"suse/setup/descr";
@@ -1344,6 +1533,13 @@
CopyDirectoryRec(base_source, 1, "boot/loader", sformat("%1/boot", skel_root));
}
}
+ else if (Arch::ppc() || Arch::ppc64())
+ {
+ CopyPPCBoot(base_source, skel_root);
+
+ // recursive copy of /boot
+ CopyDirectoryRec(base_source, 1, "boot", skel_root);
+ }
else
{
// recursive copy of /boot/loader/*
@@ -1352,7 +1548,12 @@
}
else
{
- CopyDirectoryRec(base_source, 1, "/boot", skel_root);
+ CopyDirectoryRec(base_source, 1, "boot", skel_root);
+
+ if (Arch::ppc() || Arch::ppc64())
+ {
+ CopyPPCBoot(base_source, skel_root);
+ }
}
}
}
@@ -1395,7 +1596,7 @@
{
// copy slide show
Exec(sformat("/bin/mkdir -p '%1/%2'", String::Quote(skel_root), String::Quote(slidedir)));
- Exec(sformat("/bin/cp -a -- '%1/*' '%2/%3'", String::Quote(l_slidedir), String::Quote(skel_root), String::Quote(slidedir)));
+ Exec(sformat("/bin/cp -a -- '%1' '%2/%3'", String::Quote(l_slidedir), String::Quote(skel_root), String::Quote(datadir + "/setup/")));
}
}
else
@@ -1504,6 +1705,9 @@
// remove the meta information from content file
Exec(sformat("/usr/bin/grep -v -e '^KEY ' -e '^META ' '%1/content' > '%1/content.new'", String::Quote(skel_root)));
Exec(sformat("/bin/mv '%1/content.new' '%1/content'", String::Quote(skel_root)));
+ // mark the final product as 'base'
+ if (SCR::Execute (.target.bash, sformat("/usr/bin/grep '^TYPE' '%1/content'", String::Quote(skel_root))) != 0)
+ Exec(sformat("echo 'TYPE base' >> '%1/content'", String::Quote(skel_root)));
// recreate the index file
// FIXME: use create_directory when it supports parameter with spaces
@@ -1528,12 +1732,14 @@
files = [];
}
- files = filter(string f, files, {return regexpmatch(f, "\\.pat$");});
+ files = filter(string f, files, {return regexpmatch(f, "\\.pat$") || regexpmatch(f, "\\.pat.gz$");});
y2milestone("found pattern files: %1", files);
- list<string> used_files_regexps = maplist(string p, used_patterns, {return sformat("^%1-.*\\.pat$", p);});
- y2debug("used_files_regexps: %1", used_files_regexps);
+ list<string> used_files_regexps = (list<string>)union(maplist(string p, used_patterns, {return sformat("^%1-.*\\.pat$", p);}),
+ maplist(string p, used_patterns, {return sformat("^%1-.*\\.pat.gz$", p);}));
+
+ y2milestone("used_files_regexps: %1", used_files_regexps);
boolean refresh_diryast = false;
foreach(string f, files,
@@ -1553,14 +1759,15 @@
{
// remove the pattern
string cmd = sformat("/bin/rm -- '%1/%2/%3'", String::Quote(skel_root), String::Quote(descrDir), String::Quote(f));
- y2milestone("removing pattern %1", f);
success = success && Exec(cmd);
- y2debug("success: %1", success);
+ y2milestone("removing pattern %1: %2", f, success);
refresh_diryast = true;
}
}
);
+ y2milestone("removed patterns: %1", success);
+
if (refresh_diryast)
{
// regenerate directory.yast and patterns file
@@ -1569,9 +1776,8 @@
success = success && Exec(cmd);
y2debug("success: %1", success);
- cmd = sformat("cd '%1/%2'; ls *.pat > '%1/%2/patterns'", String::Quote(skel_root), String::Quote(descrDir));
- success = success && Exec(cmd);
- y2debug("success: %1", success);
+ cmd = sformat("cd '%1/%2'; ls *.pat *.pat.gz > '%1/%2/patterns'", String::Quote(skel_root), String::Quote(descrDir));
+ Exec(cmd);
}
}
@@ -1590,7 +1796,7 @@
success = success && SCR::Write(.target.string, target_addon_file, addon_file);
}
- y2debug("success: %1", success);
+ y2milestone("Created skeleton: %1", success);
return success;
}
@@ -1631,6 +1837,37 @@
return ret;
}
+string DumpKernelFromObjectFile(string object)
+{
+ y2milestone("Extracting kernel from file %1", object);
+ string tmpdir = (string)SCR::Read(.target.tmpdir);
+ string target = tmpdir + "/tmp_kernel.gz";
+
+ string command = sformat("objcopy -O binary -j .kernel:vmlinux.strip '%1' '%2'", String::Quote(object), String::Quote(target));
+ string ret = (Exec(command)) ? target : "";
+
+ y2milestone("Kernel extracted to %1", ret);
+
+ return ret;
+}
+
+string GunzipKernel(string kernel_gz)
+{
+ string command = sformat("gunzip -f %1", kernel_gz);
+ boolean success = Exec(command);
+ string ret = "";
+
+ // remove .gz suffix from the file name
+ if (success)
+ {
+ ret = regexpsub (kernel_gz, "^(.*)\\.gz$", "\\1");
+ }
+
+ y2milestone("Kernel unpacked to %1", ret);
+
+ return ret;
+}
+
global boolean InsertKeyToInitrds(string gpg_key, string base_dir)
{
// get initrd list
@@ -1646,12 +1883,54 @@
find_output = out["stdout"]:"";
}
+ map inst_mapping = $[];
+
if (SCR::Read(.target.size, base_dir + "/suseboot") >= 0)
{
y2milestone("Searching for 'initrd*' in %1/suseboot...", base_dir);
command = sformat("cd '%1' && find suseboot -type f -name 'initrd*'", String::Quote(base_dir));
out = (map)SCR::Execute(.target.bash_output, command);
find_output = find_output + out["stdout"]:"";
+
+ if (size(out["stdout"]:"") == 0)
+ {
+ y2milestone("initrd not found, searching for inst*");
+
+ command = sformat("cd '%1' && find suseboot -type f -name 'inst32'; find suseboot -type f -name 'inst64'", String::Quote(base_dir));
+ out = (map)SCR::Execute(.target.bash_output, command);
+
+ list<string> inst_files = splitstring(out["stdout"]:"", "\n");
+ // remove empty strings
+ inst_files = filter(string inst, inst_files, {return inst != "";});
+
+ if (size(inst_files) > 0)
+ {
+ y2milestone("Found inst* files: %1", inst_files);
+
+ integer index = 0;
+ // unpack the initrd from the inst* object
+ foreach(string inst, inst_files,
+ {
+ string tmp_initrd = sformat("suseboot/.tmp_yast_initrd%1.gz", index);
+
+ command = sformat("cd '%1' && objcopy -O binary -j .kernel:initrd '%2' '%3'", String::Quote(base_dir), String::Quote(inst), tmp_initrd);
+
+ out = (map)SCR::Execute(.target.bash_output, command);
+
+ if (out["exit"]:-1 == 0)
+ {
+ y2milestone("Extracted %1 from %2", tmp_initrd, inst);
+ find_output = find_output + tmp_initrd + "\n";
+
+ inst_mapping = add(inst_mapping, inst, tmp_initrd);
+ }
+
+ index = index + 1;
+ }
+ );
+
+ }
+ }
}
list<string> initrds = splitstring(find_output, "\n");
@@ -1674,6 +1953,50 @@
}
);
+ // put the initrd back to the inst file
+ foreach(string orig_inst, string tmp_initrd, inst_mapping,
+ {
+ y2milestone("%1 -> %2", tmp_initrd, orig_inst);
+
+ if (orig_inst == "suseboot/inst32" || orig_inst == "suseboot/inst64")
+ {
+ // extract kernel
+ string gzkernel = DumpKernelFromObjectFile(base_dir + "/" + orig_inst);
+
+ if (gzkernel != "")
+ {
+ // unpack the kernel image - required by mkzimage
+ string kernel = GunzipKernel(gzkernel);
+ string tmp_dir = (string)SCR::Read( .target.tmpdir );
+
+ string initrd_copy = sformat("%1/tmp_initrd", tmp_dir);
+
+ // copy the initrd to a temp dir - mkzimage doesn't work properly
+ // when there is a space in path
+ ret = ret && Exec(sformat("mv '%1/%2' '%3'", String::Quote(base_dir), tmp_initrd, initrd_copy));
+
+ // create new inst file
+ // see mk_ppc_installation-images_bootbinaries.sh (installation-images)
+ command = sformat("/bin/mkzimage --board chrp --vmlinux '%1' --initrd '%2' --output '%3/new_inst' --tmp '%3'",
+ kernel, initrd_copy, tmp_dir);
+ ret = ret && Exec(command);
+
+ // remove the temporary files
+ command = sformat("rm -f '%1' '%2'", kernel, initrd_copy);
+ ret = ret && Exec(command);
+
+ // move the new file to the target directory
+ command = sformat("mv '%1/new_inst' '%2/%3'", tmp_dir, String::Quote(base_dir), orig_inst);
+ ret = ret && Exec(command);
+ }
+ }
+ else
+ {
+ y2warning("Unsupported inst file: %1", orig_inst);
+ }
+ }
+ );
+
return ret;
}
@@ -1712,6 +2035,26 @@
return ret;
}
+// do not sign the sources, just update content files
+global boolean UpdateContentFiles()
+{
+ boolean success = true;
+
+ foreach(integer srcid, string dir, product_map,
+ {
+ map general_info = Pkg::SourceGeneralData(srcid);
+
+ if (general_info["type"]:"" == "YaST")
+ {
+ success = UpdateContentFile(skel_root + "/" + dir, "suse/setup/descr") && success;
+ y2milestone("Updated content file in %1: %2", skel_root + "/" + dir, success);
+ }
+ }
+ );
+
+ return success;
+}
+
global boolean SignSourceStep()
{
boolean success = true;
@@ -1943,7 +2286,22 @@
return;
}
-
+/**
+ * Check if there is a language selected in the package manager,
+ * if not then select the language used in the UI. Htis prevents the solver
+ * from allocating too many resources (see bug #339756)
+ */
+global void CheckLanguage()
+{
+/* FIXME no relevant code in SP2
+ if (Pkg::GetPackageLocale() == "" && Pkg::GetAdditionalLocales() == [])
+ {
+ y2warning("No language selected, preselecting the current UI language: %1", UI::GetLanguage(true));
+ // if there is nothing selected yet then preset the language
+ Pkg::SetPackageLocale(UI::GetLanguage(true));
+ }
+*/
+}
/**
* Set packages to be copied to iso image tree
@@ -1961,17 +2319,21 @@
kernels = [
"kernel-64k-pagesize",
"kernel-bigsmp",
+ "kernel-pae",
"kernel-debug",
"kernel-default",
"kernel-iseries64",
"kernel-pmac64",
"kernel-pseries64",
+ "kernel-ppc64",
"kernel-s390",
"kernel-s390x",
"kernel-smp",
"kernel-sn2",
"kernel-xen",
- "kernel-um"
+ "kernel-xenpae",
+ "kernel-um",
+ "kernel-vanilla"
];
} else {
kernels = add(kernels, kernel);
@@ -2017,6 +2379,8 @@
Pkg::DoProvide(packages);
+ CheckLanguage();
+
boolean ret = Pkg::PkgSolve(false);
return (ret);
@@ -2145,11 +2509,73 @@
return true;
}
-global void CallbackSourceReportEnd(integer numeric_id, string url, string task, string error, string reason)
+global void CallbackSourceReportEnd(integer numeric_id, string url, string task, symbol error, string reason)
{
y2debug("source_id: %1, url: %2, task: %3, error: %4, reason: %5", numeric_id, url, task, error, reason);
}
+global void InitDownload(string task)
+{
+ y2debug("InitDownload: %1", task);
+}
+
+global void DestDownload()
+{
+ y2debug("DestDownload");
+}
+
+global void StartDownload (string url, string localfile)
+{
+ // reformat the URL
+ string url_report = URL::FormatURL(URL::Parse(url), 60);
+
+ if (Mode::commandline()) {
+ CommandLine::PrintVerbose(url_report);
+ }
+ else
+ {
+ // change the label
+ UI::ChangeWidget(`id(`pb), `Label, sformat(_("Copying %1"), url_report));
+ }
+}
+
+
+global void StartDownloadEmpty (string url, string localfile)
+{
+ y2debug("StartDownload: %1", url);
+}
+
+global boolean ProgressDownload (integer percent, integer bps_avg, integer bps_current)
+{
+ return UI::PollInput() != `abort;
+}
+
+global void RedirectCallbacks()
+{
+ Pkg::CallbackSourceReportStart("ProductCreator::CallbackSourceReportStart");
+ Pkg::CallbackSourceReportProgress("ProductCreator::CallbackSourceReportProgress");
+ Pkg::CallbackSourceReportEnd("ProductCreator::CallbackSourceReportEnd");
+
+// Pkg::CallbackInitDownload ("ProductCreator::InitDownload");
+ Pkg::CallbackStartDownload ("ProductCreator::StartDownload");
+ Pkg::CallbackProgressDownload ("ProductCreator::ProgressDownload");
+ // use the standard callback handler
+ Pkg::CallbackDoneDownload ("PackageCallbacks::DoneDownload");
+// Pkg::CallbackDestDownload ("ProductCreator::DestDownload");
+}
+
+global void ResetCallbacks()
+{
+ Pkg::CallbackSourceReportStart("PackageCallbacks::SourceReportStart");
+ Pkg::CallbackSourceReportProgress("PackageCallbacks::SourceReportProgress");
+ Pkg::CallbackSourceReportEnd("PackageCallbacks::SourceReportEnd");
+
+// Pkg::CallbackInitDownload ("PackageCallbacks::InitDownload");
+ Pkg::CallbackStartDownload ("PackageCallbacks::StartDownload");
+ Pkg::CallbackProgressDownload ("PackageCallbacks::ProgressDownload");
+ Pkg::CallbackDoneDownload ("PackageCallbacks::DoneDownload");
+// Pkg::CallbackDestDownload ("PackageCallbacks::DestDownload");
+}
/**
* CopyPackages()
@@ -2165,13 +2591,11 @@
boolean ret = true;
- // disable source report callbacks - there is a progress dialog
- Pkg::CallbackSourceReportStart("ProductCreator::CallbackSourceReportStart");
- Pkg::CallbackSourceReportProgress("ProductCreator::CallbackSourceReportProgress");
- Pkg::CallbackSourceReportEnd("ProductCreator::CallbackSourceReportEnd");
-
y2milestone("Package summary: %1", toCopy);
+// Pkg::CallbackStartDownload (ProductCreator::StartDownloadEmpty);
+ Pkg::CallbackStartDownload ("ProductCreator::StartDownloadEmpty");
+
// copy the packages
foreach(integer source, map srcmapping, toCopy,
{
@@ -2241,16 +2665,24 @@
else
{
// TODO FIXME get datadir from the source
- ret = ret && Exec(sformat("cd '%1/%2/%3' && /usr/bin/create_package_descr -x setup/descr/EXTRA_PROV",
+ ret = ret && Exec(sformat("cd '%1/%2/%3' && /usr/bin/create_package_descr -x setup/descr/EXTRA_PROV -M 3",
String::Quote(basedir), String::Quote(subdir), String::Quote(datadir)));
+
+ // check if the metadata are gzipped
+ boolean compressed_meta = FileUtils::Exists(sformat("%1/%2/%3/setup/descr/packages.DU.gz", basedir, subdir, datadir));
+ y2milestone("Compressed metadata: %1", compressed_meta);
+
+ if (compressed_meta)
+ {
+ ret = ret && Exec(sformat("cd '%1/%2/%3/setup/descr/' && gzip -9 -f packages packages.DU packages.en",
+ String::Quote(basedir), String::Quote(subdir), String::Quote(datadir)));
+ }
}
}
);
- // restore the source report callbacks
- Pkg::CallbackSourceReportStart("PackageCallbacks::SourceReportStart");
- Pkg::CallbackSourceReportProgress("PackageCallbacks::SourceReportProgress");
- Pkg::CallbackSourceReportEnd("PackageCallbacks::SourceReportEnd");
+// Pkg::CallbackStartDownload (ProductCreator::StartDownload);
+ Pkg::CallbackStartDownload ("ProductCreator::StartDownload");
return ret;
}
Modified: branches/tmp/jsuchome/product-creator/src/commandline.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/commandline.ycp?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/commandline.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/commandline.ycp Tue Jul 8 16:28:12 2008
@@ -363,7 +363,7 @@
else
{
// summary text
- CommandLine::Print (_("The medium will not be digitally signed."));
+ CommandLine::Print (_("The medium will not be digitally signed"));
}
return false;
}
Modified: branches/tmp/jsuchome/product-creator/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/complex.ycp?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/complex.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/complex.ycp Tue Jul 8 16:28:12 2008
@@ -267,17 +267,29 @@
help );
- if(ProductCreator::Abort()) return `abort;
+ if(ProductCreator::Abort())
+ {
+ ProductCreator::ResetCallbacks();
+ return `abort;
+ }
Progress::NextStage();
+ // redirect the download callbacks
+ ProductCreator::RedirectCallbacks();
+
if (!ProductCreator::CreateSkeleton())
{
Report::Error(_("Error while creating skeleton."));
+ ProductCreator::ResetCallbacks();
return `overview;
}
- if(ProductCreator::Abort()) return `abort;
+ if(ProductCreator::Abort())
+ {
+ ProductCreator::ResetCallbacks();
+ return `abort;
+ }
Progress::NextStage();
if (ProductCreator::Config["pkgtype"]:"" == "autoyast")
{
@@ -288,9 +300,12 @@
if (ProductCreator::Config["bootconfig"]:"" != "")
{
y2debug("bootconfig available");
- SCR::Write(.target.string,
- sformat("%1/boot/loader/isolinux.cfg", ProductCreator::skel_root),
- ProductCreator::Config["bootconfig"]:"" );
+
+ string fname = (ProductCreator::Config["code10"]:false)
+ ? sformat("%1/boot/%2/loader/isolinux.cfg", ProductCreator::skel_root, Arch::architecture())
+ : sformat("%1/boot/loader/isolinux.cfg", ProductCreator::skel_root);
+
+ SCR::Write(.target.string, fname, ProductCreator::Config["bootconfig"]:"" );
}
}
@@ -298,6 +313,7 @@
Progress::NextStage();
if (!ProductCreator::CopyPackages())
{
+ ProductCreator::ResetCallbacks();
return `overview;
}
@@ -306,9 +322,15 @@
Progress::NextStage();
if (!ProductCreator::SignSourceStep())
{
+ ProductCreator::ResetCallbacks();
return `overview;
}
}
+ else
+ {
+ // update content files if the source is not signed (bnc #368146)
+ ProductCreator::UpdateContentFiles();
+ }
integer i = 0;
@@ -344,8 +366,10 @@
{
Popup::ShowFeedback(_("Creating CD Image..."), _("This may take a while"));
}
+ string arch = Arch::architecture ();
+ if (arch == "s390_64") arch = "s390x";
- string command = sformat("/usr/lib/YaST2/bin/y2mkiso '%1' '%2' '%3'", String::Quote(isodir), String::Quote(isofile), String::Quote((ProductCreator::Config["code10"]:false) ? Arch::architecture() : ""));
+ string command = sformat("/usr/lib/YaST2/bin/y2mkiso '%1' '%2' '%3'", String::Quote(isodir), String::Quote(isofile), String::Quote((ProductCreator::Config["code10"]:false) ? arch : ""));
y2milestone("command: %1", command);
SCR::Execute (.target.bash, command, $["CD_PUBLISHER": pub, "CD_PREPARER": prep ]);
@@ -358,6 +382,9 @@
}
} until (ret == `next || ret == `back || ret == `abort);
+
+ ProductCreator::ResetCallbacks();
+
return (symbol)ret;
}
@@ -525,6 +552,13 @@
return `skip_isolinux;
}
+ // skip isolinux configuration if the architecture
+ // is not i386 or x86_64 - there is no isolinux
+ if (Arch::architecture() != "i386" && Arch::architecture() != "x86_64")
+ {
+ return `skip_isolinux;
+ }
+
return `next;
}
@@ -576,7 +610,7 @@
}
// help text
- string help_text = _("<p>Start the creation of a new image configuration with <b>Add</b>.</p>") +
+ string help_text = _("<p>Start the creating of new image configuration with <b>Add</b>.</p>") +
// help text
_("<p>Use <b>Edit</b> to change selected image configuration or create the image.</p>") +
@@ -585,7 +619,7 @@
_("<p>Delete the directory with selected configuration using <b>Delete</b>.</p>") +
// help text, %1 is directory
- sformat (_("<p>All image configurations are saved in the <tt>%1</tt> directory.</p>"), images_dir);
+ sformat (_("<p>All image configurations are saved in <tt>%1</tt> directory.</p>"), images_dir);
// main dialog caption
string caption = _("Image Creator Configuration Overview");
@@ -612,7 +646,6 @@
Wizard::HideAbortButton();
UI::ChangeWidget (`id (`edit), `Enabled, size (overview) > 0);
- UI::ChangeWidget (`id (`delete), `Enabled, size (overview) > 0);
if (size (overview) > 0)
{
string current = (string) UI::QueryWidget(`id(`table), `CurrentItem);
@@ -646,7 +679,7 @@
{
if (Popup::YesNo (
// yes/no popup
-sformat (_("Delete configuration %1 now?"), current)))
+sformat (_("Delete configutation %1 now?"), current)))
{
map config = Configurations[current]:$[];
string dir =
@@ -658,8 +691,6 @@
overview = filter (term it, (list<term>) overview,
``(it[0,0]:"" != current));
UI::ChangeWidget (`id (`table), `Items, overview);
- UI::ChangeWidget (`id (`edit), `Enabled, size (overview) > 0);
- UI::ChangeWidget (`id (`delete), `Enabled, size (overview) > 0);
}
}
else if (ret == `edit)
Modified: branches/tmp/jsuchome/product-creator/src/data/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/data/Makefile.am?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/data/Makefile.am (original)
+++ branches/tmp/jsuchome/product-creator/src/data/Makefile.am Tue Jul 8 16:28:12 2008
@@ -13,6 +13,4 @@
fillup_DATA = sysconfig.product-creator
-fillupdir = /var/adm/fillup-templates
-
EXTRA_DIST = $(ydata_DATA) $(fillup_DATA)
Modified: branches/tmp/jsuchome/product-creator/src/data/isolinux.cfg
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/data/isolinux.cfg?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/data/isolinux.cfg (original)
+++ branches/tmp/jsuchome/product-creator/src/data/isolinux.cfg Tue Jul 8 16:28:12 2008
@@ -38,7 +38,7 @@
label memtest
kernel memtest
-implicit 0
+implicit 1
gfxboot bootlogo
display message
prompt 1
Modified: branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/iso/config.xml
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/iso/config.xml?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/iso/config.xml (original)
+++ branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/iso/config.xml Tue Jul 8 16:28:12 2008
@@ -26,7 +26,7 @@
<package name="kernel-xen"/>
<package name="xen"/>
</packages>
- <packages type="boot">
+ <packages type="bootstrap">
<package name="filesystem"/>
<package name="glibc-locale"/>
<package name="kernel-default"/>
Modified: branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/xen/config.xml
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/xen/config.xml?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/xen/config.xml (original)
+++ branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/xen/config.xml Tue Jul 8 16:28:12 2008
@@ -168,7 +168,7 @@
<package name="kernel-xen"/>
<package name="xen"/>
</packages>
- <packages type="boot">
+ <packages type="bootstrap">
<package name="filesystem"/>
<package name="glibc-locale"/>
<package name="devs"/>
Modified: branches/tmp/jsuchome/product-creator/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/dialogs.ycp?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/dialogs.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/dialogs.ycp Tue Jul 8 16:28:12 2008
@@ -16,7 +16,6 @@
import "SourceManager";
import "Report";
import "URL";
- import "StorageDevices";
import "Arch";
import "Label";
import "Popup";
@@ -96,10 +95,9 @@
define symbol Configure1Dialog () ``{
/* ProductCreator configure1 dialog caption */
- string caption = _("CD Creator Configuration");
+ string caption = _("Product Creator Configuration");
- string source = ProductCreator::Config["source"]:"";
string name = ProductCreator::Config["name"]:"";
string pkgtype = ProductCreator::Config["pkgtype"]:"package-manager";
@@ -255,6 +253,9 @@
return (symbol)ret;
}
+ // remember the direction to correctly skip baseProductSelectionDialog()
+ boolean going_back = false;
+
/**
* Configure2 dialog
* @return dialog result
@@ -268,7 +269,6 @@
string publisher = ProductCreator::Config["publisher"]:"";
string preparer = ProductCreator::Config["preparer"]:"";
string result = ProductCreator::Config["result"]:"iso";
- string db = ProductCreator::Config["database"]:"original";
string isofile_path = ProductCreator::Config["isofile"]:"";
boolean savespace = ProductCreator::Config["savespace"]:false;
@@ -383,6 +383,7 @@
}
else if (ret == `back)
{
+ going_back = true;
break;
}
else if(ret == `next)
@@ -450,7 +451,7 @@
y2debug("sources: %1", sources);
term table =
- `Table( `id( `table ), `opt( `keepSorting ),
+ `Table( `id( `table ), `opt( `keepSorting, `notify ),
`header(_("Selected"), _("Status"), _("Name"), _("URL") ),
sources
);
@@ -493,6 +494,11 @@
while(true) {
ret = UI::UserInput();
+ if (ret == `table)
+ {
+ integer ID = (integer)UI::QueryWidget(`id(`table),`CurrentItem);
+ ret = contains (selected_items, ID) ? `remove : `select;
+ }
/* abort? */
if(ret == `abort || ret == `cancel) {
if(ProductCreator::ReallyAbort()) break;
@@ -532,11 +538,17 @@
y2milestone("Architecture %1 is supported: %2", arch, found_architecture);
- if (true)
+ if (found_architecture)
{
if (!contains(selected_items, SrcID))
{
selected_items = add (selected_items, SrcID );
+
+ // enable the source
+ if (general_info["enabled"]:false)
+ {
+ Pkg::SourceSetEnabled(SrcID, true);
+ }
}
UI::ChangeWidget(`id(`table), `Item(SrcID, 0) , _("X"));
@@ -551,6 +563,14 @@
else if (ret == `remove)
{
integer SrcID = (integer)UI::QueryWidget(`id(`table), `CurrentItem);
+ map general_info = Pkg::SourceGeneralData(SrcID);
+
+ // disable the source
+ if (general_info["enabled"]:false)
+ {
+ Pkg::SourceSetEnabled(SrcID, false);
+ }
+
selected_items = filter(integer i, selected_items, ``(SrcID!=i ));
UI::ChangeWidget(`id(`table), `Item(SrcID, 0) , "");
}
@@ -594,17 +614,9 @@
Report::Error(_("Select at least one source."));
continue;
}
- integer base_source = ProductCreator::checkProductDependency();
- // is the base source bootable?
- if (!ProductCreator::isBootSource(base_source))
- {
- if (Popup::ContinueCancel("The selected installation source doesn't contain /boot directory.
-The created medium will not be bootable.\n"))
- {
- break;
- }
- }
+ going_back = false;
+
break;
}
else if( ret == `back) {
@@ -619,6 +631,82 @@
return (symbol)ret;
}
+ define symbol baseProductSelectionDialog()
+ {
+ if (size(ProductCreator::Config["sources"]:[]) == 1)
+ {
+ // there is just one repository, we can skip this dialog
+ y2milestone("Only one repository selected, skipping base repository selection");
+
+ // remove the option if it exists
+ if (haskey (ProductCreator::Config, "base_repo"))
+ ProductCreator::Config = remove(ProductCreator::Config, "base_repo");
+ return going_back ? `back : `next;
+ }
+
+ /* dialog caption */
+ string caption = _("Base Source Selection");
+
+ integer default_base = ProductCreator::Config["base_repo"]:-1;
+
+ if (default_base < 0)
+ {
+ y2milestone("The base repository is unknown, proposing...");
+ default_base = ProductCreator::checkProductDependency();
+ }
+
+ string default_url = Pkg::SourceGeneralData(default_base)["url"]:"";
+
+ list<term> items = [];
+
+ foreach(string srcurl, ProductCreator::Config["sources"]:[],
+ {
+ items = add(items, `item(srcurl, srcurl == default_url));
+ }
+ );
+
+ term contents = `SelectionBox(`id(`base_selection), _("Selected Base Source"), items);
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["baseSelection"]:"",
+ Label::BackButton(), Label::NextButton());
+
+ symbol ret = `again;
+ string base = "";
+
+ while(!contains([`next, `back, `abort], ret))
+ {
+ ret = (symbol)UI::UserInput();
+
+ if (ret == `next)
+ {
+ // get the selected source
+ base = (string)UI::QueryWidget(`id(`base_selection), `CurrentItem);
+ y2internal("Selected base product: %1", base);
+
+ integer base_src_id = ProductCreator::UrlToId([base])[0]:-1;
+
+ // is the base source bootable?
+ if (!ProductCreator::isBootSource(base_src_id))
+ {
+ y2warning("Selected base product is not bootable");
+
+ if (!Popup::ContinueCancel("The selected base repository doesn't contain /boot directory.
+The created medium will not be bootable.\n"))
+ {
+ ret = `again;
+ }
+ }
+ }
+ }
+
+ if (ret == `next)
+ {
+ ProductCreator::Config["base_repo"] = base;
+ }
+
+ return ret;
+ }
+
/**
* Configure3 dialog
* @return dialog result
@@ -626,7 +714,7 @@
define symbol isolinuxDialog () ``{
/* dialog caption */
- string caption = _("CD Creator Configuration");
+ string caption = _("Product Creator Configuration");
string isolinux = ProductCreator::Readisolinux();
@@ -769,8 +857,6 @@
**/
symbol detailedSelection( symbol mode )
{
- Pkg::SaveState();
-
// Open empty dialog for instant feedback
UI::OpenDialog(`opt(`defaultsize),
@@ -783,19 +869,14 @@
// while the package manager is initialized
UI::ReplaceWidget(`rep,
mode == nil ?
- `PackageSelector(`id(`packages ), StorageDevices::FloppyDevice ) :
- `PackageSelector(`id(`packages ), `opt(mode), StorageDevices::FloppyDevice )
+ `PackageSelector(`id(`packages )) :
+ `PackageSelector(`id(`packages ), `opt(mode))
);
symbol result = (symbol) UI::RunPkgSelection(`id(`packages ) );
UI::CloseDialog();
y2milestone( "Package selector returned %1", result );
- if (result == `accept)
- Pkg::ClearSaveState();
- else
- Pkg::RestoreState(false);
-
return result;
}
@@ -873,6 +954,9 @@
any ret = nil;
+ Pkg::ResolvableNeutral ("", `package, true);
+ Pkg::ResolvableNeutral ("", `pattern, true);
+
// set a mount point - there is no use to display DU of the current system
Pkg::TargetInitDU([ $[ "name" : "/",
"free" : ProductCreator::max_size_mb * 1024,
@@ -920,6 +1004,9 @@
list<string> addons = patterns;
+ // ensure that a langugage is selected
+ ProductCreator::CheckLanguage();
+
if (size(addons) > 0 || ProductCreator::Config["base"]:"" != "")
{
y2milestone("base pattern: %1, addons: %2", base_pattern, addons);
@@ -1132,7 +1219,17 @@
}
else
{
- seladd = Pkg::GetPatterns(`selected, "");
+ // do not return patterns selected by dependencies
+ foreach (map pat, Pkg::ResolvableProperties ("", `pattern, ""),
+ {
+ if (pat["status"]:`none == `selected)
+ {
+ y2milestone ("pat %1 selected by %2" , pat["name"]:"",
+ pat["transact_by"]:nil);
+ if (pat["transact_by"]:nil != `solver)
+ seladd = add (seladd, pat["name"]:"");
+ }
+ });
selbase = Pkg::GetPatterns(`selected, "base");
}
}
@@ -1266,7 +1363,7 @@
// "validate_help" : _("Select a gpg key in the table. Create...")
"help" : _("<p><big><b>Sign</b></big><br>
To make it possible for users to verify your product, sign it with a GPG key.
-This key is checked when the product is added as an installation source.</p>")
+This key is checked when the product is added as a repository.</p>")
]
];
}
@@ -1341,10 +1438,24 @@
// summary caption
summary = Summary::AddHeader(summary,_("Output Directory"));
- // summary line
- summary = Summary::AddLine(summary,sformat(_("Creating directory tree in <b> %1/%2 </b>"),
+ if (ProductCreator::Config["result"]:"tree" == "iso")
+ {
+ summary = Summary::AddLine (summary,
+ // summary line (%1/%2 is file path)
+ sformat (_("Creating ISO image %1/%2"),
+ ProductCreator::Config["iso-directory"]:"",
+ ProductCreator::Config["isofile"]:"")
+ );
+ }
+ else
+ {
+ summary = Summary::AddLine (summary,
+ // summary line (%1/%2 is file path)
+ sformat(_("Creating directory tree in <b> %1/%2 </b>"),
ProductCreator::Config["iso-directory"]:"",
- ProductCreator::Config["name"]:"") );
+ ProductCreator::Config["name"]:"")
+ );
+ }
// header in the summary dialog
@@ -1376,7 +1487,7 @@
else
{
// summary text
- summary = Summary::AddLine(summary, _("The medium will not be digitally signed."));
+ summary = Summary::AddLine(summary, _("The medium will not be digitally signed"));
}
term contents =
Modified: branches/tmp/jsuchome/product-creator/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/helps.ycp?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/helps.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/helps.ycp Tue Jul 8 16:28:12 2008
@@ -49,7 +49,7 @@
/* Ovreview dialog help 1/3 */
- "overview" : _("<p><b><big>CD Creator Configuration Overview</big></b><br>
+ "overview" : _("<p><b><big>Product Creator Configuration Overview</big></b><br>
Obtain an overview of available configurations. Additionally
edit those configuration.<br></p>
") +
@@ -116,6 +116,23 @@
</p>
"),
+ /* help text - the base selection dialog 1/4 */
+"baseSelection" : _("<p><b>The Base Product</b></p>") +
+
+ /* help text - the base selection dialog 2/4 */
+_("<p>One of the used repositories must be marked as the base product. The base
+product repository should be bootable to ensure the new created product is also
+bootable.</p>") +
+
+ /* help text - the base selection dialog 3/4 */
+_("<p>The other repositories will be used as add-ons for the base repository.</p>")
+
+ /* help text - the base selection dialog 4/4 */
++ _("<p>The product creator solves dependencies of the selected products and proposes
+the base product. If the proposed value is wrong then select the right base
+repository from the list.</p>"),
+
+
];
/* EOF */
Modified: branches/tmp/jsuchome/product-creator/src/image-creator.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/image-creator.ycp?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/image-creator.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/image-creator.ycp Tue Jul 8 16:28:12 2008
@@ -33,7 +33,7 @@
return false;
}
- if (!Package::InstallAll (["kiwi", "yast2-instserver"]))
+ if (!Package::InstallAll (["kiwi"]))
{
Popup::Error(_("Installation of required packages
failed."));
@@ -50,7 +50,7 @@
map cmdline_description = $[
"id" : "image-creator",
// transltors: command line help text for the Xproduct-creator module
- "help" : _("Configuration of Image Creator"),
+ "help" : _("Configuration of Image creator"),
"guihandler" : ICSequence,
];
Added: branches/tmp/jsuchome/product-creator/src/kiwi.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/kiwi.ycp?rev=48925&view=auto
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/kiwi.ycp (added)
+++ branches/tmp/jsuchome/product-creator/src/kiwi.ycp Tue Jul 8 16:28:12 2008
@@ -0,0 +1,91 @@
+/**
+ * File: clients/kiwi.ycp
+ * Package: Configuration of product-creator
+ * Summary: Client to start the kiwi UI
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ *
+ */
+
+{
+
+textdomain "product-creator";
+
+include "product-creator/kiwi_dialogs.ycp";
+include "product-creator/wizards.ycp";
+
+import "CommandLine";
+import "Confirm";
+import "PackageCallbacksInit";
+import "Sequencer";
+
+/**
+ * configuration workflow for kiwi
+ * @return sequence result
+ */
+define boolean ShortKiwiSequence() {
+
+ map aliases = $[
+ "prepare" : ``( PrepareDialog() ),
+ "kiwi" : ``( KiwiDialog () ),
+ ];
+ map sequence = $[
+ "ws_start" : "prepare",
+ "prepare" : $[
+ `abort : `abort,
+ `next : "kiwi"
+ ],
+ "kiwi" : $[
+ `abort : `abort,
+ `next : `next
+ ]
+ ];
+
+ Wizard::CreateDialog();
+ Wizard::SetDesktopIcon("kiwi");
+
+ if (!Confirm::MustBeRoot ())
+ {
+ UI::CloseDialog ();
+ return false;
+ }
+
+ // not necessary to install all kiwi-descs, but now we don't know
+ // which will be needed...
+ if (!Package::InstallAll (["kiwi", "kiwi-desc-isoboot", "kiwi-desc-xenboot", "kiwi-desc-usbboot", "kiwi-desc-vmxboot"]))
+ {
+ // error popup
+ Popup::Error(_("Installation of required packages
+failed."));
+ return false;
+ }
+
+ InitRepositories ();
+ PackageCallbacksInit::InitPackageCallbacks();
+
+ symbol ret = Sequencer::Run(aliases, sequence);
+ UI::CloseDialog();
+ return ret == `next;
+}
+
+map cmdline_description = $[
+ "id" : "kiwi",
+ // command line help text for the kiwi module
+ "help" : _("Configuration of Kiwi"),
+ "guihandler" : ShortKiwiSequence,
+ "actions" : $[],
+];
+
+y2milestone ("----------------------------------------");
+y2milestone ("ProductCreator-kiwi module started");
+
+
+any ret = CommandLine::Run(cmdline_description);
+
+y2milestone("ProductCreator-kiwi module finished with %1", ret);
+y2milestone("----------------------------------------");
+
+return ret;
+
+}
Modified: branches/tmp/jsuchome/product-creator/src/kiwi_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/kiwi_dialogs.ycp?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/kiwi_dialogs.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/kiwi_dialogs.ycp Tue Jul 8 16:28:12 2008
@@ -16,6 +16,7 @@
import "Label";
import "Kiwi";
import "Package";
+ import "PackageSystem";
import "Popup";
import "ProductCreator";
import "SourceDialogsLite";
@@ -55,9 +56,9 @@
return ret;
}
- /********************************************************************************************
+ /*****************************************************************************
* widget handlers
- *******************************************************************************************/
+ ****************************************************************************/
/**
* Initialize the widget with ignored packages
@@ -84,13 +85,47 @@
* Initialize the widget with packages intended for deletion
*/
define void InitSWDelete (string id) {
- UI::ChangeWidget (`id (id), `Value, mergestring (KiwiConfig["delete_packages"]:[], "\n"));
+
+ list<string> to_delete = [];
+ foreach (map pmap, KiwiConfig["packages"]:[], {
+ string type = pmap["type"]:"";
+ if (type == "delete")
+ {
+ to_delete = maplist (map pacmap, pmap["package"]:[], ``(
+ pacmap["name"]:"")
+ );
+ }
+ });
+ UI::ChangeWidget (`id (id), `Value, mergestring (to_delete, "\n"));
}
define void StoreSWDelete (string key, map event) {
- string ignore_key = "delete_packages";
- KiwiConfig[ignore_key] = filter (string p,
- splitstring ((string) UI::QueryWidget(`id(key), `Value), "\n"), ``(p != ""));
+
+ list<string> to_delete = filter (string p, splitstring (
+ (string) UI::QueryWidget (`id(key), `Value), "\n"), ``(p != "")
+ );
+ integer index = 0;
+ integer del_index = -1;
+ foreach (map pmap, KiwiConfig["packages"]:[], {
+ if (pmap["type"]:"" == "delete")
+ {
+ del_index = index;
+ break;
+ }
+ index = index + 1;
+ });
+
+ map sw_contents = KiwiConfig["packages",del_index]:$[];
+ if (del_index == -1)
+ {
+ sw_contents = $[ "type" : "delete" ];
+ del_index = size (KiwiConfig["packages"]:[]);
+ KiwiConfig["packages"] = add (KiwiConfig["packages"]:[], $[]);
+ }
+ sw_contents["package"] = maplist (string name, to_delete,
+ ``($[ "name" : name])
+ );
+ KiwiConfig["packages",del_index] = sw_contents;
}
define symbol HandleSWDelete (string key, map event) {
@@ -103,27 +138,33 @@
*/
define void InitSWRichText (string id) {
- string sw_selection = KiwiConfig["sw_selection"]:"image";
- string pattern_key = sw_selection == "image" ? "addons" : (sw_selection + "_patterns");
+ integer package_set = KiwiConfig["package_set"]:0;
string rt = "";
- if (KiwiConfig[pattern_key]:[] != [])
- {
+
+ list packages = KiwiConfig["packages"]:[];
+ string pat = "";
+ string pac = "";
+ string ign = "";
+
+ if (size (packages[package_set,"opensusePattern"]:[]) > 0)
// richtext header
- rt = Summary::AddHeader ("", _("Patterns"));
- foreach (string pattern, (list<string>) KiwiConfig[pattern_key]:[], {
- rt = Summary::AddListItem (rt, pattern);
- });
- }
- string package_key = sw_selection == "image" ? "packages" : (sw_selection + "_packages");
- if (KiwiConfig[package_key]:[] != [])
- {
+ pat = Summary::AddHeader ("", _("Patterns"));
+ foreach (map patmap, packages[package_set,"opensusePattern"]:[], {
+ pat = Summary::AddListItem (pat, patmap["name"]:"");
+ });
+ if (size (packages[package_set,"package"]:[]) > 0)
// richtext header
- rt = Summary::AddHeader (rt, _("Packages"));
- foreach (string package, (list<string>) KiwiConfig[package_key]:[], {
- rt = Summary::AddListItem (rt, package);
- });
- }
- UI::ChangeWidget (`id (id), `Value, rt);
+ pac = Summary::AddHeader ("", _("Packages"));
+ foreach (map pacmap, packages[package_set,"package"]:[], {
+ pac = Summary::AddListItem (pac, pacmap["name"]:"");
+ });
+ if (size (packages[package_set,"ignore"]:[]) > 0)
+ ign = Summary::AddHeader ("",
+ deletechars (_("&Ignored Software"), "&"));
+ foreach (map pacmap, packages[package_set,"ignore"]:[], {
+ ign = Summary::AddListItem (ign, pacmap["name"]:"");
+ });
+ UI::ChangeWidget (`id (id), `Value, pat + pac + ign);
}
/**
@@ -132,42 +173,33 @@
define symbol HandleSWSelection (string key, map event) {
if (event["ID"]:nil == key)
{
- string sw_selection = KiwiConfig["sw_selection"]:"image";
+ integer package_set = KiwiConfig["package_set"]:0;
+ map sw_contents = KiwiConfig["packages",package_set]:$[];
integer mbytes = (integer) UI::QueryWidget (`id ("size"), `Value);
if (UI::QueryWidget (`id ("sizeunit"), `Value) == "G")
mbytes = mbytes * 1024;
ProductCreator::max_size_mb = mbytes;
- if (sw_selection == "image" && packageSelector () != `cancel)
- {
- KiwiConfig["addons"] = ProductCreator::Config["addons"]:[];
- KiwiConfig["packages"] = ProductCreator::Config["packages"]:[];
- InitSWRichText ("rt_sw");
- if (ProductCreator::Config["taboo"]:[] != nil)
- {
- //FIXME do not replace current 'ignored' tags...
- KiwiConfig["ignore"] = union (KiwiConfig["ignore"]:[],
- ProductCreator::Config["taboo"]:[]);
- InitSWIgnore ("ignore");
- }
- }
- else if (sw_selection != "image")
- {
- map selected = runPackageSelector ("",
- KiwiConfig[sw_selection + "_patterns"]:[],
- KiwiConfig[sw_selection + "_packages"]:[],
- KiwiConfig[sw_selection + "_ignore"]:[],
- `packages
- );
- KiwiConfig[sw_selection + "_patterns"] = selected["addons"]:[];
- KiwiConfig[sw_selection + "_packages"] = selected["packages"]:[];
- InitSWRichText ("rt_sw");
- if (ProductCreator::Config["taboo"]:[] != nil)
- {
- KiwiConfig["ignore"] = ProductCreator::Config["taboo"]:[];
- InitSWIgnore ("ignore");
- }
- }
+
+ map ret_map = runPackageSelector ("",
+ maplist (map pat, sw_contents["opensusePattern"]:[],
+ ``(pat["name"]:"")),
+ maplist (map pat, sw_contents["package"]:[],
+ ``(pat["name"]:"")),
+ maplist (map pat, sw_contents["ignore"]:[],
+ ``(pat["name"]:"")),
+ `packages
+ );
+ if (ret_map["ui"]:nil == `cancel)
+ return nil;
+ sw_contents["opensusePattern"] = maplist (string name,
+ ret_map["addons"]:[], ``($[ "name" : name]));
+ sw_contents["package"] = maplist (string name,
+ ret_map["packages"]:[], ``($[ "name" : name]));
+ sw_contents["ignore"] = maplist (string name,
+ ret_map["taboo"]:[], ``($[ "name" : name]));
+ KiwiConfig["packages",package_set] = sw_contents;
+ InitSWRichText ("rt_sw");
}
return nil;
}
@@ -176,21 +208,46 @@
* initialize the combo box with package selection groups
*/
define void InitSWSelectionCombo (string id) {
- string sw_selection = KiwiConfig["sw_selection"]:"image";
- list items = [
- `item (`id ("image"), _("Image"), sw_selection == "image"),
- ];
- if (kiwi_task == "xen")
- items = add (items, `item (`id ("xen"), _("Xen Specific"), sw_selection == "xen"));
+ integer package_set = KiwiConfig["package_set"]:0;
+ list items = [];
+ integer i = 0;
+ foreach (map pmap, KiwiConfig["packages"]:[], {
+ string type = pmap["type"]:"";
+ // combo box label
+ string label = _("Packages for Image");
+ if (type == "delete")
+ {
+ // combo box label
+ label = _("Packages to Delete");
+ i = i + 1; // index to list must be increased
+ return; // delete is handled by different widgets
+ }
+ if (type == "bootstrap")
+ // combo box label
+ label = _("Bootstrap");
+ else if (type == "xen")
+ // combo box label
+ label = _("Xen Specific Packages");
+ else if (type == "testsuite")
+ // combo box label
+ label = _("Testing");
+ else if (type != "image")
+ label = type;
+ if (pmap["profiles"]:"" != "")
+ // combo box label, %1 is profile name
+ label = sformat(_("Image, profile %1"),pmap["profiles"]:"");
+ items = add (items, `item (`id (i), label, package_set == i));
+ i = i + 1;
+ });
UI::ChangeWidget (`id (id), `Items, items);
}
define void StoreSWSelectionCombo (string key, map event) {
- KiwiConfig[key] = (string) UI::QueryWidget(`id(key), `Value);
+ KiwiConfig["package_set"] = (integer) UI::QueryWidget(`id(key), `Value);
}
/**
- * handler for combo box with isoboot items
+ * handler for combo box with package sets items
*/
define symbol HandleSWSelectionCombo (string key, map event) {
any id = event["ID"]:nil;
@@ -198,13 +255,12 @@
if (id == `next) StoreSWSelectionCombo (key, event);
else if (event["ID"]:nil == key)
{
- string selected = (string) UI::QueryWidget(`id(key), `Value);
- if (selected != KiwiConfig["sw_selection"]:"image")
+ integer selected = (integer) UI::QueryWidget(`id(key), `Value);
+ if (selected != KiwiConfig["package_set"]:-1)
{
- StoreSWIgnore ("ignore", event);
+ KiwiConfig["package_set"] = selected;
StoreSWSelectionCombo (key, event);
InitSWRichText ("rt_sw");
- InitSWIgnore ("ignore");
}
}
return nil;
@@ -260,7 +316,7 @@
* initialize the value of version
*/
define void InitVersion (string id) {
- UI::ChangeWidget (`id (id), `Value, sformat ("%1", KiwiConfig[id]:"1"));
+ UI::ChangeWidget (`id (id), `Value, sformat ("%1", KiwiConfig[id]:"1.0.0"));
}
/**
@@ -688,13 +744,63 @@
];
Kiwi::WriteConfigXML (KiwiConfig, kiwi_task);
- // default question
- if (Popup::YesNo (question[kiwi_task]:_("Create image now?")))
- {
- if (true)
+ boolean create_image_now = false;
+ string selected_profiles = "";
+ if (size (KiwiConfig["profiles"]:[]) > 0)
+ {
+ term items = `VBox (`VSpacing (0.5));
+ list profiles = maplist (map prof,KiwiConfig["profiles",0,"profile"]:[],
+ {
+ string name = prof["name"]:"";
+ string desc = prof["description"]:"";
+ items = add (items, `Left (`CheckBox (`id (name),
+ desc == "" ? name : sformat ("%1 (%2)", name, desc)))
+ );
+ return name;
+ });
+ UI::OpenDialog (`opt(`decorated), `HBox (`HSpacing (0.5), `VBox (
+ `VSpacing (0.5),
+ // popup label
+ `Label (question[kiwi_task]:_("Create image now?")),
+ items,
+ `HBox (
+ `PushButton (`id(`yes),`opt(`key_F10), Label::YesButton()),
+ `PushButton (`id(`no),`opt(`key_F9), Label::NoButton())
+ ),
+ `VSpacing (0.5)), `HSpacing (0.5))
+ );
+ while (true)
{
+ any ret = UI::UserInput ();
+ if (ret == `no)
+ {
+ create_image_now = false;
+ break;
+ }
+ if (ret == `yes)
+ {
+ create_image_now = true;
+ foreach (string name, (list<string>) profiles, {
+ if (UI::QueryWidget (`id (name), `Value) == true)
+ selected_profiles = selected_profiles +
+ " --add-profile " + name;
+ });
+ break;
+ }
+ }
+ UI::CloseDialog ();
+ }
+ else
+ {
+ create_image_now =
+ // default question
+ Popup::YesNo (question[kiwi_task]:_("Create image now?"));
+ }
+ if (create_image_now)
+ {
string out_dir = KiwiConfig["iso-directory"]:"";
- if (FileUtils::CheckAndCreatePath (out_dir) && Kiwi::PrepareAndCreate (out_dir))
+ if (FileUtils::CheckAndCreatePath (out_dir) &&
+ Kiwi::PrepareAndCreate (out_dir, selected_profiles))
{
if (kiwi_task == "usb" && false)
{
@@ -717,7 +823,6 @@
{
ret = false;
}
- }
}
string dir = Kiwi::SaveConfiguration (KiwiConfig, kiwi_task);
if (dir != nil && dir != "")
@@ -734,7 +839,13 @@
define void InitImageConfiguration () {
kiwi_task = Kiwi::kiwi_task;
- string kiwi_dir = "/usr/share/kiwi/image/";
+
+
+ // path to definition of openSUSE live CD (used if kiwi-config-openSUSE-kde,
+ // resp. kiwi-config-openSUSE-gnome is installed)
+ string kiwi_dir = "/usr/share/openSUSE/kiwi-config-kde";
+ if (!FileUtils::Exists (kiwi_dir))
+ kiwi_dir = "/usr/share/openSUSE/kiwi-config-gnome";
// read the information from the base product
integer src_id = ProductCreator::checkProductDependency ();
@@ -744,17 +855,10 @@
// busy popup
Popup::ShowFeedback (_("Reading current image configuration..."), _("Please wait..."));
- map default_dirmap = $[
- "iso" : sformat ("%1/kwliveDVD-suse-10.3", kiwi_dir),
- "xen" : sformat ("%1/buildhost-suse-SLES10", kiwi_dir),
- "usb" : sformat ("%1/kwliveDVD-suse-10.3", kiwi_dir),
- "vmx" : sformat ("%1/kwliveDVD-suse-10.3", kiwi_dir),
- ];
-
// path to current config directory
- string default_dir = default_dirmap[kiwi_task]:"";
+ string default_dir = (kiwi_task == "iso") ? kiwi_dir : "";
string kiwi_configuration = KiwiConfig["kiwi_configuration_" + kiwi_task]:default_dir;
- if (!FileUtils::Exists (kiwi_configuration))
+ if (kiwi_configuration == "" || !FileUtils::Exists (kiwi_configuration))
{
// use local template if default dir does not exist (bug #289552)
if (!FileUtils::Exists (default_dir))
@@ -816,7 +920,7 @@
foreach (string key, ["addons", "packages", "sources"], {
KiwiConfig[key] = ProductCreator::Config[key]:[];
});
- KiwiConfig["name"] = ProductCreator::Config["name"]:"";
+ KiwiConfig["name"] = ProductCreator::Config["name"]:"";
}
else
{
@@ -838,9 +942,12 @@
map label2boot = $[
"openSUSE 10.2" : "suse-10.2",
"openSUSE 10.3" : "suse-10.3",
+ "openSUSE 11.0" : "suse-11.0",
"SUSE Linux 10.1" : "suse-10.1",
"SUSE Linux Enterprise Server 10" : "suse-SLES10",
- "SUSE Linux Enterprise Desktop 10" : "suse-SLED10"
+ "SUSE Linux Enterprise Desktop 10" : "suse-SLED10",
+ "SUSE Linux Enterprise Server 10 SP2" : "suse-SLES10-SP2",
+ "SUSE Linux Enterprise Desktop 10 SP2" : "suse-SLED10-SP2",
];
map distproduct2boot = $[
"openSUSE-10.2-CD-download" : "suse-10.2",
@@ -851,7 +958,9 @@
"SUSE-Linux-Enterprise-Server-i386" : "suse-SLES10",
"SUSE-Linux-Enterprise-Desktop-i386" : "suse-SLED10",
"SUSE-Linux-Enterprise-Server-SP1" : "suse-SLES10-SP1",
- "SUSE-Linux-Enterprise-Desktop-SP1" : "suse-SLED10-SP1"
+ "SUSE-Linux-Enterprise-Desktop-SP1" : "suse-SLED10-SP1",
+ "SUSE-Linux-Enterprise-Server-SP2" : "suse-SLES10-SP2",
+ "SUSE-Linux-Enterprise-Desktop-SP2" : "suse-SLED10-SP2",
];
string boot_image = label2boot[content["LABEL"]:""]:"";
if (boot_image == "")
@@ -884,9 +993,9 @@
}
- /********************************************************************************************
+ /****************************************************************************
* widget descriptions
- *******************************************************************************************/
+ ****************************************************************************/
// return map with description of tabs
// it is a function, to be able to adapt to actual state (e.g. boot_image_widget ())
@@ -902,22 +1011,30 @@
`HBox (
`HWeight (1, "version"),
`HWeight (1, `HBox ("size", "sizeunit"))
+ /*
+ `VBox (
+ `Label (""), "compressed"
+ FIXME compressed vs. unified
+ )
+ */
),
- "sw_selection",
`HBox (
- `HWeight (1, `VBox (
- `Left (`Label (_("Installed Software"))), "rt_sw", `Right ("configure_sw")
+ `HWeight (2, `VBox (
+ "sw_selection",
+ `Left (`Label (_("Installed Software"))),
+ "rt_sw",
+ `Right ("configure_sw")
)),
- `HWeight (1, `VBox ("ignore", "delete_sw"))
+ `HWeight (1, "delete_sw")
),
`VSpacing (0.2)
), `HSpacing(1)),
"widget_names" : [
"version",
- "size", "sizeunit",
+ "size", "sizeunit", // "compressed",
"sw_selection",
"rt_sw", "configure_sw",
- "ignore", "delete_sw"
+ "delete_sw",
],
],
"description" : $[
@@ -1006,79 +1123,6 @@
"no_help" : true,
],
// widgets for config.xml tab
- /*
- "isoboot" : $[
- "widget" : `combobox,
- "opt" : [ `hstretch, `notify ],
- // combo box label
- "label" : _("C&D Boot Image"),
- // help text for "C&D Boot Image", %1/%2 is path (on extra line)
- "help" : sformat (_("<p>Choose one <b>CD Boot Image</b> from the<br>
-<tt>%1/%2</tt><br>
-directory.</p>
-"),
- Kiwi::kiwi_dir, boot_image_widget ()),
- "items" : [],
- "init" : InitBootCombo,
- "store" : StoreBootCombo,
- "handle" : HandleBootCombo,
- ],
- "xenboot" : $[
- "widget" : `combobox,
- "opt" : [ `hstretch, `notify ],
- // combo box label
- "label" : _("&Xen Boot Image"),
- // help text for "XEN Boot Image"
- "help" : sformat (_("<p>Choose one <b>Xen Boot Image</b> from the<br>
-<tt>%1/%2</tt><br>
-directory.</p>
-"),
- Kiwi::kiwi_dir, boot_image_widget ()),
- "items" : [],
- "init" : InitBootCombo,
- "store" : StoreBootCombo,
- "handle" : HandleBootCombo,
- ],
- "usbboot" : $[
- "widget" : `combobox,
- "opt" : [ `hstretch, `notify ],
- // combo box label
- "label" : _("&USB Stick Boot Image"),
- // help text for "XEN Boot Image"
- "help" : sformat (_("<p>Choose one <b>USB stick Boot Image</b> from the<br>
-<tt>%1/%2</tt><br>
-directory.</p>
-"),
- Kiwi::kiwi_dir, boot_image_widget ()),
- "items" : [],
- "init" : InitBootCombo,
- "store" : StoreBootCombo,
- "handle" : HandleBootCombo,
- ],
- "vmxboot" : $[
- "widget" : `combobox,
- "opt" : [ `hstretch, `notify ],
- // combo box label
- "label" : _("&Virtual Disk Boot Image"),
- // help text for "XEN Boot Image"
- "help" : sformat (_("<p>Choose one <b>Virtual Disk Boot Image</b> from the<br>
-<tt>%1/%2</tt><br>
-directory.</p>
-"),
- Kiwi::kiwi_dir, boot_image_widget ()),
- "items" : [],
- "init" : InitBootCombo,
- "store" : StoreBootCombo,
- "handle" : HandleBootCombo,
- ],
- */
- "configure_boot" : $[
- "widget" : `push_button,
- // pusbutton label
- "label" : _("C&onfigure..."),
- "help" : _("<p>Create a new boot image with <b>Configure</b>.</p>"),
- "handle" : NotImplementedHandler
- ],
"compressed" : $[
"widget" : `checkbox,
// textentry label
@@ -1088,6 +1132,7 @@
"store" : StoreCompressCheckBox,
"handle" : HandleCompressCheckBox,
],
+ /*
"sw_selection" : kiwi_task == "xen" ? $[
"widget" : `combobox,
"opt" : [ `hstretch, `notify ],
@@ -1103,6 +1148,19 @@
"widget" : `empty,
"no_help" : true,
],
+ */
+ "sw_selection" : $[
+ "widget" : `combobox,
+ "opt" : [ `hstretch, `notify ],
+ // combo box label
+ "label" : _("So&ftware Selection"),
+ // help text for "So&ftware selection"
+ "help" : "",
+ "items" : [],
+ "init" : InitSWSelectionCombo,
+ "store" : StoreSWSelectionCombo,
+ "handle" : HandleSWSelectionCombo,
+ ],
"rt_sw" : $[
"widget" : `richtext,
"init" : InitSWRichText,
@@ -1140,7 +1198,7 @@
"widget" : `textentry,
// textentry label
"label" : _("O&utput Directory"),
- "help" : _("Help for output dir"),
+ "help" : _("help for output dir"),
"init" : InitOutputDir,
],
"browse_output_dir" : $[
@@ -1354,17 +1412,6 @@
// general help for users tab
"help" : _("<p>Here, create users that should be available in the target system.</p>"),
],
- /*
- "group" : $[
- "widget" : `textentry,
- // textentry label
- "label" : _("&Group name"),
- "help" : _("<p>Select the <b>Group Name</b> to which the users belong.</p>"),
- "init" : InitDescription,
- "store" : StoreDescription,
- "handle" : HandleDescription,
- ],
- */
"userstable" : $[
"widget" : `custom,
"custom_widget" : `Table (`id("table"), `opt (`notify), `header(
@@ -1476,7 +1523,7 @@
map Config = ProductCreator::Config;
string kiwi_configuration = Config["kiwi_configuration_" + kiwi_task]:"";
string name = Config["name"]:"";
- string out_dir = Config["iso-directory"]:"";
+ string out_dir = Config["iso-directory"]:"/tmp";
map repositories = Kiwi::current_repositories;
boolean new_configuration = (Config == $[]);
boolean append_name = false;
@@ -1496,7 +1543,7 @@
_("<p>Select <b>Output Directory</b> for the created image.</p>") +
// help text for kiwi UI preparation, cont.
- _("<p>Modify the list of <b>Package Repositories</b> that will be used for creating the image. Use <b>Add From System</b> to add one of the current system repository.</p>") +
+ _("<p>Modify the list of <b>Package Repositories</b> that will be used for creating the image. Use <b>Add From System</b> to add one of current system repository.</p>") +
// help text for kiwi UI preparation, cont.
_("<p>Use <b>Next</b> to continue with the configuration.</p>");
@@ -1725,7 +1772,7 @@
if (template_items != [])
UI::ChangeWidget (`id (`template), `Enabled, false);
UI::ChangeWidget (`id (`import), `Enabled, false);
- UI::ChangeWidget (`id (`config), `ValidChars, String::CAlnum () + "-_");
+ UI::ChangeWidget (`id (`config), `ValidChars, String::CAlnum ()+".-_");
}
any ret = nil;
while (true)
@@ -1788,7 +1835,6 @@
if ((type_ret == `next || type_ret == `finish))
{
- // FIXME SLP code for SLE10SP1 only, adapt for 10.3...
if (type_ret == `finish && SourceDialogsLite::GetURL () == "slp://")
{
string service = SourceManager::AddSourceTypeSLP ();
@@ -1914,7 +1960,7 @@
kiwi_task = (string) UI::QueryWidget (`id (`type), `Value);
list<string> failed_repositories = [];
- map new_repositories = $[];
+ map new_repositories = $[];
if (size (repositories) > 0)
{
map current_sources = $[];
@@ -1956,7 +2002,7 @@
if (failed_repositories != [])
{
// continue/cancel popup %1 is a \n separated list
- if (!Popup::ContinueCancel (sformat (_("Failed to add these installation sources:
+ if (!Popup::ContinueCancel (sformat (_("Failed to add these repositories:
%1.
Modified: branches/tmp/jsuchome/product-creator/src/product-creator.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/product-creator.ycp?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/product-creator.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/product-creator.ycp Tue Jul 8 16:28:12 2008
@@ -29,7 +29,7 @@
map cmdline_description = $[
"id" : "product-creator",
// transltors: command line help text for the Xproduct-creator module
- "help" : _("Configuration of CD creator"),
+ "help" : _("Configuration of Product creator"),
"guihandler" : ProductCreatorSequence,
"initialize" : ProductCreator::Read,
"finish" : ProductCreator::Write,
@@ -83,7 +83,7 @@
],
"configfile" : $[
// cmd line help text for the 'configfile' option, %1 is a file name
- "help" : sformat(_("Path to the configuration file (default is %1"),
+ "help" : sformat(_("Path to the configuration file (default is %1)"),
ProductCreator::ConfigFile),
"type" : "string"
],
Modified: branches/tmp/jsuchome/product-creator/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/wizards.ycp?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/wizards.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/wizards.ycp Tue Jul 8 16:28:12 2008
@@ -17,7 +17,6 @@
import "Package";
import "PackageCallbacksInit";
import "Sequencer";
-import "URL";
include "product-creator/complex.ycp";
include "product-creator/dialogs.ycp";
@@ -33,6 +32,7 @@
map aliases = $[
"source" : ``( sourceDialog() ),
+ "base" : ``( baseProductSelectionDialog() ),
"config1" : ``( Configure1Dialog() ),
"config2" : ``( Configure2Dialog() ),
"isolinuxcheck" : [ ``( CheckBootableSrc() ), true],
@@ -48,6 +48,10 @@
"ws_start" : "config1",
"source" : $[
`abort : `abort,
+ `next : "base"
+ ],
+ "base" : $[
+ `abort : `abort,
`next : "config2"
],
"config1" : $[
@@ -134,27 +138,6 @@
symbol InitSources () {
ProductCreator::EnableSource();
-
- // remove the source types unsupported by kiwi (#339110)
- list<string> sources = [];
- list<string> removed = [];
- foreach (string url, ProductCreator::Config["sources"]:[], {
- map parsed = URL::Parse(url);
- if (contains (Kiwi::unsupported_schemes, parsed["scheme"]:""))
- removed = add (removed, url);
- else
- sources = add (sources, url);
- });
- ProductCreator::Config["sources"] = sources;
- if (removed != [])
- {
- // message popup, %1 is a \n separated list
- Popup::Message (sformat (_("These installation sources are not supported by kiwi:
-
-%1.
-
-They were removed from the current configuration."), mergestring (removed, "\n")));
- }
return `next;
}
@@ -317,8 +300,17 @@
Wizard::CreateDialog();
Wizard::SetDesktopIcon("cd-creator");
- // .content_file agent is in yast2-instserver package - TODO: move it to yast2.rpm
- if (!Package::InstallAll(["inst-source-utils", "mkisofs", "yast2-instserver"]))
+ list<string> required_packages = ["inst-source-utils", "mkisofs", "createrepo"];
+
+ // add PPC specific packages
+ if (Arch::architecture() == "ppc" || Arch::architecture() == "ppc64")
+ {
+ // /bin/objcopy - binutils
+ // /bin/mkzimage - lilo
+ required_packages = (list<string>)union(required_packages, ["binutils", "lilo"]);
+ }
+
+ if (!Package::InstallAll(required_packages))
{
Popup::Error(_("Installation of required packages
failed."));
Modified: branches/tmp/jsuchome/product-creator/yast2-product-creator.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/yast2-product-creator.spec.in?rev=48925&r1=48913&r2=48925&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/yast2-product-creator.spec.in (original)
+++ branches/tmp/jsuchome/product-creator/yast2-product-creator.spec.in Tue Jul 8 16:28:12 2008
@@ -7,6 +7,15 @@
Requires: yast2-packager autoyast2-installation yast2-security
+# for ag_anyxml
+Requires: perl-XML-Simple
+
+# for ag_kiwi
+Requires: perl-XML-LibXML
+
+# for ag_contentfile
+Requires: yast2-instserver
+
# GPG.ycp and GPGWidgets.ycp
Requires: yast2 >= 2.13.90
BuildRequires: yast2 >= 2.13.90
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org