Modify the way of generating swap image.

This commit is contained in:
Kazuhiro MUSASHI 2019-11-05 23:20:26 +08:00
parent 8489d95992
commit 2c96bd7276
1 changed files with 2 additions and 3 deletions

View File

@ -1,12 +1,11 @@
# Make swap file: # Make swap file:
[ [
'dd if=/dev/zero of=/swap.img bs=1M count=2048 && chomod 600 /swap.img', 'dd if=/dev/zero of=/swap.img bs=1M count=2048 && chmod 600 /swap.img && mkswap /swap.img'
'mkswap /swap.img'
].each do |cmd| ].each do |cmd|
execute cmd do execute cmd do
user 'root' user 'root'
only_if 'test ! -f /swap.img -a `cat /proc/swaps | wc -l` -eq 1' only_if 'test ! -f /swap.img'
end end
end end