Merge pull request #2720 from aristidb/master
fhs-chrootenv (steam): support directly using users other than root, fix sound support, fix /run/user
This commit is contained in:
commit
7cdeb712c3
pkgs
build-support/build-fhs-chrootenv
top-level
|
@ -1,11 +1,11 @@
|
||||||
{stdenv, glibc, glibcLocales, gcc, coreutils, diffutils, findutils, gnused, gnugrep, gnutar, gzip, bzip2,
|
{stdenv, glibc, glibcLocales, gcc, coreutils, diffutils, findutils, gnused, gnugrep, gnutar, gzip, bzip2,
|
||||||
bashInteractive, xz, shadow, gawk, less, su, buildEnv}:
|
bashInteractive, xz, shadow, gawk, less, buildEnv}:
|
||||||
{name, pkgs ? [], profile ? ""}:
|
{name, pkgs ? [], profile ? ""}:
|
||||||
|
|
||||||
let
|
let
|
||||||
basePkgs = [
|
basePkgs = [
|
||||||
glibc glibcLocales gcc coreutils diffutils findutils gnused gnugrep gnutar
|
glibc glibcLocales gcc coreutils diffutils findutils gnused gnugrep gnutar
|
||||||
gzip bzip2 bashInteractive xz shadow gawk less su
|
gzip bzip2 bashInteractive xz shadow gawk less
|
||||||
];
|
];
|
||||||
|
|
||||||
# Compose a global profile for the chroot environment
|
# Compose a global profile for the chroot environment
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
chrootenvDest=/run/chrootenv/@name@
|
chrootenvDest=/run/chrootenv/@name@
|
||||||
|
|
||||||
# Enter the LFS chroot environment
|
# Enter the LFS chroot environment
|
||||||
chroot $chrootenvDest /usr/bin/env -i PS1="$PS1" TERM="$TERM" DISPLAY="$DISPLAY" HOME="/root" PATH="/bin:/sbin" /bin/bash --login
|
sudo chroot --userspec "$USER:${GROUPS[0]}" --groups "${GROUPS[0]}" $chrootenvDest /usr/bin/env -i PS1="$PS1" TERM="$TERM" DISPLAY="$DISPLAY" HOME="$HOME" PATH="/bin:/sbin" XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" /bin/bash --login
|
||||||
|
|
|
@ -17,7 +17,7 @@ mount --bind /home $chrootenvDest/home
|
||||||
|
|
||||||
# Bind mount state directories
|
# Bind mount state directories
|
||||||
mount --bind /var $chrootenvDest/var
|
mount --bind /var $chrootenvDest/var
|
||||||
mount --bind /run $chrootenvDest/run
|
mount --rbind /run $chrootenvDest/run
|
||||||
|
|
||||||
# Bind mount the host system's /etc
|
# Bind mount the host system's /etc
|
||||||
mount --bind /etc $chrootenvDest/host-etc
|
mount --bind /etc $chrootenvDest/host-etc
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
chrootenvDest=/run/chrootenv/@name@
|
chrootenvDest=/run/chrootenv/@name@
|
||||||
|
|
||||||
# Unmount all bind mounts
|
# Unmount all (r)bind mounts
|
||||||
umount $chrootenvDest/{dev/pts,dev/shm,dev,nix/store,proc,sys,host-etc,home,var,run}
|
umount -l $chrootenvDest/{dev/pts,dev/shm,dev,nix/store,proc,sys,host-etc,home,var,run}
|
||||||
|
|
|
@ -270,7 +270,7 @@ let
|
||||||
buildFHSChrootEnv = import ../build-support/build-fhs-chrootenv {
|
buildFHSChrootEnv = import ../build-support/build-fhs-chrootenv {
|
||||||
inherit stdenv glibc glibcLocales gcc coreutils diffutils findutils;
|
inherit stdenv glibc glibcLocales gcc coreutils diffutils findutils;
|
||||||
inherit gnused gnugrep gnutar gzip bzip2 bashInteractive xz shadow gawk;
|
inherit gnused gnugrep gnutar gzip bzip2 bashInteractive xz shadow gawk;
|
||||||
inherit less su buildEnv;
|
inherit less buildEnv;
|
||||||
};
|
};
|
||||||
|
|
||||||
dotnetenv = import ../build-support/dotnetenv {
|
dotnetenv = import ../build-support/dotnetenv {
|
||||||
|
|
Loading…
Reference in New Issue