@@ -127,10 +127,6 @@ BM_FLAVOR_ID=${BM_FLAVOR_ID:-11}
127127BM_FLAVOR_ARCH=${BM_FLAVOR_ARCH:-$BM_CPU_ARCH}
128128
129129
130- # Below this, we set some path and filenames.
131- # Defaults are probably sufficient.
132- DIB_DIR=${DIB_DIR:-$DEST/diskimage-builder}
133-
134130# Use DIB to create deploy ramdisk and kernel.
135131BM_BUILD_DEPLOY_RAMDISK=`trueorfalse True $BM_BUILD_DEPLOY_RAMDISK`
136132# If not use DIB, these files are used as deploy ramdisk/kernel.
@@ -165,8 +161,9 @@ function is_baremetal {
165161# Install diskimage-builder and shell-in-a-box
166162# so that we can build the deployment kernel & ramdisk
167163function prepare_baremetal_toolchain {
168- git_clone $DIB_REPO $DIB_DIR $DIB_BUILD_BRANCH
169-
164+ if [[ $(type -P ramdisk-image-create) == "" ]]; then
165+ pip_install diskimage_builder
166+ fi
170167 local shellinabox_basename=$(basename $BM_SHELL_IN_A_BOX)
171168 if [[ ! -e $DEST/$shellinabox_basename ]]; then
172169 cd $DEST
@@ -223,7 +220,7 @@ function upload_baremetal_deploy {
223220 BM_DEPLOY_KERNEL=bm-deploy.kernel
224221 BM_DEPLOY_RAMDISK=bm-deploy.initramfs
225222 if [ ! -e "$TOP_DIR/files/$BM_DEPLOY_KERNEL" -o ! -e "$TOP_DIR/files/$BM_DEPLOY_RAMDISK" ]; then
226- $DIB_DIR/bin/ ramdisk-image-create $BM_DEPLOY_FLAVOR \
223+ ramdisk-image-create $BM_DEPLOY_FLAVOR \
227224 -o $TOP_DIR/files/bm-deploy
228225 fi
229226 fi
@@ -271,7 +268,7 @@ function extract_and_upload_k_and_r_from_image {
271268 image_name=$(basename "$file" ".qcow2")
272269
273270 # this call returns the file names as "$kernel,$ramdisk"
274- out=$($DIB_DIR/bin/ disk-image-get-kernel \
271+ out=$(disk-image-get-kernel \
275272 -x -d $TOP_DIR/files -o bm-deploy -i $file)
276273 if [ $? -ne 0 ]; then
277274 die $LINENO "Failed to get kernel and ramdisk from $file"
0 commit comments