From ba808fa6ecfb71cd85976e153d7c7755b7a082d0 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Fri, 7 Aug 2015 13:45:12 +0100 Subject: [PATCH] ironic-agent element to output a .kernel file The ironic-agent element is created using the disk-image-create utility (even being a ramdisk) and outputs a .vmlinuz file for the kernel (different than the ramdisk-image-create which outputs a .kernel file for the kernel). This is inconsistent and make scripting against the diskimage-builder more complicated if one wants to support different types of ramdisk. This patch creates a hard link for the .vmlinuz file to a .kernel file at the end of the process (to keep backward compatibility) and print a deprecation message. Depends-On: I81400305f166d62aa4612aab54602abb8178b64c Change-Id: I476f9ec9ec4206ece0261eaaf2b4182c6bcbd802 Closes-Bug: #1482606 --- elements/ironic-agent/README.rst | 9 +++++++++ elements/ironic-agent/cleanup.d/99-ramdisk-create | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/elements/ironic-agent/README.rst b/elements/ironic-agent/README.rst index 0484adc14..f1fb42580 100644 --- a/elements/ironic-agent/README.rst +++ b/elements/ironic-agent/README.rst @@ -16,6 +16,15 @@ Beyond installing the ironic-python-agent, this element does the following: in order to support source based installation of ironic-python-agent and its dependencies. +This element outputs three files: + +- ``$IMAGE-NAME.initramfs``: The deploy ramdisk file containing the + ironic-python-agent (IPA) service. +- ``$IMAGE-NAME.kernel``: The kernel binary file. +- ``$IMAGE-NAME.vmlinuz``: A hard link pointing to the ``$IMAGE-NAME.kernel`` + file; this is just a backward compatibility layer, please do not rely + on this file. + .. note:: The package based install currently only enables the service when using the systemd init system. This can easily be changed if there is an agent diff --git a/elements/ironic-agent/cleanup.d/99-ramdisk-create b/elements/ironic-agent/cleanup.d/99-ramdisk-create index a6d17b742..33a8c7cb8 100755 --- a/elements/ironic-agent/cleanup.d/99-ramdisk-create +++ b/elements/ironic-agent/cleanup.d/99-ramdisk-create @@ -21,4 +21,10 @@ sudo ln -s ./sbin/init ./ sudo find . -path ./sys -prune -o -path ./proc -prune -o -path './tmp/*' -prune -o -path './boot/*' -prune -o -path './root/*' -prune -o -path './usr/lib/locale/*' -prune -o -path './usr/share/doc/*' -prune -o -path './usr/share/man/*' -prune -o -path './usr/share/info/*' -prune -o -path './usr/share/licenses/*' -prune -o -path './usr/share/misc/*' -prune -o -print | sudo cpio -o -H newc | gzip > ${IMAGE_PATH}.initramfs select_boot_kernel_initrd $TARGET_ROOT -sudo cp $BOOTDIR/$KERNEL ${IMAGE_PATH}.vmlinuz +sudo cp $BOOTDIR/$KERNEL ${IMAGE_PATH}.kernel + +# TODO(lucasagomes): Create a hard link for the .vmlinuz file to keep +# it backward compatible. Remove it after it has been consistent and +# documented in both places for at least one full OpenStack release cycle +echo "WARNING: The kernel extension .vmlinuz has been deprecated. Please rely on the file with the extension .kernel instead." +sudo ln ${IMAGE_PATH}.kernel ${IMAGE_PATH}.vmlinuz