summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2020-04-25 23:36:46 +0000
committerLaurent Bonnans <laurent.bonnans@here.com>2020-06-02 12:04:05 +0200
commit237edebe4170db9a22e4d14a65120e8a627bab14 (patch)
treeb3d26a70413d49fcb0e868a92a558f102be8c844
parent20c8a0dbda0295d4973559a96b92c2ac5169f213 (diff)
downloadmeta-updater-237edebe4170db9a22e4d14a65120e8a627bab14.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 95035e2..7cc4baa 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -55,13 +55,11 @@ IMAGE_CMD_ostree () {
55 mkdir -p usr/etc/tmpfiles.d 55 mkdir -p usr/etc/tmpfiles.d
56 tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf 56 tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf
57 echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf} 57 echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf}
58 echo "L /var/rootdirs/home - - - - /sysroot/home" >>${tmpfiles_conf}
59 else 58 else
60 mkdir -p usr/etc/init.d 59 mkdir -p usr/etc/init.d
61 tmpfiles_conf=usr/etc/init.d/tmpfiles.sh 60 tmpfiles_conf=usr/etc/init.d/tmpfiles.sh
62 echo '#!/bin/sh' > ${tmpfiles_conf} 61 echo '#!/bin/sh' > ${tmpfiles_conf}
63 echo "mkdir -p /var/rootdirs; chmod 755 /var/rootdirs" >> ${tmpfiles_conf} 62 echo "mkdir -p /var/rootdirs; chmod 755 /var/rootdirs" >> ${tmpfiles_conf}
64 echo "ln -sf /sysroot/home /var/rootdirs/home" >> ${tmpfiles_conf}
65 63
66 ln -s ../init.d/tmpfiles.sh usr/etc/rcS.d/S20tmpfiles.sh 64 ln -s ../init.d/tmpfiles.sh usr/etc/rcS.d/S20tmpfiles.sh
67 fi 65 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