Discussion:
Custom actions for mock chroot init
Michael Ivanov
2017-12-22 13:18:40 UTC
Permalink
Greetings!

I hope this is the right place to ask questions about 'mock' buildsystem.
Is there a possibility to add custom actions to mock chroot tree initialization?
I need a specific user and group to exist in rpm build environment. Currently I
do it manually using --shell command, but as soon as I run src package build
forgetting --no-clean option, everything is wiped away and recreated automatically.

And another one. Is it possible to request some files to be copied into chroot
tree after initialization? I found 'files' config option, but it looks to me that
file contents is to be embedded in cfg file: and this is possible only for short
text files.

I expected to find an option to specify post-init script to perform such actions,
but did not succeed

Best regards,
--
Michael Ivanov
_______________________________________________
buildsys mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to buildsys-leav
Miroslav Suchý
2018-01-01 22:27:04 UTC
Permalink
Post by Michael Ivanov
Greetings!
I hope this is the right place to ask questions about 'mock' buildsystem.
It is the right place :)
Post by Michael Ivanov
Is there a possibility to add custom actions to mock chroot tree initialization?
I need a specific user and group to exist in rpm build environment. Currently I
do it manually using --shell command, but as soon as I run src package build
forgetting --no-clean option, everything is wiped away and recreated automatically.
No. Mock primary task is to make clean chroot so others can reproduce the build as well.
Any other customization of chroot goes against the spirit of mock.

But ... you can use lvm plugin
https://github.com/rpm-software-management/mock/wiki/Plugin-LvmRoot
do the customization (if you really need it) and take the snapshot using --snapshot and then build on top of this snapshot.

BTW --chroot is slightly better than --shell for this because does not pass everything as one argument.
Post by Michael Ivanov
And another one. Is it possible to request some files to be copied into chroot
tree after initialization? I found 'files' config option, but it looks to me that
file contents is to be embedded in cfg file: and this is possible only for short
text files.
See --copyin in man page.

Miroslav Suchy
_______________________________________________
buildsys mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to buildsys-***@lists.fed

Loading...