OLD | NEW |
---|---|
1 #!/bin/sh -x | 1 #!/bin/sh -x |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 # /init script for use in factory install shim. Requires busybox in | 7 # /init script for use in factory install shim. Requires busybox in |
8 # /bin/busybox, and a symlink from /bin/sh -> busybox. | 8 # /bin/busybox, and a symlink from /bin/sh -> busybox. |
9 | 9 |
10 # USB card partition and mount point. | 10 # USB card partition and mount point. |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
300 log "Copying usb->tmpfs..." | 300 log "Copying usb->tmpfs..." |
301 (cd "${USB_MNT}" ; tar cf - . | (cd "${NEWROOT_MNT}" && tar xf -)) | 301 (cd "${USB_MNT}" ; tar cf - . | (cd "${NEWROOT_MNT}" && tar xf -)) |
302 RES=$? | 302 RES=$? |
303 log "Copy returned with result $RES" | 303 log "Copy returned with result $RES" |
304 return $RES | 304 return $RES |
305 } | 305 } |
306 | 306 |
307 copy_lsb() { | 307 copy_lsb() { |
308 STATEFUL_LSB="dev_image/etc/lsb-factory" | 308 STATEFUL_LSB="dev_image/etc/lsb-factory" |
309 mkdir -p "${NEWROOT_MNT}/mnt/stateful_partition/dev_image/etc" | 309 mkdir -p "${NEWROOT_MNT}/mnt/stateful_partition/dev_image/etc" |
310 # Mounting ext3 as ext2 since the journal is unneeded in ro. | 310 # Mounting ext3 as ext2 since the journal is unneeded in ro. |
jglasgow
2011/03/07 17:02:59
This comment is no longer relevant
| |
311 if ! mount -n -o ro -t ext2 "${STATE_DEV}" "${STATEFUL_MNT}"; then | 311 if ! mount -n "${STATE_DEV}" "${STATEFUL_MNT}"; then |
312 log "Failed to mount ${STATE_DEV}!! Failing." | 312 log "Failed to mount ${STATE_DEV}!! Failing." |
313 return 1 | 313 return 1 |
314 fi | 314 fi |
315 if [ -f "${STATEFUL_MNT}/${STATEFUL_LSB}" ]; then | 315 if [ -f "${STATEFUL_MNT}/${STATEFUL_LSB}" ]; then |
316 log "Found ${STATEFUL_MNT}/${STATEFUL_LSB}" | 316 log "Found ${STATEFUL_MNT}/${STATEFUL_LSB}" |
317 cp -a "${STATEFUL_MNT}/${STATEFUL_LSB}" \ | 317 cp -a "${STATEFUL_MNT}/${STATEFUL_LSB}" \ |
318 "${NEWROOT_MNT}/mnt/stateful_partition/${STATEFUL_LSB}" | 318 "${NEWROOT_MNT}/mnt/stateful_partition/${STATEFUL_LSB}" |
319 else | 319 else |
320 log "Failed to find ${STATEFUL_MNT}/${STATEFUL_LSB}!! Failing." | 320 log "Failed to find ${STATEFUL_MNT}/${STATEFUL_LSB}!! Failing." |
321 umount "$STATEFUL_MNT" | 321 umount "$STATEFUL_MNT" |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
813 exit 0 | 813 exit 0 |
814 } | 814 } |
815 | 815 |
816 # Make this source-able for testing. | 816 # Make this source-able for testing. |
817 if [ "$0" = "/init" ]; then | 817 if [ "$0" = "/init" ]; then |
818 main "$@" | 818 main "$@" |
819 # Should never reach here. | 819 # Should never reach here. |
820 exit 1 | 820 exit 1 |
821 fi | 821 fi |
822 | 822 |
OLD | NEW |