Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
boot-deploy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Reidel
boot-deploy
Commits
8e2d2379
Unverified
Commit
8e2d2379
authored
10 months ago
by
Clayton Craft
Browse files
Options
Downloads
Patches
Plain Diff
check_image_size: add new function for comparing image and block dev sizes (MR 64)
parent
08d14208
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
boot-deploy-functions.sh
+23
-0
23 additions, 0 deletions
boot-deploy-functions.sh
with
23 additions
and
0 deletions
boot-deploy-functions.sh
+
23
−
0
View file @
8e2d2379
...
...
@@ -375,6 +375,29 @@ append_or_copy_dtb() {
done
}
# Compare the given image to the given partition size. Returns true/0 if the
# image is smaller than the partition, else returns false/1.
# $1: image file
# $2: partition / block device
check_image_size
()
{
local
img
=
"
$1
"
local
part
=
"
$2
"
local
img_size
# note: using 'du' instead of get_size_of_files since the function returns
# KiB and lsblk returns bytes, it saves us a conversion step
img_size
=
"
$(
du
-b
"
$img
"
|
cut
-f1
)
"
local
part_size
part_size
=
"
$(
lsblk
"
$part
"
--noheadings
--bytes
--output
size
)
"
if
[
"
$img_size
"
-gt
"
$part_size
"
]
;
then
log
"ERROR: The
$img
size (
$img_size
bytes) is greater than the
$part
size (
$part_size
bytes)"
return
1
fi
return
0
}
# Add MediaTek header to kernel and/or initramfs
add_mtk_header
()
{
local
_kernel_label
=
""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment