mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 05:26:58 +02:00
cgpt_shell: avoid bash
This script gets run on the target, so we need to avoid bash. BUG=chromium-os:34715 TEST=build_image works Change-Id: Ib64036246149b8b98414e4434ed89a3a40c2f693 Reviewed-on: https://gerrit.chromium.org/gerrit/33911 Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
89b8a8bf85
commit
e82e99e999
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
# 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
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
# found in the LICENSE file.
|
# found in the LICENSE file.
|
||||||
@ -6,11 +6,12 @@
|
|||||||
# This script is automatically generated by @SCRIPT_GENERATOR@
|
# This script is automatically generated by @SCRIPT_GENERATOR@
|
||||||
# Do not edit!
|
# Do not edit!
|
||||||
|
|
||||||
if ! type numsectors &>/dev/null; then
|
if ! type numsectors >/dev/null 2>&1; then
|
||||||
if [[ -f "/usr/sbin/chromeos-common.sh" ]]; then
|
if [ -f "/usr/sbin/chromeos-common.sh" ]; then
|
||||||
. "/usr/sbin/chromeos-common.sh"
|
. "/usr/sbin/chromeos-common.sh"
|
||||||
else
|
else
|
||||||
die "Can't load chromeos-common.sh, dying!"
|
echo "Can't load chromeos-common.sh, dying!" 1>&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
locate_gpt
|
locate_gpt
|
||||||
@ -22,13 +23,13 @@ create_image() {
|
|||||||
local dev=$1
|
local dev=$1
|
||||||
local min_disk_size=$2
|
local min_disk_size=$2
|
||||||
local block_size=$3
|
local block_size=$3
|
||||||
if [[ -b "${dev}" ]]; then
|
if [ -b "${dev}" ]; then
|
||||||
# Zap any old partitions (otherwise gpt complains).
|
# Zap any old partitions (otherwise gpt complains).
|
||||||
dd if=/dev/zero of="${dev}" conv=notrunc bs=512 count=32
|
dd if=/dev/zero of="${dev}" conv=notrunc bs=512 count=32
|
||||||
dd if=/dev/zero of="${dev}" conv=notrunc bs=512 \
|
dd if=/dev/zero of="${dev}" conv=notrunc bs=512 \
|
||||||
seek=$((${min_disk_size} - 1 - 33)) count=33
|
seek=$((${min_disk_size} - 1 - 33)) count=33
|
||||||
else
|
else
|
||||||
if [[ ! -e "${dev}" ]]; then
|
if [ ! -e "${dev}" ]; then
|
||||||
dd if=/dev/zero of="${dev}" bs=${block_size} count=1 \
|
dd if=/dev/zero of="${dev}" bs=${block_size} count=1 \
|
||||||
seek=$((${min_disk_size} - 1))
|
seek=$((${min_disk_size} - 1))
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user