Class: CryptReboot::Initramfs::Patcher

Inherits:
Object
  • Object
show all
Defined in:
lib/crypt_reboot/initramfs/patcher.rb

Overview

Yield path to initramfs patched with files_spec. Patched initramfs will be removed afterwards if user doesn’t want to save it

Instance Method Summary collapse

Instance Method Details

#call(initramfs_path, files_spec) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/crypt_reboot/initramfs/patcher.rb', line 10

def call(initramfs_path, files_spec)
  temp_provider.call do |base_dir|
    files_dir, patch_path, patched_path = prefix('files', 'patch', 'result', with: base_dir)
    writer.call(files_spec, files_dir)
    archiver.call(files_dir, patch_path)
    saver.call(patch_path)
    concatenator.call(initramfs_path, patch_path, to: patched_path)
    yield patched_path
  end
end