diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2020-04-25 22:22:37 +0000 |
---|---|---|
committer | Laurent Bonnans <laurent.bonnans@here.com> | 2020-06-02 12:02:33 +0200 |
commit | fb0ff31aa8879e34d9dca02d7f14f825ca5faa29 (patch) | |
tree | e7ed948b86d0fb797ea21a93388deeefc4c5f51b | |
parent | 38c99b68929d00064978d69ced2d763e66501bdc (diff) | |
download | meta-updater-fb0ff31aa8879e34d9dca02d7f14f825ca5faa29.tar.gz |
image_types_ostree/ota: do not commit homes to the OSTree
The home directory currently are commited to the OSTree, presumably
to then use it for the deployment. However, we do have access to the
original rootfs in the OSTree deployment tasks (do_image_ota) hence
transferring the files "via OSTree" is not necessary. We do already
carry over some files from the original OE rootfs to /var/sota.
Follow this approach for /var/local and /home as well.
The home will still be stored in the sysroot as documented in
https://ostree.readthedocs.io/en/latest/manual/adapting-existing/.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r-- | classes/image_types_ostree.bbclass | 12 | ||||
-rw-r--r-- | classes/image_types_ota.bbclass | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 7275867..95035e2 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -70,13 +70,11 @@ IMAGE_CMD_ostree () { | |||
70 | mkdir -p usr/share/sota/ | 70 | mkdir -p usr/share/sota/ |
71 | echo -n "${OSTREE_BRANCHNAME}" > usr/share/sota/branchname | 71 | echo -n "${OSTREE_BRANCHNAME}" > usr/share/sota/branchname |
72 | 72 | ||
73 | # Preserve data in /home to be later copied to /sysroot/home by sysroot | 73 | # home directories get copied from the OE root later to the final sysroot |
74 | # generating procedure | 74 | # Create a symlink to var/rootdirs/home to make sure the OSTree deployment |
75 | mkdir -p usr/homedirs | 75 | # redirects /home to /var/rootdirs/home. |
76 | if [ -d "home" ] && [ ! -L "home" ]; then | 76 | rm -rf home/ |
77 | mv home usr/homedirs/home | 77 | ln -sf var/rootdirs/home home |
78 | ln -sf var/rootdirs/home home | ||
79 | fi | ||
80 | 78 | ||
81 | # Move persistent directories to /var | 79 | # Move persistent directories to /var |
82 | dirs="opt mnt media srv" | 80 | dirs="opt mnt media srv" |
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index e9f9467..8f5a01a 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass | |||
@@ -80,8 +80,8 @@ IMAGE_CMD_ota () { | |||
80 | # Ensure the permissions are correctly set | 80 | # Ensure the permissions are correctly set |
81 | chmod 700 ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota | 81 | chmod 700 ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota |
82 | 82 | ||
83 | cp -a ${OSTREE_ROOTFS}/var/local ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true | 83 | cp -a ${IMAGE_ROOTFS}/var/local ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true |
84 | cp -a ${OSTREE_ROOTFS}/usr/homedirs/home ${OTA_SYSROOT}/ || true | 84 | cp -a ${IMAGE_ROOTFS}/home ${OTA_SYSROOT}/ || true |
85 | # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local) | 85 | # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local) |
86 | install -d ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local | 86 | install -d ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local |
87 | # Set package version for the first deployment | 87 | # Set package version for the first deployment |