From 98c74348a0ec02f8c830021fcc6f6872e0b5cbfd Mon Sep 17 00:00:00 2001 From: Valentin David Date: Mon, 27 Apr 2020 15:44:03 +0000 Subject: [PATCH] Do not use /home but /var/home Otherwise flatpak'ed Buildstream and flatpak'ed Flatpak Builder do not work. https://github.com/ostreedev/ostree/issues/2086 --- elements/vm/ostree-config.bst | 64 +++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/elements/vm/ostree-config.bst b/elements/vm/ostree-config.bst index 33994bb0b..72adcd160 100644 --- a/elements/vm/ostree-config.bst +++ b/elements/vm/ostree-config.bst @@ -21,26 +21,48 @@ config: gnome.conf.in >gnome.conf install-commands: - - | - mkdir %{install-root}/boot - mkdir %{install-root}/efi - mkdir %{install-root}/etc - mkdir %{install-root}/mnt - mkdir %{install-root}/run - mkdir %{install-root}/opt - mkdir %{install-root}/sys - mkdir %{install-root}/tmp - mkdir %{install-root}/dev - mkdir %{install-root}/proc + - mkdir %{install-root}/boot + - mkdir %{install-root}/efi + - mkdir %{install-root}/etc + - mkdir %{install-root}/mnt + - mkdir %{install-root}/run + - mkdir %{install-root}/opt + - mkdir %{install-root}/sys + - mkdir %{install-root}/tmp + - mkdir %{install-root}/dev + - mkdir %{install-root}/proc - - | - mkdir -p "%{install-root}/sysroot" - ln -s sysroot/ostree "%{install-root}/ostree" - ln -s var/home "%{install-root}/home" - ln -s var/roothome "%{install-root}/root" - ln -s run/media "%{install-root}/media" + - mkdir -p "%{install-root}/sysroot" + - ln -s sysroot/ostree "%{install-root}/ostree" + - ln -s var/roothome "%{install-root}/root" + - ln -s run/media "%{install-root}/media" - - | - install -Dm644 -t "%{install-root}/usr/lib/tmpfiles.d" ostree.conf - install -Dm644 *.gpg "%{install-root}/etc/pki/ostree/gnome.gpg" - install -Dm644 -t "%{install-root}/etc/ostree/remotes.d" gnome.conf + # Though we use /var/home in /etc/passwd and this symlink should + # be useless removing this symlink breaks --filesystem=host on + # flatpak. + - ln -s var/home "%{install-root}/home" + + - install -Dm644 -t "%{install-root}/usr/lib/tmpfiles.d" ostree.conf + - install -Dm644 *.gpg "%{install-root}/etc/pki/ostree/gnome.gpg" + - install -Dm644 -t "%{install-root}/etc/ostree/remotes.d" gnome.conf + +public: + bst: + integration-commands: + # /etc/default/useradd is provided by freedesktop-sdk.bst's + # components/shadow.bst. In non OSTree configuration it should + # stay /home. So we have to adjust the value of HOME in OSTree + # configurations only. + # + # Even though we have a symlink /home -> var/home, we should not + # define home directory. The real root filesystem (which is + # /sysroot) is not mounted as recursive shared on OSTree. When + # the home directory in /etc/passwd is defined to use the symlink, + # then mounts in home are mounted on this /sysroot instead of + # /var. That means that the mount does not propagate in Flatpak + # applications. This breaks Flatpak Builder and BuildStream which + # require fuse mounts. + - | + if [ -f /etc/default/useradd ]; then + sed -i 's,HOME=/home,HOME=/var/home,' /etc/default/useradd + fi