plc-checkweigher 1.30.0 → 1.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/setup.sh +47 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plc-checkweigher",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.0",
|
|
4
4
|
"description": "One-command installer for the PLC Check-Weigher system on Raspberry Pi (PREEMPT_RT kernel, Python stack, WiFi, SMB, systemd RT services)",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"postinstall": "node bin/cli.js"
|
package/setup.sh
CHANGED
|
@@ -746,7 +746,51 @@ lock_source_files() {
|
|
|
746
746
|
}
|
|
747
747
|
|
|
748
748
|
# ── 12. RT kernel — installed LAST so only one reboot is needed ───────────────
|
|
749
|
-
# ── 11d.
|
|
749
|
+
# ── 11d. Debloat — purge applications unused by the PLC stack ────────────────
|
|
750
|
+
# KEEP: chromium (kiosk display), code / VS Code (maintenance), NetworkManager,
|
|
751
|
+
# ssh, lightdm + compositor, rpi-connect, python3, git, nodejs, samba-client,
|
|
752
|
+
# plymouth, build-essential.
|
|
753
|
+
setup_debloat() {
|
|
754
|
+
step "Removing unused applications (dedicating resources to the tool) ..."
|
|
755
|
+
local _PURGE=(
|
|
756
|
+
firefox # kiosk uses chromium
|
|
757
|
+
chromium-l10n # browser locale packs — English UI only
|
|
758
|
+
vlc vlc-l10n # no media playback on the line
|
|
759
|
+
realvnc-vnc-server # Pi Connect (wayvnc) provides screen share
|
|
760
|
+
rpi-imager rpi-userguide rp-bookshelf piwiz
|
|
761
|
+
pocketsphinx-en-us # offline speech model
|
|
762
|
+
python3-mypy
|
|
763
|
+
thonny geany geany-common
|
|
764
|
+
firmware-atheros firmware-mediatek firmware-libertas # non-Pi WiFi chips
|
|
765
|
+
avahi-daemon
|
|
766
|
+
cups cups-daemon cups-browsed
|
|
767
|
+
bluez # BT radio already disabled at boot
|
|
768
|
+
wolfram-engine sonic-pi scratch scratch2 scratch3 minecraft-pi
|
|
769
|
+
claws-mail mu-editor smartsim sense-emu-tools
|
|
770
|
+
libreoffice-core libreoffice-common
|
|
771
|
+
)
|
|
772
|
+
local _TO_REMOVE=() _p
|
|
773
|
+
for _p in "${_PURGE[@]}"; do
|
|
774
|
+
dpkg -l "$_p" 2>/dev/null | grep -q "^ii" && _TO_REMOVE+=("$_p")
|
|
775
|
+
done
|
|
776
|
+
if [[ ${#_TO_REMOVE[@]} -gt 0 ]]; then
|
|
777
|
+
local _BEFORE
|
|
778
|
+
_BEFORE=$(df --output=avail / | tail -1)
|
|
779
|
+
DEBIAN_FRONTEND=noninteractive apt-get purge -y -qq "${_TO_REMOVE[@]}" \
|
|
780
|
+
> /tmp/debloat.log 2>&1 || warn "Some purges had warnings — see /tmp/debloat.log"
|
|
781
|
+
ok "Purged: ${_TO_REMOVE[*]}"
|
|
782
|
+
DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y -qq \
|
|
783
|
+
>> /tmp/debloat.log 2>&1 || true
|
|
784
|
+
apt-get clean
|
|
785
|
+
local _AFTER
|
|
786
|
+
_AFTER=$(df --output=avail / | tail -1)
|
|
787
|
+
ok "Orphans removed, apt cache cleared — freed $(( (_AFTER - _BEFORE) / 1024 )) MB"
|
|
788
|
+
else
|
|
789
|
+
ok "No unused applications found"
|
|
790
|
+
fi
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
# ── 11e. System optimization — disable everything not needed by the tool ─────
|
|
750
794
|
setup_system_optimize() {
|
|
751
795
|
step "System optimization (disable non-essential services) ..."
|
|
752
796
|
|
|
@@ -920,7 +964,8 @@ main() {
|
|
|
920
964
|
setup_display # 11 — LightDM priority, CPU isolation, utmpx
|
|
921
965
|
setup_vscode_priority # 11b — VS Code: cores 0-2, Nice=-5
|
|
922
966
|
lock_source_files # 11c — root:root on .py, pi:pi on data/
|
|
923
|
-
|
|
967
|
+
setup_debloat # 11d — purge unused applications (~800 MB+)
|
|
968
|
+
setup_system_optimize # 11e — disable bluetooth/avahi/cups/apt-timers
|
|
924
969
|
install_rt_kernel # 12 — LAST, so only one reboot needed
|
|
925
970
|
do_reboot # 12 — single reboot applies everything
|
|
926
971
|
}
|