summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2020-04-25 23:36:46 +0000
committerStefan Agner <stefan.agner@toradex.com>2020-04-27 07:42:22 +0000
commitfb058bb8eedd9a3a168fa87534f55d1ea610a90a (patch)
tree0bad5d771d0d94c8f093e2b3c4b7a7acb45cec9d
parentcd153180c359fefb95d57968b8a4fa0471b588c0 (diff)
downloadmeta-updater-fb058bb8eedd9a3a168fa87534f55d1ea610a90a.tar.gz
image_types_ostree/ota: move home physically to /var/rootdirs/home
Instead of using the double indirection mode /home -> /var/rootdirs/home -> /sysroot/home move the home directory physically into /var/rootdirs. This allows to use the --modern flag when initializing the file system. The "old" style is still supported, and does make sense in case the home directories need to be shared between multiple deployments. Since multiple deployments is not a use case in meta-updater use the /var approach. See also: https://github.com/ostreedev/ostree/issues/2085. The modern flag also gets rid of dev, proc, root, run, sys and tmp. All of them have been empty and unused. Note: This change cannot be pushed through updates as this is an initial deployment setting. Only devices provisioned with images built with this change applied will use the new layout. Updates will continue to work on both systems as the symlink from the deployment stays the same (first indirection is still /home -> /var/rootdirs/home). Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--classes/image_types_ostree.bbclass2
-rw-r--r--classes/image_types_ota.bbclass7
2 files changed, 5 insertions, 4 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 28d9802..a8a6c39 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -56,13 +56,11 @@ IMAGE_CMD_ostree () {
56 mkdir -p usr/etc/tmpfiles.d 56 mkdir -p usr/etc/tmpfiles.d
57 tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf 57 tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf
58 echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf} 58 echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf}
59 echo "L /var/rootdirs/home - - - - /sysroot/home" >>${tmpfiles_conf}
60 else 59 else
61 mkdir -p usr/etc/init.d 60 mkdir -p usr/etc/init.d
62 tmpfiles_conf=usr/etc/init.d/tmpfiles.sh 61 tmpfiles_conf=usr/etc/init.d/tmpfiles.sh
63 echo '#!/bin/sh' > ${tmpfiles_conf} 62 echo '#!/bin/sh' > ${tmpfiles_conf}
64 echo "mkdir -p /var/rootdirs; chmod 755 /var/rootdirs" >> ${tmpfiles_conf} 63 echo "mkdir -p /var/rootdirs; chmod 755 /var/rootdirs" >> ${tmpfiles_conf}
65 echo "ln -sf /sysroot/home /var/rootdirs/home" >> ${tmpfiles_conf}
66 64
67 ln -s ../init.d/tmpfiles.sh usr/etc/rcS.d/S20tmpfiles.sh 65 ln -s ../init.d/tmpfiles.sh usr/etc/rcS.d/S20tmpfiles.sh
68 fi 66 fi
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass
index 8f5a01a..374ddc2 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -45,7 +45,7 @@ do_image_ota[cleandirs] = "${OTA_SYSROOT}"
45do_image_ota[depends] = "${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER') == 'grub' else ''} \ 45do_image_ota[depends] = "${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER') == 'grub' else ''} \
46 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER') == 'u-boot' else ''}" 46 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER') == 'u-boot' else ''}"
47IMAGE_CMD_ota () { 47IMAGE_CMD_ota () {
48 ostree admin --sysroot=${OTA_SYSROOT} init-fs ${OTA_SYSROOT} 48 ostree admin --sysroot=${OTA_SYSROOT} init-fs --modern ${OTA_SYSROOT}
49 ostree admin --sysroot=${OTA_SYSROOT} os-init ${OSTREE_OSNAME} 49 ostree admin --sysroot=${OTA_SYSROOT} os-init ${OSTREE_OSNAME}
50 50
51 # Preparation required to steer ostree bootloader detection 51 # Preparation required to steer ostree bootloader detection
@@ -81,7 +81,10 @@ IMAGE_CMD_ota () {
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 ${IMAGE_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 ${IMAGE_ROOTFS}/home ${OTA_SYSROOT}/ || true 84
85 mkdir -p ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/rootdirs
86 cp -a ${IMAGE_ROOTFS}/home ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/rootdirs/home || true
87
85 # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local) 88 # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local)
86 install -d ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local 89 install -d ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local
87 # Set package version for the first deployment 90 # Set package version for the first deployment