From 4dceacd5ed96d570bd015ce2c01ce91d1463499e Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Sat, 13 Dec 2014 09:14:06 -0800 Subject: [PATCH] Allow absolute path to image with ironic-agent The element was prepending the work directory forcibly, which will have problems when the image name has an absolute path, which is allowed. Change-Id: I0cb7b96e24daab8ee73611936af72074c70ac1aa Closes-Bug: #1400405 --- elements/ironic-agent/cleanup.d/99-ramdisk-create | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elements/ironic-agent/cleanup.d/99-ramdisk-create b/elements/ironic-agent/cleanup.d/99-ramdisk-create index f9e0c62b4..560de151d 100755 --- a/elements/ironic-agent/cleanup.d/99-ramdisk-create +++ b/elements/ironic-agent/cleanup.d/99-ramdisk-create @@ -7,14 +7,14 @@ set -o pipefail source $_LIB/img-functions -WORKDIR=$(pwd) +IMAGE_PATH=$(readlink -f $IMAGE_NAME) cd $TARGET_ROOT echo "#disabled" > ./tmp/fstab.new sudo mv ./tmp/fstab.new ./etc/fstab sudo ln -s ./sbin/init ./ -sudo find . -path ./sys -prune -o -path ./proc -prune -o -print | sudo cpio -o -H newc | gzip > $WORKDIR/$IMAGE_NAME.initramfs +sudo find . -path ./sys -prune -o -path ./proc -prune -o -print | sudo cpio -o -H newc | gzip > ${IMAGE_PATH}.initramfs select_boot_kernel_initrd $TARGET_ROOT -sudo cp $BOOTDIR/$KERNEL $WORKDIR/$IMAGE_NAME.vmlinuz +sudo cp $BOOTDIR/$KERNEL ${IMAGE_PATH}.vmlinuz