Copy recovery kernel to syslinux path only on x86.

This is intended to fix a build error seen on ARM platforms where
the path "$esp_mnt/syslinux" does not exist.

Change-Id: I0b9e2d1fae376a7137d7e196901fbea4f2e796bc

BUG=http://code.google.com/p/chromium-os/issues/detail?id=9713
TEST=Not tested.

Review URL: http://codereview.chromium.org/5404001
This commit is contained in:
David Hendricks 2010-11-30 17:21:39 -08:00
parent adcb314d9f
commit 6edcc4d952

View File

@ -292,15 +292,20 @@ install_recovery_kernel() {
# Replace vmlinuz.A with the recovery version # Replace vmlinuz.A with the recovery version
local sysroot="${FLAGS_build_root}/${FLAGS_board}" local sysroot="${FLAGS_build_root}/${FLAGS_board}"
local vmlinuz="$sysroot/boot/vmlinuz" local vmlinuz="$sysroot/boot/vmlinuz"
local failed=0
if [ "$ARCH" = "x86" ]; then
# There is no syslinux on ARM, so this copy only makes sense for x86.
set +e
local esp_offset=$(partoffset "$RECOVERY_IMAGE" 12) local esp_offset=$(partoffset "$RECOVERY_IMAGE" 12)
local esp_mnt=$(mktemp -d) local esp_mnt=$(mktemp -d)
set +e
local failed=0
sudo mount -o loop,offset=$((esp_offset * 512)) "$RECOVERY_IMAGE" "$esp_mnt" sudo mount -o loop,offset=$((esp_offset * 512)) "$RECOVERY_IMAGE" "$esp_mnt"
sudo cp "$vmlinuz" "$esp_mnt/syslinux/vmlinuz.A" || failed=1 sudo cp "$vmlinuz" "$esp_mnt/syslinux/vmlinuz.A" || failed=1
sudo umount -d "$esp_mnt" sudo umount -d "$esp_mnt"
rmdir "$esp_mnt" rmdir "$esp_mnt"
set -e set -e
fi
if [ $failed -eq 1 ]; then if [ $failed -eq 1 ]; then
echo "Failed to copy recovery kernel to ESP" echo "Failed to copy recovery kernel to ESP"
return 1 return 1