mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 19:56:32 +02:00
build_image: publish kernel along with base image for generating updates
This commit is contained in:
parent
e89fa7f0fc
commit
14eb89a5dc
@ -282,6 +282,7 @@ finish_image() {
|
||||
local disk_layout="$2"
|
||||
local root_fs_dir="$3"
|
||||
local image_contents="$4"
|
||||
local image_kernel="$5"
|
||||
local install_grub=0
|
||||
|
||||
local disk_img="${BUILD_DIR}/${image_name}"
|
||||
@ -364,6 +365,13 @@ finish_image() {
|
||||
"${root_fs_dir}/boot/coreos/vmlinuz-a"
|
||||
fi
|
||||
|
||||
if [[ -n "${image_kernel}" ]]; then
|
||||
# copying kernel from vfat so ignore the permissions
|
||||
cp --no-preserve=mode \
|
||||
"${root_fs_dir}/boot/coreos/vmlinuz-a" \
|
||||
"${BUILD_DIR}/${image_kernel}"
|
||||
fi
|
||||
|
||||
${BUILD_LIBRARY_DIR}/generate_kernel_hash.sh "${root_fs_dir}/boot/coreos/vmlinuz-a" ${COREOS_VERSION} >${pcr_dir}/kernel.config
|
||||
rm -rf "${BUILD_DIR}"/configroot
|
||||
cleanup_mounts "${root_fs_dir}"
|
||||
|
||||
@ -66,6 +66,7 @@ create_prod_image() {
|
||||
local image_contents="${image_name%.bin}_contents.txt"
|
||||
local image_packages="${image_name%.bin}_packages.txt"
|
||||
local image_licenses="${image_name%.bin}_licenses.txt"
|
||||
local image_kernel="${image_name%.bin}.vmlinuz"
|
||||
local image_pcr_policy="${image_name%.bin}_pcr_policy.zip"
|
||||
|
||||
start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}"
|
||||
@ -112,11 +113,12 @@ EOF
|
||||
sudo mv -n ${root_fs_dir}/etc/pam.d/* ${root_fs_dir}/usr/lib/pam.d/
|
||||
sudo rmdir ${root_fs_dir}/etc/pam.d
|
||||
|
||||
finish_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${image_contents}"
|
||||
finish_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${image_contents}" "${image_kernel}"
|
||||
|
||||
upload_image -d "${BUILD_DIR}/${image_name}.bz2.DIGESTS" \
|
||||
"${BUILD_DIR}/${image_contents}" \
|
||||
"${BUILD_DIR}/${image_packages}" \
|
||||
"${BUILD_DIR}/${image_name}" \
|
||||
"${BUILD_DIR}/${image_kernel}" \
|
||||
"${BUILD_DIR}/${image_pcr_policy}"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user