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

> Include a squashfs image in stacker binary for validation of mount #523

Open
smoser opened this issue Oct 10, 2023 · 0 comments
Open

> Include a squashfs image in stacker binary for validation of mount #523

smoser opened this issue Oct 10, 2023 · 0 comments

Comments

@smoser
Copy link
Contributor

smoser commented Oct 10, 2023

Serge had the idea in #514 to include a squashfs image inside stacker and use that to determine if extract methods (kernel-mount, squashfuse-mount, unsquashfs) are available. that would simplify things compared to what we're doing in #514 as you would know that the image attempting to be mounted is good.

We could keep inside the stacker binary an empty squashfs; every time stacker starts, we try to mount it from and to a tmpdir, and use that to inform whether to use kernel mounting...

It may seem wasteful, but apart from not having to do the Once() for the first kernel mount of an image, it also prevents us from misinterpreting an attempted mount of a bad squashfs blob as insufficient privilege.

I kind of like it.

$ echo "hi mom" > file.txt
$ mksquashfs file.txt out.squashfs
$ ls -l out.squashfs
-rw-r--r-- 1 smoser smoser 4096 Oct  5 16:09 out.squashfs
$ mkdir mnt
$ mount -t squashfs -o loop,ro out.squashfs mnt
$ cat mnt/file.txt 
hi mom

4096 bytes isn't too wasteful.

Originally posted by @smoser in #514 (comment)

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

No branches or pull requests

1 participant