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

attach file to bundle #333

Closed
ilkondr opened this issue Sep 26, 2018 · 4 comments
Closed

attach file to bundle #333

ilkondr opened this issue Sep 26, 2018 · 4 comments

Comments

@ilkondr
Copy link

ilkondr commented Sep 26, 2018

Hi folks,
I'm trying to get configured pre-install and post-install hooks, which are not slot-related, but system-related. So I would like to have code put into bundle with behaviour of handlers. Is there any internal solution for this? Is there way to just attach a file to bundle?

In order to attach file I tried to add new slot with type=file to manifest (tarball with my scripts).
Than I created handlers which unpack tarball and execute scripts. Sounds good.
But rauc install does not work for me if manifest has extra slot (system.conf with 3 slots and bundle manifest with 4 slots).
As you can see install succeeded but no update performed:

rauc[282]: Starting pre install handler: /etc/rauc/pre-install.sh
rauc[282]: Using default handler
rauc[282]: (rauc:282): rauc-WARNING **: No target slot for class upgrade-handlers of image upgrade-handlers.tar.img found
rauc[282]: rauc-Message: Marking target slot as non-bootable...
rauc[282]: rauc-Message: Marking slots as bootable...
rauc[282]: rauc-Message: installing /home/root/bundle.raucb: Updating slots...
rauc[282]: rauc-Message: installing /home/root/bundle.raucb: All slots updated
rauc[282]: Starting post install handler: /etc/rauc/post-install.sh
rauc[282]: rauc-Message: installing /home/root/bundle.raucb: finished
rauc[282]: rauc-Message: installing `/home/root/bundle.raucb` succeeded

That would be great if there is a way to get things working with extra slot.
Thanks

@ejoerns
Copy link
Member

ejoerns commented Sep 26, 2018

Hi @ilkondr

Several things on this:

  • An image listed in the manifest must have a corresponding slot (class) listed in system.conf. This is what your log already rejected and what is by intention

  • Attaching a file to a bundle is quite easy, RAUC packs all files that are located in the folder you create your bundle from together. There is no need to list it in the manifest.

  • Hooks lack support for pre- and post-install. This is not intentionally but simply because it is not implemented yet -> patches welcome

Thus, without adding support to the handlers, the only way to achieve what you described would be to use a handler and simply put the image into the bundle. Build system integration for this might be missing -> patches welcome :)

Anyway, to better understand what would fit your needs, could you explain what actual purpose of your extra image / archive is? It means, what do you want to do with it? Bootstrapping something? Adding additional content to a slot? ..

@ilkondr
Copy link
Author

ilkondr commented Sep 26, 2018

Thanks @ejoerns !
As I use integration with yocto I'm not familiar with process of creating bundle from command line. I will take a look.

Regarding my intention for this. Strictly speaking I can implement all my needs using existing tools at the moment. But it will be much more flexible with bundle-specific handlers or even another files. This can help perform some tricky upgrades in the future without 2-stage upgrade. So this is just a try to make things more flexible

BTW, shouldn't RAUC fail installing with that inappropriate manifest?

@ejoerns
Copy link
Member

ejoerns commented Oct 3, 2018

@ilkondr Thanks for proposing a solution for adding extra files in meta-rauc! I link it here for reference: rauc/meta-rauc#53

You are also right that your case should be fatal but unintentionally it became a warning only. In master, this is already fixed by 3f4953b

@ejoerns
Copy link
Member

ejoerns commented Sep 23, 2022

Yocto support was added with rauc/meta-rauc#102

@ejoerns ejoerns closed this as completed Sep 23, 2022
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

2 participants