Solved 15-STABLE /compat/linux problem; Brave doesn’t work

VirtualBox VM install, 14.3-R-p4 was cloned, clone upgraded using freebsd-update upgrade -r to 15.0-BETA1, then pkgbasefied and upgraded to 15-STABLE (FreeBSD 15.0-STABLE stable/15-n280708-bbfaff26bf36 GENERIC amd64 1500500).

All /etc/*.pkgsave were dealt with for file in *.pkgsave; do cp “$file” “${file%.pkgsave}”; done and pwd_mkdb -p /etc/master.passwd.
List of all pkgs was saved on 14 and used to reinstall what got missing in 15-STABLE. Linux is emulators/linux_base-rl9 with bunch of other rl9 pkgs, all same version on 14 and 15.

/etc/fstab is same on both:
Code:
# Device        Mountpoint              FStype          Options         Dump    Pass#
/dev/ada0p1     /boot/efi               msdosfs         rw              2       2
/dev/ada0p2     none                    swap            sw              0       0
#
#/dev/cd0       /mnt/cdrom              cd9660          ro,noauto       0       0
/dev/da1/       /mnt/usb/               auto            rw,noauto       0       0
#
fdesc           /dev/fd                 fdescfs         rw,auto,late    0       0
proc            /proc                   procfs          rw              0       0
linproc         /compat/linux/proc      linprocfs       rw,auto,late    0       0
linsys          /compat/linux/sys       linsysfs        rw              0       0
tmpfs           /compat/linux/dev/shm   tmpfs           rw,mode=1777    0       0
But permissions under /compat/linux are different in 14 and 15
14:
Code:
 > ls -l /compat/linux/
drwxr-xr-x   2 root wheel    2B Sep  9 17:40 afs/
lrwxr-xr-x   1 root wheel    7B Nov  3  2024 bin -> usr/bin
drwxr-xr-x   3 root wheel    3B Mar 23  2017 dev/
drwxr-xr-x  36 root wheel   77B Sep  9 17:41 etc/
lrwxr-xr-x   1 root wheel    7B Nov  3  2024 lib -> usr/lib
lrwxr-xr-x   1 root wheel    9B Nov  3  2024 lib64 -> usr/lib64
drwxr-xr-x   2 root wheel    2B Sep  9  2016 mnt/
drwxr-xr-x   2 root wheel    2B Sep  9 17:40 opt/
dr-xr-xr-x   1 root wheel    0B Oct 16 11:31 proc/
lrwxr-xr-x   1 root wheel    8B Sep  6 03:06 run -> /var/run
lrwxr-xr-x   1 root wheel    8B Nov  3  2024 sbin -> usr/sbin
drwxr-xr-x   2 root wheel    2B Sep  9  2016 selinux/
drwxr-xr-x   2 root wheel    2B Sep  9 17:40 srv/
dr-xr-xr-x   1 root wheel    0B Oct 16 11:31 sys/
drwxr-xr-x  12 root wheel   13B Sep  9 17:40 usr/
drwxr-xr-x  17 root wheel   18B Sep  9 17:40 var/

> ls -ld /compat/linux/dev/shm/
drwxrwxrwt  2 root wheel    0B Oct 16 11:28 /compat/linux/dev/shm//
In 14 /shm/ is only item under /compat/linux/dev/

In 15 dir looks like this:
Code:
> ls -l /compat/linux/
drwxr-xr-x   2 root wheel    2B Sep  9 17:40 afs/
lrwxr-xr-x   1 root wheel    7B Nov  3  2024 bin -> usr/bin
dr-xr-xr-x   8 root wheel  512B Oct 16 11:03 dev/
drwxr-xr-x  36 root wheel   77B Oct 16 06:19 etc/
lrwxr-xr-x   1 root wheel    7B Nov  3  2024 lib -> usr/lib
lrwxr-xr-x   1 root wheel    9B Nov  3  2024 lib64 -> usr/lib64
drwxr-xr-x   2 root wheel    2B Sep  9  2016 mnt/
drwxr-xr-x   2 root wheel    2B Sep  9 17:40 opt/
dr-xr-xr-x   1 root wheel    0B Oct 16 11:26 proc/
lrwxr-xr-x   1 root wheel    8B Oct 12 03:14 run -> /var/run
lrwxr-xr-x   1 root wheel    8B Nov  3  2024 sbin -> usr/sbin
drwxr-xr-x   2 root wheel    2B Sep  9  2016 selinux/
drwxr-xr-x   2 root wheel    2B Sep  9 17:40 srv/
dr-xr-xr-x   1 root wheel    0B Oct 16 11:26 sys/
drwxr-xr-x  12 root wheel   13B Oct 16 05:54 usr/
drwxr-xr-x  17 root wheel   18B Oct 16 05:54 var/

> ls -ld /compat/linux/dev/shm/
dr-xr-xr-x  2 root wheel  512B Oct 16 11:03 /compat/linux/dev/shm//
Please notice difference in permissions, both /dev/ and /dev/shm are not writable, despite same /etc/fstab and /etc/rc.conf. Also, in 15 /compat/linux/dev/ now has 85 different items in it.

It’s no wonder that brave-browser fails when can’t write to /shm/ (Creating shared memory in /dev/shm/.org.chromium.Chromium.xVe9l0 failed: Operation not supported (95)); It works perfectly on 14.3-R-p4

My guess that other software that needs to write to tmpfs will also fail on 15-STABLE.

What I can do to fix this problem?
Thanks in advance.
 
/etc/fstab is same on both:
Code:
fdesc           /dev/fd                 fdescfs         rw,auto,late    0       0
proc            /proc                   procfs          rw              0       0
linproc         /compat/linux/proc      linprocfs       rw,auto,late    0       0
linsys          /compat/linux/sys       linsysfs        rw              0       0
tmpfs           /compat/linux/dev/shm   tmpfs           rw,mode=1777    0       0

Instead of mounting Linux mounts from fstab, try rc.conf linux_enable="YES".

The variable executes /etc/rc.d/linux
Rich (BB code):
        ...
        if checkyesno linux_mounts_enable; then
                linux_mount linprocfs "${_emul_path}/proc" -o nocover
                linux_mount linsysfs "${_emul_path}/sys" -o nocover
                linux_mount devfs "${_emul_path}/dev" -o nocover
                linux_mount fdescfs "${_emul_path}/dev/fd" -o nocover,linrdlnk
                linux_mount tmpfs "${_emul_path}/dev/shm" -o nocover,mode=1777
        fi
        ...
and /etc/defaults/rc.conf
Code:
linux_mounts_enable="YES" # If linux_enable is set to YES, mount Linux-specific
                        # filesystems at startup.
 
Instead of mounting Linux mounts from fstab, try rc.conf linux_enable="YES".

The variable executes /etc/rc.d/linux
Rich (BB code):
        ...
        if checkyesno linux_mounts_enable; then
                linux_mount linprocfs "${_emul_path}/proc" -o nocover
                linux_mount linsysfs "${_emul_path}/sys" -o nocover
                linux_mount devfs "${_emul_path}/dev" -o nocover
                linux_mount fdescfs "${_emul_path}/dev/fd" -o nocover,linrdlnk
                linux_mount tmpfs "${_emul_path}/dev/shm" -o nocover,mode=1777
        fi
        ...
and /etc/defaults/rc.conf
Code:
linux_mounts_enable="YES" # If linux_enable is set to YES, mount Linux-specific
                        # filesystems at startup.
Brilliant, thanks a ton 🙏 That solved the problem – I commented out Linux part of /etc/fstab and added line linux_mounts_enable="YES" under linux_enable="YES" in /etc/rc.conf and now .../dev/shm/ has same permissions as in 14.3-R-p4
drwxrwxrwt 2 root wheel 0B Oct 16 13:33 /compat/linux/dev/shm// and brave-browser starts normally 🥳🎉

Thanks again! IDK about linux_mounts_enable="YES" before, that’s very useful to know!

15-STABLE-Brave.jpg
 
I commented out Linux part of /etc/fstab and added line linux_mounts_enable="YES" under linux_enable="YES" in /etc/rc.conf
linux_mounts_enable defaults to "YES". See /etc/defaults/rc.conf.
Code:
linux_enable="NO"       # Linux binary compatibility loaded at startup (or NO).
linux_mounts_enable="YES" # If linux_enable is set to YES, mount Linux-specific
                           # filesystems at startup.
 
linux_mounts_enable defaults to "YES". See /etc/defaults/rc.conf.
Code:
linux_enable="NO"       # Linux binary compatibility loaded at startup (or NO).
linux_mounts_enable="YES" # If linux_enable is set to YES, mount Linux-specific
                           # filesystems at startup.
That's very good to know, thanks! 🙏 One question: looking at /etc/rc.d/linux doesn’t look that it covers for debootstrap need for /tmp & /home nullfs
Code:
/tmp            /compat/ubuntu/tmp      nullfs          rw,late                      0       0
/home           /compat/ubuntu/home     nullfs          rw,late                      0       0
In that case, we have to use /etc/fstab or I’m wrong?
 
Back
Top