OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 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 # Script to generate a factory install partition set and miniomaha.conf | 7 # Script to generate a factory install partition set and miniomaha.conf |
8 # file from a release image and a factory image. This creates a server | 8 # file from a release image and a factory image. This creates a server |
9 # configuration that can be installed using a factory install shim. | 9 # configuration that can be installed using a factory install shim. |
10 # | 10 # |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 "$(stat -c %s ${outdev})" != "$(( ${sectors} * 512 ))" -o \ | 103 "$(stat -c %s ${outdev})" != "$(( ${sectors} * 512 ))" -o \ |
104 "$FLAGS_preserve" = "$FLAGS_FALSE" ]; then | 104 "$FLAGS_preserve" = "$FLAGS_FALSE" ]; then |
105 echo "Generating empty image file" | 105 echo "Generating empty image file" |
106 image_dump_partial_file /dev/zero 0 "${sectors}" | | 106 image_dump_partial_file /dev/zero 0 "${sectors}" | |
107 dd of="${outdev}" bs=8M | 107 dd of="${outdev}" bs=8M |
108 else | 108 else |
109 echo "Reusing $outdev" | 109 echo "Reusing $outdev" |
110 fi | 110 fi |
111 | 111 |
112 # Create GPT partition table. | 112 # Create GPT partition table. |
| 113 locate_gpt |
113 install_gpt "${outdev}" 0 0 "${pmbrcode}" 0 "${force_full}" | 114 install_gpt "${outdev}" 0 0 "${pmbrcode}" 0 "${force_full}" |
114 # Activate the correct partition. | 115 # Activate the correct partition. |
115 cgpt add -i 2 -S 1 -P 1 "${outdev}" | 116 sudo "${GPT}" add -i 2 -S 1 -P 1 "${outdev}" |
116 } | 117 } |
117 | 118 |
118 prepare_omaha() { | 119 prepare_omaha() { |
119 sudo rm -rf "${OMAHA_DATA_DIR}/rootfs-test.gz" | 120 sudo rm -rf "${OMAHA_DATA_DIR}/rootfs-test.gz" |
120 sudo rm -rf "${OMAHA_DATA_DIR}/rootfs-release.gz" | 121 sudo rm -rf "${OMAHA_DATA_DIR}/rootfs-release.gz" |
121 rm -rf "${OMAHA_DATA_DIR}/efi.gz" | 122 rm -rf "${OMAHA_DATA_DIR}/efi.gz" |
122 rm -rf "${OMAHA_DATA_DIR}/oem.gz" | 123 rm -rf "${OMAHA_DATA_DIR}/oem.gz" |
123 rm -rf "${OMAHA_DATA_DIR}/state.gz" | 124 rm -rf "${OMAHA_DATA_DIR}/state.gz" |
124 if [ ! -d "${OMAHA_DATA_DIR}" ]; then | 125 if [ ! -d "${OMAHA_DATA_DIR}" ]; then |
125 mkdir -p "${OMAHA_DATA_DIR}" | 126 mkdir -p "${OMAHA_DATA_DIR}" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 To run the server: | 359 To run the server: |
359 python2.6 devserver.py --factory_config miniomaha.conf" | 360 python2.6 devserver.py --factory_config miniomaha.conf" |
360 } | 361 } |
361 | 362 |
362 # Main | 363 # Main |
363 if [ -n "$FLAGS_diskimg" ]; then | 364 if [ -n "$FLAGS_diskimg" ]; then |
364 generate_img | 365 generate_img |
365 else | 366 else |
366 generate_omaha | 367 generate_omaha |
367 fi | 368 fi |
OLD | NEW |