mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 23:21:17 +02:00
fix for issue 2610
- add back in RECOVERY variable since we can't specify value "0" in place of boolean flag "--recovery" - for recovery image, make ROOT-B 1GB, KERN-B 16MB and stateful partition 1GB Review URL: http://codereview.chromium.org/2133006
This commit is contained in:
parent
7a8a838350
commit
6df5aeeebb
11
build_gpt.sh
11
build_gpt.sh
@ -23,6 +23,8 @@ DEFINE_string board "$DEFAULT_BOARD" \
|
|||||||
"The board to build an image for."
|
"The board to build an image for."
|
||||||
DEFINE_string arm_extra_bootargs "" \
|
DEFINE_string arm_extra_bootargs "" \
|
||||||
"Additional command line options to pass to the ARM kernel."
|
"Additional command line options to pass to the ARM kernel."
|
||||||
|
DEFINE_boolean recovery $FLAGS_FALSE \
|
||||||
|
"Build GPT for a recovery image. Default: False."
|
||||||
|
|
||||||
# Usage.
|
# Usage.
|
||||||
FLAGS_HELP=$(cat <<EOF
|
FLAGS_HELP=$(cat <<EOF
|
||||||
@ -77,6 +79,8 @@ set -e
|
|||||||
set -u
|
set -u
|
||||||
|
|
||||||
# Check for missing parts.
|
# Check for missing parts.
|
||||||
|
# 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}"
|
||||||
@ -90,13 +94,13 @@ if [[ ! -s ${KERNEL_IMG} ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
STATEFUL_IMG="${IMAGEDIR}/stateful_partition.image"
|
STATEFUL_IMG="${IMAGEDIR}/stateful_partition.image"
|
||||||
if [[ ! -s ${STATEFUL_IMG} ]]; then
|
if [ ! -s ${STATEFUL_IMG} ] && [ ${FLAGS_recovery} -eq $FLAGS_FALSE ]; then
|
||||||
error "Can't find ${STATEFUL_IMG}"
|
error "Can't find ${STATEFUL_IMG}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ESP_IMG="${IMAGEDIR}/esp.image"
|
ESP_IMG="${IMAGEDIR}/esp.image"
|
||||||
if [[ ! -s ${ESP_IMG} ]]; then
|
if [ ! -s ${ESP_IMG} ] && [ ${FLAGS_recovery} -eq $FLAGS_FALSE ]; then
|
||||||
error "Can't find ${ESP_IMG}"
|
error "Can't find ${ESP_IMG}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -111,7 +115,8 @@ fi
|
|||||||
|
|
||||||
# Create the GPT. This has the side-effect of setting some global vars
|
# Create the GPT. This has the side-effect of setting some global vars
|
||||||
# describing the partition table entries (see the comments in the source).
|
# describing the partition table entries (see the comments in the source).
|
||||||
install_gpt $OUTDEV $ROOTFS_IMG $KERNEL_IMG $STATEFUL_IMG $PMBRCODE $ESP_IMG
|
install_gpt $OUTDEV $ROOTFS_IMG $KERNEL_IMG $STATEFUL_IMG $PMBRCODE $ESP_IMG \
|
||||||
|
false $FLAGS_recovery
|
||||||
|
|
||||||
if [[ "$ARCH" = "arm" ]]; then
|
if [[ "$ARCH" = "arm" ]]; then
|
||||||
# assume /dev/mmcblk1. we could not get this from ${OUTDEV}
|
# assume /dev/mmcblk1. we could not get this from ${OUTDEV}
|
||||||
|
@ -44,6 +44,8 @@ DEFINE_boolean factory_install $FLAGS_FALSE \
|
|||||||
is also required in image_to_usb."
|
is also required in image_to_usb."
|
||||||
DEFINE_string arm_extra_bootargs "" \
|
DEFINE_string arm_extra_bootargs "" \
|
||||||
"Additional command line options to pass to the ARM kernel."
|
"Additional command line options to pass to the ARM kernel."
|
||||||
|
DEFINE_boolean recovery $FLAGS_FALSE \
|
||||||
|
"Build a recovery image. Default: False."
|
||||||
|
|
||||||
# Parse command line.
|
# Parse command line.
|
||||||
FLAGS "$@" || exit 1
|
FLAGS "$@" || exit 1
|
||||||
@ -442,11 +444,17 @@ cleanup
|
|||||||
|
|
||||||
trap delete_prompt EXIT
|
trap delete_prompt EXIT
|
||||||
|
|
||||||
|
RECOVERY="--norecovery"
|
||||||
|
if [[ ${FLAGS_recovery} -eq $FLAGS_TRUE ]]; then
|
||||||
|
RECOVERY="--recovery"
|
||||||
|
fi
|
||||||
|
|
||||||
# Create the GPT-formatted image
|
# Create the GPT-formatted image
|
||||||
${SCRIPTS_DIR}/build_gpt.sh \
|
${SCRIPTS_DIR}/build_gpt.sh \
|
||||||
--arch=${ARCH} \
|
--arch=${ARCH} \
|
||||||
--board=${FLAGS_board} \
|
--board=${FLAGS_board} \
|
||||||
--arm_extra_bootargs="${FLAGS_arm_extra_bootargs}" \
|
--arm_extra_bootargs="${FLAGS_arm_extra_bootargs}" \
|
||||||
|
${RECOVERY} \
|
||||||
"${OUTPUT_DIR}" \
|
"${OUTPUT_DIR}" \
|
||||||
"${OUTPUT_IMG}"
|
"${OUTPUT_IMG}"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user