-
Notifications
You must be signed in to change notification settings - Fork 34
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
[Bug] cannot run 'apt-get install' #350
Comments
Running strace as @hallyn suggested left me with output like this:
I can reproduce the problem with a simple test: #include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
int main(int argc, char* argv[]) {
int fd = 0, errors = 0;
for (int i=1; i<argc;i++) {
fd = openat(AT_FDCWD, argv[i], O_RDWR|O_CREAT|O_NOFOLLOW, 0640);
if (fd < 0) {
printf("%s: %d: %s\n", argv[i], fd, strerror(errno));
errors++;
} else {
printf("%s: %d\n", argv[i], fd);
}
close(fd);
}
return errors;
} I can run that via stacker.yaml with
|
I can fix this for real root by supporting kernel mounts of squashfs like this: diff --git a/squashfs/squashfs.go b/squashfs/squashfs.go
index 17ded43..d0a1241 100644
--- a/squashfs/squashfs.go
+++ b/squashfs/squashfs.go
@@ -168,7 +168,15 @@ func ExtractSingleSquash(squashFile string, extractDir string, storageType strin
return err
}
- if p := which("squashfuse"); p != "" {
+ if realuid := os.Getenv("STACKER_REAL_UID"); realuid == "0" {
+ log.Debugf("Extracting %s -> %s with kernel mount", squashFile, extractDir)
+ cmd := exec.Command("mount", "-oloop,ro", squashFile, extractDir)
+ cmd.Stdout = os.Stdout
+ cmd.Stderr = os.Stderr
+ cmd.Stdin = nil
+ return cmd.Run()
+ return cmd.Start()
+ } else if p := which("squashfuse"); p != "" {
// given extractDir of path/to/some/dir[/], log to path/to/some/.dir-squashfs.log
extractDir := strings.TrimSuffix(extractDir, "/") |
Can you show the squashfuse log for that? |
I compiled the following program:
I created a squashfs file containing:
I created a userns and mntns, mounted the s.squashfs (built from
This is on 5.15.0-56-generic . I wonder what's going on with the stacker build! |
Oh, duh - it's what happens when the file exists: root@jerom ~/delme/squashfuse$ ~/test/openat dest/a/ab So, why? |
Just O_CREATE works, but O_CREATE|O_RDWR does not. |
running squashfuse with -o allow_root does not help. Debug mode gives me:
|
I opened a squashfuse issue with a recreate vasi/squashfuse#80 |
Thanks - i was still looking through the closed issue for a hint. I'm thinking I'll try and reproduce this in a lucid ubuntu image with mainline kernel. It does seem just as likely that the villain here is overlay, not directly squashfuse. |
I've been misreading my squashfuse log file. The open arguments did not cause the 'Function not implemented'. It is an opcode 46 that is done immediately after:
I had been thinking that was part of the previous open operation. |
tldr; This is fixed in squashfuse and libfuse3 packages available in ppa:puzzleos/dev. Some status here. I found that
I filed debian bug #1025706 requesting it be built against fuse3. I then:
Binaries are available in ppa:puzzleos/dev An upload to debian or ubuntu (lunar) that linked against fuse3 will fix this (fuse3 in lunar is sufficient, but probably not in kinetic and definitely not in jammy). |
closing this, it is fixed see comment above. |
stacker version
v0.30.1-5-g1346183 liblxc 074b9fe66304fb05e07554d01353c8d2e53e392a
Describe the bug
No response
To reproduce
Given this stacker.yaml
This will work fine:
But attempting squashfs will fail as shown:
Expected behavior
Expected squash to work as tar.
Screenshots
No response
Additional context
I don't have an easy way to give a reference docker container. Those on zothub are not built with new enough stacker to have xattrs removed.
can probably attach a tarball.
The text was updated successfully, but these errors were encountered: