Hi all,

I am able to generate a rootfs image of type btrfs.
Btrfs supports subvolumes, for instance with name @.

Using subvolumes instead of partitions allow more efficient use of the emmc compared to separate partitions. And it allows multiple versions of the rootfs in the same pool.

Manually I can create a subvolume (on the host) by loop mounting the btrfs image and taking the snapshot. Something like this:
mkdir tmp
sudo mount edison-image.btrfs tmp
sudo btrfs subvolume snapshot tmp tmp/@

and then remove all dir's in root except @.

mount and btrfs operations need root permissions AFAIK. Is there any way to add these to the recipe?

There is 2nd thing I want to achieve:
Btrfs can send / receive these snapshots allowing over-the-air-updates.

For this I need to:
sudo btrfs subvolume snapshot -r tmp/@ tmp/@ota
sudo btrfs send tmp/@ota > edison-image.snapshot

And then later manually (with the device having mounted btrfs on /mnt):

cat edison-image.snapshot | ssh root@edison "btrfs receive /mnt"
ssh root@edison "btrfs property set -ts /mnt/@ota ro false"

How do I automated the first steps in yocto?

Ferry



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#48573): https://lists.yoctoproject.org/g/yocto/message/48573
Mute This Topic: https://lists.yoctoproject.org/mt/71474721/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to