Re: [PATCH] host/rootfs: add mount-userdata command

Alyssa Ross
2025-12-13T10:59:55Z

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

Demi Marie Obenour <demiobenour@gmail.com> writes:

> On 12/12/25 16:48, Alyssa Ross wrote:
>> diff --git a/host/rootfs/image/usr/bin/mount-userdata b/host/rootfs/image/usr/bin/mount-userdata
>> new file mode 100755
>> index 00000000..e4a873c0
>> --- /dev/null
>> +++ b/host/rootfs/image/usr/bin/mount-userdata
>> @@ -0,0 +1,24 @@
>> +#!/bin/execlineb -W
>> +# SPDX-License-Identifier: EUPL-1.2+
>> +# SPDX-FileCopyrightText: 2025 Alyssa Ross <hi@alyssa.is>
>> +
>> +backtick -D "" uuid {
>> + importas -Siu 1
>> + blkid -o value -s UUID $1
>
> Missing "--"?

Will add.

>> +}
>> +
>> +multisubstitute {
>> + importas -Siu 0
>> + importas -Siu 1
>> + importas -Siu uuid
>> +}
>> +
>> +case $uuid {
>> + "" {
>> + fdmove -c 1 2
>> + printf "%s: '%s' does not have a UUID\n" $0 $1
>> + }
>> +}
>> +
>> +if { mount -m -o nosuid,nodev,noexec,nosymfollow -- $1 /media/${uuid} }
>> +printf "%s\n" /media/${uuid}
>
> Do we really want a mode of 0755? Also, I believe Spectrum should
> use noatime. This avoids a burst of unsharing of snapshots due to
> atime updates.

Will applications be okay with that? What do OpenSUSE/Fedora do?

I'm going to go ahead with the default for now but happy to keep
discussing.

> Should this use ‘-t btrfs’? I thought Spectrum assumed this.

Yeah, makes sense.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]