summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2019-07-19 22:11:50 +0200
committerStefan Agner <stefan.agner@toradex.com>2019-07-19 23:50:24 +0200
commitbc6c9f098442a2c0bf4a7a40ba50c9ee5fe40cc1 (patch)
tree3919923b1787a08a8275b9f6f26eb4cdee25daa9 /classes
parentc170b6344b13ea075aff4091c846623b9b6f9a97 (diff)
downloadmeta-updater-bc6c9f098442a2c0bf4a7a40ba50c9ee5fe40cc1.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>
Diffstat (limited to 'classes')
-rw-r--r--classes/image_types_ostree.bbclass25
1 files changed, 25 insertions, 0 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index d3e7d0d..b1c53ff 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -104,6 +104,31 @@ IMAGE_CMD_ostree () {
104 ln -sf var/roothome root 104 ln -sf var/roothome root
105 fi 105 fi
106 106
107 if [ -d usr/local ] && [ ! -L usr/local ]; then
108 if [ "$(ls -A usr/local)" ]; then
109 bbfatal "Data in /usr/local directory is not preserved by OSTree."
110 fi
111 rm -rf usr/local
112 fi
113
114 if [ -n "${SYSTEMD_USED}" ]; then
115 echo "d /var/usrlocal 0755 root root -" >>${tmpfiles_conf}
116 else
117 echo "mkdir -p /var/usrlocal; chown 755 /var/usrlocal" >>${tmpfiles_conf}
118 fi
119
120 dirs="bin etc games include lib man sbin share src"
121
122 for dir in ${dirs}; do
123 if [ -n "${SYSTEMD_USED}" ]; then
124 echo "d /var/usrlocal/${dir} 0755 root root -" >>${tmpfiles_conf}
125 else
126 echo "mkdir -p /var/usrlocal/${dir}; chown 755 /var/usrlocal/${dir}" >>${tmpfiles_conf}
127 fi
128 done
129
130 ln -sf ../var/usrlocal usr/local
131
107 if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then 132 if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then
108 # this is a hack for ostree not to override init= in kernel cmdline - 133 # this is a hack for ostree not to override init= in kernel cmdline -
109 # make it think that the initramfs is present (while it is in FIT image) 134 # make it think that the initramfs is present (while it is in FIT image)