cut fails on uncompressed deb

Đang mở Phù hợp với người mới
#348 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

@yuminn-k đang làm issue này rồi.

Từ ngày 7/11/2026.

  • #350 của @yuminn-k — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với internal/deb/extract.go và DataReader, mà issue xác định là chỉ xử lý các thành phần dữ liệu đã nén. Kiểm tra cách chọn các thành phần trong archive và cách các bài kiểm thử hiện có bao phủ payload .gz, .xz và .zst. Công việc hoàn tất khi có thể giải nén thành công một gói chứa data.tar không nén và có bài kiểm thử cho trường hợp này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
434
Fork
74
Merge trung bình
1 ngày 30 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của canonical/chisel

Tất cả issue của canonical/chisel

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.