cut fails on uncompressed deb

未关闭 适合新手
#348 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@yuminn-k 已经在做这个了。

开始于 2026年11月7日。

  • #350 来自 @yuminn-k —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
backend

调研方向

从 internal/deb/extract.go 和 DataReader 入手;issue 指出它们只处理压缩的数据成员。检查归档成员的选择方式,以及现有测试如何覆盖 .gz、.xz 和 .zst 负载。完成标准是:包含未压缩 data.tar 的软件包可以成功解包,并且有针对未压缩情况的测试。

由索引模型根据 Issue 内容生成。

描述

Bug

chisel cannot cut a package whose data.tar is not compressed. this is not common (clearly) but it does happen.

deb(5) allows the data of the deb to be plain data.tar, as well as the usual suspects (.gz, .xz, etc etc). DataReader in internal/deb/extract.go only handles data.tar.gz, data.tar.xz and data.tar.zst. it skips every other kind and reports io.EOF as "no data payload".

some packages in the archives are built like this (with dpkg-deb -Znone). e.g. in 26.04 main that is every linux-firmware-*, linux-image-* and linux-modules-*.

$ curl -sO http://archive.ubuntu.com/ubuntu/pool/main/l/linux-firmware-realtek/linux-firmware-realtek_20260319.git217ca6e4-0ubuntu1.2_all.deb
$ ar t linux-firmware-realtek_20260319.git217ca6e4-0ubuntu1.2_all.deb
debian-binary
control.tar
data.tar

none of these packages are sliced, so the repro uses chisel-proxy with a deb built the same way:

$ alias chisel-proxy='go run github.com/lczyk/chisel-proxy/cmd/[email protected]'
$ mkdir -p test-package/DEBIAN test-package/usr/lib/test-package
$ printf 'Package: test-package\nVersion: 1.0\nArchitecture: all\nMaintainer: nobody\nDescription: uncompressed data member\n' > test-package/DEBIAN/control
$ echo data > test-package/usr/lib/test-package/file
$ dpkg-deb -Znone --build test-package test-package_1.0_all.deb
$ ar t test-package_1.0_all.deb
debian-binary
control.tar
data.tar
# test-package.yaml
package: test-package
slices:
  all:
    contents:
      /usr/lib/test-package/file:
$ chisel-proxy cut --arch amd64 ./test-package_1.0_all.deb ./test-package.yaml \
    -- --root ./rootfs test-package_all
Extracting files from package "test-package"...
error: cannot extract from package "test-package": no data payload

the same deb built with -Zgzip cuts fine.

主要语言
Go
星标
434
派生
74
平均合并
1 天 30 分钟
30 天内合并 PR
1

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

canonical/chisel 的其他 Issue

查看 canonical/chisel 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。