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

build-kmod-kit: use explicit paths #1285

Merged
merged 1 commit into from
Jan 22, 2021

Conversation

tjkirch
Copy link
Contributor

@tjkirch tjkirch commented Jan 20, 2021

Before, this step used /home/builder for input and output artifacts and /tmp
for preparing the contents of the final output tarball. It assumed that
/home/builder was readable and writable by the current user, though in the
image it's owned by builder:builder. This can cause the following:

[cargo-make] INFO - Running Task: build-kmod-kit
find: './rpms': Permission denied
find: Failed to restore initial working directory: /home/builder: Permission denied
cpio: premature end of archive
[cargo-make] ERROR - Error while executing command, exit code: 2

This change makes the path usage more explicit by no longer relying on
/home/builder and avoiding use of the current working directory. Working
artifacts and output artifacts are put in separate directory trees under /tmp.

Testing done:

Build now succeeds:

[cargo-make] INFO - Running Task: build-packages
    Finished dev [optimized] target(s) in 0.12s
[cargo-make] INFO - Running Task: build-kmod-kit
[cargo-make] INFO - Build Done in 24 seconds.
Took 24.631 seconds: cargo make build-archives

Kit artifact still looks good:

> ls -l build/archives/
total 61872
-rw-r--r--. 1 tjk tjk 63355624 01-20 21:47 aws-k8s-1.17-x86_64-kmod-kit-v1.0.5.tar.xz

> tar tf build/archives/aws-k8s-1.17-x86_64-kmod-kit-v1.0.5.tar.xz
aws-k8s-1.17-x86_64-kmod-kit-v1.0.5/
aws-k8s-1.17-x86_64-kmod-kit-v1.0.5/kernel-devel/
aws-k8s-1.17-x86_64-kmod-kit-v1.0.5/kernel-devel/Documentation/
...

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Before, this step used /home/builder for input and output artifacts and /tmp
for preparing the contents of the final output tarball.  It assumed that
/home/builder was readable and writable by the current user, though in the
image it's owned by builder:builder.  This can cause the following:

```
[cargo-make] INFO - Running Task: build-kmod-kit
find: './rpms': Permission denied
find: Failed to restore initial working directory: /home/builder: Permission denied
cpio: premature end of archive
[cargo-make] ERROR - Error while executing command, exit code: 2
```

This change makes the path usage more explicit by no longer relying on
/home/builder and avoiding use of the current working directory.  Working
artifacts and output artifacts are put in separate directory trees under /tmp.
@tjkirch tjkirch merged commit 95f51bc into bottlerocket-os:develop Jan 22, 2021
@tjkirch tjkirch deleted the kmod-kit-dirs branch January 22, 2021 05:39
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

Successfully merging this pull request may close these issues.

3 participants