diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2019-07-19 22:11:50 +0200 |
---|---|---|
committer | Laurent Bonnans <laurent.bonnans@here.com> | 2019-08-15 17:48:39 +0200 |
commit | 4f6bd2518d030cf94f48885dbdeceb483b05384a (patch) | |
tree | a31fe9007dc902dc80fa0d9b0398219f3ccca7a2 | |
parent | 75625f1203d9a387b028884111cad8738c455065 (diff) | |
download | meta-updater-4f6bd2518d030cf94f48885dbdeceb483b05384a.tar.gz |
image_types_ostree: add /usr/local support
Add /usr/local support as outlined in OSTree documentation. This
makes sure that a writeable and persistent /usr/local directory
is available.
See also: https://ostree.readthedocs.io/en/latest/manual/adapting-existing/
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
(cherry-picked from commit bc6c9f098442a2c0bf4a7a40ba50c9ee5fe40cc1)
-rw-r--r-- | classes/image_types_ostree.bbclass | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index d644f53..3300a3d 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -119,6 +119,31 @@ IMAGE_CMD_ostree () { | |||
119 | ln -sf var/roothome root | 119 | ln -sf var/roothome root |
120 | fi | 120 | fi |
121 | 121 | ||
122 | if [ -d usr/local ] && [ ! -L usr/local ]; then | ||
123 | if [ "$(ls -A usr/local)" ]; then | ||
124 | bbfatal "Data in /usr/local directory is not preserved by OSTree." | ||
125 | fi | ||
126 | rm -rf usr/local | ||
127 | fi | ||
128 | |||
129 | if [ -n "${SYSTEMD_USED}" ]; then | ||
130 | echo "d /var/usrlocal 0755 root root -" >>${tmpfiles_conf} | ||
131 | else | ||
132 | echo "mkdir -p /var/usrlocal; chown 755 /var/usrlocal" >>${tmpfiles_conf} | ||
133 | fi | ||
134 | |||
135 | dirs="bin etc games include lib man sbin share src" | ||
136 | |||
137 | for dir in ${dirs}; do | ||
138 | if [ -n "${SYSTEMD_USED}" ]; then | ||
139 | echo "d /var/usrlocal/${dir} 0755 root root -" >>${tmpfiles_conf} | ||
140 | else | ||
141 | echo "mkdir -p /var/usrlocal/${dir}; chown 755 /var/usrlocal/${dir}" >>${tmpfiles_conf} | ||
142 | fi | ||
143 | done | ||
144 | |||
145 | ln -sf ../var/usrlocal usr/local | ||
146 | |||
122 | checksum=`sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " "` | 147 | checksum=`sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " "` |
123 | 148 | ||
124 | cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum} | 149 | cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum} |