From dd64cfaef71a7739dde6f0ea68218dfe7019427d Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Wed, 25 Feb 2026 08:31:31 +1100 Subject: [PATCH 1/7] bugfix fab-rewind - ensure that cdroot is removed --- contrib/fab-rewind | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/fab-rewind b/contrib/fab-rewind index adcbe0a..834f36c 100755 --- a/contrib/fab-rewind +++ b/contrib/fab-rewind @@ -68,7 +68,6 @@ undeck() { stop_services "$targ" if [[ "$targ" == "cdroot" ]]; then rm -rf build/product.iso - rm -rf "build/$targ" else deck -D "build/$targ" fi @@ -93,6 +92,7 @@ mount_if_not_mounted() { fi } +# cdroot is not a deck - but 'undeck' handles it anyway undeck cdroot undeck root.sandbox From f3f4fa6ef78ebc99d7715cecb3af5b36276212e9 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Thu, 22 Jan 2026 18:13:47 +1100 Subject: [PATCH 2/7] packaging: make squashfs-tools & xorriso depends & move pool to recommends --- debian/control | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index 8b0c6aa..b4273a2 100644 --- a/debian/control +++ b/debian/control @@ -18,10 +18,10 @@ Depends: ${shlibs:Depends}, turnkey-chroot, python3-debian, - pool -Recommends: xorriso, - squashfs-tools + squashfs-tools, +Recommends: + pool, Suggests: dd, wodim, From 20da2e38bc032b006831c8979504d68cf825feed Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Thu, 22 Jan 2026 01:35:15 +0000 Subject: [PATCH 3/7] Add additional env debugging --- fab | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fab b/fab index a0e30b6..e5a5ae8 100755 --- a/fab +++ b/fab @@ -197,6 +197,19 @@ def cmd_chroot( environ["USER"] = "root" environ["UID"] = "0" environ["EUID"] = "0" + + os_environ_debug = "\n".join( + sorted([f" {k}: {v}" for k, v in os.environ.items()]) + ) + chr_environ_debug = "\n".join( + sorted([f" {k}: {v}" for k, v in environ.items()]) + ) + logger.debug( + "cmd_chroot()" + f"\nchroot = Chroot({chroot_path}, {environ=})" + f"\n\nfull env:\n---------\n{os_environ_debug}" + f"\n\nchroot env:\n-----------\n{chr_environ_debug}" + ) chroot = Chroot(chroot_path, environ=environ) if not script_args and not script_path_raw: From c8862dbd237522314dbe0cd1353d011e1844b1d6 Mon Sep 17 00:00:00 2001 From: navigator Date: Sat, 21 Mar 2026 03:17:00 +0000 Subject: [PATCH 4/7] fix: migrate debian.debfile.Deb822 to debian.deb822.Deb822 (Trixie) --- fablib/annotate.py | 2 +- fablib/installer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fablib/annotate.py b/fablib/annotate.py index 19ac143..74ec89e 100644 --- a/fablib/annotate.py +++ b/fablib/annotate.py @@ -4,7 +4,7 @@ from re import Match from tempfile import TemporaryDirectory -from debian import debfile +from debian import deb822 def parse_plan(plan: str) -> set[str]: diff --git a/fablib/installer.py b/fablib/installer.py index d1c3743..eec8550 100644 --- a/fablib/installer.py +++ b/fablib/installer.py @@ -16,7 +16,7 @@ from typing import TextIO, cast from chroot import Chroot -from debian import debfile +from debian import deb822 from fablib import common From ce0bda05869028b44c8109479522ffea9e94dcb5 Mon Sep 17 00:00:00 2001 From: PopSolutions Date: Sun, 22 Mar 2026 07:24:13 +0000 Subject: [PATCH 5/7] fix: re-add debfile import - still used by PoolInstaller._get_package_index --- fablib/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fablib/installer.py b/fablib/installer.py index eec8550..e0041db 100644 --- a/fablib/installer.py +++ b/fablib/installer.py @@ -16,7 +16,7 @@ from typing import TextIO, cast from chroot import Chroot -from debian import deb822 +from debian import deb822, debfile from fablib import common From 6f2880175ada4c918a5add03cc24719ac64742d1 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Thu, 2 Apr 2026 19:37:40 +1100 Subject: [PATCH 6/7] Ignore python build artifacts --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 12cdd16..2b6343d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,7 @@ tmp *.pyo *.tar.bz2 .mypy_cache +.ruff_cache __pycache__ tags +fab.egg-info/ From 67df004eafdc793b59c71845d8284801eecc0f52 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Wed, 8 Apr 2026 14:02:16 +1000 Subject: [PATCH 7/7] Tweak product.mk, inc using 'load_env' bash script to set make env vars --- share/load_env | 103 +++++++++++++++++++++++++++++++++++++++++++++++ share/product.mk | 73 +++++---------------------------- 2 files changed, 114 insertions(+), 62 deletions(-) create mode 100755 share/load_env diff --git a/share/load_env b/share/load_env new file mode 100755 index 0000000..7b9b425 --- /dev/null +++ b/share/load_env @@ -0,0 +1,103 @@ +#!/bin/bash +# This script is called by /usr/share/fab/product.mk. +# It sets the needed environment variables once, so make doesn't need to keep +# recalculating them + + +_echo() { + # Because we call this script directly from the top of the make file/s, + # make will expect anything sent to stdout to be valid make commands. + # However stderr is ignored by make, so ALL output to users needs to be + # sent to stderr. + echo "$*" >&2 +} +fatal() { _echo "Fatal: $*"; exit 1; } + +[[ -n "$FAB_PATH" ]] || fatal "FAB_PATH not set - required for default paths" + +if [[ -z "$RELEASE" ]]; then + _distro="$(lsb_release -si)" + DISTRO="${_distro,,}" + CODENAME="$(lsb_release -sc)" + RELEASE="$DISTRO/$CODENAME" + _echo "RELEASE not set - falling back to system: $RELEASE" +else + DISTRO="$(dirname "$RELEASE")" + CODENAME="$(basename "$RELEASE")" +fi + +DEBIAN= +UBUNTU= +case $DISTRO in + debian) + DEBIAN=y;; + ubuntu) + UBUNTU=y;; + *) + fatal "Distro '$DISTRO' not supported" +esac + +AMD64= +ARM64= +FAB_ARCH_FAMILY= +if [[ -z "$FAB_ARCH" ]]; then + FAB_ARCH="$(dpkg --print-architecture)" + _echo "FAB_ARCH not set - falling back to system: $FAB_ARCH" +fi +case $FAB_ARCH in + amd64) + AMD64=y + FAB_ARCH_FAMILY=x86 + ;; + arm64) + ARM64=y + FAB_ARCH_FAMILY=arm + ;; + *) + fatal "Architecture '$FAB_ARCH' not supported" + ;; +esac + +if [[ -n "$FAB_POOL" ]]; then + FAB_POOL_PATH="$FAB_PATH/pools/$CODENAME" + FAB_INSTALL_OPTS="$FAB_INSTALL_OPTS --no-deps" +fi + +if [[ "${NO_PROXY,,}" == "true" ]]; then + _echo "NO_PROXY set - disabling caching proxies" + FAB_HTTP_PROXY= + FAB_HTTPS_PROXY= +else + [[ -n "$FAB_HTTP_PROXY" ]] || _echo "Warning - FAB_HTTP_PROXY not set" + [[ -n "$FAB_HTTPS_PROXY" ]] || _echo "Warning - FAB_HTTPS_PROXY not set" +fi + +cat > /tmp/.build_env <