Skip to content

Commit

Permalink
Do not use /home but /var/home
Browse files Browse the repository at this point in the history
Otherwise flatpak'ed Buildstream and flatpak'ed Flatpak Builder do not work.

ostreedev/ostree#2086
  • Loading branch information
valentindavid committed May 4, 2020
1 parent 307fc37 commit 98c7434
Showing 1 changed file with 43 additions and 21 deletions.
64 changes: 43 additions & 21 deletions elements/vm/ostree-config.bst
Expand Up @@ -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

0 comments on commit 98c7434

Please sign in to comment.