cut fails on uncompressed deb

オープン 初心者向け
#348 コメント 1 件 リアクション 0 件 担当者 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分
マージ済み PR(30日)
1

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

canonical/chisel のほかの issue

canonical/chisel の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。