Skip to content

Commit

Permalink
conf: machine: Add partup layout configuration
Browse files Browse the repository at this point in the history
Add partup layout configurations, stored in the directory "partup",
analogous to WIC. Use different layouts depending on whether RAUC is
being used or not.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Signed-off-by: Norbert Wesp <n.wesp@phytec.de>
  • Loading branch information
mschwan-phytec authored and svlstriker committed Aug 24, 2023
1 parent 2e24c24 commit 4beae7a
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 0 deletions.
31 changes: 31 additions & 0 deletions conf/machine/include/partup-layout-config.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
PARTUP_PACKAGE_FILES = " \
${BOOTLOADER_FILE} \
${IMAGE_BOOT_FILES} \
${IMAGE_LINK_NAME}.ext4 \
"
PARTUP_PACKAGE_FILES:update += " \
config-partition.tar.gz \
"

PARTUP_LAYOUT_CONFIG = "partup-layout-default.yaml"
PARTUP_LAYOUT_CONFIG:update = "partup-layout-rauc.yaml"

PARTUP_SECTIONS += "clean"
PARTUP_SECTION_clean = "${@bb.utils.contains('PREFERRED_PROVIDER_virtual/bootloader', 'barebox', False, True, d)}"

PARTUP_ARRAYS += "image_boot_files"
PARTUP_ARRAY_image_boot_files = "${IMAGE_BOOT_FILES}"

BOOTLOADER_SKIP ??= "${@bb.utils.contains('PREFERRED_PROVIDER_virtual/bootloader', 'barebox', 1, 0, d)}"
BOOTLOADER_SEEK ??= "1"
BOOTLOADER_FILE ??= "u-boot.bin"
BOOTLOADER_FILE:k3 ?= "${SPL_BINARY}"
BOOTLOADER_FILE:mx6-generic-bsp ?= "${BAREBOX_BINARY}"
BOOTLOADER_FILE:mx6ul-generic-bsp ?= "${BAREBOX_BINARY}"
BOOTLOADER_FILE:mx8m-generic-bsp ?= "imx-boot"

do_layout_config[vardeps] += " \
BOOTLOADER_SKIP \
BOOTLOADER_SEEK \
BOOTLOADER_FILE \
"
32 changes: 32 additions & 0 deletions partup/partup-layout-default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
api-version: 0
disklabel: msdos

raw:
- input-offset: ${BOOTLOADER_SKIP}kiB
output-offset: ${BOOTLOADER_SEEK}kiB
input:
uri: ${BOOTLOADER_FILE}

# BEGIN_CLEAN
clean:
- offset: 3840kiB
size: 64kiB
- offset: 3968kiB
size: 64kiB
# END_CLEAN
partitions:
- label: BOOT
type: primary
filesystem: fat32
size: 128MiB
offset: 4MiB
input: # ARRAY_IMAGE_BOOT_FILES
- uri: @KEY@ # ARRAY_IMAGE_BOOT_FILES

- label: ROOT
type: primary
filesystem: null
expand: true
block-size: 4kiB
input:
- uri: ${IMAGE_LINK_NAME}.ext4
61 changes: 61 additions & 0 deletions partup/partup-layout-rauc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
api-version: 0
disklabel: msdos

emmc-boot-partitions:
enable: true
input-offset: 0kiB
output-offset: ${BOOTLOADER_SEEK_EMMC}kiB
input:
uri: ${BOOTLOADER_FILE}

raw:
- input-offset: ${BOOTLOADER_SKIP}kiB
output-offset: ${BOOTLOADER_SEEK}kiB
input:
uri: ${BOOTLOADER_FILE}

# BEGIN_CLEAN
clean:
- offset: 3840kiB
size: 64kiB
- offset: 3968kiB
size: 64kiB
# END_CLEAN
partitions:
- label: BOOT0
type: primary
filesystem: fat32
size: 128MiB
offset: 4MiB
input: # ARRAY_IMAGE_BOOT_FILES
- uri: @KEY@ # ARRAY_IMAGE_BOOT_FILES

- label: BOOT1
type: primary
filesystem: fat32
size: 128MiB
input: # ARRAY_IMAGE_BOOT_FILES
- uri: @KEY@ # ARRAY_IMAGE_BOOT_FILES

- label: CONFIG
type: primary
filesystem: ext4
size: 64MiB
input:
- uri: config-partition.tar.gz

- label: ROOT0
type: logical
filesystem: null
expand: true
block-size: 4kiB
input:
- uri: ${IMAGE_LINK_NAME}.ext4

- label: ROOT1
type: logical
filesystem: null
expand: true
block-size: 4kiB
input:
- uri: ${IMAGE_LINK_NAME}.ext4

0 comments on commit 4beae7a

Please sign in to comment.