ACC SHELL

Path : /usr/share/YaST2/clients/
File Upload :
Current File : //usr/share/YaST2/clients/inst_bootloader.ycp

/**
 * File:
 *      bootloader/routines/inst_bootloader.ycp
 *
 * Module:
 *      Bootloader installation and configuration
 *
 * Summary:
 *      Functions to write "dummy" config files for kernel
 *
 * Authors:
 *      Jozef Uhliarik <juhliarik@suse.cz>
 *
 *
 */

{

textdomain "bootloader";

import "Bootloader";
import "BootCommon";
import "Installation";
import "GetInstArgs";
import "Mode";


y2milestone ("starting inst_bootloader");


if ( GetInstArgs::going_back())     // going backwards?
{
    return `auto;                   // don't execute this once more
}

if (Mode::installation())
{
    Bootloader::blSave (false, false, false);
    map<string,string> files = BootCommon::GetFilesContents ();

    y2milestone("contents FILES: %1", files);

    //F#300779 - Install diskless client (NFS-root) 
    //kokso: bootloader will not be installed
    string device = BootCommon::getBootDisk();

    if (device == "/dev/nfs")
    {
	   y2milestone("inst_bootloader -> Boot partition is nfs type, bootloader will not be installed.");
           BootCommon::InitializeLibrary(true, "none");
	   BootCommon::setLoaderType("none");

    } else {
    	   foreach (string file, string content, files, 
           {
		integer last=findlastof(file,"/");
		string path_file = substring (file, 0, last);
		WFM::Execute(.local.mkdir, Installation::destdir + path_file);
		y2milestone ("writing file: %1", file); 
		WFM::Write(.local.string, Installation::destdir + file, content);
           });
    }
}

// FATE #302245 save kernel args etc to /etc/sysconfig/bootloader
BootCommon::WriteToSysconf(true);

y2milestone ("finish inst_bootloader");

return `auto;

}

ACC SHELL 2018