Sha256: 1640a6fcf1b96931100b8d13cae1a563feff3c3f83823fb81459444a8968cb6f

Contents?: true

Size: 784 Bytes

Versions: 2

Compression:

Stored size: 784 Bytes

Contents

module Getch
  module FileSystem
    module Ext4
      module Encrypt
        class Format < Getch::FileSystem::Ext4::Encrypt::Device
          def initialize
            super
            @fs = 'ext4'
            @state = Getch::States.new()
            format
          end

          def format
            return if STATES[:format]
            puts "Format #{@disk} with #{@fs}"
            exec("mkfs.fat -F32 #{@dev_boot_efi}") if Helpers::efi?
            exec("mkfs.#{@fs} -F #{@luks_root}")
            exec("mkswap -f #{@dev_swap}")
            exec("mkfs.#{@fs} -F #{@luks_home}") if @dev_home
            @state.format
          end

          private

          def exec(cmd)
            Getch::Command.new(cmd).run!
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
getch-0.1.0 lib/getch/filesystem/ext4/encrypt/format.rb
getch-0.0.9 lib/getch/filesystem/ext4/encrypt/format.rb