#!/bin/bash
# Copyright (c) 2014 The CoreOS Authors.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

set -e

# Look up the currently mounted usr partition.
dev=$(rootdev -s /usr)

# Repair partition table if required (e.g. the backup GPT may be out of sync)
cgpt repair "${dev}"

# Mark /usr as successfully booted (success=1, tries=0) and highest priority.
cgpt add -S1 -T0 "${dev}"
cgpt prioritize "${dev}"
