Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IOWRT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue 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
IOPSYS
IOWRT
Commits
77265e00
Commit
77265e00
authored
8 years ago
by
Felix Fietkau
Browse files
Options
Downloads
Patches
Plain Diff
build: add support code for appending metadata to images
Signed-off-by:
Felix Fietkau
<
nbd@nbd.name
>
parent
cc853810
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/image-commands.mk
+18
-0
18 additions, 0 deletions
include/image-commands.mk
include/image.mk
+4
-1
4 additions, 1 deletion
include/image.mk
with
22 additions
and
1 deletion
include/image-commands.mk
+
18
−
0
View file @
77265e00
...
...
@@ -172,3 +172,21 @@ define Build/sysupgrade-tar
--rootfs
$(
call
param_get_default,rootfs,
$(
1
)
,
$(
IMAGE_ROOTFS
))
\
$@
endef
json_quote
=
$(
subst
','
\'
',
$(
subst ",\",
$(
1
)))
#")')
metadata_devices
=
$(
if
$(
1
)
,
$(
subst "
$(
space
)
","
$(
comma
)
",
$(
strip
$(
foreach v,
$(
1
)
,"
$(
call json_quote,
$(
v
))
"
))))
metadata_json
=
\
'
{
$(
if
$(
IMAGE_METADATA
)
,
$(
IMAGE_METADATA
)$(
comma
))
\
"supported_devices"
:[
$(
call metadata_devices,
$(
1
))
]
,
\
"version"
:
{
\
"dist"
:
"
$(
call json_quote,
$(
VERSION_DIST
))
"
,
\
"version"
:
"
$(
call json_quote,
$(
VERSION_NUMBER
))
"
,
\
"revision"
:
"
$(
call json_quote,
$(
REVISION
))
"
,
\
"board"
:
"
$(
call json_quote,
$(
BOARD
))
"
\
}
\
}
'
define
Build/append-metadata
$(
if
$(
SUPPORTED_DEVICES
)
,echo
$(
call metadata_json,
$(
SUPPORTED_DEVICES
))
| fwtool -I - $@
)
endef
This diff is collapsed.
Click to expand it.
include/image.mk
+
4
−
1
View file @
77265e00
...
...
@@ -346,6 +346,8 @@ define Device/Init
BOARD_NAME
:=
UIMAGE_NAME
:=
SUPPORTED_DEVICES
:=
IMAGE_METADATA
:=
FILESYSTEMS
:=
$(
TARGET_FILESYSTEMS
)
endef
...
...
@@ -355,7 +357,8 @@ DEFAULT_DEVICE_VARS := \
DEVICE_DTS DEVICE_DTS_DIR BOARD_NAME CMDLINE
\
UBOOTENV_IN_UBI KERNEL_IN_UBI
\
BLOCKSIZE PAGESIZE SUBPAGESIZE VID_HDR_OFFSET
\
UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS
UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS
\
SUPPORTED_DEVICES IMAGE_METADATA
define
Device/ExportVar
$(1)
:
$(2):=$$($(2))
...
...
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