On 2021-10-02, Vagrant Cascadian wrote:
> On 2021-02-15, Vieno Hakkerinen wrote:
>> I created a ext2 for /boot and luks+lvm+btrfs for /. As d-i defaults
>> to use a @rootfs subvolume for btrfs the linux bootargs need to have
>> set "rootflags=subvol=@rootfs". This was not set during configuration
>> of flash-kernel. Without this argument debian failed to boot with an
>> error that no init was found.
>
>>    * What outcome did you expect instead?
>>
>> debian-installer should set "rootflags=subvol=@rootfs" in 
>> /etc/default/flash-kernel when btrfs is used for /
>
>>    * What did you do to solve the problem?
>>
>> 1. I ran "setenv bootargs rootflags=subvol=@rootfs" in u-boot
>> 2. I ran "boot" in u-boot
>> 3. debian found init successfully
>> 4. I added "rootflags=subvol=@rootfs" to LINUX_KERNEL_CMDLINE_DEFAULTS in 
>> /etc/default/flash-kernel
>> 5. I ran flash-kernel
>> 6. I rebooted
>> 7. debian booted successfully
>
> So, flash-kernel-installer has a debconf question that might be useable
> for this purpose:
>
> flash-kernel-installer.postinst.in:echo flash-kernel 
> flash-kernel/linux_cmdline string $kopt_params | \
> flash-kernel-installer.postinst.in-     chroot /target debconf-set-selections
>
> I'm curious how other systems handle btrfs (e.g. grub on amd64); are
> there any configuration options passed via debian-installer to set
> "rootflags=subvol=@rootfs", or does grub have any configuration that are
> set from update-grub or whatever ... or autodetected when rootfs is on
> btrfs?

To answer my own question, looks like it's autodetected in
/etc/grub.d/10_linux:

case x"$GRUB_FS" in
    xbtrfs)
    rootsubvol="`make_system_path_relative_to_its_root /`"
    rootsubvol="${rootsubvol#/}"
    if [ "x${rootsubvol}" != x ]; then
        GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol}
        ${GRUB_CMDLINE_LINUX}"
    fi;;


I suspect the way to handle this would be to have flash-kernel-installer
do something similar and pass it into the debconf option ... unless
someone can find a sane place to put that into flash-kernel at
run-time...

It might be easier to adapt other code, such as u-boot-menu and install
u-boot-menu instead of, or in addition to, flash-kernel... or at least,
that would be another case where this could be supported.


live well,
  vagrant


Attachment: signature.asc
Description: PGP signature

Reply via email to