浏览代码

board/mender/x86_64: clean up post build and image scripts

- Use function_name() {} instead of function function_name {}
- Use consistent double newlines between methods.
- Un-indent the comment aboe the mender_fixup method.
- Remove "Consecutive empty lines" check-package warning

Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
[Arnout: Remove "Consecutive empty lines" check-package warning]
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
(cherry picked from commit 451470b7a5f2bf26954673a87e74b580735f2d6e)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Adam Duskett 10 月之前
父节点
当前提交
91dcb8210c
共有 3 个文件被更改,包括 9 次插入13 次删除
  1. 0 1
      .checkpackageignore
  2. 4 4
      board/mender/x86_64/post-build.sh
  3. 5 8
      board/mender/x86_64/post-image-efi.sh

+ 0 - 1
.checkpackageignore

@@ -45,7 +45,6 @@ board/lego/ev3/post-image.sh Shellcheck
 board/lemaker/bananapro/patches/linux/0001-arch-arm-boot-dts-sun7i-a20-bananapro.dts-disable-00.patch lib_patch.Upstream
 board/lemaker/bananapro/post-build.sh Shellcheck
 board/lemaker/bananapro/post-image.sh Shellcheck
-board/mender/x86_64/post-image-efi.sh lib_shellscript.ConsecutiveEmptyLines
 board/minnowboard/post-build.sh Shellcheck
 board/nexbox/a95x/post-build.sh Shellcheck
 board/nexbox/a95x/post-image.sh Shellcheck

+ 4 - 4
board/mender/x86_64/post-build.sh

@@ -3,7 +3,7 @@ set -e
 DEVICE_TYPE="buildroot-x86_64"
 ARTIFACT_NAME="1.0"
 
-function parse_args {
+parse_args() {
     local o O opts
     o='a:o:d:'
     O='artifact-name:,data-part-size:,device-type:'
@@ -28,8 +28,8 @@ function parse_args {
     done
 }
 
-  # Create a persistent directory to mount the data partition at.
-function mender_fixup {
+# Create a persistent directory to mount the data partition at.
+mender_fixup() {
     pushd "${TARGET_DIR}"
     if [[ -L var/lib/mender ]]; then
         rm var/lib/mender
@@ -44,7 +44,7 @@ function mender_fixup {
     popd
 }
 
-function main {
+main() {
     parse_args "${@}"
     mender_fixup
     echo "device_type=${DEVICE_TYPE}" > "${TARGET_DIR}/etc/mender/device_type"

+ 5 - 8
board/mender/x86_64/post-image-efi.sh

@@ -5,9 +5,8 @@ DATA_PART_SIZE="32M"
 DEVICE_TYPE="buildroot-x86_64"
 ARTIFACT_NAME="1.0"
 
-
 # Parse arguments.
-function parse_args {
+parse_args() {
     local o O opts
     o='a:o:d:'
     O='artifact-name:,data-part-size:,device-type:'
@@ -32,7 +31,7 @@ function parse_args {
 }
 
 # Create the data partition
-function make_data_partition {
+make_data_partition() {
     "${HOST_DIR}/sbin/mkfs.ext4" \
         -F \
         -r 1 \
@@ -42,9 +41,8 @@ function make_data_partition {
         "${BINARIES_DIR}/data-part.ext4" "${DATA_PART_SIZE}"
 }
 
-
 # Create a mender image.
-function generate_mender_image {
+generate_mender_image() {
     echo "Creating ${BINARIES_DIR}/${DEVICE_TYPE}-${ARTIFACT_NAME}.mender"
     "${HOST_DIR}/bin/mender-artifact" \
         --compression lzma \
@@ -55,13 +53,12 @@ function generate_mender_image {
         -o "${BINARIES_DIR}/${DEVICE_TYPE}-${ARTIFACT_NAME}.mender"
 }
 
-
-function generate_image {
+generate_image() {
     sh support/scripts/genimage.sh -c "${BOARD_DIR}/genimage-efi.cfg"
 }
 
 # Main function.
-function main {
+main() {
     parse_args "${@}"
     make_data_partition
     generate_image