~mil/sxmo-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
6 3

[PATCH sxmo-utils] sxmo_init.sh: use mkrundir if available

Details
Message ID
<20240325163743.25608-2-contact@willowbarraco.fr>
DKIM signature
pass
Download raw message
Patch: +5 -0
mkrundir is a simple program by whynothugo that simply create the
rundir.

This patch is enough for Sxmo to use /run/user-$uid as XDG_RUNTIME_DIR. Even if
this is still less common that /run/user/$uid, it still is preferable, and more
compatible than our /dev/shm/user/$uid (ex: flatpak refuse to bind mount /dev/
paths).

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
---
 configs/profile.d/sxmo_init.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/configs/profile.d/sxmo_init.sh b/configs/profile.d/sxmo_init.sh
index 785d235f..83d50ea6 100644
--- a/configs/profile.d/sxmo_init.sh
+++ b/configs/profile.d/sxmo_init.sh
@@ -48,6 +48,11 @@ _sxmo_find_runtime_dir() {
		fi
	done

	if type mkrundir > /dev/null 2>&1; then
		mkrundir
		return
	fi

	# Fallback to a shared memory location
	printf "/dev/shm/user/%s" "$(id -u)"
}
-- 
2.44.0

[sxmo-utils/patches/test.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D02Z8TNDTSLL.3FKOQR4DQFY6E@fra01>
In-Reply-To
<20240325163743.25608-2-contact@willowbarraco.fr> (view parent)
DKIM signature
missing
Download raw message
sxmo-utils/patches/test.yml: SUCCESS in 32s

[sxmo_init.sh: use mkrundir if available][0] from [Willow Barraco][1]

[0]: https://lists.sr.ht/~mil/sxmo-devel/patches/50441
[1]: contact@willowbarraco.fr

✓ #1178150 SUCCESS sxmo-utils/patches/test.yml https://builds.sr.ht/~mil/job/1178150
Details
Message ID
<56bbx5zo3ou5vygdz2cvwlozlhydlcpob6acplp6gnb2lmkyjs@asgg3o4wst5h>
In-Reply-To
<20240325163743.25608-2-contact@willowbarraco.fr> (view parent)
DKIM signature
pass
Download raw message
On Mon, Mar 25, 2024 at 05:37:43PM +0100, Willow Barraco wrote:
> mkrundir is a simple program by whynothugo that simply create the
> rundir.
> 
> This patch is enough for Sxmo to use /run/user-$uid as XDG_RUNTIME_DIR. Even if
> this is still less common that /run/user/$uid, it still is preferable, and more
> compatible than our /dev/shm/user/$uid (ex: flatpak refuse to bind mount /dev/
> paths).
> 
> Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
> ---
>  configs/profile.d/sxmo_init.sh | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/configs/profile.d/sxmo_init.sh b/configs/profile.d/sxmo_init.sh
> index 785d235f..83d50ea6 100644
> --- a/configs/profile.d/sxmo_init.sh
> +++ b/configs/profile.d/sxmo_init.sh
> @@ -48,6 +48,11 @@ _sxmo_find_runtime_dir() {
>  		fi
>  	done
>  
> +	if type mkrundir > /dev/null 2>&1; then
> +		mkrundir

Does this need to be "XDG_RUNTIME_DIR=$(mkrundir)"?

Also is there a reason to use type instead of command -v like we do
elsewhere?

Besides that, looks good to me.

------------------------------------------------------------------------

Has there been any progress on hare getting 32bit support? It would be
nice if we could have a single fallback for XDG_RUNTIME_DIR if it's not
set, but 32bit support will prevent mkrundir from doing that.

 - Aren

> +		return
> +	fi
> +
>  	# Fallback to a shared memory location
>  	printf "/dev/shm/user/%s" "$(id -u)"
>  }
> -- 
> 2.44.0
> 
Details
Message ID
<D0H2IZOBFYDK.2T9V2FVNTAXL5@willowbarraco.fr>
In-Reply-To
<56bbx5zo3ou5vygdz2cvwlozlhydlcpob6acplp6gnb2lmkyjs@asgg3o4wst5h> (view parent)
DKIM signature
pass
Download raw message
> >  configs/profile.d/sxmo_init.sh | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/configs/profile.d/sxmo_init.sh b/configs/profile.d/sxmo_init.sh
> > index 785d235f..83d50ea6 100644
> > --- a/configs/profile.d/sxmo_init.sh
> > +++ b/configs/profile.d/sxmo_init.sh
> > @@ -48,6 +48,11 @@ _sxmo_find_runtime_dir() {
> >  		fi
> >  	done
> >  
> > +	if type mkrundir > /dev/null 2>&1; then
> > +		mkrundir
>
> Does this need to be "XDG_RUNTIME_DIR=$(mkrundir)"?

Now, this is the _sxmo_find_runtime_dir that just output what should be
used. It is then used by _sxmo_load_environments or _sxmo_grab_session.

> Also is there a reason to use type instead of command -v like we do
> elsewhere?

No, I should rather use command -v. Fixed my tree. Thanks!

> Has there been any progress on hare getting 32bit support? It would be
> nice if we could have a single fallback for XDG_RUNTIME_DIR if it's not
> set, but 32bit support will prevent mkrundir from doing that.

I agree, but no there is still no progress on this yet..

Thanks Aren!
Willow
Details
Message ID
<ui3scv6tvkiri4alj56ivqai3hiny2er3d2qlnneatwbsomynr@4jejiilb6epu>
In-Reply-To
<D0H2IZOBFYDK.2T9V2FVNTAXL5@willowbarraco.fr> (view parent)
DKIM signature
pass
Download raw message
On Thu, Apr 11, 2024 at 08:09:59AM +0200, Willow Barraco wrote:
> > >  configs/profile.d/sxmo_init.sh | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/configs/profile.d/sxmo_init.sh b/configs/profile.d/sxmo_init.sh
> > > index 785d235f..83d50ea6 100644
> > > --- a/configs/profile.d/sxmo_init.sh
> > > +++ b/configs/profile.d/sxmo_init.sh
> > > @@ -48,6 +48,11 @@ _sxmo_find_runtime_dir() {
> > >  		fi
> > >  	done
> > >  
> > > +	if type mkrundir > /dev/null 2>&1; then
> > > +		mkrundir
> >
> > Does this need to be "XDG_RUNTIME_DIR=$(mkrundir)"?
> 
> Now, this is the _sxmo_find_runtime_dir that just output what should be
> used. It is then used by _sxmo_load_environments or _sxmo_grab_session.

Oh right, I guess I should have looked at this with a bit more context.

> > Also is there a reason to use type instead of command -v like we do
> > elsewhere?
> 
> No, I should rather use command -v. Fixed my tree. Thanks!

Sounds good, feel free to add:
Reviewed-by: Aren Moynihan <aren@peacevolution.org>

> > Has there been any progress on hare getting 32bit support? It would be
> > nice if we could have a single fallback for XDG_RUNTIME_DIR if it's not
> > set, but 32bit support will prevent mkrundir from doing that.
> 
> I agree, but no there is still no progress on this yet..
> 
> Thanks Aren!
> Willow
Details
Message ID
<3ygdety3ic6ozwirx6dboo4mnajbqxnyyq5ihrwe6k32zpm4kk@arpfi4z7a4d5>
In-Reply-To
<D0H2IZOBFYDK.2T9V2FVNTAXL5@willowbarraco.fr> (view parent)
DKIM signature
pass
Download raw message
On Thu, Apr 11, 2024 at 08:09:59AM +0200, Willow Barraco wrote:
> > >  configs/profile.d/sxmo_init.sh | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/configs/profile.d/sxmo_init.sh b/configs/profile.d/sxmo_init.sh
> > > index 785d235f..83d50ea6 100644
> > > --- a/configs/profile.d/sxmo_init.sh
> > > +++ b/configs/profile.d/sxmo_init.sh
> > > @@ -48,6 +48,11 @@ _sxmo_find_runtime_dir() {
> > >  		fi
> > >  	done
> > >  
> > > +	if type mkrundir > /dev/null 2>&1; then
> > > +		mkrundir
> >
> > Does this need to be "XDG_RUNTIME_DIR=$(mkrundir)"?
> 
> Now, this is the _sxmo_find_runtime_dir that just output what should be
> used. It is then used by _sxmo_load_environments or _sxmo_grab_session.
> 
> > Also is there a reason to use type instead of command -v like we do
> > elsewhere?
> 
> No, I should rather use command -v. Fixed my tree. Thanks!

Can you resend the version with this fix? Marking as needs revision
Details
Message ID
<D138MIA9H0UW.1VDI7GQS8KMO5@willowbarraco.fr>
In-Reply-To
<3ygdety3ic6ozwirx6dboo4mnajbqxnyyq5ihrwe6k32zpm4kk@arpfi4z7a4d5> (view parent)
DKIM signature
pass
Download raw message
I've merged the patch with the reviewed change. Thanks!
Reply to thread Export thread (mbox)