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

ostree init and init-fs, should order of calls matter? #3055

Open
fwilhe opened this issue Sep 21, 2023 · 2 comments
Open

ostree init and init-fs, should order of calls matter? #3055

fwilhe opened this issue Sep 21, 2023 · 2 comments
Labels

Comments

@fwilhe
Copy link
Contributor

fwilhe commented Sep 21, 2023

Hi,

I was observing something that did not seem logical to me, I'm not sure if this is a bug but I don't really understand what ostree is doing here.

Given this example cli session:

$ mkdir sysroot
$ ostree admin init-fs --modern sysroot
$ mkdir -p sysroot/ostree/repo
$ ostree init --mode=archive --repo=sysroot/ostree/repo
$ mkdir rootfs
$ echo abc > rootfs/foo
$ ostree commit --repo=sysroot/ostree/repo --branch main rootfs
fd004ec9528faf3f625f317b22bdb831ce5e96b53dd03ac004e068a86034baae
$ find sysroot/ostree/repo/objects -name '*file*'
sysroot/ostree/repo/objects/7f/a6fb6a81831271eb66391c71655e254ac8e553c5379bb0eaf4b3ef2ea9129e.file

I do get a file with the name *.file despite using the mode archive which should result in getting a *.filez file.

Out of curiosity, I swapped the order of the init-fs and the init call, which does give me the *.filez file as expected.

$ mkdir -p sysroot/ostree/repo
$ ostree init --mode=archive --repo=sysroot/ostree/repo
$ ostree admin init-fs --modern sysroot
$ mkdir rootfs
$ echo abc > rootfs/foo
$ ostree commit --repo=sysroot/ostree/repo --branch main rootfs
c4e6224df8807b1719a3da767ede362d55c58efa2fd640e357d90f0b7c34c8a4
$ find sysroot/ostree/repo/objects -name '*file*'
sysroot/ostree/repo/objects/7f/a6fb6a81831271eb66391c71655e254ac8e553c5379bb0eaf4b3ef2ea9129e.filez

Is this the intended behaviour? I guess I was using it wrong, but I think the cli is not very forgiving here, where could I have learned about the correct order of commands?

Edit: In case this matters, I'm using ostree from the debian testing repo on arm64

ostree --version
libostree:
 Version: '2023.6'
 Features:
  - inode64
  - libcurl
  - libsoup3
  - gpgme
  - ex-fsverity
  - libarchive
  - selinux
  - avahi
  - libmount
  - systemd
  - release
  - p2p
fwilhe added a commit to fwilhe/ostree-debian-builder that referenced this issue Sep 21, 2023
@jlebon
Copy link
Member

jlebon commented Sep 21, 2023

ostree admin init-fs implies creating the ostree repo, which is always in bare mode for sysroots (since the goal is to share hardlinks). ostree init is idempotent but will confusingly not error out if the requested mode isn't of the type of the existing repo. But anyway, you normally cannot switch from one repo mode to another after it's been created.

@fwilhe
Copy link
Contributor Author

fwilhe commented Sep 22, 2023

Thanks @jlebon that helps.

Just to be clear: os-init is different in that regard, right?

fwilhe added a commit to gardenlinux/gardenlinux that referenced this issue Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants