lib/sgdisk.rb in getch-0.7.3 vs lib/sgdisk.rb in getch-0.11.0
- old
+ new
@@ -40,17 +40,17 @@
end
def make_boot
@boot || return
- partition @boot, @boot_code, '0:+256MiB'
+ partition @boot, @boot_code, "0:+#{Getch::OPTIONS[:boot_size]}MiB"
end
def make_swap
@swap || return
- mem = Getch::Helpers.get_memory
+ mem = "#{Getch::OPTIONS[:swap_size]}M"
partition @swap, @swap_code, "0:+#{mem}"
end
# Align the end
# https://unix.stackexchange.com/questions/588930/sgdisk-force-alignment-of-end-sector
@@ -96,11 +96,11 @@
def end_sector(dev)
disk = dev[/^[a-z]+/]
cmd = Getch::Command.new("sgdisk -E /dev/#{disk}")
end_position = cmd.res.to_i
- ( end_position - ( end_position + 1 ) % 2048 )
+ (end_position - (end_position + 1) % 2048)
end
end
class Ext4 < Root
end
@@ -133,14 +133,14 @@
end
def make_boot
@boot || return
- partition @boot, @boot_code, '0:+2G'
+ partition @boot, @boot_code, "0:+#{Getch::OPTIONS[:boot_size]}MiB"
end
def make_swap
- mem = Getch::Helpers.get_memory
+ mem = "#{Getch::OPTIONS[:swap_size]}M"
partition @swap, @swap_code, "0:+#{mem}"
add_zlog
add_zcache
end