(SquashFS是一个压缩文件系统 - http://en.wikipedia.org/wiki/SquashFS)
我正在寻找一种从程序中读取SquashFS文件系统的方法.到目前为止,我已经了解了内核驱动程序,但我确信它的用户空间库必须存在于某个地方.任何语言都可以,但C是首选.
只是安装文件系统并以这种方式使用它在技术上是可行的,但我宁愿避免使用该路由,因为我正在查看的应用程序将涉及在任何给定时间使用至少几十个档案.
我有一个为我制作的奇点容器(用于在 Comet GPU 节点上运行张量流),但我需要根据我的目的修改 keras 安装。
我知道.simg文件不可编辑(并且不推荐使用可写格式),因此不鼓励转换为文件、编辑然后转换回的.img过程:.img.simg
sudo singularity build --writable development.img production.simg
## make changes
sudo singularity build production2.img development.simg
Run Code Online (Sandbox Code Playgroud)
在我看来,最好的方法可能是提取内容(比如放入沙箱中),编辑它们,然后将沙箱重建为.simg图像。
我知道如何进行第二次转换(singularity build new-sif sandbox),但我该如何进行第一次转换?
我已尝试以下操作,但该命令从未完成:
sudo singularity build tf_gpu tensorflow-gpu.simg
WARNING: Authentication token file not found : Only pulls of public images will succeed
Build target already exists. Do you want to overwrite? [N/y] y
2018/10/12 08:39:54 bufio.Scanner: token too long
INFO: Starting build...
Run Code Online (Sandbox Code Playgroud) 我正在使用带有内置 NAND 闪存的嵌入式 ARM 平台。我的屋顶分区是 squashfs。u-boot 和内核都使用 OMAP_ECC_BCH8_CODE_HW。问题是一些板(不仅仅是一个)在停电后停止工作(它们使用了大约 2 个月)。
启动时可以看到这些错误:
[ 8.270507] end_request: I/O error, dev mtdblock9, sector 25184
[ 8.278930] SQUASHFS error: squashfs_read_data failed to read block 0xc40396
[ 8.286376] SQUASHFS error: Unable to read fragment cache entry [c40396]
[ 8.293579] SQUASHFS error: Unable to read page, block c40396, size d696
[ 8.300628] SQUASHFS error: Unable to read fragment cache entry [c40396]
[ 8.307647] SQUASHFS error: Unable to read page, block c40396, size d696
[ 8.314819] SQUASHFS error: …Run Code Online (Sandbox Code Playgroud) 我想在bazel中创建以下结构。
dir1
|_ file1
|_ file2
|_ dir2
|_file3
Run Code Online (Sandbox Code Playgroud)
创建特定的结构似乎并不简单。我希望有一个简单且可重复使用的规则。就像是:
makedir(
name = "dir1",
path = "dir1",
)
makedir(
name = "dir2",
path = "dir1/dir2",
deps = [":dir1"],
)
Run Code Online (Sandbox Code Playgroud)
我尝试过的
mkdir -p path/to/directoy没有工作编辑:
用例是我想使用bazel 创建一个squashfs。
重要的是要注意,Bazel提供了一些打包功能。
要创建squashfs,该命令需要一个由构件填充的目录结构。
我在从 squashfs 中排除特定文件时遇到问题。我希望能够排除所有以 *.db 结尾的文件类型,但没有成功。
\n\n每当我使用排除该文件的参数运行 mksquashfs 命令时,它总是包含该文件。我尝试了该命令的许多不同变体。我的测试脚本如下:
\n\n#!/bin/bash\n\nOPT="-regex -e \'*.db\' "\n\necho -e "Creating squashfs..."\nmksquashfs test test.package ${OPT}\necho "Ran the following command: mksquashfs pf test.package ${OPT}"\n\necho -e "Uncompressing squashfs..."\nmkdir pf_post\nunsquashfs -f -d test_post/ test.package \n\necho\nread -p "press any key to continue..."\n\nrm test.package\nrm -r test_post\nRun Code Online (Sandbox Code Playgroud)\n\n测试目录的树如下所示。应排除 test.db 的两个实例,但它似乎不起作用。
\n\ntest\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 test\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 test.db\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 test.ab\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 test.cd\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 test.db\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 test.ef\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 test.gh\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 test.sh\nRun Code Online (Sandbox Code Playgroud)\n\n将其切换为通配符部分修复了它。这排除了第一个 .db 文件,但不排除第二个更深的子目录。有没有办法告诉它排除所有“.db”文件,而不仅仅是最低目录中的第一个文件?下面是排除第一种文件类型的代码。两种解决方案仍然没有排除子目录“.db”文件。
\n\nmksquashfs test test.package -wildcards -e \'*.db\'\n\nmksquashfs test test.package -regex -e \'\\.db$\'\nRun Code Online (Sandbox Code Playgroud)\n\n以下链接提供了上述一些解决方案,但我遇到了无法排除所有“.db”文件的死胡同。\n https://askubuntu.com/questions/628585/mksquashfs …
我需要帮助解决 Debian Buster Crostini 上的 Snap Package Manager 的大问题。每当我尝试使用 Snap 包管理器安装 Anbox 时,都会出现错误:
error: system does not fully support snapd: cannot mount squashfs image using
"squashfs": mount: /tmp/sanity-mountpoint-772933788: mount failed:
Operation not permitted.
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助解决这个问题吗?
我必须更新squashfs图像文件中的某些文件。我在Linux中找到了一个工具,但在Windows中找不到。
有人可以帮忙吗?
有什么方法可以检查在squashfs文件系统中压缩后特定文件的最终大小吗?
我正在查看mksquashfs / unsquashfs命令行选项,但找不到任何内容。
使用mksquashfs-info中的选项仅打印压缩前的大小。
谢谢