Author: snwint Date: Mon Mar 5 14:51:06 2012 New Revision: 67563 URL: http://svn.opensuse.org/viewcvs/yast?rev=67563&view=rev Log: - add new grub2 files Added: trunk/bootloader/src/grub2/ trunk/bootloader/src/grub2/Makefile.am trunk/bootloader/src/grub2/Makefile.in trunk/bootloader/src/grub2/dialogs.ycp trunk/bootloader/src/modules/BootGRUB2.ycp Added: trunk/bootloader/src/grub2/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/grub2/Makefile.am?... ============================================================================== --- trunk/bootloader/src/grub2/Makefile.am (added) +++ trunk/bootloader/src/grub2/Makefile.am Mon Mar 5 14:51:06 2012 @@ -0,0 +1,11 @@ +# +# Makefile.am for bootloader/src +# + +yncludedir = @yncludedir@/bootloader/grub2 + +ynclude_DATA = \ + dialogs.ycp + +EXTRA_DIST = \ + $(ynclude_DATA) Added: trunk/bootloader/src/grub2/Makefile.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/grub2/Makefile.in?... ============================================================================== --- trunk/bootloader/src/grub2/Makefile.in (added) +++ trunk/bootloader/src/grub2/Makefile.in Mon Mar 5 14:51:06 2012 @@ -0,0 +1,466 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile.am for bootloader/src +# + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = src/grub2 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \ + $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ + $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\*|]/\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*//!s/ .*/ ./; s,( .*)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(yncludedir)" +DATA = $(ynclude_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AGENT_LIBADD = @AGENT_LIBADD@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER = @MAINTAINER@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RPMNAME = @RPMNAME@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +STYLESHEET_CSS = @STYLESHEET_CSS@ +STYLESHEET_HTML = @STYLESHEET_HTML@ +STYLESHEET_PDF = @STYLESHEET_PDF@ +STYLESHEET_YCPDOC = @STYLESHEET_YCPDOC@ +STYLESHEET_YDOC = @STYLESHEET_YDOC@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +Y2CORE_CFLAGS = @Y2CORE_CFLAGS@ +Y2CORE_LIBS = @Y2CORE_LIBS@ +Y2DEVTOOLS_PREFIX = @Y2DEVTOOLS_PREFIX@ +YCPC = @YCPC@ +YCPDOC = @YCPDOC@ +YCPMAKEDEP = @YCPMAKEDEP@ +YDOXYGEN = @YDOXYGEN@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +agentdir = @agentdir@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +clientdir = @clientdir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +desktopdir = @desktopdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +execcompdir = @execcompdir@ +fillupdir = @fillupdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +imagedir = @imagedir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfigdatadir = @pkgconfigdatadir@ +pkgconfigdir = @pkgconfigdir@ +plugindir = @plugindir@ +potdir = @potdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +schemadir = @schemadir@ +scrconfdir = @scrconfdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +themedir = @themedir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +yast2dir = @yast2dir@ +ybindir = @ybindir@ +ydatadir = @ydatadir@ +yncludedir = @yncludedir@/bootloader/grub2 +ystartupdir = @ystartupdir@ +ynclude_DATA = \ + dialogs.ycp + +EXTRA_DIST = \ + $(ynclude_DATA) + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/grub2/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/grub2/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-yncludeDATA: $(ynclude_DATA) + @$(NORMAL_INSTALL) + test -z "$(yncludedir)" || $(MKDIR_P) "$(DESTDIR)$(yncludedir)" + @list='$(ynclude_DATA)'; test -n "$(yncludedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(yncludedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(yncludedir)" || exit $$?; \ + done + +uninstall-yncludeDATA: + @$(NORMAL_UNINSTALL) + @list='$(ynclude_DATA)'; test -n "$(yncludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(yncludedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(yncludedir)" && rm -f $$files +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\*]/\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\*]/\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '///!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} ;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} ;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(yncludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-yncludeDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-yncludeDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + install-yncludeDATA installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-yncludeDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: trunk/bootloader/src/grub2/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/grub2/dialogs.ycp?... ============================================================================== --- trunk/bootloader/src/grub2/dialogs.ycp (added) +++ trunk/bootloader/src/grub2/dialogs.ycp Mon Mar 5 14:51:06 2012 @@ -0,0 +1,51 @@ +/** + * File: + * include/bootloader/grub2/dialogs.ycp + * + * Module: + * Bootloader installation and configuration + * + * Summary: + * Dialogs for configuraion i386-specific functions + * + * Authors: + * Jiri Srain <jsrain@suse.cz> + * + * $Id: dialogs.ycp 56563 2009-04-02 08:41:25Z jreidinger $ + * + */ + +{ + +textdomain "bootloader"; + + +import "Label"; +import "Wizard"; +import "CWM"; +import "BootCommon"; +import "Stage"; + +include "bootloader/grub/options.ycp"; + +/** + * Cache for genericWidgets function + */ +map<string,map<string,any> > _grub2_widgets = nil; + +/** + * Get generic widgets + * @return a map describing all generic widgets + */ +global map<string,map<string,any> > grub2Widgets () { + if (_grub2_widgets == nil) + { + _grub2_widgets = $[ + "loader_location" : grubBootLoaderLocationWidget (), + ]; + } + return _grub2_widgets; +} + +} //EOF + Added: trunk/bootloader/src/modules/BootGRUB2.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootGRUB2.... ============================================================================== --- trunk/bootloader/src/modules/BootGRUB2.ycp (added) +++ trunk/bootloader/src/modules/BootGRUB2.ycp Mon Mar 5 14:51:06 2012 @@ -0,0 +1,207 @@ +/** + * File: + * modules/BootGRUB2.ycp + * + * Module: + * Bootloader installation and configuration + * + * Summary: + * Module containing specific functions for GRUB2 configuration + * and installation + * + * Authors: + * Jiri Srain <jsrain@suse.cz> + * Joachim Plack <jplack@suse.de> + * Olaf Dabrunz <od@suse.de> + * Philipp Thomas <pth@suse.de> + * + * $Id: BootGRUB.ycp 63508 2011-03-04 12:53:27Z jreidinger $ + * + */ + +{ +module "BootGRUB2"; + +textdomain "bootloader"; + +import "Arch"; +import "BootCommon"; +import "BootStorage"; +import "Kernel"; +import "Mode"; +import "Stage"; +import "Storage"; +import "StorageDevices"; +import "Pkg"; +import "HTML"; + +// includes +// for shared some routines with grub +include "bootloader/grub/misc.ycp"; +// for simplified widgets than other +include "bootloader/grub2/dialogs.ycp"; +// general functions + +/** + * Read settings from disk + * @param reread boolean true to force reread settings from system + * @param avoid_reading_device_map do not read new device map from file, use + * internal data + * @return boolean true on success + */ +global boolean Read (boolean reread, boolean avoid_reading_device_map) { + BootCommon::InitializeLibrary (reread, "grub2"); + if (reread) { + BootCommon::ReadFiles (avoid_reading_device_map); + } + // TODO: check if necessary for grub2 + grub_DetectDisks (); + boolean ret = BootCommon::Read (false, avoid_reading_device_map); + + // TODO: check if necessary for grub2 + // refresh device map if not read + if (BootStorage::device_mapping == nil + || size (BootStorage::device_mapping) == 0) + { + BootStorage::ProposeDeviceMap (); + } + + return ret; +} + +/** + * Update read settings to new version of configuration files + */ +global define void Update () { + Read (true, true); + + //we don't handle sections, grub2 section create them for us + //BootCommon::UpdateSections (); + BootCommon::UpdateGlobals (); +} +/** + * Write bootloader settings to disk + * @return boolean true on success + */ +global define boolean Write () { + + boolean ret = BootCommon::UpdateBootloader (); + + //TODO: InstallingToFloppy .. + if (BootCommon::location_changed) { + // bnc #461613 - Unable to boot after making changes to boot loader + // bnc #357290 - module rewrites grub generic code when leaving with no changes, which may corrupt grub + grub_updateMBR (); + + boolean grub_ret = BootCommon::InitializeBootloader (); + if (grub_ret == nil) + grub_ret = false; + + y2milestone ("GRUB return value: %1", grub_ret); + ret = ret && grub_ret; + ret = ret && BootCommon::PostUpdateMBR (); + } + + return ret; +} + +/** + * Reset bootloader settings + * @param init boolean true to repropose also device map + */ +global define void Reset (boolean init) { + if (Mode::autoinst ()) + return; + BootCommon::Reset (init); +} + +/** + * Propose bootloader settings + */ + +global define void Propose () { + y2milestone ("Proposed globals: %1", BootCommon::globals); + grub_LocationProposal (); +} + + +/** + * Display bootloader summary + * @return a list of summary lines + */ + +global define list<string> Summary () { + list<string> result = [ sformat (_("Boot Loader Type: %1"), + BootCommon::getLoaderName (BootCommon::getLoaderType (false), `summary)) ]; + list<string> locations = []; + + if (BootCommon::globals["boot_boot"]:"" == "true") + locations = add(locations, BootStorage::BootPartitionDevice + _(" ("/boot")")); + if (BootCommon::globals["boot_extended"]:"" == "true") + locations = add(locations, BootStorage::ExtendedPartitionDevice + _(" (extended)")); + if (BootCommon::globals["boot_root"]:"" == "true") + locations = add(locations, BootStorage::RootPartitionDevice + _(" ("/")")); + if (BootCommon::globals["boot_mbr"]:"" == "true") + locations = add(locations, BootCommon::mbrDisk + _(" (MBR)")); + if (haskey (BootCommon::globals, "boot_custom")) + locations = add(locations, BootCommon::globals["boot_custom"]:""); + if (size(locations) > 0) { + // FIXME: should we translate all devices to names and add MBR suffixes? + result = add (result, sformat (_("Status Location: %1"), mergestring (locations, ", "))); + } + + return result; +} + +/** + * Return map of provided functions + * @return a map of functions (eg. $["write":BootGRUB2::Write]) + */ +global map<string, any> GetFunctions () { + return $[ + "read" : Read, + "reset" : Reset, + "propose" : Propose, + "summary" : Summary, + "update" : Update, + "widgets" : grub2Widgets, + "write" : Write, + ]; +} + +/** + * Initializer of GRUB bootloader + */ +global define void Initializer () { + y2milestone ("Called GRUB2 initializer"); + BootCommon::current_bootloader_attribs = $[ + "propose" : false, + "read" : false, + "scratch" : false, + "restore_mbr" : false, + "bootloader_on_disk" : false, + ]; +} + +/** + * Constructor + */ +global define void BootGRUB2 () { + BootCommon::bootloader_attribs["grub2"] = $[ + "required_packages" : ["grub2"], + "loader_name" : "GRUB2", + "initializer" : BootGRUB2::Initializer, + ]; +} + +} // EOF + +/* + * Local variables: + * mode: ycp + * mode: font-lock + * mode: auto-fill + * indent-level: 4 + * fill-column: 78 + * End: + */ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org