mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-29 06:21:46 +01:00
Change script style for ARCH comparisons to double-bracket bash style
BUG=none TEST=test setup_board, build_packages, build_image, image_to_vm, on x86-generic and amd64-generic Change-Id: I43d9d8e6e0e48cbce4d0086b78721ed86b120d4a Reviewed-on: http://gerrit.chromium.org/gerrit/10209 Reviewed-by: Vince Laviano <vlaviano@chromium.org> Commit-Ready: Sonny Rao <sonnyrao@chromium.org> Tested-by: Sonny Rao <sonnyrao@chromium.org>
This commit is contained in:
parent
1261bc5886
commit
3163cf0605
@ -273,7 +273,7 @@ make_image_bootable() {
|
|||||||
esp_size=$((esp_size * 512)) # sectors to bytes
|
esp_size=$((esp_size * 512)) # sectors to bytes
|
||||||
local bootloader_to_flags="--to_offset=${esp_offset} --to_size=${esp_size}"
|
local bootloader_to_flags="--to_offset=${esp_offset} --to_size=${esp_size}"
|
||||||
|
|
||||||
if [ "${FLAGS_arch}" = "x86" -o "${FLAGS_arch}" = "amd64" ]; then
|
if [[ "${FLAGS_arch}" = "x86" || "${FLAGS_arch}" = "amd64" ]]; then
|
||||||
# Use the kernel partition to acquire configuration flags.
|
# Use the kernel partition to acquire configuration flags.
|
||||||
kernel_part="--kernel_partition='${FLAGS_output_dir}/vmlinuz.image'"
|
kernel_part="--kernel_partition='${FLAGS_output_dir}/vmlinuz.image'"
|
||||||
# Install syslinux on the EFI System Partition.
|
# Install syslinux on the EFI System Partition.
|
||||||
|
|||||||
@ -148,7 +148,7 @@ EOF
|
|||||||
WORK="${WORK} ${FLAGS_working_dir}/boot.config"
|
WORK="${WORK} ${FLAGS_working_dir}/boot.config"
|
||||||
info "Emitted cross-platform boot params to ${FLAGS_working_dir}/boot.config"
|
info "Emitted cross-platform boot params to ${FLAGS_working_dir}/boot.config"
|
||||||
|
|
||||||
if [ "${FLAGS_arch}" = "x86" -o "${FLAGS_arch}" = "amd64" ]; then
|
if [[ "${FLAGS_arch}" = "x86" || "${FLAGS_arch}" = "amd64" ]]; then
|
||||||
# Legacy BIOS will use the kernel in the rootfs (via syslinux), as will
|
# Legacy BIOS will use the kernel in the rootfs (via syslinux), as will
|
||||||
# standard EFI BIOS (via grub, from the EFI System Partition). Chrome OS
|
# standard EFI BIOS (via grub, from the EFI System Partition). Chrome OS
|
||||||
# BIOS will use a separate signed kernel partition, which we'll create now.
|
# BIOS will use a separate signed kernel partition, which we'll create now.
|
||||||
|
|||||||
@ -47,7 +47,7 @@ build_gpt() {
|
|||||||
local pmbr_img
|
local pmbr_img
|
||||||
if [ "$ARCH" = "arm" ]; then
|
if [ "$ARCH" = "arm" ]; then
|
||||||
pmbr_img=/dev/zero
|
pmbr_img=/dev/zero
|
||||||
elif [ "$ARCH" = "x86" -o "$ARCH" = "amd64" ]; then
|
elif [[ "$ARCH" = "x86" || "$ARCH" = "amd64" ]]; then
|
||||||
pmbr_img=$(readlink -f /usr/share/syslinux/gptmbr.bin)
|
pmbr_img=$(readlink -f /usr/share/syslinux/gptmbr.bin)
|
||||||
else
|
else
|
||||||
error "Unknown architecture: $ARCH"
|
error "Unknown architecture: $ARCH"
|
||||||
|
|||||||
@ -55,7 +55,7 @@ verity_common="${verity_common} dm_verity.dev_wait=${dev_wait}"
|
|||||||
# Populate the x86 rootfs to support legacy and EFI bios config templates.
|
# Populate the x86 rootfs to support legacy and EFI bios config templates.
|
||||||
# The templates are used by the installer to populate partition 12 with
|
# The templates are used by the installer to populate partition 12 with
|
||||||
# the correct bootloader configuration.
|
# the correct bootloader configuration.
|
||||||
if [ "${FLAGS_arch}" = "x86" -o "${FLAGS_arch}" = "amd64" ]; then
|
if [[ "${FLAGS_arch}" = "x86" || "${FLAGS_arch}" = "amd64" ]]; then
|
||||||
# TODO: For some reason the /dev/disk/by-uuid is not being generated by udev
|
# TODO: For some reason the /dev/disk/by-uuid is not being generated by udev
|
||||||
# in the initramfs. When we figure that out, switch to root=UUID=${UUID}.
|
# in the initramfs. When we figure that out, switch to root=UUID=${UUID}.
|
||||||
sudo mkdir -p ${FLAGS_to}
|
sudo mkdir -p ${FLAGS_to}
|
||||||
|
|||||||
@ -189,7 +189,7 @@ cleanup() {
|
|||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
sudo mount "${ESP_DEV}" "${ESP_FS_DIR}"
|
sudo mount "${ESP_DEV}" "${ESP_FS_DIR}"
|
||||||
|
|
||||||
if [ "${FLAGS_arch}" = "x86" -o "${FLAGS_arch}" = "amd64" ]; then
|
if [[ "${FLAGS_arch}" = "x86" || "${FLAGS_arch}" = "amd64" ]]; then
|
||||||
# Populate the EFI bootloader configuration
|
# Populate the EFI bootloader configuration
|
||||||
sudo mkdir -p "${ESP_FS_DIR}/efi/boot"
|
sudo mkdir -p "${ESP_FS_DIR}/efi/boot"
|
||||||
sudo cp "${FLAGS_from}"/efi/boot/bootx64.efi \
|
sudo cp "${FLAGS_from}"/efi/boot/bootx64.efi \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user