Skip to content

Commit 21c891b

Browse files
committed
Update build script to facilitate iso builds
Signed-off-by: Rahul Ganesh <[email protected]>
1 parent a562ffd commit 21c891b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

bash/linuxkit.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,25 @@ function linuxkit_build() {
100100
log info "Building Hook with kernel ${inventory_id} using linuxkit: ${lk_args[*]}"
101101
"${linuxkit_bin}" build "--format" "kernel+initrd" "${lk_args[@]}"
102102

103+
# if LINUXKIT_ISO is set, build an ISO with the kernel and initramfs
104+
if [[ -n "${LINUXKIT_ISO}" ]]; then
105+
declare lk_iso_output_dir="out"
106+
mkdir -p "${lk_iso_output_dir}"
107+
108+
declare -a lk_iso_args=(
109+
"--docker"
110+
"--arch" "${kernel_info['DOCKER_ARCH']}"
111+
"--format" "iso-efi-initrd"
112+
"--name" "hook"
113+
"--cache" "${lk_cache_dir}"
114+
"--dir" "${lk_iso_output_dir}"
115+
"hook.${inventory_id}.yaml" # the linuxkit configuration file
116+
)
117+
118+
log info "Building Hook ISO with kernel ${inventory_id} using linuxkit: ${lk_iso_args[*]}"
119+
"${linuxkit_bin}" build "${lk_iso_args[@]}"
120+
fi
121+
103122
declare initramfs_path="${lk_output_dir}/hook-initrd.img"
104123
# initramfs_path is a gzipped file. obtain the uncompressed byte size, without decompressing it
105124
declare -i initramfs_size_bytes=0

0 commit comments

Comments
 (0)