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>
This commit is contained in:
Adam Duskett
2024-10-08 09:33:00 +02:00
committed by Arnout Vandecappelle
parent aa3ba97554
commit 451470b7a5
3 changed files with 9 additions and 13 deletions

View File

@@ -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"

View File

@@ -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