Skip to content

Commit

Permalink
Merge pull request #1 from uli/Code-11-SP1
Browse files Browse the repository at this point in the history
- s390: use secret crash kernel size formula, filter devices (fate #3140...
  • Loading branch information
wfeldt committed Jan 17, 2013
2 parents fb3ef8d + 200e147 commit 447f875
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2.17.22
2.17.23
13 changes: 10 additions & 3 deletions src/Kdump.ycp
Expand Up @@ -741,7 +741,10 @@ boolean ProposeAlocatedMemory ()
{
if (alocated_memory == "0")
{
if ((total_memory >= 512) && (total_memory/1024) <2)
if (Arch::s390()) {
alocated_memory = tostring(128 + (total_memory * 256) * 2.01 / 8 / 1048576);
}
else if ((total_memory >= 512) && (total_memory/1024) <2)
alocated_memory = "64";
else if ((total_memory/1024) >= 2)
alocated_memory = "128";
Expand Down Expand Up @@ -819,6 +822,11 @@ boolean ReadAvailableMemory () {
*/
boolean ReadKdumpSettings () {
KDUMP_SETTINGS = DEFAULT_CONFIG;
if (Arch::s390()) {
string cmd = "lscss | egrep \"(3990|2105|3880|9343|6310|2107|1731/03|3215)\" |cut -d\" \" -f1|sed s/^/\\!/|tr \"\n\" ,|sed s/,$//";
map cmd_out = (map) SCR::Execute (.target.bash_output, cmd);
KDUMP_SETTINGS["KDUMP_COMMANDLINE_APPEND"] = sformat("cio_ignore=all,%1", cmd_out["stdout"]:nil);
}
foreach (string key, SCR::Dir(.sysconfig.kdump), {
string val = (string) SCR::Read(add(.sysconfig.kdump, key));
if (val != nil) KDUMP_SETTINGS[key] = val;
Expand All @@ -836,8 +844,6 @@ boolean ReadKdumpSettings () {
return true;
}



/**
* Write current kdump configuration
*
Expand Down Expand Up @@ -1318,5 +1324,6 @@ global define boolean Import (map settings)
import_called = true;
return result;
}

/* EOF */
}
2 changes: 1 addition & 1 deletion src/kdump.ycp
Expand Up @@ -321,7 +321,6 @@ string cmdParsePassPath (string path_file) {
return password;
}


boolean cmdKdumpDumpTarget (map options) {
if (options["target"]:nil!=nil) {
string target = tostring(options["target"]:nil);
Expand Down Expand Up @@ -468,6 +467,7 @@ boolean cmdKdumpDumpTarget (map options) {
break;
}
Kdump::KDUMP_SETTINGS["KDUMP_SAVEDIR"]= tostringKDUMP_SAVE_TARGET();
fixCommandLine(KDUMP_SAVE_TARGET["target"]:nil);
return true;
} else {
// TRANSLATORS: CommandLine error message
Expand Down
23 changes: 22 additions & 1 deletion src/uifunctions.ycp
Expand Up @@ -663,6 +663,27 @@ symbol HandleTargetKdump (string key, map event) {

}

boolean fixCommandLine (string target) {
if (!Arch::s390 ())
return false;

y2milestone("fixing commandline append for s390");
string allowed = nil;
if (target == "file") {
// allow disks
allowed = "3990|2105|3880|9343|6310|2107|1731/03";
}
else {
// allow network devices
allowed = "1731/0[15]|3088";
}

string cmd = sformat ("lscss | egrep \"(%1|3215)\" |cut -d\" \" -f1|sed s/^/\\!/|tr \"\n\" ,|sed s/,$//", allowed);
map cmd_out = (map) SCR::Execute (.target.bash_output, cmd);
Kdump::KDUMP_SETTINGS["KDUMP_COMMANDLINE_APPEND"] = sformat("cio_ignore=all,%1", cmd_out["stdout"]:nil);
return true;
}

void StoreTargetKdumpHandle(string type)
{
string radiobut = type;
Expand Down Expand Up @@ -839,7 +860,7 @@ void StoreTargetKdumpHandle(string type)
KDUMP_SAVE_TARGET["password"] = "";
}
Kdump::KDUMP_SETTINGS["KDUMP_SAVEDIR"] = tostringKDUMP_SAVE_TARGET();

fixCommandLine(KDUMP_SAVE_TARGET["target"]:nil);
}

/**
Expand Down

0 comments on commit 447f875

Please sign in to comment.