diff options
author | David Zeuthen <zeuthen@google.com> | 2015-09-09 19:01:27 -0400 |
---|---|---|
committer | David Zeuthen <zeuthen@google.com> | 2015-09-11 14:11:30 -0400 |
commit | 19ec0baab5311fc3498ced1fb5e9b4a6cead2864 (patch) | |
tree | 0e5a19ebdf24e77562e2c7d0f7b0b8e1b026925f | |
parent | 5faedb2da3b29845535eefbc2cea2272c910100a (diff) | |
download | dragonboard-19ec0baab5311fc3498ced1fb5e9b4a6cead2864.tar.gz |
dragonboard: Use A/B partitioning by default.
With this change, dragonboard will use two sets of partitions by default
which enables update_engine to perform updates in the background.
This CL will not break existing Dragonboard devices that are not yet
repartitioned.
Change-Id: Ie7ebc95970ae033fcb5658498605b01155996a26
-rw-r--r-- | base_product/dragonboard.mk | 6 | ||||
-rwxr-xr-x | brillo-provision-dragonboard410c.sh | 26 | ||||
-rw-r--r-- | fstab.device | 2 |
3 files changed, 24 insertions, 10 deletions
diff --git a/base_product/dragonboard.mk b/base_product/dragonboard.mk index b0a7a41..2ec74e9 100644 --- a/base_product/dragonboard.mk +++ b/base_product/dragonboard.mk @@ -24,3 +24,9 @@ PRODUCT_DEVICE := dragonboard # Install DragonBoard-specific config file for weaved. PRODUCT_COPY_FILES += \ device/qcom/dragonboard/base_product/weaved.conf:system/etc/weaved/weaved.conf + +# Include bootctl utility and the copy-boot_X-to-boot implementation +# of the boot_control HAL. +PRODUCT_PACKAGES += \ + bootctl \ + bootctrl.default diff --git a/brillo-provision-dragonboard410c.sh b/brillo-provision-dragonboard410c.sh index 2c5f54e..e80a165 100755 --- a/brillo-provision-dragonboard410c.sh +++ b/brillo-provision-dragonboard410c.sh @@ -94,16 +94,24 @@ BOARD_PARTITIONS+="sec:303e6ac3-af15-4c54-9e9b-d9a8fbecf401:16K:${VENDOR_DIR}/se BOARD_PARTITIONS+="aboot:400ffdcd-22e0-47e7-9a23-f16ed9382388:1024K:${VENDOR_DIR}/aboot.bin " BOARD_PARTITIONS+="abootbak:ebd0a0a2-b9e5-4433-87c0-68b6b72699c7:1024K:${VENDOR_DIR}/aboot.bin " -# The Android misc partition. -# -# TODO(zeuthen): Use a host-version of bootctl to populate the misc -# partition with data indicating that slot A is GOOD. -BOARD_PARTITIONS+="misc:${LINUX_GUID_TYPE}:1024K: " - -# TODO(zeuthen): replace {boot,system} by just a single boot partition -# containing the Brillo Boot Selector kernel and initramfs. +# Setup the Android misc partition with slot_suffix (at offset 864, +# see bootable/recovery/bootloader.h) indicating it should use the +# first slot. Also include boot_control_copy specific data (see +# system/extras/boot_control_copy/bootinfo.h). +MISC_PART="${WORKDIR}/misc.bin" +MISC_PART_SIZE_BYTES=$((1024*1024)) +MISC_PART_SLOT_SUFFIX_OFFSET=864 +SLOT_SUFFIX_DATA="_a\\x00\x00BCc\\x00\\x00\\x01" +dd if=/dev/zero of="${MISC_PART}" bs=1 count=0 \ + seek=${MISC_PART_SIZE_BYTES} status=none +echo -n -e ${SLOT_SUFFIX_DATA} > "${WORKDIR}/slot_suffix" +dd if="${WORKDIR}/slot_suffix" of="${MISC_PART}" bs=1 count=32 \ + seek=${MISC_PART_SLOT_SUFFIX_OFFSET} status=none conv=notrunc +BOARD_PARTITIONS+="misc:${LINUX_GUID_TYPE}:${MISC_PART_SIZE_BYTES}:${MISC_PART} " + +# The boot partition, used by system/extras/boot_control_copy as the +# destination when making a slot active. BOARD_PARTITIONS+="boot:${LINUX_GUID_TYPE}:32M:${BRILLO_OUT_DIR}/boot.img " -BOARD_PARTITIONS+="system:${LINUX_GUID_TYPE}:256M:${BRILLO_OUT_DIR}/system.img " # Brillo-specific partitions. diff --git a/fstab.device b/fstab.device index ab5d0cd..2c2a0ed 100644 --- a/fstab.device +++ b/fstab.device @@ -1,3 +1,3 @@ -/dev/block/platform/soc.0/7824900.sdhci/by-name/system /system ext4 ro,barrier=1,discard wait +/dev/block/platform/soc.0/7824900.sdhci/by-name/system /system ext4 ro,barrier=1,discard wait,slotselect /dev/block/platform/soc.0/7824900.sdhci/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,check,encryptable=footer /dev/block/platform/soc.0/7824900.sdhci/by-name/misc /misc emmc defaults defaults |