mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 13:36: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: Icd4902f5a823241f24eb64f68f80c8e5e5198341 Reviewed-on: http://gerrit.chromium.org/gerrit/4928 Reviewed-by: Richard Barnette <jrbarnette@chromium.org> Tested-by: Richard Barnette <jrbarnette@chromium.org>
This commit is contained in:
parent
1926874a19
commit
77ec32a128
@ -220,8 +220,6 @@ make_image_bootable() {
|
||||
if="${FLAGS_rootfs_hash}" \
|
||||
of="${image}" \
|
||||
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
|
||||
# stateful partition. Mount stateful fs, copy file, and umount fs.
|
||||
@ -268,6 +266,10 @@ make_image_bootable() {
|
||||
${bootloader_to_flags} \
|
||||
$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
|
||||
${SCRIPTS_DIR}/mount_gpt_image.sh -u -r "${FLAGS_rootfs_mountpoint}" \
|
||||
-s "${FLAGS_statefulfs_mountpoint}"
|
||||
|
@ -678,11 +678,6 @@ create_base_image() {
|
||||
# create /usr/local or /var on host (already exist on target).
|
||||
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
|
||||
# ChromeOS EFI BIOS). ARM uses this space to determine which
|
||||
# partition is bootable. NOTE: The size argument for mkfs.vfat is
|
||||
@ -700,7 +695,6 @@ create_base_image() {
|
||||
# Create the GPT-formatted image.
|
||||
build_gpt "${OUTPUT_DIR}/${image_name}" \
|
||||
"${ROOT_FS_IMG}" \
|
||||
"${OUTPUT_DIR}/vmlinuz.image" \
|
||||
"${STATEFUL_FS_IMG}" \
|
||||
"${ESP_FS_IMG}"
|
||||
|
||||
@ -903,8 +897,7 @@ if [ ${FLAGS_test} -eq ${FLAGS_TRUE} ] ; then
|
||||
fi
|
||||
|
||||
# Clean up temporary files.
|
||||
rm -f "${ROOT_FS_IMG}" "${STATEFUL_FS_IMG}" "${OUTPUT_DIR}/vmlinuz.image" \
|
||||
"${ESP_FS_IMG}" "${OUTPUT_DIR}/vmlinuz_hd.vblock"
|
||||
rm -f "${ROOT_FS_IMG}" "${STATEFUL_FS_IMG}" "${ESP_FS_IMG}"
|
||||
rmdir "${ROOT_FS_DIR}" "${STATEFUL_FS_DIR}" "${ESP_FS_DIR}"
|
||||
|
||||
# Generating AU generator zip file to run outside chroot
|
||||
|
@ -40,9 +40,8 @@ HEADER
|
||||
build_gpt() {
|
||||
local outdev="$1"
|
||||
local rootfs_img="$2"
|
||||
local kernel_img="$3"
|
||||
local stateful_img="$4"
|
||||
local esp_img="$5"
|
||||
local stateful_img="$3"
|
||||
local esp_img="$4"
|
||||
|
||||
# We'll need some code to put in the PMBR, for booting on legacy BIOS.
|
||||
local pmbr_img
|
||||
@ -72,10 +71,6 @@ build_gpt() {
|
||||
$sudo dd if="$stateful_img" of="$outdev" conv=notrunc bs=512 \
|
||||
seek=$START_STATEFUL
|
||||
|
||||
echo "Copying kernel..."
|
||||
$sudo dd if="$kernel_img" of="$outdev" conv=notrunc bs=512 \
|
||||
seek=$START_KERN_A
|
||||
|
||||
echo "Copying rootfs..."
|
||||
$sudo dd if="$rootfs_img" of="$outdev" conv=notrunc bs=512 \
|
||||
seek=$START_ROOTFS_A
|
||||
|
Loading…
Reference in New Issue
Block a user