cifs root fails with read-only share

Bug #1997511 reported by Luiz Angelo Daros de Luca
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
casper (Ubuntu)
New
Undecided
Unassigned

Bug Description

If someone uses this kernel cmdline with casper:

 ip=dhcp maybe-ubiquity initrd=initrd netboot=cifs nfsroot=//myserver/share/ubuntu22.10/

It will fail if //myserver/share is marked as readonly. It fails on the losetup step:

 losetup /dev/loop0 /cdrom/casper/filesystem.squashfs

Because losetup will try to open that file as read/write and samba denies it. It looks like mount.cifs does not know/care about share read-only state and mount it as rw.

There are two ways to make losetup work:

1) mount the samba share as ro adding "NFSOPTS=-oro,user=root,password=" to the kernel command line
2) add '-r' to that losetup call

The first option is already possible without any code changes. However, I do believe there is no reason to try to access a squashfs file as read/write. It should somehow propagate to the function that calls losetup that it is dealing with a file that will not be written and losetup can use '-r'.

Tested with ubuntu 22.10 media

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.