From 6edcc4d952ee77e12d0d2650dc2cd781c6634ec8 Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Tue, 30 Nov 2010 17:21:39 -0800 Subject: [PATCH] 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 --- mod_image_for_recovery.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/mod_image_for_recovery.sh b/mod_image_for_recovery.sh index e6cc8859a8..2d6e03151b 100755 --- a/mod_image_for_recovery.sh +++ b/mod_image_for_recovery.sh @@ -292,15 +292,20 @@ install_recovery_kernel() { # Replace vmlinuz.A with the recovery version local sysroot="${FLAGS_build_root}/${FLAGS_board}" local vmlinuz="$sysroot/boot/vmlinuz" - local esp_offset=$(partoffset "$RECOVERY_IMAGE" 12) - local esp_mnt=$(mktemp -d) - set +e local failed=0 - sudo mount -o loop,offset=$((esp_offset * 512)) "$RECOVERY_IMAGE" "$esp_mnt" - sudo cp "$vmlinuz" "$esp_mnt/syslinux/vmlinuz.A" || failed=1 - sudo umount -d "$esp_mnt" - rmdir "$esp_mnt" - set -e + + 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_mnt=$(mktemp -d) + sudo mount -o loop,offset=$((esp_offset * 512)) "$RECOVERY_IMAGE" "$esp_mnt" + sudo cp "$vmlinuz" "$esp_mnt/syslinux/vmlinuz.A" || failed=1 + sudo umount -d "$esp_mnt" + rmdir "$esp_mnt" + set -e + fi + if [ $failed -eq 1 ]; then echo "Failed to copy recovery kernel to ESP" return 1