![](https://seccdn.libravatar.org/avatar/af22e20b6884acbc89be6d7736c43e92.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package yast2-bootloader checked in at Mon Nov 20 15:57:40 CET 2006. -------- --- yast2-bootloader/yast2-bootloader.changes 2006-11-17 13:23:20.000000000 +0100 +++ /mounts/work_src_done/STABLE/yast2-bootloader/yast2-bootloader.changes 2006-11-20 15:54:48.000000000 +0100 @@ -1,0 +2,28 @@ +Mon Nov 20 15:52:07 CET 2006 - od@suse.de + +- reverted initrd and kernel names to links for everything but + Mode::normal() (#214935) +- resolve symlinks for kernel and initrd during inst_finish, so + that the "real names" are put into the bootloader configuration + -- this is the plan B solution, plan A (which shows correct + filenames instead of link names in the proposal) does not + currently work (#214935) +- 2.14.4 + +------------------------------------------------------------------- +Mon Nov 20 15:31:58 CET 2006 - jplack@suse.de + +- fix format for DefaultKernelParams + +------------------------------------------------------------------- +Mon Nov 20 15:29:50 CET 2006 - jplack@suse.de + +- fix boot loader location mapping: check boot_root before + boot_boot (#219409) + +------------------------------------------------------------------- +Mon Nov 20 13:12:45 CET 2006 - jplack@suse.de + +- fix full adoption to new grub name sceme ((#214935, FATE#300732) + +------------------------------------------------------------------- Old: ---- yast2-bootloader-2.14.3.tar.bz2 New: ---- yast2-bootloader-2.14.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-bootloader.spec ++++++ --- /var/tmp/diff_new_pack.QNitT0/_old 2006-11-20 15:57:11.000000000 +0100 +++ /var/tmp/diff_new_pack.QNitT0/_new 2006-11-20 15:57:11.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package yast2-bootloader (Version 2.14.3) +# spec file for package yast2-bootloader (Version 2.14.4) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,12 +11,12 @@ # norootforbuild Name: yast2-bootloader -Version: 2.14.3 +Version: 2.14.4 Release: 1 License: GNU General Public License (GPL) Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-bootloader-2.14.3.tar.bz2 +Source0: yast2-bootloader-2.14.4.tar.bz2 prefix: /usr BuildRequires: docbook-xsl-stylesheets doxygen gcc-c++ libxslt limal-bootloader limal-devel perl-XML-Writer perl-gettext sgml-skel swig update-alternatives update-desktop-files yast2-devel yast2-devtools yast2-installation yast2-perl-bindings yast2-testsuite PreReq: /bin/sed %fillup_prereq @@ -60,7 +60,7 @@ Dan Meszaros %prep -%setup -n yast2-bootloader-2.14.3 +%setup -n yast2-bootloader-2.14.4 %build %{prefix}/bin/y2tool y2autoconf @@ -112,6 +112,22 @@ /usr/share/YaST2/clients/bootfloppy.ycp %changelog -n yast2-bootloader +* Mon Nov 20 2006 - od@suse.de +- reverted initrd and kernel names to links for everything but + Mode::normal() (#214935) +- resolve symlinks for kernel and initrd during inst_finish, so + that the "real names" are put into the bootloader configuration + -- this is the plan B solution, plan A (which shows correct + filenames instead of link names in the proposal) does not + currently work (#214935) +- 2.14.4 +* Mon Nov 20 2006 - jplack@suse.de +- fix format for DefaultKernelParams +* Mon Nov 20 2006 - jplack@suse.de +- fix boot loader location mapping: check boot_root before + boot_boot (#219409) +* Mon Nov 20 2006 - jplack@suse.de +- fix full adoption to new grub name sceme ((#214935, FATE#300732) * Fri Nov 17 2006 - od@suse.de - added comments - fix finding the correct names for kernel image and initrd (not ++++++ yast2-bootloader-2.14.3.tar.bz2 -> yast2-bootloader-2.14.4.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-bootloader-2.14.3/VERSION new/yast2-bootloader-2.14.4/VERSION --- old/yast2-bootloader-2.14.3/VERSION 2006-11-17 13:17:21.000000000 +0100 +++ new/yast2-bootloader-2.14.4/VERSION 2006-11-20 15:51:59.000000000 +0100 @@ -1 +1 @@ -2.14.3 +2.14.4 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-bootloader-2.14.3/src/clients/bootloader_finish.ycp new/yast2-bootloader-2.14.4/src/clients/bootloader_finish.ycp --- old/yast2-bootloader-2.14.3/src/clients/bootloader_finish.ycp 2006-10-16 18:52:27.000000000 +0200 +++ new/yast2-bootloader-2.14.4/src/clients/bootloader_finish.ycp 2006-11-20 15:29:38.000000000 +0100 @@ -8,7 +8,7 @@ * Authors: * Jiri Srain <jsrain@suse.cz> * - * $Id: bootloader_finish.ycp 33387 2006-10-13 09:45:28Z sf $ + * $Id: bootloader_finish.ycp 34486 2006-11-20 14:29:37Z odabrunz $ * */ @@ -139,6 +139,11 @@ // Install bootloader (always, see #23018) // should also set Misc::boot_msg appropriate + // FIXME: this is the plan B solution, try to solve plan A in + // BootCommon.ycp:CreateLinuxSection() (line 435) + // resolve symlinks in kernel and initrd paths + Bootloader::ResolveSymlinksInSections(); + if (!Mode::update ()) { return Bootloader::Write (); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-bootloader-2.14.3/src/modules/BootArch.ycp new/yast2-bootloader-2.14.4/src/modules/BootArch.ycp --- old/yast2-bootloader-2.14.3/src/modules/BootArch.ycp 2006-06-09 18:22:16.000000000 +0200 +++ new/yast2-bootloader-2.14.4/src/modules/BootArch.ycp 2006-11-20 15:50:43.000000000 +0100 @@ -13,7 +13,7 @@ * Authors: * Jiri Srain <jsrain@suse.cz> * - * $Id: BootArch.ycp 31425 2006-06-09 16:22:14Z odabrunz $ + * $Id: BootArch.ycp 34489 2006-11-20 14:32:44Z jplack $ * */ @@ -80,40 +80,42 @@ * @return string parameters for default kernel */ global string DefaultKernelParams (string resume) { + string features = + ProductFeatures::GetStringFeature ( + "globals", + "additional_kernel_parameters"); + string kernel_cmdline = Kernel::GetCmdLine (); + if (Arch::i386 () || Arch::x86_64 ()) { - string resumestring = ""; + string ret = (kernel_cmdline != "") ? kernel_cmdline + " " : ""; if (resume != "") - resumestring = sformat ("resume=%1", resume); - string ret = sformat ("%1 %2 %3", - Kernel::GetCmdLine (), - resumestring, - ProductFeatures::GetStringFeature ( - "globals", - "additional_kernel_parameters")); + ret = ret + sformat ("resume=%1 ", resume); + if (features != "") + ret = ret + features + " "; if (regexpmatch (ret, "^(.* )?splash=[[:lower:]]+( .*)?$")) ret = regexpsub (ret, "^((.* ))?splash=[[:lower:]]+(( .*)?)$", "\\1 \\3"); - ret = ret + " splash=silent showopts"; + ret = ret + "splash=silent showopts"; return ret; } else if (Arch::ia64 ()) { - string append = sformat ("%1 %2 splash=silent", - ProductFeatures::GetStringFeature ( - "globals", - "additional_kernel_parameters"), - Kernel::GetCmdLine ()); - // on SIG Altix change kernel default hash tables sizes + string ret = (kernel_cmdline != "") ? kernel_cmdline + " " : ""; + if (features != "") + ret = ret + features + " "; + ret = ret + "splash=silent"; + + // on SGI Altix change kernel default hash tables sizes if (SCR::Read (.target.stat, "/proc/sgi_sn") != $[]) { - append = append + " thash_entries=2097152"; + ret = ret + " thash_entries=2097152"; } - return append; + return ret; } else { y2warning ("Default kernel parameters not defined"); - return Kernel::GetCmdLine (); + return kernel_cmdline; } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-bootloader-2.14.3/src/modules/BootCommon.ycp new/yast2-bootloader-2.14.4/src/modules/BootCommon.ycp --- old/yast2-bootloader-2.14.3/src/modules/BootCommon.ycp 2006-11-17 13:17:14.000000000 +0100 +++ new/yast2-bootloader-2.14.4/src/modules/BootCommon.ycp 2006-11-20 15:20:50.000000000 +0100 @@ -15,7 +15,7 @@ * Joachim Plack <jplack@suse.de> * Olaf Dabrunz <od@suse.de> * - * $Id: BootCommon.ycp 34442 2006-11-17 12:17:11Z odabrunz $ + * $Id: BootCommon.ycp 34475 2006-11-20 13:04:47Z jplack $ * */ @@ -432,36 +432,49 @@ ? getLargestSwapPartition () : ""; - // Find out the file names of the "real" kernel and initrd files, with - // version etc. pp. whatever (currently version-flavor) attached. - // - // First, get the file names in the "selected" kernel package, - string kernel_package = Kernel::GetFinalKernel(); - list<string> files = Pkg::PkgGetFilelist( kernel_package, `any ); - y2milestone ("kernel package %1 has these files: %2", kernel_package, files); - - // then find the first file that matches the arch-dependent kernel file - // name prefix and the initrd filename prefix. - string kernel_prefix = "/boot/" + Kernel::GetBinary (); - string initrd_prefix = "/boot/initrd"; + // FIXME: + // This only works in the installed system (problem with GetFinalKernel))), + // in all other cases we use the symlinks. + + string kernel_fn = ""; + string initrd_fn = ""; + + if (Mode::normal ()) { + // Find out the file names of the "real" kernel and initrd files, with + // version etc. pp. whatever (currently version-flavor) attached. + // + // First, get the file names in the "selected" kernel package, + string kernel_package = Kernel::GetFinalKernel(); + list<string> files = Pkg::PkgGetFilelist( kernel_package, `any ); + y2milestone ("kernel package %1 has these files: %2", kernel_package, files); + + // then find the first file that matches the arch-dependent kernel file + // name prefix and the initrd filename prefix. + string kernel_prefix = "/boot/" + Kernel::GetBinary (); + string initrd_prefix = "/boot/initrd"; - list<string> files_filtered = filter (string file, files, { - return ( substring(file, 0, size(kernel_prefix)) == kernel_prefix ); - }); - string kernel_fn = ( - title == "wildcard" ? - "/boot/" + Kernel::GetBinary () + "-*" : - files_filtered[0]:"" - ); + list<string> files_filtered = filter (string file, files, { + return ( substring(file, 0, size(kernel_prefix)) == kernel_prefix ); + }); + kernel_fn = ( + title == "wildcard" ? + "/boot/" + Kernel::GetBinary () + "-*" : + files_filtered[0]:"" + ); - files_filtered = filter (string file, files, { - return substring(file, 0, size(initrd_prefix)) == initrd_prefix ; - }); - string initrd_fn = ( - title == "wildcard" ? - "/boot/initrd-*" : - files_filtered[0]:"" - ); + files_filtered = filter (string file, files, { + return substring(file, 0, size(initrd_prefix)) == initrd_prefix ; + }); + initrd_fn = ( + title == "wildcard" ? + "/boot/initrd-*" : + files_filtered[0]:"" + ); + } else { + kernel_fn = "/boot/" + Kernel::GetBinary () + + (title == "wildcard" ? "-*" : ""); + initrd_fn = "/boot/initrd" + (title == "wildcard" ? "-*" : ""); + } // done: kernel_fn and initrd_fn are the results y2milestone ("kernel_fn: %1 initrd_fn: %2", kernel_fn, initrd_fn); @@ -488,6 +501,7 @@ } if (title == "xen") { + ret["type"] = "xen"; ret["xen_append"] = ""; if (UsingXenPae()) { ret["xen"] = "/boot/xen-pae.gz"; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-bootloader-2.14.3/src/modules/BootGRUB.ycp new/yast2-bootloader-2.14.4/src/modules/BootGRUB.ycp --- old/yast2-bootloader-2.14.3/src/modules/BootGRUB.ycp 2006-11-17 13:17:14.000000000 +0100 +++ new/yast2-bootloader-2.14.4/src/modules/BootGRUB.ycp 2006-11-20 15:50:43.000000000 +0100 @@ -13,7 +13,7 @@ * Jiri Srain <jsrain@suse.cz> * Joachim Plack <jplack@suse.de> * - * $Id: BootGRUB.ycp 34442 2006-11-17 12:17:11Z odabrunz $ + * $Id: BootGRUB.ycp 34487 2006-11-20 14:31:32Z jplack $ * */ @@ -66,6 +66,27 @@ //---------------------------------------------------------------------------- +// wrapper function to adjuct to new grub name sceme +global map<string,any> CreateLinuxSection (string title) { + map<string,any> section = + BootCommon::CreateLinuxSection (title); + + // replace "kernel" by "image" + if (haskey(section, "kernel")) { + section["image"] = section["kernel"]:""; + section = remove(section, "kernel"); + } + // replace "vga" by "vgamode" + if (haskey(section, "vga")) { + section["vgamode"] = section["vga"]:""; + section = remove(section, "vga"); + } + + return section; +} + + + /** * Propose sections to bootloader menu * modifies internal structures @@ -73,10 +94,10 @@ global define void CreateSections () ``{ y2debug ("Creating GRUB sections from scratch"); list<map<string,any> > out = [ - BootCommon::CreateLinuxSection ("linux"), + CreateLinuxSection ("linux"), ]; if (BootCommon::XenPresent ()) - out = add (out, BootCommon::CreateLinuxSection ("xen")); + out = add (out, CreateLinuxSection ("xen")); list<string> others_ignore = []; list<string> others = (list<string>)Storage::GetForeignPrimary(); y2debug ("Other primaries: %1", others); @@ -235,7 +256,7 @@ { map<string,any> m = $[ "name" : BootCommon::translateSectionTitle (label), - "type" : "chainloader", + "type" : "other", "original_name" : label, "chainloader" : dev, "__changed" : false, @@ -252,7 +273,7 @@ out = add (out, $[ "name" : BootCommon::translateSectionTitle("hard disk"), "original_name" : "hard_disk", - "type" : "chainloader", + "type" : "other", "chainloader" : BootCommon::mbrDisk, "__changed" : false, "__auto" : true, @@ -264,16 +285,16 @@ out = add (out, $[ "name" : BootCommon::translateSectionTitle("floppy"), "original_name" : "floppy", - "type" : "chainloader", + "type" : "other", "chainloader" : "/dev/fd0", "__changed" : false, "__auto" : true, "__devs" : [], ]); } - out = add (out, BootCommon::CreateLinuxSection ("failsafe")); - out = add (out, BootCommon::CreateLinuxSection ("memtest86")); - // out = add (out, BootCommon::CreateLinuxSection ("wildcard")); + out = add (out, CreateLinuxSection ("failsafe")); + out = add (out, CreateLinuxSection ("memtest86")); + if (Mode::normal ()) { foreach (map<string,string> additional, @@ -281,8 +302,8 @@ { string type = additional["version"]:""; type = sformat ("%1", type); - map<string,any> s = BootCommon::CreateLinuxSection (type); - s["kernel"] = additional["kernel"]:""; + map<string,any> s = CreateLinuxSection (type); + s["image"] = additional["image"]:""; if (haskey (additional, "initrd")) s["initrd"] = additional["initrd"]:""; out = add (out, s); @@ -550,10 +571,10 @@ } BootCommon::change_widget_default_value("boot_custom", ""); // FIXME: kludge, maybe obsolete - if ( BootCommon::loader_device == BootCommon::BootPartitionDevice ) { - BootCommon::globals["boot_boot"] = sformat("%1", true); - } else if ( BootCommon::loader_device == BootCommon::RootPartitionDevice ) { + if ( BootCommon::loader_device == BootCommon::RootPartitionDevice ) { BootCommon::globals["boot_root"] = sformat("%1", true); + } else if ( BootCommon::loader_device == BootCommon::BootPartitionDevice ) { + BootCommon::globals["boot_boot"] = sformat("%1", true); } else if ( BootCommon::loader_device == BootCommon::mbrDisk ) { BootCommon::globals["boot_mbr"] = sformat("%1", true); } else { @@ -698,7 +719,7 @@ */ global define void Update () { BootCommon::UpdateDeviceMap (); - BootCommon::UpdateSections (true, BootCommon::CreateLinuxSection); + BootCommon::UpdateSections (true, CreateLinuxSection); BootCommon::UpdateGlobals (); // BootCommon::loader_device // = BootCommon::UpdateDevice (BootCommon::loader_device); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-bootloader-2.14.3/src/modules/Bootloader.ycp new/yast2-bootloader-2.14.4/src/modules/Bootloader.ycp --- old/yast2-bootloader-2.14.3/src/modules/Bootloader.ycp 2006-09-15 18:56:23.000000000 +0200 +++ new/yast2-bootloader-2.14.4/src/modules/Bootloader.ycp 2006-11-20 15:29:39.000000000 +0100 @@ -11,7 +11,7 @@ * Authors: * Jiri Srain <jsrain@suse.cz> * - * $Id: Bootloader.ycp 32910 2006-09-15 16:57:59Z odabrunz $ + * $Id: Bootloader.ycp 34486 2006-11-20 14:29:37Z odabrunz $ * */ @@ -22,6 +22,7 @@ import "Arch"; import "BootCommon"; + import "Installation"; import "Initrd"; import "Kernel"; import "Mode"; @@ -414,7 +415,7 @@ // Initialize device mapper and LVM in target system if (Stage::initial () || Mode::update ()) { - # FIXME: should be handled by partitioner + // FIXME: should be handled by partitioner map out = (map)SCR::Execute (.target.bash_output, "test -f /sbin/devmap_mknod.sh && /sbin/devmap_mknod.sh;" + "test -f /sbin/vgscan && /sbin/vgscan --mknodes" @@ -552,6 +553,64 @@ // sections handling functions +/** + * Resolve a single symlink in key image_key in section map s + * @param section map map of section to change + * @param image_key string key in section that contains the link + */ +global define void ResolveSymlink(map<string,any> section, string key) { + string readlink_cmd = "/usr/bin/readlink -m " + Installation::destdir; + map out = $[]; + string newval = ""; + + // FIXME: find out why we need WFM::Execute() here (as olh used it above) + out = (map) WFM::Execute (.local.bash_output, readlink_cmd + section[key]:""); + if (out["exit"]:0 == 0 && out["stdout"]:"" != "" ) { + newval = substring(out["stdout"]:"", size(Installation::destdir)); + y2milestone("section %1: converting old %2 parameter from %3 to %4", + section["name"]:"", key, section[key]:"", newval); + section[key] = newval; + } else { + y2error ("section %1: failed to remap %2 parameter", + section["name"]:"", key); + } +// y2milestone("old kernel parameter in section %1: %2", s["name"], s["kernel"]); +// s["kernel"] = SCR::Execute (.target.bash, "/usr/bin/readlink " + s["kernel"]); +// y2milestone("converted kernel parameter to: %2", s["kernel"]); +} + +/** + * Resolve symlinks in kernel and initrd paths + */ +// FIXME: this is the plan B solution, try to solve plan A in +// BootCommon.ycp:CreateLinuxSection() (line 435) +global define void ResolveSymlinksInSections() { + // The "-m" is needed in case the link is an absolute link, so that it does + // not fail to resolve when the root partition is mounted in + // Installation::destdir. + list image_key_names = ["kernel", "image"]; + string image_key_name = ""; + integer i = 0; + + BootCommon::sections = maplist (map<string,any> s, BootCommon::sections, { + // FIXME: did not make a function out of this, because this file looks + // like a script and defining functions in here scares me. Need to try + // this next time. + // + // first, resolve kernel link name + while ( i < size(image_key_names) ) { + image_key_name = image_key_names[i]:""; + if (haskey (s, image_key_name)) { + ResolveSymlink(s, image_key_name); + } + i = i + 1; + } + // resolve initrd link name + ResolveSymlink(s, "initrd"); + return s; + }); +} + /** * return default section label * @return string default section label ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org