Browse Source

Merge pull request #141 from oleorhagen/shellcheck

Shellcheck
2.0.x
oleorhagen 5 years ago
committed by GitHub
parent
commit
222d52d834
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      mender-convert
  2. 2
      mender-convert-extract
  3. 2
      mender-convert-modify
  4. 6
      mender-convert-package
  5. 2
      modules/disk.sh
  6. 4
      modules/probe.sh
  7. 2
      scripts/run-tests.sh

4
mender-convert

@ -67,7 +67,7 @@ while (( "$#" )); do
exit 0 exit 0
;; ;;
*) *)
break; break
;; ;;
esac esac
done done
@ -82,7 +82,7 @@ if [ -z "${MENDER_ARTIFACT_NAME}" ]; then
echo "Sorry, it seems that you have not defined MENDER_ARTIFACT_NAME" echo "Sorry, it seems that you have not defined MENDER_ARTIFACT_NAME"
echo "You can do this with the following command:" echo "You can do this with the following command:"
echo "" echo ""
echo -e "\tMENDER_ARTIFACT_NAME="release-1" ./mender-convert" echo -e "\tMENDER_ARTIFACT_NAME=\"release-1\" ./mender-convert"
exit 1 exit 1
fi fi

2
mender-convert-extract

@ -1,4 +1,4 @@
#!/bin/bash #! /usr/bin/env bash
# #
# Copyright 2019 Northern.tech AS # Copyright 2019 Northern.tech AS
# #

2
mender-convert-modify

@ -1,4 +1,4 @@
#!/bin/bash #! /usr/bin/env bash
# #
# Copyright 2019 Northern.tech AS # Copyright 2019 Northern.tech AS
# #

6
mender-convert-package

@ -1,4 +1,4 @@
#!/bin/bash #! /usr/bin/env bash
# #
# Copyright 2019 Northern.tech AS # Copyright 2019 Northern.tech AS
# #
@ -129,8 +129,8 @@ fi
boot_part_sectors=$(disk_align_sectors ${boot_part_sectors} ${MENDER_PARTITION_ALIGNMENT} ) boot_part_sectors=$(disk_align_sectors ${boot_part_sectors} ${MENDER_PARTITION_ALIGNMENT} )
# Calculate rootfs size # Calculate rootfs size
rootfs_part_sectors=$(( (${disk_image_total_sectors} - ${data_part_sectors} \ rootfs_part_sectors=$(((${disk_image_total_sectors} - ${data_part_sectors} - \
- ${boot_part_sectors} - ${overhead_sectors}) / 2 )) ${boot_part_sectors} - ${overhead_sectors}) / 2))
# Make sure rootfs size is aligned to MENDER_PARTITION_ALIGNMENT # Make sure rootfs size is aligned to MENDER_PARTITION_ALIGNMENT
rootfs_part_sectors=$(disk_align_sectors ${rootfs_part_sectors} ${MENDER_PARTITION_ALIGNMENT} ) rootfs_part_sectors=$(disk_align_sectors ${rootfs_part_sectors} ${MENDER_PARTITION_ALIGNMENT} )

2
modules/disk.sh

@ -75,7 +75,6 @@ disk_sectors_to_mb() {
echo "$(( (${1} * 512) / 1024 / 1024 ))" echo "$(( (${1} * 512) / 1024 / 1024 ))"
} }
# Align value (result is number of 512 sectors) # Align value (result is number of 512 sectors)
# #
# $1 - value to align (number of 512 sectors) # $1 - value to align (number of 512 sectors)
@ -129,6 +128,7 @@ disk_create_file_system_from_folder() {
;; ;;
*) *)
log_fatal "Unknown file system type specified: ${4}" log_fatal "Unknown file system type specified: ${4}"
;;
esac esac
run_and_log_cmd "mkdir -p work/output" run_and_log_cmd "mkdir -p work/output"

4
modules/probe.sh

@ -65,6 +65,7 @@ probe_grub_efi_name() {
;; ;;
*) *)
log_fatal "Unknown arch: ${arch}" log_fatal "Unknown arch: ${arch}"
;;
esac esac
echo "$efi_name" echo "$efi_name"
} }
@ -88,6 +89,7 @@ probe_debian_arch_name() {
;; ;;
*) *)
log_fatal "Unknown arch: ${arch}" log_fatal "Unknown arch: ${arch}"
;;
esac esac
echo "${deb_arch}" echo "${deb_arch}"
} }
@ -113,6 +115,7 @@ probe_grub_efi_target_name() {
;; ;;
*) *)
log_fatal "Unknown arch: ${arch}" log_fatal "Unknown arch: ${arch}"
;;
esac esac
echo "$efi_target_name" echo "$efi_target_name"
} }
@ -163,7 +166,6 @@ probe_initrd_image() {
echo "${initrd_image_path}" echo "${initrd_image_path}"
} }
# Prints Linux kernel image name # Prints Linux kernel image name
# #
# It will look for it in both boot and rootfs parts. If image is only present # It will look for it in both boot and rootfs parts. If image is only present

2
scripts/run-tests.sh

@ -59,11 +59,11 @@ convert_and_test() {
*) *)
echo "Unknown image type: ${image_name_compressed}" echo "Unknown image type: ${image_name_compressed}"
exit 1 exit 1
;;
esac esac
rm -f ${WORKSPACE}/test_config rm -f ${WORKSPACE}/test_config
# Two motives for the following statement # Two motives for the following statement
# #
# - speed up tests by avoiding decompression on all images (majority of images # - speed up tests by avoiding decompression on all images (majority of images

Loading…
Cancel
Save