ostree
ostree copied to clipboard
Preparing final bootloader swap: symlinkat: Operation not permitted
Hi,
I'm trying to build a custom rootfs for my Raspberry Pi 4B 64-bit using multistrap and deploy it via ostree admin deploy via a HTTP OSTree repository.
The build works fine (even If I think I missed few things) but when I try to deploy the tree on my RPi I got this error:
sudo ostree admin deploy --os=debian rpi/debian/stable/arm64 -vvv
OT: Preparing transaction in repository 0x5597508000
OT: Pushing lock non-blocking with timeout 30
OT: Creating repo lock table
OT: Opening repo lock file
OT: Push lock: state=unlocked, depth=0
OT: Locking repo shared
OT: Using new tmpdir staging-ae7ca82b-90f5-4160-8194-987727f46a5a-xyZ6ls
OT: Committing transaction in repository 0x5597508000
OT: txn commit staging-ae7ca82b-90f5-4160-8194-987727f46a5a-xyZ6ls
OT: Popping lock non-blocking with timeout 30
OT: Pop lock: state=shared, depth=1
OT: Unlocking repo
OT: boot is ro: no
OT: Using bootloader: (none)
OT: Free lock: state=unlocked, depth=0
OT: Closing repo lock file
OT: Free lock table
error: Preparing final bootloader swap: symlinkat: Operation not permitted
The problem is that /boot partition is vfat and symlinks cannot be created on this filesystem and during the ostree admin deploy I think /boot/ostree try to be created.
I tried to follow the information from @starnight provided in this issue https://github.com/ostreedev/ostree/issues/2223 (I opened) but I'm kind of stuck.
Any idea?
The more I search for a solution the more I think it's related to my rootfs.
What will be the "best" tool/solution to build rootfs based on Debian for Raspberry Pi?
The problem is that /boot partition is vfat and symlinks cannot be created on this filesystem and during the ostree admin deploy I think /boot/ostree try to be created.
Yes! "vfat does not support link" is the key point.
Endless OS has two partitions on RPi 4B's SD card.
SD card
- boot partition (FAT)
- A folder has RPi firmware files, config files and u-boot (u-boot will find the boot.scr in the rootfs system partition's
/boot/by enumerating partitions)
- A folder has RPi firmware files, config files and u-boot (u-boot will find the boot.scr in the rootfs system partition's
- rootfs system partition (ext4)
- /boot/ (not the boot partition)
- boot.scr (u-boot script)
- ostree/
- the OSTree layer/snapshot ...
- uEnv.txt
- ...
- /dev/
- /etc/
- /lib/
- /ostree/
- /sys/
- /sysroot/
- /usr/
- ...
- /boot/ (not the boot partition)
For this case in Endless OS, OSTree only plays things in the rootfs system partition, and does not touch the things in the boot partition.
@starnight Thanks for the information, this is exactly what I'm trying to achieve with all this information in mind.
How can I prevent ostree admin deploy to write in /boot?
Then I think it has something to do with the way I initialize OSTtree on the client.
ostree admin init-fs /
Does it seems correct for you or do I need to replace / by a different directory?
Did you ever find a good solution @goldyfruit? Looks like there's some work around this here: https://github.com/ostreedev/ostree/pull/1967
Did you ever find a good solution @goldyfruit? Looks like there's some work around this here: https://github.com/ostreedev/ostree/pull/1967
No I didn't.
Gnome managed to get Raspberry Pi 4 to work with help of U-Boot as demonstrated here: https://gitlab.gnome.org/rmader/gnome-build-meta/-/blob/gnome-43/elements/boards/raspberrypi-4/image.bst
They're also setting up a QEMU VM which skips bootloader creation altogether and instead they just copy over relevant files to /boot (which seems to be useful for oneshot setup but you'd have to tweak it to get atomic updates to work properly if I've understood it correctly):
https://gitlab.gnome.org/rmader/gnome-build-meta/-/blob/gnome-43/elements/vm/image.bst