mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 22:51:03 +02:00
fix for issue 2610
- add --recovery flag to chromeos-installer script to install a recovery image from partition B onto a device's hard drive - add temporary workaround to populate partition B to make installer work - TODO(tgao): write a script to populate partition B and remove workaround Review URL: http://codereview.chromium.org/2127010
This commit is contained in:
parent
fa08140093
commit
6c84bea17d
17
build_gpt.sh
17
build_gpt.sh
@ -80,7 +80,6 @@ set -u
|
|||||||
|
|
||||||
# Check for missing parts.
|
# Check for missing parts.
|
||||||
# For recovery image, only populate ROOT-A and KERN-A
|
# For recovery image, only populate ROOT-A and KERN-A
|
||||||
# TODO(tgao): write a script to populate ROOT-B and KERN-B
|
|
||||||
ROOTFS_IMG="${IMAGEDIR}/rootfs.image"
|
ROOTFS_IMG="${IMAGEDIR}/rootfs.image"
|
||||||
if [[ ! -s ${ROOTFS_IMG} ]]; then
|
if [[ ! -s ${ROOTFS_IMG} ]]; then
|
||||||
error "Can't find ${ROOTFS_IMG}"
|
error "Can't find ${ROOTFS_IMG}"
|
||||||
@ -148,7 +147,21 @@ echo "Copying kernel..."
|
|||||||
$sudo dd if=${KERNEL_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_KERN_A}
|
$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 seek=${START_ROOTFS_A}
|
$sudo dd if=${ROOTFS_IMG} of=${OUTDEV} conv=notrunc bs=512 \
|
||||||
|
seek=${START_ROOTFS_A}
|
||||||
|
|
||||||
|
# TODO(tgao): write a script to populate ROOT-B and KERN-B with user-specified
|
||||||
|
# rootfs and kernel. Do NOT remove if block below until then (otherwise
|
||||||
|
# chromeos-installer will fail b/c it expects to install from partition B)
|
||||||
|
if [ ${FLAGS_recovery} -eq $FLAGS_TRUE ]; then
|
||||||
|
echo "Copying kernel B..."
|
||||||
|
$sudo dd if=${KERNEL_IMG} of=${OUTDEV} conv=notrunc bs=512 \
|
||||||
|
seek=${START_KERN_B}
|
||||||
|
|
||||||
|
echo "Copying rootfs B..."
|
||||||
|
$sudo dd if=${ROOTFS_IMG} of=${OUTDEV} conv=notrunc bs=512 \
|
||||||
|
seek=${START_ROOTFS_B}
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Copying EFI system partition..."
|
echo "Copying EFI system partition..."
|
||||||
$sudo dd if=${ESP_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_ESP}
|
$sudo dd if=${ESP_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_ESP}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user