Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wr0ngway/rubber
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Conway committed May 23, 2011
2 parents 184cbac + 0bfb5c2 commit f672c58
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/rubber/recipes/rubber/volumes.rb
Expand Up @@ -124,9 +124,14 @@ def setup_volume(ic, vol_spec)
fi
mv /etc/fstab /etc/fstab.bak
cat /etc/fstab.bak | grep -v '#{vol_spec['mount']}' > /etc/fstab
echo '#{vol_spec['device']} #{vol_spec['mount']} #{vol_spec['filesystem']} noatime 0 0 # rubber volume #{vol_id}' >> /etc/fstab
#{('yes | mkfs -t ' + vol_spec['filesystem'] + ' ' + vol_spec['device']) if created}
if grep '11\.04' /etc/lsb-release; then
device=`echo #{vol_spec['device']} | sed 's/sd/xvd/'`
else
device='#{vol_spec['device']}'
fi
echo "$device #{vol_spec['mount']} #{vol_spec['filesystem']} noatime 0 0 # rubber volume #{vol_id}" >> /etc/fstab
#{('yes | mkfs -t ' + vol_spec['filesystem'] + ' ' + '$device') if created}
#{("mkdir -p '#{vol_spec['mount']}'") if vol_spec['mount']}
#{("mount '#{vol_spec['mount']}'") if vol_spec['mount']}
fi
Expand Down Expand Up @@ -157,7 +162,7 @@ def setup_partition(ic, partition_spec)
fi
# partition format is: Start (blank is first available),Size(MB due to -uM),Id(83=linux,82=swap,etc),Bootable
echo "#{partition_spec['start']},#{partition_spec['size']},#{partition_spec['type']},#{partition_spec['bootable']}" | sfdisk -L -uM #{partition_spec['disk_device']}
echo "#{partition_spec['start']},#{partition_spec['size']},#{partition_spec['type']},#{partition_spec['bootable']}" | sfdisk -L -uM #{partition_spec['disk_device']}
fi
ENDSCRIPT
end
Expand Down

0 comments on commit f672c58

Please sign in to comment.