mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 22:11:59 -09:00
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 451470b7a5)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
committed by
Peter Korsgaard
parent
ae27b61496
commit
91dcb8210c
@@ -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/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-build.sh Shellcheck
|
||||||
board/lemaker/bananapro/post-image.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/minnowboard/post-build.sh Shellcheck
|
||||||
board/nexbox/a95x/post-build.sh Shellcheck
|
board/nexbox/a95x/post-build.sh Shellcheck
|
||||||
board/nexbox/a95x/post-image.sh Shellcheck
|
board/nexbox/a95x/post-image.sh Shellcheck
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ set -e
|
|||||||
DEVICE_TYPE="buildroot-x86_64"
|
DEVICE_TYPE="buildroot-x86_64"
|
||||||
ARTIFACT_NAME="1.0"
|
ARTIFACT_NAME="1.0"
|
||||||
|
|
||||||
function parse_args {
|
parse_args() {
|
||||||
local o O opts
|
local o O opts
|
||||||
o='a:o:d:'
|
o='a:o:d:'
|
||||||
O='artifact-name:,data-part-size:,device-type:'
|
O='artifact-name:,data-part-size:,device-type:'
|
||||||
@@ -28,8 +28,8 @@ function parse_args {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a persistent directory to mount the data partition at.
|
# Create a persistent directory to mount the data partition at.
|
||||||
function mender_fixup {
|
mender_fixup() {
|
||||||
pushd "${TARGET_DIR}"
|
pushd "${TARGET_DIR}"
|
||||||
if [[ -L var/lib/mender ]]; then
|
if [[ -L var/lib/mender ]]; then
|
||||||
rm var/lib/mender
|
rm var/lib/mender
|
||||||
@@ -44,7 +44,7 @@ function mender_fixup {
|
|||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
function main {
|
main() {
|
||||||
parse_args "${@}"
|
parse_args "${@}"
|
||||||
mender_fixup
|
mender_fixup
|
||||||
echo "device_type=${DEVICE_TYPE}" > "${TARGET_DIR}/etc/mender/device_type"
|
echo "device_type=${DEVICE_TYPE}" > "${TARGET_DIR}/etc/mender/device_type"
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ DATA_PART_SIZE="32M"
|
|||||||
DEVICE_TYPE="buildroot-x86_64"
|
DEVICE_TYPE="buildroot-x86_64"
|
||||||
ARTIFACT_NAME="1.0"
|
ARTIFACT_NAME="1.0"
|
||||||
|
|
||||||
|
|
||||||
# Parse arguments.
|
# Parse arguments.
|
||||||
function parse_args {
|
parse_args() {
|
||||||
local o O opts
|
local o O opts
|
||||||
o='a:o:d:'
|
o='a:o:d:'
|
||||||
O='artifact-name:,data-part-size:,device-type:'
|
O='artifact-name:,data-part-size:,device-type:'
|
||||||
@@ -32,7 +31,7 @@ function parse_args {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Create the data partition
|
# Create the data partition
|
||||||
function make_data_partition {
|
make_data_partition() {
|
||||||
"${HOST_DIR}/sbin/mkfs.ext4" \
|
"${HOST_DIR}/sbin/mkfs.ext4" \
|
||||||
-F \
|
-F \
|
||||||
-r 1 \
|
-r 1 \
|
||||||
@@ -42,9 +41,8 @@ function make_data_partition {
|
|||||||
"${BINARIES_DIR}/data-part.ext4" "${DATA_PART_SIZE}"
|
"${BINARIES_DIR}/data-part.ext4" "${DATA_PART_SIZE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Create a mender image.
|
# Create a mender image.
|
||||||
function generate_mender_image {
|
generate_mender_image() {
|
||||||
echo "Creating ${BINARIES_DIR}/${DEVICE_TYPE}-${ARTIFACT_NAME}.mender"
|
echo "Creating ${BINARIES_DIR}/${DEVICE_TYPE}-${ARTIFACT_NAME}.mender"
|
||||||
"${HOST_DIR}/bin/mender-artifact" \
|
"${HOST_DIR}/bin/mender-artifact" \
|
||||||
--compression lzma \
|
--compression lzma \
|
||||||
@@ -55,13 +53,12 @@ function generate_mender_image {
|
|||||||
-o "${BINARIES_DIR}/${DEVICE_TYPE}-${ARTIFACT_NAME}.mender"
|
-o "${BINARIES_DIR}/${DEVICE_TYPE}-${ARTIFACT_NAME}.mender"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generate_image() {
|
||||||
function generate_image {
|
|
||||||
sh support/scripts/genimage.sh -c "${BOARD_DIR}/genimage-efi.cfg"
|
sh support/scripts/genimage.sh -c "${BOARD_DIR}/genimage-efi.cfg"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Main function.
|
# Main function.
|
||||||
function main {
|
main() {
|
||||||
parse_args "${@}"
|
parse_args "${@}"
|
||||||
make_data_partition
|
make_data_partition
|
||||||
generate_image
|
generate_image
|
||||||
|
|||||||
Reference in New Issue
Block a user