>
> Do you mean the following ?

> - list the partitions (same as now)
> - let the user choose a partition (same as now)
> - if the filesystem is btrfs,
>    - mount the top level subvolume on /target
>    - list the subvolumes
>    - if there are subvolumes (other than top level),
>      - let the user choose a subvolume (including top level and default)
>      - if the selected subvolume is not top level,
>        - unmount the top level subvolume
>        - mount the selected subvolume on /target


Close, except for the last 3 steps. What I suggested:
- Not changing the way partition selection happens
- Not changing the way /target is populated

When it comes to executing the shell I suggested:
- If more than 1 btrfs subvolume exists then enumerate all of the btrfs
subvolumes for the user in a list
- Do not adjust any mounted volumes/subvolumes based on this selection
- Use the user selected or default subvolume as the directory to execute
the chrooted shell in

The first issue can be solved by mounting the top level subvolume
> instead of the default subvolume.


I suggest that mounting the top level subvolume in /target is the only
reasonable option unless all subvolumes are enumerated and are offered as a
choice to become what is mounted at /target. Perhaps then the way to
approach this should be:

- If more than one subvolume exists in a btrfs partition enumerate all of
the subvolumes and display them in a list to the user
- Use the selection of the user as the contents of /target, or if there is
only one subvolume then mount it under /target without prompting, or if
there are no subvolumes then make the contents of /target the top level
subvolume.
- Offer the top level subvolume as a choice in the list of subvolumes if
more than one subvolume is available

Do you mean if the filesystem has only the top level subvolume ? Or only
> one subvolume such as @rootfs in the top level subvolume ?


Not knowing any better I'd suggest:
- If there is only a top level subvolume then do not prompt the user for a
selection and mount it at /target
- If there is only a single subvolume in the top level subvolume then do
not prompt the user for a selection

I suppose it may make sense in the case of a single subvolume inside the
top level subvolume to offer a choice between the top level subvolume and
the single subvolume under the top level one.

On Fri, Apr 18, 2025 at 7:39 AM Pascal Hambourg <pas...@plouf.fr.eu.org>
wrote:

> On 18/04/2025 at 01:24, Tyler Riddle wrote:
> >
> > I think it would be fine if the btrfs sub
> > volumes were enumerated and a list of options was provided to me to
> select
> > from and the chosen sub volume was used as the location to launch the
> > shell.
>
> Do you mean the following ?
>
> - list the partitions (same as now)
> - let the user choose a partition (same as now)
> - if the filesystem is btrfs,
>    - mount the top level subvolume on /target
>    - list the subvolumes
>    - if there are subvolumes (other than top level),
>      - let the user choose a subvolume (including top level and default)
>      - if the selected subvolume is not top level,
>        - unmount the top level subvolume
>        - mount the selected subvolume on /target
>
> > Other concerns notwithstanding I think it would make sense to
> > continue to have the contents of /target be the btrfs volume mounted with
> > no subvolume specified (continuing the behavior as it is now) and that
> when
> > the menu is used to pick a subvolume it only tells the Debian installer
> > what the chroot directory should be.
>
> I see two issues with this:
> - If the default subvolume is not the top level subvolume, then other
> subvolumes which are not in its path are hidden.
> - rescue.d/ scripts which may belong to other packages than rescue-mode
> such as grub-install expect the system root to be in /target.
>
> The first issue can be solved by mounting the top level subvolume
> instead of the default subvolume. However the second issue requires to
> change the interface between rescue-mode and rescue.d scripts.
>
> > If there is only a single subvolume present I don't see why it would be
> > necessary to prompt the user to select the only option from a list
>
> Do you mean if the filesystem has only the top level subvolume ? Or only
> one subvolume such as @rootfs in the top level subvolume ?
>

Reply via email to