Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparing final bootloader swap: symlinkat: Operation not permitted #2478

Open
goldyfruit opened this issue Nov 3, 2021 · 6 comments
Open

Comments

@goldyfruit
Copy link

goldyfruit commented Nov 3, 2021

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 #2223 (I opened) but I'm kind of stuck.

Any idea?

@goldyfruit
Copy link
Author

goldyfruit commented Nov 4, 2021

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?

@starnight
Copy link

starnight commented Nov 4, 2021

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)
  • 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/
    • ...

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.

@goldyfruit
Copy link
Author

@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?

@GrabbenD
Copy link

GrabbenD commented Aug 29, 2023

Did you ever find a good solution @goldyfruit?
Looks like there's some work around this here: #1967

@goldyfruit
Copy link
Author

Did you ever find a good solution @goldyfruit?
Looks like there's some work around this here: #1967

No I didn't.

@GrabbenD
Copy link

GrabbenD commented Sep 4, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants