| #!/bin/sh |
| |
| # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # This script is called after an AutoUpdate or USB install. This script is a |
| # simple wrapper to convert from the hardcoded command line to the new |
| # executable command line. |
| |
| INSTALL_ROOT=$(dirname "$0") |
| |
| # Set up the mount points userland needs/expects. |
| MOUNTS="/proc /dev /sys /tmp /run /var /mnt/stateful_partition" |
| |
| cleanup() { |
| local d |
| for d in ${MOUNTS}; do |
| umount -lf "./${d}" || : |
| done |
| } |
| |
| main() { |
| cd "${INSTALL_ROOT}" || exit 1 |
| |
| trap cleanup EXIT |
| |
| local d |
| for d in ${MOUNTS}; do |
| mount -n --bind "${d}" "./${d}" |
| done |
| |
| chroot . /usr/bin/cros_installer postinst "/" "$@" |
| } |
| main "$@" |