Class: Installation::InstsysCleaner

Inherits:
Object
  • Object
show all
Extended by:
Yast::Logger
Defined in:
src/lib/installation/instsys_cleaner.rb

Constant Summary collapse

KERNEL_MODULES_WATERLINE =

memory limit for removing the kernel modules from inst-sys (1GB)

1 << 30
KERNEL_MODULES_MOUNT_POINT =
"/parts/mp_0000".freeze

Class Method Summary collapse

Class Method Details

.make_cleanObject

Remove some files in inst-sys to have more free space if the system has too low memory. If the system has enough memory keep everything in place. This method might remove the kernel modules from the system, make sure all needed kernel modules are aready loaded before calling this method.


41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'src/lib/installation/instsys_cleaner.rb', line 41

def self.make_clean
  # just a sanity check to make sure it's not called in an unexpected situation
  if !Yast::Stage.initial || !(Yast::Mode.installation || Yast::Mode.update || Yast::Mode.auto)
    log.warn("Skipping inst-sys cleanup (not in installation/update)")
    return
  end

  # memory size in bytes
  memory = Yast2::HwDetection.memory

  # run the cleaning actions depending on the available memory
  unmount_kernel_modules if memory < KERNEL_MODULES_WATERLINE
end