mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 13:36:58 +02:00
Revert "Skip filling in kernel partition until cros_make_image_bootable"
This reverts commit a966c2bad686f787268f01a7529851a1a2a6ad9b Change-Id: I0990252c34853f7e1884da19b2649ed32e52e078 Reviewed-on: http://gerrit.chromium.org/gerrit/5091 Reviewed-by: Elly Jones <ellyjones@chromium.org> Tested-by: Richard Barnette <jrbarnette@chromium.org>
This commit is contained in:
parent
44da798e21
commit
c6818be0da
@ -220,6 +220,8 @@ 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.
|
||||
@ -266,10 +268,6 @@ 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,6 +678,11 @@ 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
|
||||
@ -695,6 +700,7 @@ 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}"
|
||||
|
||||
@ -897,7 +903,8 @@ if [ ${FLAGS_test} -eq ${FLAGS_TRUE} ] ; then
|
||||
fi
|
||||
|
||||
# Clean up temporary files.
|
||||
rm -f "${ROOT_FS_IMG}" "${STATEFUL_FS_IMG}" "${ESP_FS_IMG}"
|
||||
rm -f "${ROOT_FS_IMG}" "${STATEFUL_FS_IMG}" "${OUTPUT_DIR}/vmlinuz.image" \
|
||||
"${ESP_FS_IMG}" "${OUTPUT_DIR}/vmlinuz_hd.vblock"
|
||||
rmdir "${ROOT_FS_DIR}" "${STATEFUL_FS_DIR}" "${ESP_FS_DIR}"
|
||||
|
||||
# Generating AU generator zip file to run outside chroot
|
||||
|
@ -40,8 +40,9 @@ HEADER
|
||||
build_gpt() {
|
||||
local outdev="$1"
|
||||
local rootfs_img="$2"
|
||||
local stateful_img="$3"
|
||||
local esp_img="$4"
|
||||
local kernel_img="$3"
|
||||
local stateful_img="$4"
|
||||
local esp_img="$5"
|
||||
|
||||
# We'll need some code to put in the PMBR, for booting on legacy BIOS.
|
||||
local pmbr_img
|
||||
@ -71,6 +72,10 @@ 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