Make /usr/local compatible with SOTA 71/9071/5
authorJosé Bollo <jose.bollo@iot.bzh>
Mon, 10 Apr 2017 11:14:31 +0000 (13:14 +0200)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Fri, 19 May 2017 10:38:25 +0000 (10:38 +0000)
This provides a link from /usr/local to ../../var/local
that enforces file hierarchy local to the machine
to be in a directory frankly separated from /usr.

This is important for SOTA/OSTree that must not manage
the locally installed files. But this is also important
for correctly separating layers of the target. For
this reason, the change is not conditionnal to SOTA.

Bug-AGL: SPEC-359
Bug-AGL: SPEC-533

Change-Id: I0a709ba15582a011a43f3a3b68d4230bae11b658
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/9071
Tested-by: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
ci-image-build: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
Reviewed-by: Stéphane Desneux <stephane.desneux@iot.bzh>
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
meta-app-framework/recipes-core/base-files/base-files_%.bbappend

index 7e12bc8..0e93b4d 100644 (file)
@@ -4,6 +4,13 @@ RDEPENDS_${PN}_append_smack = " smack-userspace"
 do_install_append() {
     install -d ${D}/${sysconfdir}/skel/app-data
     install -d ${D}/${sysconfdir}/skel/.config
+    install -m 0755 -d ${D}/var
+    if [ -d ${D}/usr/local ]; then
+        mv ${D}/usr/local ${D}/var
+    else
+        install -m 0755 -d ${D}/var/local
+    fi
+    ln -s ../../var/local ${D}/usr/local
 }
 
 do_install_append_smack () {