Browse Source

Reformat: All files with shfmt

Changelog: None
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
2.4.x
Ole Petter 4 years ago
parent
commit
ae6a9e1b03
No known key found for this signature in database GPG Key ID: A7100375167A7B21
  1. 1
      configs/mender_convert_config
  2. 1
      modules/config.sh
  3. 13
      modules/disk.sh
  4. 1
      modules/git.sh
  5. 3
      modules/log.sh
  6. 8
      modules/probe.sh

1
configs/mender_convert_config

@ -32,7 +32,6 @@ MENDER_ARTIFACT_COMPRESSION="gzip"
# this.
MENDER_ENABLE_SYSTEMD=y
# Custom mkfs options for creating the rootfs partition
MENDER_ROOT_PART_MKFS_OPTS=""

1
modules/config.sh

@ -21,7 +21,6 @@ for config in "${configs[@]}"; do
source "${config}"
done
# Fine grained partition variables override device/number variables where applicable
disk_override_partition_variable "MENDER_BOOT_PART_NUMBER" "${MENDER_BOOT_PART}"
disk_override_partition_variable "MENDER_ROOTFS_PART_A_NUMBER" "${MENDER_ROOTFS_PART_A}"

13
modules/disk.sh

@ -48,9 +48,8 @@ disk_get_part_value() {
#
# $1 - path to disk image
disk_get_part_nums() {
partx --show $1 | tail -n +2 |
while read line
do
partx --show $1 | tail -n +2 \
| while read line; do
echo $line | awk '{printf "%d\n", $1}'
done
}
@ -185,7 +184,6 @@ disk_root_part() {
echo "${root_part}"
}
# Check if supplied argument is valid partuuid device path.
# Supports both dos and gpt paths
#
@ -194,7 +192,6 @@ disk_is_valid_partuuid_device() {
disk_is_valid_partuuid_gpt_device "$1" || disk_is_valid_partuuid_dos_device "$1"
}
# Check if supplied argument is valid gpt partuuid device path.
#
# Example: /dev/disk/by-partuuid/26445670-f37c-408b-be2c-3ef419866620
@ -204,7 +201,6 @@ disk_is_valid_partuuid_gpt_device() {
echo "${1}" | grep -qE '^/dev/disk/by-partuuid/([0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12})$'
}
# Check if supplied argument is valid dos partuuid device path.
#
# Example: /dev/disk/by-partuuid/26445670-01
@ -214,7 +210,6 @@ disk_is_valid_partuuid_dos_device() {
echo "${1}" | grep -qE '^/dev/disk/by-partuuid/[0-9a-f]{8}-[0-9a-f]{2}$'
}
# Get partuuid from supplied device path.
# Supports both dos and gpt paths
#
@ -226,7 +221,6 @@ disk_get_partuuid_from_device() {
echo "${1}" | sed "s:/dev/disk/by-partuuid/::"
}
# Get dos disk identifier from supplied device path.
#
# $1 - dos compatible partuuid device path
@ -238,7 +232,6 @@ disk_get_partuuid_dos_diskid_from_device() {
echo "$partuuid" | cut -d- -f1
}
# Get dos partuuid number from supplied device path.
#
# $1 - dos compatible partuuid device path
@ -283,7 +276,6 @@ disk_root_part_b_device() {
disk_get_part_device "${MENDER_ROOTFS_PART_B_NUMBER}" "MENDER_ROOTFS_PART_B"
}
# Get device partition number from device path.
# Unrecognized or unsupported device paths will generate an error
#
@ -350,7 +342,6 @@ disk_get_device_base() {
fi
}
# Conditionally redefine partition number/device if fine grained variable set.
#
# $1 - variable name

1
modules/git.sh

@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Print the mender convert version
#
git_mender_convert_version() {

3
modules/log.sh

@ -18,7 +18,6 @@
# from sub-directories
log_file="${MENDER_CONVERT_LOG_FILE:-${PWD}/work/convert.log}"
# Add some colour to the log messages
YELLOW='\033[1;33m' # Warning
@ -33,7 +32,7 @@ function log {
local -r timestamp=$(date +"%Y-%m-%d %H:%M:%S")
local -r script_name="$(basename "$0")"
echo -e "${timestamp} [${level}] [$script_name] ${message}" >> ${log_file}
>&2 echo -e "${timestamp} [${level}] [$script_name] ${message}"
echo >&2 -e "${timestamp} [${level}] [$script_name] ${message}"
}
function local_log_debug {

8
modules/probe.sh

@ -213,9 +213,9 @@ probe_kernel_in_boot_and_root() {
if [ -n "${kernel_imagetype_path}" ] && [ "${boot}" == "work/boot" ]; then
log_info "Found Linux kernel image in boot part, moving to rootfs/boot"
sudo cp ${kernel_imagetype_path} work/rootfs/boot
break;
break
elif [ -n "${kernel_imagetype_path}" ]; then
break;
break
fi
done
@ -252,9 +252,9 @@ probe_initrd_in_boot_and_root() {
initrd_image_path=$(probe_initrd_image ${boot})
if [ -n "${initrd_image_path}" ] && [ "${boot}" == "work/boot" ]; then
sudo cp ${initrd_image_path} work/rootfs/boot
break;
break
elif [ -n "${initrd_image_path}" ]; then
break;
break
fi
done

Loading…
Cancel
Save