diff options
| author | Stefan Agner <stefan.agner@toradex.com> | 2019-07-19 22:11:50 +0200 |
|---|---|---|
| committer | Patrick Vacek <patrickvacek@gmail.com> | 2019-07-24 13:37:15 +0200 |
| commit | 6364206eb7be5693a48b0b7a7b07aa02f7fc1c8f (patch) | |
| tree | bb55b9612e65e49103bcd7c55ba2d10765c06eba | |
| parent | 62383728ea11f71543d2798243b126b8dc3fa40f (diff) | |
| download | meta-updater-follow-fhs.tar.gz | |
image_types_ostree: add /usr/local supportfollow-fhs
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>
| -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 9ae5a3a..a9a8174 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
| @@ -106,6 +106,31 @@ IMAGE_CMD_ostree () { | |||
| 106 | ln -sf var/roothome root | 106 | ln -sf var/roothome root |
| 107 | fi | 107 | fi |
| 108 | 108 | ||
| 109 | if [ -d usr/local ] && [ ! -L usr/local ]; then | ||
| 110 | if [ "$(ls -A usr/local)" ]; then | ||
| 111 | bbfatal "Data in /usr/local directory is not preserved by OSTree." | ||
| 112 | fi | ||
| 113 | rm -rf usr/local | ||
| 114 | fi | ||
| 115 | |||
| 116 | if [ -n "${SYSTEMD_USED}" ]; then | ||
| 117 | echo "d /var/usrlocal 0755 root root -" >>${tmpfiles_conf} | ||
| 118 | else | ||
| 119 | echo "mkdir -p /var/usrlocal; chown 755 /var/usrlocal" >>${tmpfiles_conf} | ||
| 120 | fi | ||
| 121 | |||
| 122 | dirs="bin etc games include lib man sbin share src" | ||
| 123 | |||
| 124 | for dir in ${dirs}; do | ||
| 125 | if [ -n "${SYSTEMD_USED}" ]; then | ||
| 126 | echo "d /var/usrlocal/${dir} 0755 root root -" >>${tmpfiles_conf} | ||
| 127 | else | ||
| 128 | echo "mkdir -p /var/usrlocal/${dir}; chown 755 /var/usrlocal/${dir}" >>${tmpfiles_conf} | ||
| 129 | fi | ||
| 130 | done | ||
| 131 | |||
| 132 | ln -sf ../var/usrlocal usr/local | ||
| 133 | |||
| 109 | if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then | 134 | if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then |
| 110 | # this is a hack for ostree not to override init= in kernel cmdline - | 135 | # this is a hack for ostree not to override init= in kernel cmdline - |
| 111 | # make it think that the initramfs is present (while it is in FIT image) | 136 | # make it think that the initramfs is present (while it is in FIT image) |
