build-fs-pickle: add FAMILY switch (apt|opkg|none) for non-Debian pickles#40113
Open
Bierchermuesli wants to merge 1 commit into
Open
build-fs-pickle: add FAMILY switch (apt|opkg|none) for non-Debian pickles#40113Bierchermuesli wants to merge 1 commit into
Bierchermuesli wants to merge 1 commit into
Conversation
Today the script is hardcoded to apt-get / Debian. Generalize it so the same wrapper can produce pickles for non-Debian personas: - FAMILY=apt (default) Debian/Ubuntu, current behaviour - FAMILY=opkg OpenWrt rootfs, installs python3-light - FAMILY=none no install step; image must contain python3 OUT= already existed and now it's actually useful: build pickles for multiple personas into separate paths from one tree. Update the Makefile help text and document the wrapper + the FAMILY switch in docs/HONEYFS.rst (right after the existing createfs section).
Up to standards ✅🟢 Issues
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Generalize
bin/build-fs-pickle.shso the same wrapper can producefs.picklefor non-Debian targets. Today it's hardcoded to apt/Debian.Adds
FAMILY=:apt(default) — Debian/Ubuntu, current behaviour, no change for existing users.opkg— OpenWrt rootfs (e.g.openwrt/rootfs:x86-64-23.05.5); installspython3-light+$PACKAGES.none— no install step; the image must already containpython3(e.g.python:3-alpinefor a BusyBox-style surface, or any prebuilt rootfs you've imported).OUT=already existed and now it's actually useful — point it anywhere on the host to bake pickles for multiple personas into separate paths from one tree.The default invocation (
bin/build-fs-pickle.sh/make build-fs-pickle) is unchanged — still produces the Debian 12 pickle intosrc/cowrie/data/fs.pickle.new. No regression risk for existing users.motivation
This is the tool needed to actually produce the non-Debian pickles for #40092 (FLAVOR build-arg, currently open) — you can't ship an OpenWrt flavor without a way to bake its
fs.pickle. Sits on the long arc of #285 (device profile support, open since 2016).The apt path was used to regenerate the pickle for #40090 (Debian 12 fingerprint bump, merged); this PR just extends the same pattern.
Implementation notes
caseinside the in-containersh -c, withFAMILYandPACKAGESpassed as plain env vars. Noeval.IMAGEandPACKAGESset on the host side via: "${IMAGE:=...}"/: "${IMAGE:?...}"so missing-required-var errors are explicit.Building from a real containersubsection added todocs/HONEYFS.rst, right after the existingcreatefssection, covering the wrapper + theFAMILYswitch with examples.Test plan
bin/build-fs-pickle.shstill produces a valid Debian 12 pickle (no regression).FAMILY=none IMAGE=python:3-alpine OUT=...end-to-end smoke: pulls image, runs createfs inside, writes a valid 880KB pickle with sensible top-level entries (root, opt, dev, proc, run, etc.).FAMILY=opkgsmoke against anopenwrt/rootfsimage (worth a maintainer check — I haven't pulled an OpenWrt rootfs locally).Known follow-ups (not in this PR)
FAMILY=rawfor images without python3 (would dodocker export | tar -x+ sidecar python container walking the extracted rootfs). Lets you snapshot purebusybox:latestand extracted firmware images. Can be a separate PR once this lands.apt/apt-getactually unavailable on a busybox/openwrt persona. Larger architectural change, deserves its own design discussion.let me know what you think