Sha256: 087143bacbdb63ceedec67d5426716da92d84180a30d05c6aedf7f8b0a580a00

Contents?: true

Size: 837 Bytes

Versions: 2

Compression:

Stored size: 837 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} with #{@fs}"
            exec("mkfs.fat -F32 #{@dev_boot_efi}") if @dev_boot_efi
            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

2 entries across 2 versions & 1 rubygems

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