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

fix(initrd): Several small fixes #957

Merged

Conversation

craciunoiuc
Copy link
Member

@craciunoiuc craciunoiuc commented Nov 1, 2023

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran make fmt on your commit series before opening this PR;
  • Updated relevant documentation.

Description of changes

GitHub-Fixes: #904

Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
@craciunoiuc craciunoiuc added kind/enhancement New feature or request area/initrd Issue or PR is related to the initrd package labels Nov 1, 2023
@craciunoiuc
Copy link
Member Author

PS C:\Users\Cezar\kraftkit> go test ./initrd
--- FAIL: TestNewFromDirectory (0.03s)
    directory_test.go:83: Encountered unexpected file in cpio archive: testdata/rootfs
    directory_test.go:94: file [/entrypoint.sh]: got size 27, expected 25
    directory_test.go:94: file [/etc/app.conf]: got size 18, expected 16
    directory_test.go:88: file [/lib/libtest.so.1]: got mode 0100000, expected 0120000
    directory_test.go:91: file [/lib/libtest.so.1]: got linkname "", expected "libtest.so.1.0.0"
    directory_test.go:94: file [/lib/libtest.so.1]: got size 16, expected 0
    directory_test.go:94: file [/lib/libtest.so.1.0.0]: got size 10, expected 9

@antoineco The tests still fail on windows but now I think this is because of something else:

  • It appends \CR when reading files, that's why each line is an extra line
  • Links behave differently within Windows

@antoineco
Copy link
Contributor

@craciunoiuc good thing that the tests caught that. In the current state of things, an image created on Windows won't run with Unikraft.

initrd/directory.go Outdated Show resolved Hide resolved
Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
@craciunoiuc craciunoiuc force-pushed the craciunoiuc/trim-trailing-slash branch from c808de0 to c40f9a1 Compare November 2, 2023 12:26
@craciunoiuc
Copy link
Member Author

No fears my son ✝️ push the Merge button

(also add your approved-by in there)

@antoineco antoineco merged commit f05b84f into unikraft:staging Nov 2, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/initrd Issue or PR is related to the initrd package kind/enhancement New feature or request
Projects
Status: 🚀 Done
Development

Successfully merging this pull request may close these issues.

Kraft run fails if --rootfs path to directory has / appended
2 participants