Sha256: c5b1c4116d3b312308d70482009336ffc49eec6ac2206824d1c02ce90e055ae6

Contents?: true

Size: 814 Bytes

Versions: 4

Compression:

Stored size: 814 Bytes

Contents

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

          def format
            return if STATES[:format]
            puts "Format #{@disk}"
            exec("mkfs.fat -F32 #{@dev_esp}") if @dev_esp
            exec("mkfs.#{@fs} -F #{@dev_boot}") if @dev_boot
            exec("mkswap -f #{@lv_swap}")
            exec("mkfs.#{@fs} -F #{@lv_root}")
            exec("mkfs.#{@fs} -F #{@lv_home}") if @lv_home
            @state.format
          end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
getch-0.1.5 lib/getch/filesystem/lvm/encrypt/format.rb
getch-0.1.3 lib/getch/filesystem/lvm/encrypt/format.rb
getch-0.1.2 lib/getch/filesystem/lvm/encrypt/format.rb
getch-0.1.1 lib/getch/filesystem/lvm/encrypt/format.rb