读取 SquashFS 存档
(SquashFS 是一个压缩文件系统 - http://en.wikipedia.org/wiki/SquashFS)
我正在寻找一种从程序读取 SquashFS 文件系统的方法。到目前为止,我已经了解了它的内核驱动程序,但我确信它的用户空间库必须存在于某个地方。任何语言都可以,但 C 是首选。
仅安装文件系统并以这种方式使用它在技术上是可行的,但我宁愿避免这种路线,因为我正在查看的应用程序将涉及在任何给定时间处理至少几十个档案。
(SquashFS is a compressed filesystem - http://en.wikipedia.org/wiki/SquashFS)
I'm looking for a way to read a SquashFS filesystem from a program. So far, I've know about the in-kernel drivers for it, but I'm sure that a userspace library for it must exist somewhere. Any language would be fine, but C is preferred.
Just mounting the filesystem and using it that way is technically possible, but I'd rather avoid that route because the application I'm looking at would involve working with at least a few dozen archives at any given time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有一个名为
unsquashfs
的工具,它可以提取类似于tar
的 squashfs 映像。它应该与 mksquashfs 捆绑在一起There is a tool called
unsquashfs
which extracts the squashfs image akin totar
. It should be bundled withmksquashfs
我刚刚从squashfs.sourceforce.net下载了代码tarball,里面没有内核代码。
mksquashfs
和unsquashfs
仅使用 C 语言编写用户态代码。您可能可以从 unsquashfs 中提取代码。
I just downloaded the code tarball from squashfs.sourceforce.net and there is no kernel code in there. Only userland code in C for
mksquashfs
andunsquashfs
.You could probably extract code from unsquashfs.
mksquashfs
和unsquashfs
在我的 Red Hat 系统上打包为“squashfs-tools”:请注意,挤压和取消挤压的速度非常慢。我编写的用于取消压缩、修改和重新压缩 87M
stage2.img
文件的脚本需要几分钟的时间。mksquashfs
andunsquashfs
are packaged as "squashfs-tools" on my Red Hat system:Be warned that squashing and unsquashing are painfully slow. It takes several minutes for a script I wrote to unsquash, modify, and re-squash an 87M
stage2.img
file.