Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion meta-edgeos/recipes-core/images/edgeos-image.bb
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ BUILDCFG_VARS += " \
# Disable WIC's automatic fstab updates
WIC_CREATE_EXTRA_ARGS = "--no-fstab-update"

IMAGE_INSTALL:append = "expand-rootfs"
IMAGE_INSTALL:append = "expand-rootfs"

IMAGE_INSTALL:append = " persistent-storage"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Prepare /data for application
After=data.mount
Requires=data.mount

[Service]
Type=oneshot
ExecStart=/usr/bin/data-setup.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
set -eu
mkdir -p /data/updateapp
chmod 700 /data/updateapp
13 changes: 13 additions & 0 deletions meta-edgeos/recipes-core/persistent-storage/files/data.mount
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Mount persistent data partition
After=local-fs-pre.target
Before=local-fs.target

[Mount]
What=/dev/disk/by-partlabel/data
Where=/data
Type=ext4
Options=defaults,noatime

[Install]
WantedBy=multi-user.target
28 changes: 28 additions & 0 deletions meta-edgeos/recipes-core/persistent-storage/persistent-storage.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
SUMMARY = "Persistent data partition mount + setup"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = " \
file://data.mount \
file://data-setup.service \
file://data-setup.sh \
"

inherit systemd

SYSTEMD_SERVICE:${PN} = "data.mount data-setup.service"
SYSTEMD_AUTO_ENABLE:${PN} = "enable"

do_install() {
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/data.mount ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/data-setup.service ${D}${systemd_unitdir}/system/
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/data-setup.sh ${D}${bindir}/
}

FILES:${PN} += " \
${systemd_unitdir}/system/data.mount \
${systemd_unitdir}/system/data-setup.service \
${bindir}/data-setup.sh \
"
3 changes: 0 additions & 3 deletions meta-edgeos/recipes-support/expand-rootfs/expand-rootfs.bb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ SUMMARY = "First-boot rootfs auto-expansion service"
DESCRIPTION = "Expands the active root partition and grows the filesystem on first boot."
LICENSE = "CLOSED"

PR = "r4"


SRC_URI = " \
file://expand-rootfs.sh \
file://expand-rootfs.service \
Expand Down
3 changes: 2 additions & 1 deletion meta-edgeos/wic/rpi-partuuid.wks
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bootloader --ptable gpt
part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4096 --size 128M --uuid "${EDGE_BOOT_PARTUUID}"
part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4096 --size 8192M --uuid "${EDGE_ROOT_PARTUUID}"
part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4096 --size 8192M --uuid "${EDGE_ROOT_PARTUUID}"
part --ondisk mmcblk --fstype=ext4 --label data --align 4 --size 1024 --use-uuid