| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 The Chromium 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 # This script is used to generate an HFS file system with several types of | 7 # This script is used to generate an HFS file system with several types of |
| 8 # files of different sizes. | 8 # files of different sizes. |
| 9 | 9 |
| 10 set -eu | 10 set -eu |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 exit 1 | 26 exit 1 |
| 27 fi | 27 fi |
| 28 | 28 |
| 29 if [[ ! $OUT_FILE ]]; then | 29 if [[ ! $OUT_FILE ]]; then |
| 30 echo "Need to specify a destination filename." | 30 echo "Need to specify a destination filename." |
| 31 exit 1 | 31 exit 1 |
| 32 fi | 32 fi |
| 33 | 33 |
| 34 RAMDISK_VOLUME=$(hdiutil attach -nomount ram://$RAMDISK_SIZE) | 34 RAMDISK_VOLUME=$(hdiutil attach -nomount ram://$RAMDISK_SIZE) |
| 35 diskutil erasevolume "${FILESYSTEM_TYPE}" "${VOLUME_NAME}" ${RAMDISK_VOLUME} | 35 diskutil erasevolume "${FILESYSTEM_TYPE}" "${VOLUME_NAME}" ${RAMDISK_VOLUME} |
| 36 diskutil mount ${RAMDISK_VOLUME} |
| 36 | 37 |
| 37 pushd "/Volumes/${VOLUME_NAME}" | 38 pushd "/Volumes/${VOLUME_NAME}" |
| 38 | 39 |
| 39 touch .metadata_never_index | 40 touch .metadata_never_index |
| 40 | 41 |
| 41 mkdir -p first/second/third/fourth/fifth | 42 mkdir -p first/second/third/fourth/fifth |
| 42 | 43 |
| 43 pushd first | 44 pushd first |
| 44 pushd second | 45 pushd second |
| 45 pushd third | 46 pushd third |
| (...skipping 24 matching lines...) Expand all Loading... |
| 70 | 71 |
| 71 echo "This is a test HFS+ filesystem generated by" \ | 72 echo "This is a test HFS+ filesystem generated by" \ |
| 72 "chrome/test/data/safe_browsing/dmg/make_hfs.sh." > README.txt | 73 "chrome/test/data/safe_browsing/dmg/make_hfs.sh." > README.txt |
| 73 | 74 |
| 74 popd # Original PWD | 75 popd # Original PWD |
| 75 | 76 |
| 76 # Unmount the volume, copy the raw device to a file, and then destroy it. | 77 # Unmount the volume, copy the raw device to a file, and then destroy it. |
| 77 diskutil unmount force ${RAMDISK_VOLUME} | 78 diskutil unmount force ${RAMDISK_VOLUME} |
| 78 dd if=${RAMDISK_VOLUME} of="${OUT_FILE}" &> /dev/null | 79 dd if=${RAMDISK_VOLUME} of="${OUT_FILE}" &> /dev/null |
| 79 diskutil eject ${RAMDISK_VOLUME} | 80 diskutil eject ${RAMDISK_VOLUME} |
| OLD | NEW |