It's easier to just ensure that these directories always exist. This allows getting rid of calls to mkdir from directories/up, mdev/listen, and mdev/wait, so the overall diffstat is negative. Also use mkdir -m instead of a separate call to foreground, and use -p instead of ignoring all errors. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com> --- host/rootfs/etc/mdev/listen | 1 - host/rootfs/etc/mdev/wait | 1 - host/rootfs/etc/s6-linux-init/scripts/rc.init | 1 + host/rootfs/etc/s6-rc/weston/run | 6 +----- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/host/rootfs/etc/mdev/listen b/host/rootfs/etc/mdev/listen index 8c8d86407d1f131cf28f335c8f1028d731916203..ab50ee8c5ed1139d1129bac56afa7263af150745 100755 --- a/host/rootfs/etc/mdev/listen +++ b/host/rootfs/etc/mdev/listen @@ -4,7 +4,6 @@ foreground { redirfd -w 2 /dev/null - foreground { mkdir /run/wait } mkfifo /run/wait/${1} } diff --git a/host/rootfs/etc/mdev/wait b/host/rootfs/etc/mdev/wait index 625cd46dc06618309ebaa7230f0bed49e248f3a8..6bddb303d2671ce4e5b8581cd81235d7404916e7 100755 --- a/host/rootfs/etc/mdev/wait +++ b/host/rootfs/etc/mdev/wait @@ -4,7 +4,6 @@ foreground { redirfd -w 2 /dev/null - foreground { mkdir /run/wait } mkfifo /run/wait/${1} } diff --git a/host/rootfs/etc/s6-linux-init/scripts/rc.init b/host/rootfs/etc/s6-linux-init/scripts/rc.init index 674fd38cc76837c7be25a5ef060f0f4d4b786394..d7c4b62a91c40e10e2a773bd33c0e36dc85bd378 100755 --- a/host/rootfs/etc/s6-linux-init/scripts/rc.init +++ b/host/rootfs/etc/s6-linux-init/scripts/rc.init @@ -5,6 +5,7 @@ if { s6-rc-init -c /etc/s6-rc /run/service } if { mount --make-shared /run } +if { mkdir -m 0755 /run/user /run/wait } if { mount -a --mkdir } s6-rc change ok-all diff --git a/host/rootfs/etc/s6-rc/weston/run b/host/rootfs/etc/s6-rc/weston/run index 2512c011575591eefb110d6e3586517f28ba7064..0d3c819a8fecca6cc6b825a6e791899c12806de2 100644 --- a/host/rootfs/etc/s6-rc/weston/run +++ b/host/rootfs/etc/s6-rc/weston/run @@ -4,11 +4,7 @@ unexport WAYLAND_DISPLAY -foreground { mkdir /run/user } -foreground { - umask 077 - mkdir /run/user/0 -} +if { mkdir -p -m 0700 /run/user/0 } unexport ? backtick USER { id -un } -- Sincerely, Demi Marie Obenour (she/her/hers)