* expand-on-first-boot broken with btrfs subvolume
@ 2025-01-23 2:21 Stephen Ecker
2025-01-23 7:38 ` Uladzimir Bely
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Ecker @ 2025-01-23 2:21 UTC (permalink / raw)
To: isar-users
[-- Attachment #1.1: Type: text/plain, Size: 1577 bytes --]
I have an initramfs script that moves the root filesystem to btrfs
subvolume on first boot. This breaks the expand-last-partition.sh script
for the oddest reason:
line 4: *findmnt / -o source -n*
normally this line outputs something like: */dev/name*,
but when on a btrfs subvolume, it outputs: */dev/name[@subvol] *
This leads to the error: "*Boot device equals root device - no partitioning
found"*
not exactly sure why, as I didn't dissect every line. I found that changing
the command in line 4 to: *findmnt / -o sources -n*
fixed the problem... I tried this after I noticed running *findmnt /
--output-all*, the device name alone was listed under SOURCES, where SOURCE
had the subvol appended.
I don't really *like* this solution, partly because 1) an ubuntu
installation I have doesn't even have the *sources* output (though it was
added 3 years ago,
see: https://github.com/util-linux/util-linux/blame/master/misc-utils/findmnt.c#L135
)... but mainly because I don't know exactly what this will look like for
other device / filesystem types.
maybe we could add a sed expression to trim past the device name? i.e.
*findmnt / -o source -n | sed 's, [\[.*]*,,' *
thoughts?
thanks,
Stephen
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/3652dfef-495c-431c-b91b-9ff1e6735157n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 2178 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: expand-on-first-boot broken with btrfs subvolume
2025-01-23 2:21 expand-on-first-boot broken with btrfs subvolume Stephen Ecker
@ 2025-01-23 7:38 ` Uladzimir Bely
2025-01-23 7:50 ` Stephen Ecker
0 siblings, 1 reply; 3+ messages in thread
From: Uladzimir Bely @ 2025-01-23 7:38 UTC (permalink / raw)
To: Stephen Ecker, isar-users
On Wed, 2025-01-22 at 18:21 -0800, Stephen Ecker wrote:
> I have an initramfs script that moves the root filesystem to btrfs
> subvolume on first boot. This breaks the expand-last-partition.sh
> script for the oddest reason:
>
> line 4: findmnt / -o source -n
>
> normally this line outputs something like: /dev/name,
> but when on a btrfs subvolume, it outputs: /dev/name[@subvol]
>
> This leads to the error: "Boot device equals root device - no
> partitioning found"
> not exactly sure why, as I didn't dissect every line. I found that
> changing the command in line 4 to: findmnt / -o sources -n
> fixed the problem... I tried this after I noticed running findmnt / -
> -output-all, the device name alone was listed under SOURCES, where
> SOURCE had the subvol appended.
>
> I don't really like this solution, partly because 1) an ubuntu
> installation I have doesn't even have the sources output (though it
> was added 3 years ago,
> see: https://github.com/util-linux/util-linux/blame/master/misc-utils
> /findmnt.c#L135 )... but mainly because I don't know exactly what
> this will look like for other device / filesystem types.
>
> maybe we could add a sed expression to trim past the device name?
> i.e.
>
> findmnt / -o source -n | sed 's, [\[.*]*,,'
>
> thoughts?
It doesn't look like something to be changed in Isar.
But you could simply have custom expand script in you layer that does
things you need.
| meta-your-layer/recipes-support/expand-on-first-boot/expand-on-first-
boot_%.bbappend:
|
| ```
| FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
| ```
| meta-your-layer/recipes-support/expand-on-first-boot/files/expand-
last-partition.sh
So, bitbake will take the script from your layer while other files of
the recipe will be taken from isar's `meta` layer.
> thanks,
> Stephen
> --
> You received this message because you are subscribed to the Google
> Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/isar-users/3652dfef-495c-431c-b91b-9ff1e6735157n%40googlegroups.com
> .
--
Best regards,
Uladzimir.
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/510274b28f1ae5fc4f4d61a269f7441befdcc116.camel%40ilbers.de.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: expand-on-first-boot broken with btrfs subvolume
2025-01-23 7:38 ` Uladzimir Bely
@ 2025-01-23 7:50 ` Stephen Ecker
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Ecker @ 2025-01-23 7:50 UTC (permalink / raw)
To: Uladzimir Bely; +Cc: isar-users
[-- Attachment #1: Type: text/plain, Size: 2969 bytes --]
Well, that's what I did... But I don't understand why it's not something to
be changed in isar... I presumed anyone would want their code to reasonably
support as many scenarios as possible.
On Thu, Jan 23, 2025, 1:38 AM Uladzimir Bely <ubely@ilbers.de> wrote:
> On Wed, 2025-01-22 at 18:21 -0800, Stephen Ecker wrote:
> > I have an initramfs script that moves the root filesystem to btrfs
> > subvolume on first boot. This breaks the expand-last-partition.sh
> > script for the oddest reason:
> >
> > line 4: findmnt / -o source -n
> >
> > normally this line outputs something like: /dev/name,
> > but when on a btrfs subvolume, it outputs: /dev/name[@subvol]
> >
> > This leads to the error: "Boot device equals root device - no
> > partitioning found"
> > not exactly sure why, as I didn't dissect every line. I found that
> > changing the command in line 4 to: findmnt / -o sources -n
> > fixed the problem... I tried this after I noticed running findmnt / -
> > -output-all, the device name alone was listed under SOURCES, where
> > SOURCE had the subvol appended.
> >
> > I don't really like this solution, partly because 1) an ubuntu
> > installation I have doesn't even have the sources output (though it
> > was added 3 years ago,
> > see: https://github.com/util-linux/util-linux/blame/master/misc-utils
> > /findmnt.c#L135 )... but mainly because I don't know exactly what
> > this will look like for other device / filesystem types.
> >
> > maybe we could add a sed expression to trim past the device name?
> > i.e.
> >
> > findmnt / -o source -n | sed 's, [\[.*]*,,'
> >
> > thoughts?
>
> It doesn't look like something to be changed in Isar.
>
> But you could simply have custom expand script in you layer that does
> things you need.
>
> | meta-your-layer/recipes-support/expand-on-first-boot/expand-on-first-
> boot_%.bbappend:
> |
> | ```
> | FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
> | ```
> | meta-your-layer/recipes-support/expand-on-first-boot/files/expand-
> last-partition.sh
>
> So, bitbake will take the script from your layer while other files of
> the recipe will be taken from isar's `meta` layer.
>
> > thanks,
> > Stephen
> > --
> > You received this message because you are subscribed to the Google
> > Groups "isar-users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> > send an email to isar-users+unsubscribe@googlegroups.com.
> > To view this discussion visit
> >
> https://groups.google.com/d/msgid/isar-users/3652dfef-495c-431c-b91b-9ff1e6735157n%40googlegroups.com
> > .
>
> --
> Best regards,
> Uladzimir.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/CAK9C7GDM9juAYg9ewawK0LsHDNzLBX8N3gBeyK%3DT7JShHEUdQA%40mail.gmail.com.
[-- Attachment #2: Type: text/html, Size: 4399 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-23 7:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-23 2:21 expand-on-first-boot broken with btrfs subvolume Stephen Ecker
2025-01-23 7:38 ` Uladzimir Bely
2025-01-23 7:50 ` Stephen Ecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox