Skip to content

Commit 44436d8

Browse files
ConnorRigbyfhunleth
authored andcommitted
fwup: Consolodate duplicate metadata into fwup_include/fwup-common.conf
Signed-off-by: Connor Rigby <[email protected]>
1 parent 79ad69a commit 44436d8

File tree

3 files changed

+74
-137
lines changed

3 files changed

+74
-137
lines changed

fwup-ops.conf

+1-65
Original file line numberDiff line numberDiff line change
@@ -16,74 +16,10 @@
1616
# build process. The file is stored in `/usr/share/fwup/ops.fw`.
1717
# 2. On the device, run `fwup -t <task> -d /dev/rootdisk0 --enable-trim /usr/share/fwup/ops.fw`.
1818
# 3. Reboot after running `revert` or `factory-reset`.
19-
#
20-
# It is critical that this is kept in sync with the main fwup.conf.
2119

2220
require-fwup-version="1.0.0"
2321

24-
#
25-
# Firmware metadata
26-
#
27-
28-
# All of these can be overriden using environment variables of the same name.
29-
#
30-
# Run 'fwup -m' to query values in a .fw file.
31-
# Use 'fw_printenv' to query values on the target.
32-
#
33-
# These are used by Nerves libraries to introspect.
34-
define(NERVES_FW_PRODUCT, "Nerves Firmware")
35-
define(NERVES_FW_DESCRIPTION, "")
36-
define(NERVES_FW_VERSION, "${NERVES_SDK_VERSION}")
37-
define(NERVES_FW_PLATFORM, "mangopi_mq_pro")
38-
define(NERVES_FW_ARCHITECTURE, "riscv")
39-
define(NERVES_FW_AUTHOR, "The Nerves Team")
40-
41-
# This configuration file will create an image that
42-
# has an MBR and the following layout:
43-
#
44-
# +----------------------------+
45-
# | MBR |
46-
# +----------------------------+
47-
# | SPL and U-Boot |
48-
# +----------------------------+
49-
# | U-Boot environment |
50-
# +----------------------------+
51-
# | p1: Rootfs A (squashfs) |
52-
# +----------------------------+
53-
# | p2: Rootfs B (squashfs) |
54-
# +----------------------------+
55-
# | p3: Application (f2fs) |
56-
# +----------------------------+
57-
58-
define(UBOOT_OFFSET, 16)
59-
define(UBOOT_COUNT, 8176)
60-
61-
# The U-Boot environment is written directly to the SDCard/eMMC. It is not
62-
# in any partition
63-
define(UBOOT_ENV_OFFSET, 8192)
64-
define(UBOOT_ENV_COUNT, 256) # 128 KB
65-
66-
# Let the rootfs have room to grow up to 140 MiB and align it to the nearest 1
67-
# MB boundary
68-
define(ROOTFS_A_PART_OFFSET, 43008)
69-
define(ROOTFS_A_PART_COUNT, 286720)
70-
define-eval(ROOTFS_B_PART_OFFSET, "${ROOTFS_A_PART_OFFSET} + ${ROOTFS_A_PART_COUNT}")
71-
define(ROOTFS_B_PART_COUNT, ${ROOTFS_A_PART_COUNT})
72-
73-
# Application partition. This partition can occupy all of the remaining space.
74-
# Size it to fit the destination.
75-
define-eval(APP_PART_OFFSET, "${ROOTFS_B_PART_OFFSET} + ${ROOTFS_B_PART_COUNT}")
76-
define(APP_PART_COUNT, 1048576)
77-
78-
# Firmware archive metadata
79-
meta-product = ${NERVES_FW_PRODUCT}
80-
meta-description = ${NERVES_FW_DESCRIPTION}
81-
meta-version = ${NERVES_FW_VERSION}
82-
meta-platform = ${NERVES_FW_PLATFORM}
83-
meta-architecture = ${NERVES_FW_ARCHITECTURE}
84-
meta-author = ${NERVES_FW_AUTHOR}
85-
meta-vcs-identifier = ${NERVES_FW_VCS_IDENTIFIER}
86-
meta-misc = ${NERVES_FW_MISC}
22+
include("${NERVES_SDK_IMAGES:-.}/fwup_include/fwup-common.conf")
8723

8824
# Location where installed firmware information is stored.
8925
uboot-environment uboot-env {

fwup.conf

+1-72
Original file line numberDiff line numberDiff line change
@@ -2,78 +2,7 @@
22

33
require-fwup-version="1.0.0"
44

5-
#
6-
# Firmware metadata
7-
#
8-
9-
# All of these can be overriden using environment variables of the same name.
10-
#
11-
# Run 'fwup -m' to query values in a .fw file.
12-
# Use 'fw_printenv' to query values on the target.
13-
#
14-
# These are used by Nerves libraries to introspect.
15-
define(NERVES_FW_PRODUCT, "Nerves Firmware")
16-
define(NERVES_FW_DESCRIPTION, "")
17-
define(NERVES_FW_VERSION, "${NERVES_SDK_VERSION}")
18-
define(NERVES_FW_PLATFORM, "mangopi_mq_pro")
19-
define(NERVES_FW_ARCHITECTURE, "riscv")
20-
define(NERVES_FW_AUTHOR, "The Nerves Team")
21-
22-
define(NERVES_FW_DEVPATH, "/dev/mmcblk0")
23-
define(NERVES_FW_APPLICATION_PART0_DEVPATH, "/dev/mmcblk0p4") # Linux part number is 1-based
24-
define(NERVES_FW_APPLICATION_PART0_FSTYPE, "f2fs")
25-
define(NERVES_FW_APPLICATION_PART0_TARGET, "/root")
26-
define(NERVES_PROVISIONING, "${NERVES_SYSTEM}/images/fwup_include/provisioning.conf")
27-
28-
# Default paths if not specified via the commandline
29-
define(ROOTFS, "${NERVES_SYSTEM}/images/rootfs.squashfs")
30-
31-
# This configuration file will create an image that
32-
# has an MBR and the following layout:
33-
#
34-
# +----------------------------+
35-
# | MBR |
36-
# +----------------------------+
37-
# | SPL and U-Boot |
38-
# +----------------------------+
39-
# | U-Boot environment |
40-
# +----------------------------+
41-
# | p1: Rootfs A (squashfs) |
42-
# +----------------------------+
43-
# | p2: Rootfs B (squashfs) |
44-
# +----------------------------+
45-
# | p3: Application (f2fs) |
46-
# +----------------------------+
47-
48-
define(UBOOT_OFFSET, 16)
49-
define(UBOOT_COUNT, 8176)
50-
51-
# The U-Boot environment is written directly to the SDCard/eMMC. It is not
52-
# in any partition
53-
define(UBOOT_ENV_OFFSET, 8192)
54-
define(UBOOT_ENV_COUNT, 256) # 128 KB
55-
56-
# Let the rootfs have room to grow up to 140 MiB and align it to the nearest 1
57-
# MB boundary
58-
define(ROOTFS_A_PART_OFFSET, 43008)
59-
define(ROOTFS_A_PART_COUNT, 286720)
60-
define-eval(ROOTFS_B_PART_OFFSET, "${ROOTFS_A_PART_OFFSET} + ${ROOTFS_A_PART_COUNT}")
61-
define(ROOTFS_B_PART_COUNT, ${ROOTFS_A_PART_COUNT})
62-
63-
# Application partition. This partition can occupy all of the remaining space.
64-
# Size it to fit the destination.
65-
define-eval(APP_PART_OFFSET, "${ROOTFS_B_PART_OFFSET} + ${ROOTFS_B_PART_COUNT}")
66-
define(APP_PART_COUNT, 1048576)
67-
68-
# Firmware archive metadata
69-
meta-product = ${NERVES_FW_PRODUCT}
70-
meta-description = ${NERVES_FW_DESCRIPTION}
71-
meta-version = ${NERVES_FW_VERSION}
72-
meta-platform = ${NERVES_FW_PLATFORM}
73-
meta-architecture = ${NERVES_FW_ARCHITECTURE}
74-
meta-author = ${NERVES_FW_AUTHOR}
75-
meta-vcs-identifier = ${NERVES_FW_VCS_IDENTIFIER}
76-
meta-misc = ${NERVES_FW_MISC}
5+
include("${NERVES_SDK_IMAGES:-.}/fwup_include/fwup-common.conf")
776

787
# File resources are listed in the order that they are included in the .fw file
798
# This is important, since this is the order that they're written on a firmware

fwup_include/fwup-common.conf

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#
2+
# Firmware metadata
3+
#
4+
5+
# All of these can be overriden using environment variables of the same name.
6+
#
7+
# Run 'fwup -m' to query values in a .fw file.
8+
# Use 'fw_printenv' to query values on the target.
9+
#
10+
# These are used by Nerves libraries to introspect.
11+
define(NERVES_FW_PRODUCT, "Nerves Firmware")
12+
define(NERVES_FW_DESCRIPTION, "")
13+
define(NERVES_FW_VERSION, "${NERVES_SDK_VERSION}")
14+
define(NERVES_FW_PLATFORM, "mangopi_mq_pro")
15+
define(NERVES_FW_ARCHITECTURE, "riscv")
16+
define(NERVES_FW_AUTHOR, "The Nerves Team")
17+
18+
define(NERVES_FW_DEVPATH, "/dev/mmcblk0")
19+
define(NERVES_FW_APPLICATION_PART0_DEVPATH, "/dev/mmcblk0p4") # Linux part number is 1-based
20+
define(NERVES_FW_APPLICATION_PART0_FSTYPE, "f2fs")
21+
define(NERVES_FW_APPLICATION_PART0_TARGET, "/root")
22+
define(NERVES_PROVISIONING, "${NERVES_SYSTEM}/images/fwup_include/provisioning.conf")
23+
24+
# Default paths if not specified via the commandline
25+
define(ROOTFS, "${NERVES_SYSTEM}/images/rootfs.squashfs")
26+
27+
# This configuration file will create an image that
28+
# has an MBR and the following layout:
29+
#
30+
# +----------------------------+
31+
# | MBR |
32+
# +----------------------------+
33+
# | SPL and U-Boot |
34+
# +----------------------------+
35+
# | U-Boot environment |
36+
# +----------------------------+
37+
# | p1: Rootfs A (squashfs) |
38+
# +----------------------------+
39+
# | p2: Rootfs B (squashfs) |
40+
# +----------------------------+
41+
# | p3: Application (f2fs) |
42+
# +----------------------------+
43+
44+
define(UBOOT_OFFSET, 16)
45+
define(UBOOT_COUNT, 8176)
46+
47+
# The U-Boot environment is written directly to the SDCard/eMMC. It is not
48+
# in any partition
49+
define(UBOOT_ENV_OFFSET, 8192)
50+
define(UBOOT_ENV_COUNT, 256) # 128 KB
51+
52+
# Let the rootfs have room to grow up to 140 MiB and align it to the nearest 1
53+
# MB boundary
54+
define(ROOTFS_A_PART_OFFSET, 43008)
55+
define(ROOTFS_A_PART_COUNT, 286720)
56+
define-eval(ROOTFS_B_PART_OFFSET, "${ROOTFS_A_PART_OFFSET} + ${ROOTFS_A_PART_COUNT}")
57+
define(ROOTFS_B_PART_COUNT, ${ROOTFS_A_PART_COUNT})
58+
59+
# Application partition. This partition can occupy all of the remaining space.
60+
# Size it to fit the destination.
61+
define-eval(APP_PART_OFFSET, "${ROOTFS_B_PART_OFFSET} + ${ROOTFS_B_PART_COUNT}")
62+
define(APP_PART_COUNT, 1048576)
63+
64+
# Firmware archive metadata
65+
meta-product = ${NERVES_FW_PRODUCT}
66+
meta-description = ${NERVES_FW_DESCRIPTION}
67+
meta-version = ${NERVES_FW_VERSION}
68+
meta-platform = ${NERVES_FW_PLATFORM}
69+
meta-architecture = ${NERVES_FW_ARCHITECTURE}
70+
meta-author = ${NERVES_FW_AUTHOR}
71+
meta-vcs-identifier = ${NERVES_FW_VCS_IDENTIFIER}
72+
meta-misc = ${NERVES_FW_MISC}

0 commit comments

Comments
 (0)