-
Notifications
You must be signed in to change notification settings - Fork 22
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
Distribution packaging changes #228
base: master
Are you sure you want to change the base?
Conversation
Useful for distribution packages. May also come in handy in future if we add some things that require compilation. Signed-off-by: David Disseldorp <[email protected]>
Use sed to explicitly set VM_NET_CONF="/etc/rapido/net-conf", QEMU_PID_DIR="$PWD" and DRACUT_OUT="${PWD}/rapido.cpio" to avoid default behaviour of dumping everything under RAPIDO_DIR. This approach has a few downsides, which probably should be further discussed: - /etc/rapido/rapido.conf implies a system wide configuration, with root access required for config changes + we normally try to avoid any root requirements + the RAPIDO_CONF env override can still be used, but it might make more sense to default to $HOME/.config/rapido/*conf , but that would require explicit configuration from the user. + split system and user config files might work, but would complicate logic further, especially WRT propagating the configuration into the VM images. - $PWD usage for dracut output and VM pid state might be confusing and scatter garbage all over the place. /tmp/rapido-$user might be a better spot for this. Signed-off-by: David Disseldorp <[email protected]>
If $RAPIDO_CONF is unset on invocation then use /etc/rapido/rapido.conf as the default if it exists, otherwise use the until-now-default ${RAPIDO_DIR}/rapido.conf . Signed-off-by: David Disseldorp <[email protected]>
Distribution packages will have a rapido binary symlink in $PATH: /usr/bin/rapido -> /usr/lib/rapido/rapido cut scripts will be installed under /usr/lib/rapido/cut , so we need to use "realpath -e" to work back from the $PATH binary. Signed-off-by: David Disseldorp <[email protected]>
Fix OBS sourced-script-with-shebang error. Signed-off-by: David Disseldorp <[email protected]>
When rapido is run from $PATH then $0 doesn't correspond to a file path. $BASH_SOURCE provides the source file path when run via $PATH (for distro packages) as well as explicit file path (for git clones). Signed-off-by: David Disseldorp <[email protected]>
Rapido doesn't use working-directory relative paths, but is moving towards supporting such paths for distribution packages, e.g.: DRACUT_OUT="${PWD}/rapido.cpio" With such a configuration, cut scripts prior to this change will attempt to write out the initramfs image under /usr/lib/rapido/. Signed-off-by: David Disseldorp <[email protected]>
The previous attempt assumed the $1 completion parameter corresponded to a path, which is completely incorrect. Instead, just check whether local ./rapido and ./cut/ presence indicates a git clone, or fallback to distro paths. Signed-off-by: David Disseldorp <[email protected]>
I'm going to close this one for now, as the branch is getting a little stale, and I'm still not sure how useful it'd be to have distro packages: I expect I'll always be running from a git checkout, but maybe I'd use this for CI jobs (shrug). |
FTR, Dockerfiles in OBS can do both. |
Ah okay, are your rpms based on these changes? If so I'll rebase this branch and start cleaning it up a bit. |
On Thu, Jan 18, 2024 at 02:12:48AM -0800, David Disseldorp ***@***.***> wrote:
Ah okay, are your rpms based on these changes? If so I'll rebase this
branch and start cleaning it up a bit.
They're based on [1] ¯\_(ツ)_/¯
At the same time, you don't have to keep RPMs because of me.
I will likely notice when I rebuild the container and your OBS project
is gone ;-)
[1] https://build.opensuse.org/package/show/home:dmdiss:rapido/rapido
|
All good, will reopen as draft and put this on my queue... I was somehow under the impression that nobody was using / interested in it. I'll try to let you know if I make any breaking changes against what's already in the obs. |
Looking back through the changes here, I should be able to start merging some of the simple standalone changes as-is. |
An attempt to address #204 . Packages based on this RFC can be found at:
https://build.opensuse.org/package/show/home:dmdiss:rapido/rapido