Add DIB_IPA_COMPRESS_CMD option

This option allows to specifiy command for compress built initramfs image
for ironic-agent element. This command can be specified with arguments and
should read raw data from stdin and write compressed data to stdout.
Default if "gzip".

Change-Id: I0fdd2ab91d7bf7aaaa6cdd5278e3902d44c5b883
This commit is contained in:
Andrey Shestakov 2017-01-05 14:39:25 +02:00
parent 48bbbe6268
commit 11d384e2fa
2 changed files with 7 additions and 1 deletions

View File

@ -18,6 +18,10 @@ Beyond installing the ironic-python-agent, this element does the following:
* Install the certificate if any, which is set to the environment variable * Install the certificate if any, which is set to the environment variable
``DIB_IPA_CERT`` for validating the authenticity by ironic-python-agent. The ``DIB_IPA_CERT`` for validating the authenticity by ironic-python-agent. The
certificate can be self-signed certificate or CA certificate. certificate can be self-signed certificate or CA certificate.
* Compresses initramfs with command specified in environment variable
``DIB_IPA_COMPRESS_CMD``, which is 'gzip' by default. This command should listen
for raw data from stdin and write compressed data to stdout. Command can be
with arguments.
This element outputs three files: This element outputs three files:

View File

@ -18,6 +18,8 @@ source $_LIB/img-functions
IMAGE_PATH=$(readlink -f $IMAGE_NAME) IMAGE_PATH=$(readlink -f $IMAGE_NAME)
cd $TARGET_ROOT cd $TARGET_ROOT
DIB_IPA_COMPRESS_CMD="${DIB_IPA_COMPRESS_CMD:-gzip}"
echo "#disabled" > ./tmp/fstab.new echo "#disabled" > ./tmp/fstab.new
sudo mv ./tmp/fstab.new ./etc/fstab sudo mv ./tmp/fstab.new ./etc/fstab
sudo ln -s ./sbin/init ./ sudo ln -s ./sbin/init ./
@ -42,7 +44,7 @@ sudo find . -xdev \
-path './var/cache/*' -prune -o \ -path './var/cache/*' -prune -o \
-name '*.pyc' -prune -o \ -name '*.pyc' -prune -o \
-name '*.pyo' -prune -o \ -name '*.pyo' -prune -o \
-print | sudo cpio -o -H newc | gzip > ${IMAGE_PATH}.initramfs -print | sudo cpio -o -H newc | ${DIB_IPA_COMPRESS_CMD} > ${IMAGE_PATH}.initramfs
select_boot_kernel_initrd $TARGET_ROOT select_boot_kernel_initrd $TARGET_ROOT
sudo cp $BOOTDIR/$KERNEL ${IMAGE_PATH}.kernel sudo cp $BOOTDIR/$KERNEL ${IMAGE_PATH}.kernel