fix(build_image): Add fstrim commands for -usr images.

This commit is contained in:
Michael Marineau 2014-01-17 21:07:15 -08:00
parent 825dfd63ee
commit 7e3dd619d1
2 changed files with 8 additions and 4 deletions

View File

@ -60,8 +60,10 @@ create_base_image() {
# Zero all fs free space to make it more compressible so auto-update
# payloads become smaller, not fatal since it won't work on linux < 3.2
sudo fstrim "${root_fs_dir}" || true
if [[ -d "${root_fs_dir}/media/state" ]]; then
sudo fstrim "${root_fs_dir}/media/state" || true
if [[ "${disk_layout}" == *-usr ]]; then
sudo fstrim "${root_fs_dir}/usr" || true
else
sudo fstrim "${root_fs_dir}/media/state" || true
fi
cleanup_mounts "${root_fs_dir}"

View File

@ -48,8 +48,10 @@ install_dev_packages() {
# Zero all fs free space, not fatal since it won't work on linux < 3.2
sudo fstrim "${root_fs_dir}" || true
if [[ -d "${root_fs_dir}/media/state" ]]; then
sudo fstrim "${root_fs_dir}/media/state" || true
if [[ "${disk_layout}" == *-usr ]]; then
sudo fstrim "${root_fs_dir}/usr" || true
else
sudo fstrim "${root_fs_dir}/media/state" || true
fi
info "Developer image built and stored at ${image_name}"