diskimage-builder/elements/ironic-agent/cleanup.d/99-ramdisk-create
Yuriy Zveryanskyy 676b1b738d Add element for building ramdisk with ironic-python-agent
This element creates kernel and ramdisk files based on Fedora,
example:
disk-image-create -a i386 -o test fedora ironic-agent disable-selinux

Change-Id: Ifa133d1680b81cb87d32a405aa7d7b40fe91f835
2014-11-13 19:30:44 +02:00

20 lines
440 B
Bash
Executable file

#!/bin/bash
set -eu
set -o pipefail
[ -n "$TARGET_ROOT" ]
source $_LIB/img-functions
WORKDIR=$(pwd)
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
select_boot_kernel_initrd $TARGET_ROOT
sudo cp $BOOTDIR/$KERNEL $WORKDIR/$IMAGE_NAME.vmlinuz