fix(disk_layout_util.sh): Fix changing build_image's disk layout.

Previously the code in base_image_util.sh properly handled the disk
layout command line flag but the spaghetti code later on calls a
function from disk_layout_util.sh which only returned 'base' resulting
in a bit of a mess if something other than 'base' is used. Sync up the
two code paths to avoid that...
This commit is contained in:
Michael Marineau 2013-11-06 15:44:12 -08:00
parent d5a19a0700
commit b5816f7a8d
2 changed files with 6 additions and 4 deletions

View File

@ -39,11 +39,9 @@ cleanup_mounts() {
create_base_image() {
local image_name=$1
local rootfs_verification_enabled=$2
local image_type="base"
if [[ "${FLAGS_disk_layout}" != "default" ]]; then
image_type="${FLAGS_disk_layout}"
fi
get_disk_layout_type
local image_type="${DISK_LAYOUT_TYPE}"
check_valid_layout "base"
check_valid_layout ${image_type}

View File

@ -112,6 +112,10 @@ check_valid_layout() {
get_disk_layout_type() {
DISK_LAYOUT_TYPE="base"
if [[ -n "${FLAGS_disk_layout}" && \
"${FLAGS_disk_layout}" != "default" ]]; then
DISK_LAYOUT_TYPE="${FLAGS_disk_layout}"
fi
}
emit_gpt_scripts() {