Skip to content

Commit

Permalink
support for snappy, zstd and raw dump formats
Browse files Browse the repository at this point in the history
Also, makedumpfile is needed for ELF and not for "raw"
  • Loading branch information
jiribohac committed Jun 27, 2023
1 parent 50a2aee commit fcb3138
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
5 changes: 4 additions & 1 deletion src/include/kdump/dialogs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ def wid_handling
["none_format", _("&No Dump")],
["elf_format", _("&ELF Format")],
["compressed_format", _("C&ompressed Format")],
["lzo_format", _("&LZO Compressed Format")]
["lzo_format", _("&LZO Compressed Format")],
["snappy_format", _("&Snappy Compressed Format")],
["zstd_format", _("Zstandard Compressed Format")],
["raw_format", _("Raw copy of /proc/vmcore")]
],
"orientation" => :horizontal,
"init" => fun_ref(
Expand Down
5 changes: 4 additions & 1 deletion src/include/kdump/helps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ def initialize_kdump_helps(_include_target)
" <i>No Dump</i> - Only save the kernel log.<br>\n" \
" <i>ELF Format</i> - Create dump file in ELF format.<br>\n" \
" <i>Compressed Format</i> - Compress dump data by each page with gzip.<br>\n" \
" <i>LZO Compressed Format</i> - Slightly bigger files but much faster.<br>\n</p>"
" <i>LZO Compressed Format</i> - Slightly bigger files but much faster.<br>\n</p>" \
" <i>Snappy Compressed Format</i> - Considerably faster, 64-bit optimized.<br>\n</p>" \
" <i>Zstandard Compressed Format</i> - Smaller files, slower.<br>\n</p>" \
" <i>Raw copy of /proc/vmcore</i> - does not use makedumpfile.<br>\n</p>"
),
# Dump Format - RadioButtons 1/7
"TargetKdump" => _(
Expand Down
21 changes: 17 additions & 4 deletions src/include/kdump/uifunctions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1509,12 +1509,19 @@ def StoreInitrdKernel(_key, _event)
# "Dump Format"

def InitDumpFormat(_key)
if Ops.get(Kdump.KDUMP_SETTINGS, "KDUMP_DUMPFORMAT") == "ELF"
case Ops.get(Kdump.KDUMP_SETTINGS, "KDUMP_DUMPFORMAT")
when "ELF"
UI.ChangeWidget(Id("DumpFormat"), :Value, "elf_format")
elsif Ops.get(Kdump.KDUMP_SETTINGS, "KDUMP_DUMPFORMAT") == "compressed"
when "compressed"
UI.ChangeWidget(Id("DumpFormat"), :Value, "compressed_format")
elsif Ops.get(Kdump.KDUMP_SETTINGS, "KDUMP_DUMPFORMAT") == "lzo"
when "lzo"
UI.ChangeWidget(Id("DumpFormat"), :Value, "lzo_format")
when "snappy"
UI.ChangeWidget(Id("DumpFormat"), :Value, "snappy_format")
when "zstd"
UI.ChangeWidget(Id("DumpFormat"), :Value, "zstd_format")
when "raw"
UI.ChangeWidget(Id("DumpFormat"), :Value, "raw_format")
else
UI.ChangeWidget(Id("DumpFormat"), :Value, "none_format")
end
Expand All @@ -1530,7 +1537,7 @@ def ValidDumpFormat(_key, _event)
result = true
value = Builtins.tostring(UI.QueryWidget(Id("DumpFormat"), :Value))

if value != "elf_format" || value.nil?
if value != "raw_format" || value.nil?
if Mode.installation || Mode.autoinst
Kdump.kdump_packages = Builtins.add(
Kdump.kdump_packages,
Expand Down Expand Up @@ -1578,6 +1585,12 @@ def StoreDumpFormat(_key, _event)
Ops.set(Kdump.KDUMP_SETTINGS, "KDUMP_DUMPFORMAT", "compressed")
elsif value == "lzo_format"
Ops.set(Kdump.KDUMP_SETTINGS, "KDUMP_DUMPFORMAT", "lzo")
elsif value == "snappy_format"
Ops.set(Kdump.KDUMP_SETTINGS, "KDUMP_DUMPFORMAT", "snappy")
elsif value == "zstd_format"
Ops.set(Kdump.KDUMP_SETTINGS, "KDUMP_DUMPFORMAT", "zstd")
elsif value == "raw_format"
Ops.set(Kdump.KDUMP_SETTINGS, "KDUMP_DUMPFORMAT", "raw")
else
Ops.set(Kdump.KDUMP_SETTINGS, "KDUMP_DUMPFORMAT", "none")
end
Expand Down
9 changes: 4 additions & 5 deletions src/lib/kdump/clients/kdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def main
"handler" => fun_ref(method(:cmdKdumpDumpFormat), "boolean (map)"),
# TRANSLATORS: CommandLine help
"help" => _(
"Dump format for dump image: none/ELF/compressed/lzo"
"Dump format for dump image: none/ELF/compressed/lzo/snappy/zstd/raw"
),
"example" => [
"dumpformat dump_format=none",
Expand Down Expand Up @@ -231,7 +231,7 @@ def main
"type" => "string",
# TRANSLATORS: CommandLine help
"help" => _(
"Dump format can be none, ELF, compressed or lzo"
"Dump format can be none, ELF, compressed, lzo, snappy, zstd, or raw"
)
},
"target" => {
Expand Down Expand Up @@ -786,8 +786,7 @@ def cmdKdumpDumpLevel(options)
def cmdKdumpDumpFormat(options)
options = deep_copy(options)
if Ops.get(options, "dump_format")
if Ops.get(options, "dump_format") == "ELF" ||
Ops.get(options, "dump_format") == "compressed"
if ["none", "ELF", "compressed", "lzo", "snappy", "zstd", "raw"].include?(Ops.get(options, "dump_format"))
Ops.set(
Kdump.KDUMP_SETTINGS,
"KDUMP_DUMPFORMAT",
Expand All @@ -801,7 +800,7 @@ def cmdKdumpDumpFormat(options)
CommandLine.Error(_("Wrong value of option."))
# TRANSLATORS: CommandLine printed text help
CommandLine.Print(
_("Option can include only \"none\", \"ELF\", \"compressed\" or \"lzo\" value.")
_("Option can include only \"none\", \"ELF\", \"compressed\", \"lzo\", \"snappy\", \"zstd\" or \"raw\" value.")
)
return false
end
Expand Down

0 comments on commit fcb3138

Please sign in to comment.