Merge pull request #45 from philips/switchup-bootkernel

Switchup bootkernel
This commit is contained in:
Greg Kroah-Hartman 2013-07-21 16:22:21 -07:00
commit 138e8eb715
2 changed files with 22 additions and 4 deletions

View File

@ -107,6 +107,9 @@ DEFINE_string verity_salt "" \
DEFINE_string keys_dir "/usr/share/vboot/devkeys" \
"Directory containing the signing keys."
DEFINE_string au_key "" \
"Filename of the au_key to install"
DEFINE_string rootfs_mountpoint "/tmp/rootfs" \
"Path where the rootfs can be safely mounted"
DEFINE_string statefulfs_mountpoint "/tmp/statefulfs" \
@ -182,6 +185,16 @@ make_image_bootable() {
legacy_offset_size_export ${image}
# Install an auto update key on the root before sealing it off
if [ ! -z "${FLAGS_au_key}" ]; then
local key_location=${FLAGS_rootfs_mountpoint}"/usr/share/update_engine/"
sudo cp "${FLAGS_au_key}" "$key_location/update-payload-key.pub.pem"
sudo chown root:root "$key_location/update-payload-key.pub.pem"
sudo chmod 644 "$key_location/update-payload-key.pub.pem"
echo "AU verification key was installed. Do not forget to resign the image!"
fi
# The rootfs should never be mounted rw again after this point without
# re-calling make_image_bootable.
sudo mount -o remount,ro "${FLAGS_rootfs_mountpoint}"
@ -227,12 +240,13 @@ make_image_bootable() {
esp_size=$((esp_size * 512)) # sectors to bytes
local bootloader_to_flags="--to_offset=${esp_offset} --to_size=${esp_size}"
# Update partition 12
# Update ESP partition
# NOTE: Boot kernel is identical to regular kernel for now
${SCRIPTS_DIR}/update_bootloaders.sh \
--arch=${FLAGS_arch} \
--to="${bootloader_to}" \
--from="${FLAGS_rootfs_mountpoint}"/boot \
--vmlinuz_boot_kernel="${FLAGS_rootfs_mountpoint}"/boot/vmlinuz-boot_kernel \
--vmlinuz_boot_kernel="${FLAGS_rootfs_mountpoint}"/boot/vmlinuz \
--vmlinuz="${FLAGS_rootfs_mountpoint}"/boot/vmlinuz \
${bootloader_to_flags}

View File

@ -168,8 +168,12 @@ fi
if should_build_image ${COREOS_PRODUCTION_IMAGE_NAME}; then
copy_image ${CHROMEOS_BASE_IMAGE_NAME} ${COREOS_PRODUCTION_IMAGE_NAME}
${SCRIPTS_DIR}/bin/cros_make_image_bootable "${BUILD_DIR}" \
${COREOS_PRODUCTION_IMAGE_NAME}
${SCRIPTS_DIR}/bin/cros_make_image_bootable \
"${BUILD_DIR}" \
${COREOS_PRODUCTION_IMAGE_NAME} \
--au_key=${SRC_ROOT}/third_party/coreos-overlay/coreos-base/coreos-au-key/files/update-payload-key.pub.pem
upload_image "${BUILD_DIR}/${COREOS_PRODUCTION_IMAGE_NAME}"
fi