From e205794143c7481989e0adb64f94549830e5def6 Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Thu, 15 Jan 2026 11:11:55 -0800 Subject: [PATCH 01/14] Build and install dummy deb package to satisfy libjack-jackd2-dev --- stage2/00-dummy-packages/01-run.sh | 12 ++++++++++++ stage2/00-dummy-packages/files/jack-dummy.ctl | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 stage2/00-dummy-packages/01-run.sh create mode 100644 stage2/00-dummy-packages/files/jack-dummy.ctl diff --git a/stage2/00-dummy-packages/01-run.sh b/stage2/00-dummy-packages/01-run.sh new file mode 100755 index 0000000..adba6ee --- /dev/null +++ b/stage2/00-dummy-packages/01-run.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +apt update && apt-get -y install equivs +export DEB_BUILD_OPTIONS="nocheck" +export DPKG_DEB_COMPRESSOR=gzip +equivs-build files/jack-dummy.ctl +cp jack-dummy_1.9.22_all.deb ${ROOTFS_DIR}/ + +on_chroot << EOF +dpkg -i /jack-dummy_1.9.22_all.deb +rm /jack-dummy_1.9.22_all.deb +EOF diff --git a/stage2/00-dummy-packages/files/jack-dummy.ctl b/stage2/00-dummy-packages/files/jack-dummy.ctl new file mode 100644 index 0000000..b729942 --- /dev/null +++ b/stage2/00-dummy-packages/files/jack-dummy.ctl @@ -0,0 +1,12 @@ +Section: misc +Priority: optional +Standards-Version: 4.5.0 + +Package: jack-dummy +Version: 1.9.22 +Maintainer: dummy +Architecture: all +Provides: libjack-jackd2-0, libjack-jackd2-dev, jackd2 +Description: Dummy JACK package to satisfy dependencies + This package provides JACK development/runtime dependencies without installing JACK. + From 3e121020474113bef790fbe119aa2865709a05b2 Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Thu, 15 Jan 2026 12:35:14 -0800 Subject: [PATCH 02/14] Remove dependency on libjack-jackd2-dev --- stage2/01-sys-tweaks/00-packages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 82063bb..aaf3b89 100755 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -35,7 +35,7 @@ unzip zip p7zip-full file git kms++-utils python3-venv -virtualenv python3-pip python3-dev python3-zeroconf build-essential libasound2-dev libjack-jackd2-dev +virtualenv python3-pip python3-dev python3-zeroconf build-essential libasound2-dev zlib1g-dev cmake gperf intltool ladspa-sdk libarmadillo-dev libavahi-gobject-dev liblilv-dev libjpeg-dev libavcodec-dev libavutil-dev libbluetooth-dev libboost-dev libeigen3-dev libfftw3-dev libglib2.0-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev liblrdf0-dev libsamplerate0-dev libsigc++-2.0-dev libsndfile1-dev libzita-convolver-dev From 3e667bb482aada7f712d7e2b9d22e7471d06cb15 Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Thu, 15 Jan 2026 12:39:03 -0800 Subject: [PATCH 03/14] Adding fluidsynth2 package (and apt:bullseye repo) --- stage0/00-configure-apt/files/sources.list | 4 ++++ stage2/01-sys-tweaks/00-packages | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/stage0/00-configure-apt/files/sources.list b/stage0/00-configure-apt/files/sources.list index 13697ce..707cbeb 100755 --- a/stage0/00-configure-apt/files/sources.list +++ b/stage0/00-configure-apt/files/sources.list @@ -1,6 +1,10 @@ deb http://deb.debian.org/debian RELEASE main contrib non-free non-free-firmware deb http://deb.debian.org/debian-security/ RELEASE-security main contrib non-free non-free-firmware deb http://deb.debian.org/debian RELEASE-updates main contrib non-free non-free-firmware + +# needed for libfluidsynth2:arm64 +deb http://deb.debian.org/debian bullseye main + # Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source' #deb-src http://deb.debian.org/debian RELEASE main contrib non-free non-free-firmware #deb-src http://deb.debian.org/debian-security/ RELEASE-security main contrib non-free non-free-firmware diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index aaf3b89..7c8540a 100755 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -36,8 +36,9 @@ file git kms++-utils python3-venv virtualenv python3-pip python3-dev python3-zeroconf build-essential libasound2-dev -zlib1g-dev cmake gperf intltool ladspa-sdk libarmadillo-dev libavahi-gobject-dev liblilv-dev libjpeg-dev +zlib1g-dev cmake gperf intltool ladspa-sdk libarmadillo-dev libavahi-gobject-dev liblilv-dev libjpeg-dev libavcodec-dev libavutil-dev libbluetooth-dev libboost-dev libeigen3-dev libfftw3-dev libglib2.0-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev liblrdf0-dev libsamplerate0-dev libsigc++-2.0-dev libsndfile1-dev libzita-convolver-dev -libzita-resampler-dev lv2-dev p7zip-full python3-all python3-setuptools libreadline-dev zita-alsa-pcmi-utils +libzita-resampler-dev lv2-dev p7zip-full python3-all python3-setuptools libreadline-dev zita-alsa-pcmi-utils dnsmasq iptables python3-smbus liblo-dev python3-liblo libzita-alsa-pcmi-dev authbind rcconf libfluidsynth-dev lockfile-progs +libfluidsynth2 From 7a87708f6c00c7fe8410baf6f2545808d4878820 Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Fri, 16 Jan 2026 13:00:53 -0800 Subject: [PATCH 04/14] Remove liblilv-dev from package list --- stage2/01-sys-tweaks/00-packages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 7c8540a..2db8cfc 100755 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -36,7 +36,7 @@ file git kms++-utils python3-venv virtualenv python3-pip python3-dev python3-zeroconf build-essential libasound2-dev -zlib1g-dev cmake gperf intltool ladspa-sdk libarmadillo-dev libavahi-gobject-dev liblilv-dev libjpeg-dev +zlib1g-dev cmake gperf intltool ladspa-sdk libarmadillo-dev libavahi-gobject-dev libjpeg-dev libavcodec-dev libavutil-dev libbluetooth-dev libboost-dev libeigen3-dev libfftw3-dev libglib2.0-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev liblrdf0-dev libsamplerate0-dev libsigc++-2.0-dev libsndfile1-dev libzita-convolver-dev libzita-resampler-dev lv2-dev p7zip-full python3-all python3-setuptools libreadline-dev zita-alsa-pcmi-utils From 7e44742f8d14943c55c0eb243800b2aa166acd35 Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Fri, 16 Jan 2026 13:02:03 -0800 Subject: [PATCH 05/14] move liblilv up in build order and remove static flags --- stage2/05-pistomp/02-run.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/stage2/05-pistomp/02-run.sh b/stage2/05-pistomp/02-run.sh index e802390..70e67b0 100755 --- a/stage2/05-pistomp/02-run.sh +++ b/stage2/05-pistomp/02-run.sh @@ -20,6 +20,16 @@ cd jack2 ./waf install cd .. +# debian 13 will include python3-lilv liblilv-dev +[ ! -d lilv-0.24.12 ] && \ + wget http://download.drobilla.net/lilv-0.24.12.tar.bz2 && \ + tar xvf lilv-0.24.12.tar.bz2 +cd lilv-0.24.12 +./waf configure --prefix=/usr/local --no-utils --no-bash-completion --pythondir=/usr/local/lib/python3.11/dist-packages +./waf build +./waf install +cd .. + git clone https://github.com/micahvdm/browsepy.git cd browsepy pip3 install ./ @@ -66,14 +76,5 @@ cd mod-ttymidi make install cd .. -wget http://download.drobilla.net/lilv-0.24.12.tar.bz2 -tar xvf lilv-0.24.12.tar.bz2 -cd lilv-0.24.12 - -./waf configure --prefix=/usr/local --static --static-progs --no-shared --no-utils --no-bash-completion --pythondir=/usr/local/lib/python3.11/dist-packages -./waf build -./waf install -cd .. - EOF From 84e626cf61647f0484c3238950620b5a12ec228f Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Fri, 16 Jan 2026 19:34:51 -0800 Subject: [PATCH 06/14] adding liblilv deps --- stage2/01-sys-tweaks/00-packages-nr | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stage2/01-sys-tweaks/00-packages-nr b/stage2/01-sys-tweaks/00-packages-nr index 15c0f66..d8461e3 100755 --- a/stage2/01-sys-tweaks/00-packages-nr +++ b/stage2/01-sys-tweaks/00-packages-nr @@ -1,3 +1,6 @@ cifs-utils rpicam-apps-lite mkvtoolnix +libserd-dev +libsord-dev +libsratom-dev From 6f11cb4245c9c8713fb752a8b55a829ae924d9ef Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Fri, 16 Jan 2026 21:14:46 -0800 Subject: [PATCH 07/14] test if repos exist before cloning --- stage2/05-pistomp/02-run.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/stage2/05-pistomp/02-run.sh b/stage2/05-pistomp/02-run.sh index 70e67b0..b259381 100755 --- a/stage2/05-pistomp/02-run.sh +++ b/stage2/05-pistomp/02-run.sh @@ -7,13 +7,13 @@ mkdir -p /home/${FIRST_USER_NAME}/tmp cd /home/${FIRST_USER_NAME}/tmp export NOOPT=true -git clone --recursive https://github.com/falkTX/Hylia.git +[ ! -d Hylia ] && git clone --recursive https://github.com/falkTX/Hylia.git cd Hylia make make install cd .. -git clone https://github.com/micahvdm/jack2.git +[ ! -d jack2 ] && git clone https://github.com/micahvdm/jack2.git cd jack2 ./waf configure ./waf build @@ -30,18 +30,18 @@ cd lilv-0.24.12 ./waf install cd .. -git clone https://github.com/micahvdm/browsepy.git +[ ! -d browsepy ] && git clone https://github.com/micahvdm/browsepy.git cd browsepy pip3 install ./ cd .. -git clone https://github.com/micahvdm/mod-host.git +[ ! -d mod-host ] && git clone https://github.com/micahvdm/mod-host.git cd mod-host make make install cd .. -git clone https://github.com/TreeFallSound/mod-ui.git +[ ! -d mod-ui ] && git clone https://github.com/TreeFallSound/mod-ui.git cd mod-ui chmod +x setup.py cd utils @@ -52,29 +52,28 @@ cp -r default.pedalboard /home/${FIRST_USER_NAME}/data/.pedalboards sed -i -e 's/collections.MutableMapping/collections.abc.MutableMapping/' /usr/local/lib/python3.11/dist-packages/tornado/httputil.py cd .. -git clone https://github.com/BlokasLabs/amidithru.git +[ ! -d amidithru ] && git clone https://github.com/BlokasLabs/amidithru.git cd amidithru sed -i 's/CXX=g++.*/CXX=g++/' Makefile make install cd .. -git clone https://github.com/micahvdm/touchosc2midi.git +[ ! -d touchosc2midi ] && git clone https://github.com/micahvdm/touchosc2midi.git cd touchosc2midi pip3 install ./ cd .. -git clone https://github.com/micahvdm/mod-midi-merger.git +[ ! -d mod-midi-merger ] && git clone https://github.com/micahvdm/mod-midi-merger.git cd mod-midi-merger mkdir build && cd build cmake .. make make install -cd .. +cd ../.. -git clone https://github.com/moddevices/mod-ttymidi.git +[ ! -d mod-ttymidi ] && git clone https://github.com/moddevices/mod-ttymidi.git cd mod-ttymidi make install cd .. - EOF From d6086c5f8777ff7ce55fa5d17bf6f7a7f9e6366a Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Fri, 16 Jan 2026 21:17:12 -0800 Subject: [PATCH 08/14] track repo upstreams, add jack-example-tools, add jack build deps --- stage2/01-sys-tweaks/00-packages-nr | 2 ++ stage2/05-pistomp/02-run.sh | 27 +++++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/stage2/01-sys-tweaks/00-packages-nr b/stage2/01-sys-tweaks/00-packages-nr index d8461e3..3d8e102 100755 --- a/stage2/01-sys-tweaks/00-packages-nr +++ b/stage2/01-sys-tweaks/00-packages-nr @@ -1,6 +1,8 @@ cifs-utils rpicam-apps-lite mkvtoolnix +meson +ninja-build libserd-dev libsord-dev libsratom-dev diff --git a/stage2/05-pistomp/02-run.sh b/stage2/05-pistomp/02-run.sh index b259381..d4ad3f5 100755 --- a/stage2/05-pistomp/02-run.sh +++ b/stage2/05-pistomp/02-run.sh @@ -13,13 +13,23 @@ make make install cd .. -[ ! -d jack2 ] && git clone https://github.com/micahvdm/jack2.git +[ ! -d jack2 ] && git clone --branch v1.9.22 https://github.com/jackaudio/jack2.git cd jack2 ./waf configure ./waf build ./waf install cd .. +# jack-example-tools provides jack_load/jack_unload v4 +# Alternative source: +#[ ! -d jack-example-tools ] && git clone --branch 4 https://github.com/jackaudio/jack-example-tools.git +[ ! -d jack-example-tools ] && git clone --branch debian/4-4 https://salsa.debian.org/multimedia-team/jack-example-tools.git +cd jack-example-tools +meson setup --prefix=/usr/local build +ninja -C build +meson install -C build +cd .. + # debian 13 will include python3-lilv liblilv-dev [ ! -d lilv-0.24.12 ] && \ wget http://download.drobilla.net/lilv-0.24.12.tar.bz2 && \ @@ -35,8 +45,10 @@ cd browsepy pip3 install ./ cd .. -[ ! -d mod-host ] && git clone https://github.com/micahvdm/mod-host.git +[ ! -d mod-host ] && git clone https://github.com/mod-audio/mod-host cd mod-host +# This project has no tags - using the repo head from 2025-12-27 +git checkout af11901d9d3ab02631b463853bd16d7881c4e7ca make make install cd .. @@ -58,15 +70,19 @@ sed -i 's/CXX=g++.*/CXX=g++/' Makefile make install cd .. -[ ! -d touchosc2midi ] && git clone https://github.com/micahvdm/touchosc2midi.git +[ ! -d touchosc2midi ] && git clone https://github.com/BlokasLabs/touchosc2midi.git cd touchosc2midi pip3 install ./ cd .. -[ ! -d mod-midi-merger ] && git clone https://github.com/micahvdm/mod-midi-merger.git +[ ! -d mod-midi-merger ] && git clone https://github.com/mod-audio/mod-midi-merger cd mod-midi-merger +# This project's cmake forces the install prefix to /usr for some reason, so disable that +# so that CMAKE_INSTALL_PREFIX can be used. +sed -i 's/^[[:space:]]*set(CMAKE_INSTALL_PREFIX[[:space:]]*\/usr)/# &/' CMakeLists.txt +[ -d build ] && rm -rf build mkdir build && cd build -cmake .. +cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. make make install cd ../.. @@ -76,4 +92,3 @@ cd mod-ttymidi make install cd .. EOF - From 94dcdbcfd5d807899000834e1d4ed91f3f574ae8 Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Fri, 16 Jan 2026 21:29:04 -0800 Subject: [PATCH 09/14] install jack-env into /etc/profile.d so shell can access jackd services --- stage2/05-pistomp/01-run.sh | 1 + stage2/05-pistomp/files/jack-env.sh | 1 + 2 files changed, 2 insertions(+) create mode 100644 stage2/05-pistomp/files/jack-env.sh diff --git a/stage2/05-pistomp/01-run.sh b/stage2/05-pistomp/01-run.sh index 3c9a75d..923c368 100755 --- a/stage2/05-pistomp/01-run.sh +++ b/stage2/05-pistomp/01-run.sh @@ -2,6 +2,7 @@ install -m 644 files/services/*.service ${ROOTFS_DIR}/usr/lib/systemd/system/ install -m 644 files/jackdrc ${ROOTFS_DIR}/etc/ +install -m 644 files/jack-env.sh ${ROOTFS_DIR}/etc/profile.d/ install -m 500 files/80 ${ROOTFS_DIR}/etc/authbind/byport/ mkdir -p "${ROOTFS_DIR}/etc/systemd/system/alsa-restore.service.d" diff --git a/stage2/05-pistomp/files/jack-env.sh b/stage2/05-pistomp/files/jack-env.sh new file mode 100644 index 0000000..a25592f --- /dev/null +++ b/stage2/05-pistomp/files/jack-env.sh @@ -0,0 +1 @@ +export JACK_PROMISCUOUS_SERVER=jack From f750ac503d61fd88c43e4ea56f13c36b76357fcc Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Fri, 16 Jan 2026 21:30:07 -0800 Subject: [PATCH 10/14] enable usb_max_current_enable for thumb drive booting --- stage1/00-boot-files/files/config.txt | 3 +++ stage2/05-pistomp/files/config_pistomp.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/stage1/00-boot-files/files/config.txt b/stage1/00-boot-files/files/config.txt index a1fdaeb..361707a 100755 --- a/stage1/00-boot-files/files/config.txt +++ b/stage1/00-boot-files/files/config.txt @@ -39,6 +39,9 @@ disable_overscan=1 # Run as fast as firmware / board allows arm_boost=1 +# enable high usb port power for booting from thumb drive for development +usb_max_current_enable=1 + [cm4] # Enable host mode on the 2711 built-in XHCI USB controller. # This line should be removed if the legacy DWC2 controller is required diff --git a/stage2/05-pistomp/files/config_pistomp.txt b/stage2/05-pistomp/files/config_pistomp.txt index ea6c291..fdc26c3 100644 --- a/stage2/05-pistomp/files/config_pistomp.txt +++ b/stage2/05-pistomp/files/config_pistomp.txt @@ -43,6 +43,9 @@ gpu_mem=16 disable_overscan=1 disable_splash=1 +# enable high usb port power for booting from thumb drive for development +usb_max_current_enable=1 + [pi3] kernel=vmlinuz-6.1.54-rt15-v8+ # initramfs initrd.img-6.1.54-rt15-v8+ From e135735523a95126b42c82df7bc974829bf50f92 Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Thu, 5 Feb 2026 01:52:17 -0800 Subject: [PATCH 11/14] 200mb->500mb of IMG_SIZE to handle libc upgrade --- export-image/prerun.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index 6a5309a..bb81216 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -18,13 +18,14 @@ ALIGN="$((4 * 1024 * 1024))" # some overhead (since actual space usage is usually rounded up to the # filesystem block size) and gives some free space on the resulting # image. -ROOT_MARGIN="$(echo "($ROOT_SIZE * 0.2 + 200 * 1024 * 1024) / 1" | bc)" +ROOT_MARGIN="$(echo "($ROOT_SIZE * 0.2 + 500 * 1024 * 1024) / 1" | bc)" BOOT_PART_START=$((ALIGN)) BOOT_PART_SIZE=$(((BOOT_SIZE + ALIGN - 1) / ALIGN * ALIGN)) ROOT_PART_START=$((BOOT_PART_START + BOOT_PART_SIZE)) ROOT_PART_SIZE=$(((ROOT_SIZE + ROOT_MARGIN + ALIGN - 1) / ALIGN * ALIGN)) IMG_SIZE=$((BOOT_PART_START + BOOT_PART_SIZE + ROOT_PART_SIZE)) +echo IMG_SIZE is $IMG_SIZE in $IMG_FILE truncate -s "${IMG_SIZE}" "${IMG_FILE}" From a6b5c129f8f342f6184e113bb4c61262b28257f3 Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Thu, 5 Feb 2026 01:52:50 -0800 Subject: [PATCH 12/14] only patch NetworkManager.conf if not yet patched --- stage2/05-pistomp/03-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/05-pistomp/03-run.sh b/stage2/05-pistomp/03-run.sh index 6d08439..a96e72e 100755 --- a/stage2/05-pistomp/03-run.sh +++ b/stage2/05-pistomp/03-run.sh @@ -15,7 +15,7 @@ cd /home/${FIRST_USER_NAME}/tmp #patch -b -N -u /usr/local/lib/python3.11/dist-packages/touchosc2midi/advertise.py -i advertise.diff -patch -b -N -u /etc/NetworkManager/NetworkManager.conf -i NetworkManager.conf.diff +[ ! -f /etc/NetworkManager/NetworkManager.conf.orig ] && patch -b -N -u /etc/NetworkManager/NetworkManager.conf -i NetworkManager.conf.diff dpkg -i linux-headers-6.1.54-rt15-v8+_6.1.54-rt15-v8+-2_arm64.deb dpkg -i linux-libc-dev_6.1.54-rt15-v8+-2_arm64.deb From a0caf5a04aee776a7c879e9c6b179fcd296de24a Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Thu, 5 Feb 2026 01:53:28 -0800 Subject: [PATCH 13/14] do not error if /etc/profile.d/bash_completion.sh already removed --- stage2/05-pistomp/04-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/05-pistomp/04-run.sh b/stage2/05-pistomp/04-run.sh index 781038e..cbe5307 100755 --- a/stage2/05-pistomp/04-run.sh +++ b/stage2/05-pistomp/04-run.sh @@ -9,6 +9,6 @@ chmod +x /etc/jackdrc chown jack:jack /etc/jackdrc chmod 500 /etc/authbind/byport/80 chown ${FIRST_USER_NAME}:${FIRST_USER_NAME} /etc/authbind/byport/80 -rm /etc/profile.d/bash_completion.sh +rm -f /etc/profile.d/bash_completion.sh EOF From 766c6bee0bda627e49c1044d289f0ffc3b9de4f0 Mon Sep 17 00:00:00 2001 From: Greg Simpson Date: Thu, 5 Feb 2026 01:54:11 -0800 Subject: [PATCH 14/14] sudo not needed or available --- stage3/01-pistomp/01-run.sh | 4 ++-- stage3/02-cleanup/01-run.sh | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/stage3/01-pistomp/01-run.sh b/stage3/01-pistomp/01-run.sh index ce15b8c..d0415bf 100755 --- a/stage3/01-pistomp/01-run.sh +++ b/stage3/01-pistomp/01-run.sh @@ -45,7 +45,7 @@ install -m 644 /home/${FIRST_USER_NAME}/pi-stomp/setup/services/hotspot/usr/lib/ chown -R ${FIRST_USER_NAME}:${FIRST_USER_NAME} /usr/lib/pistomp-wifi # USB automounter -sudo dpkg -i /home/${FIRST_USER_NAME}/pi-stomp/setup/services/usbmount.deb +dpkg -i /home/${FIRST_USER_NAME}/pi-stomp/setup/services/usbmount.deb # Plugins mkdir -p /home/${FIRST_USER_NAME}/tmp @@ -69,7 +69,7 @@ exit 0 EOF # Version info -software_version=$(sudo git --work-tree ${ROOTFS_DIR}/home/pistomp/pi-stomp --git-dir ${ROOTFS_DIR}/home/pistomp/pi-stomp/.git describe --dirty="*" --always) +software_version=$(git --work-tree ${ROOTFS_DIR}/home/pistomp/pi-stomp --git-dir ${ROOTFS_DIR}/home/pistomp/pi-stomp/.git describe --dirty="*" --always) build_tag=$(git --work-tree $BASE_DIR --git-dir $BASE_DIR/.git describe --dirty="*" --always) build_date=$(date +"%y%m%d") printf '{"build-tag": "%s", "build-date": "%s", "software-version": "%s"}' $build_tag $build_date $software_version > ${ROOTFS_DIR}/home/pistomp/.osbuild diff --git a/stage3/02-cleanup/01-run.sh b/stage3/02-cleanup/01-run.sh index 90fe9e3..fa5df9b 100755 --- a/stage3/02-cleanup/01-run.sh +++ b/stage3/02-cleanup/01-run.sh @@ -9,42 +9,42 @@ echo "=== Cleaning ${ROOTFS_DIR} before image export ===" # 1. Remove cached package files echo "→ Clearing APT cache..." -sudo rm -rf "${ROOTFS_DIR}/var/cache/apt/archives/"*.deb || true -sudo rm -rf "${ROOTFS_DIR}/var/lib/apt/lists/"* || true +rm -rf "${ROOTFS_DIR}/var/cache/apt/archives/"*.deb || true +rm -rf "${ROOTFS_DIR}/var/lib/apt/lists/"* || true # 2. Remove package documentation (but keep man pages) echo "→ Removing /usr/share/doc (keeping licenses)..." -sudo find "${ROOTFS_DIR}/usr/share/doc" -mindepth 1 -type d -exec rm -rf {} + 2>/dev/null || true -sudo find "${ROOTFS_DIR}/usr/share/doc" -type f ! -name 'copyright' -delete || true +find "${ROOTFS_DIR}/usr/share/doc" -mindepth 1 -type d -exec rm -rf {} + 2>/dev/null || true +find "${ROOTFS_DIR}/usr/share/doc" -type f ! -name 'copyright' -delete || true # 3. Prune locale data except English echo "→ Removing non-English locales..." -sudo find "${ROOTFS_DIR}/usr/share/locale" -mindepth 1 -maxdepth 1 \ +find "${ROOTFS_DIR}/usr/share/locale" -mindepth 1 -maxdepth 1 \ ! -name 'en' ! -name 'en_GB' ! -name 'en_US' -exec rm -rf {} + || true # 4. Clear system logs echo "→ Removing logs..." -sudo rm -rf "${ROOTFS_DIR}/var/log/"* || true +rm -rf "${ROOTFS_DIR}/var/log/"* || true # 5. Clear temporary files echo "→ Clearing /tmp and /var/tmp..." -sudo rm -rf "${ROOTFS_DIR}/tmp/"* "${ROOTFS_DIR}/var/tmp/"* || true +rm -rf "${ROOTFS_DIR}/tmp/"* "${ROOTFS_DIR}/var/tmp/"* || true # 6. Remove cache directories from common applications echo "→ Removing miscellaneous caches..." -sudo rm -rf "${ROOTFS_DIR}/var/cache/"* || true -sudo rm -rf "${ROOTFS_DIR}/home/"*/.cache || true -sudo rm -rf "${ROOTFS_DIR}/root/.cache" || true +rm -rf "${ROOTFS_DIR}/var/cache/"* || true +rm -rf "${ROOTFS_DIR}/home/"*/.cache || true +rm -rf "${ROOTFS_DIR}/root/.cache" || true # 7. Zero out free space inside the staged filesystem to help xz #echo "→ Zero-filling free space for better compression..." #MNT=$(mktemp -d) -#sudo mount -o loop,offset=$(( $(fdisk -l "${ROOTFS_DIR}/../image.img" | awk '/^Device/{getline; print $2}') * 512 )) \ +#mount -o loop,offset=$(( $(fdisk -l "${ROOTFS_DIR}/../image.img" | awk '/^Device/{getline; print $2}') * 512 )) \ # "${ROOTFS_DIR}/../image.img" "$MNT" 2>/dev/null || true #if mountpoint -q "$MNT"; then -# sudo dd if=/dev/zero of="$MNT/zero.fill" bs=1M || true -# sudo rm "$MNT/zero.fill" -# sudo umount "$MNT" +# dd if=/dev/zero of="$MNT/zero.fill" bs=1M || true +# rm "$MNT/zero.fill" +# umount "$MNT" #else # echo " (skipping zero-fill, no image mounted yet)" #fi