Skip to content

Commit

Permalink
Write active_devices and cio_ignore kernel argument always
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Jan 24, 2024
1 parent 7b388b2 commit 9802840
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions src/lib/installation/cio_ignore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ def reset

private

def kvm?
File.exist?("/proc/sysinfo") &&
File.readlines("/proc/sysinfo").grep(/Control Program: KVM\/Linux/).any?
end

def zvm?
File.exist?("/proc/sysinfo") &&
File.readlines("/proc/sysinfo").grep(/Control Program: z\/VM/).any?
end

# Get current I/O device autoconf setting (rd.zdev kernel option)
#
# @return [Boolean]
Expand All @@ -50,14 +40,7 @@ def autoconf_setting
#
# @return [Boolean]
def cio_setting
if Yast::Mode.autoinst
Yast::AutoinstConfig.cio_ignore
else
# cio_ignore does not make sense for KVM or z/VM (fate#317861)
# but for other cases return true as requested FATE#315586
!(kvm? || zvm?)
true
end
Yast::Mode.autoinst ? Yast::AutoinstConfig.cio_ignore : true
end
end

Expand Down Expand Up @@ -228,7 +211,7 @@ def write_cio_setting

res = Yast::WFM.Execute(YAST_LOCAL_BASH_PATH, "/sbin/cio_ignore --unused --purge")

log.info "result of cio_ignore call: #{res.inspect}"
log.info "result of cio_ignore --unused --purge call: #{res.inspect}"

raise "cio_ignore command failed with stderr: #{res["stderr"]}" if res["exit"] != 0

Expand Down Expand Up @@ -257,7 +240,7 @@ def write_autoconf_setting
def add_cio_boot_kernel_parameters
Yast.import "Bootloader"

param = Yast::Bootloader.kernel_param(:common, "cio_ignore")
param = Yast::Bootloader.kernel_param(:common, "cio_ignore")

if param == :missing
res = Yast::WFM.Execute(YAST_LOCAL_BASH_PATH, "/sbin/cio_ignore -k")
Expand All @@ -273,7 +256,6 @@ def add_cio_boot_kernel_parameters
def store_active_devices
Yast.import "Installation"
res = Yast::WFM.Execute(YAST_LOCAL_BASH_PATH, "/sbin/cio_ignore -L")
log.info "active devices: #{res}"

raise "cio_ignore -L failed with #{res["stderr"]}" if res["exit"] != 0

Expand All @@ -285,6 +267,7 @@ def store_active_devices

# make sure the file ends with a new line character
devices << "" unless devices.empty?
log.info "active devices to be written: #{devices.join(',')}"

File.write(target_file, devices.join("\n"))
end
Expand Down

0 comments on commit 9802840

Please sign in to comment.