mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 21:46:58 +02:00
Skip filling in kernel partition until cros_make_image_bootable
When first creating an image, vmlinuz was extracted from /boot, and installed in its place in the kernel partition. However, none of that was necessary, because cros_make_image_bootable walks over the same ground later in the build process. BUG=chromium-os:17390 TEST=build_image, boot base and dev images on ZGB and legacy device TEST=inspect build output directory, to confirm no stray artifacts Change-Id: Iaf332b6603e0bcb17585adbc95a7b65bb8bfe790 Reviewed-on: http://gerrit.chromium.org/gerrit/5107 Tested-by: Richard Barnette <jrbarnette@chromium.org> Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
This commit is contained in:
parent
c6818be0da
commit
9fb286ea02
@ -220,8 +220,6 @@ make_image_bootable() {
|
|||||||
if="${FLAGS_rootfs_hash}" \
|
if="${FLAGS_rootfs_hash}" \
|
||||||
of="${image}" \
|
of="${image}" \
|
||||||
conv=notrunc
|
conv=notrunc
|
||||||
# We don't need to keep the file around anymore.
|
|
||||||
sudo rm "${FLAGS_rootfs_hash}"
|
|
||||||
|
|
||||||
# Move the verification block needed for the hard disk install to the
|
# Move the verification block needed for the hard disk install to the
|
||||||
# stateful partition. Mount stateful fs, copy file, and umount fs.
|
# stateful partition. Mount stateful fs, copy file, and umount fs.
|
||||||
@ -268,6 +266,10 @@ make_image_bootable() {
|
|||||||
${bootloader_to_flags} \
|
${bootloader_to_flags} \
|
||||||
$kernel_part
|
$kernel_part
|
||||||
|
|
||||||
|
# We don't need to keep these files around anymore.
|
||||||
|
sudo rm "${FLAGS_rootfs_hash}" "${FLAGS_output_dir}/vmlinuz.image" \
|
||||||
|
"${FLAGS_output_dir}/vmlinuz_hd.vblock"
|
||||||
|
|
||||||
trap - EXIT
|
trap - EXIT
|
||||||
${SCRIPTS_DIR}/mount_gpt_image.sh -u -r "${FLAGS_rootfs_mountpoint}" \
|
${SCRIPTS_DIR}/mount_gpt_image.sh -u -r "${FLAGS_rootfs_mountpoint}" \
|
||||||
-s "${FLAGS_statefulfs_mountpoint}"
|
-s "${FLAGS_statefulfs_mountpoint}"
|
||||||
|
@ -678,11 +678,6 @@ create_base_image() {
|
|||||||
# create /usr/local or /var on host (already exist on target).
|
# create /usr/local or /var on host (already exist on target).
|
||||||
setup_symlinks_on_root "/usr/local" "/var" "${STATEFUL_FS_DIR}"
|
setup_symlinks_on_root "/usr/local" "/var" "${STATEFUL_FS_DIR}"
|
||||||
|
|
||||||
# cros_make_image_bootable will clobber vmlinuz.image for x86.
|
|
||||||
# Until then, just copy the kernel to vmlinuz.image. It is
|
|
||||||
# expected in build_gpt.sh.
|
|
||||||
cp "${ROOT_FS_DIR}/boot/vmlinuz" "${OUTPUT_DIR}/vmlinuz.image"
|
|
||||||
|
|
||||||
# Create EFI System Partition to boot stock EFI BIOS (but not
|
# Create EFI System Partition to boot stock EFI BIOS (but not
|
||||||
# ChromeOS EFI BIOS). ARM uses this space to determine which
|
# ChromeOS EFI BIOS). ARM uses this space to determine which
|
||||||
# partition is bootable. NOTE: The size argument for mkfs.vfat is
|
# partition is bootable. NOTE: The size argument for mkfs.vfat is
|
||||||
@ -700,7 +695,6 @@ create_base_image() {
|
|||||||
# Create the GPT-formatted image.
|
# Create the GPT-formatted image.
|
||||||
build_gpt "${OUTPUT_DIR}/${image_name}" \
|
build_gpt "${OUTPUT_DIR}/${image_name}" \
|
||||||
"${ROOT_FS_IMG}" \
|
"${ROOT_FS_IMG}" \
|
||||||
"${OUTPUT_DIR}/vmlinuz.image" \
|
|
||||||
"${STATEFUL_FS_IMG}" \
|
"${STATEFUL_FS_IMG}" \
|
||||||
"${ESP_FS_IMG}"
|
"${ESP_FS_IMG}"
|
||||||
|
|
||||||
@ -903,8 +897,7 @@ if [ ${FLAGS_test} -eq ${FLAGS_TRUE} ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean up temporary files.
|
# Clean up temporary files.
|
||||||
rm -f "${ROOT_FS_IMG}" "${STATEFUL_FS_IMG}" "${OUTPUT_DIR}/vmlinuz.image" \
|
rm -f "${ROOT_FS_IMG}" "${STATEFUL_FS_IMG}" "${ESP_FS_IMG}"
|
||||||
"${ESP_FS_IMG}" "${OUTPUT_DIR}/vmlinuz_hd.vblock"
|
|
||||||
rmdir "${ROOT_FS_DIR}" "${STATEFUL_FS_DIR}" "${ESP_FS_DIR}"
|
rmdir "${ROOT_FS_DIR}" "${STATEFUL_FS_DIR}" "${ESP_FS_DIR}"
|
||||||
|
|
||||||
# Generating AU generator zip file to run outside chroot
|
# Generating AU generator zip file to run outside chroot
|
||||||
|
@ -40,9 +40,8 @@ HEADER
|
|||||||
build_gpt() {
|
build_gpt() {
|
||||||
local outdev="$1"
|
local outdev="$1"
|
||||||
local rootfs_img="$2"
|
local rootfs_img="$2"
|
||||||
local kernel_img="$3"
|
local stateful_img="$3"
|
||||||
local stateful_img="$4"
|
local esp_img="$4"
|
||||||
local esp_img="$5"
|
|
||||||
|
|
||||||
# We'll need some code to put in the PMBR, for booting on legacy BIOS.
|
# We'll need some code to put in the PMBR, for booting on legacy BIOS.
|
||||||
local pmbr_img
|
local pmbr_img
|
||||||
@ -72,10 +71,6 @@ build_gpt() {
|
|||||||
$sudo dd if="$stateful_img" of="$outdev" conv=notrunc bs=512 \
|
$sudo dd if="$stateful_img" of="$outdev" conv=notrunc bs=512 \
|
||||||
seek=$START_STATEFUL
|
seek=$START_STATEFUL
|
||||||
|
|
||||||
echo "Copying kernel..."
|
|
||||||
$sudo dd if="$kernel_img" of="$outdev" conv=notrunc bs=512 \
|
|
||||||
seek=$START_KERN_A
|
|
||||||
|
|
||||||
echo "Copying rootfs..."
|
echo "Copying rootfs..."
|
||||||
$sudo dd if="$rootfs_img" of="$outdev" conv=notrunc bs=512 \
|
$sudo dd if="$rootfs_img" of="$outdev" conv=notrunc bs=512 \
|
||||||
seek=$START_ROOTFS_A
|
seek=$START_ROOTFS_A
|
||||||
|
Loading…
Reference in New Issue
Block a user