chore(uninstall): --skip-rootless alias + clearer naming on the keep-the-layer flag

The existing --skip-docker-images flag keeps a lot more than just images:
the docker-install user, the rootless dockerd, the rootless sysctl
drop-ins, AND the image/build cache. So a reinstall after using it
already skips the slow `dockerd-rootless-setuptool.sh install` step —
which is the meat of why anyone reaches for this flag on a local dev
loop. The name "--skip-docker-images" undersells what it actually does
and "skip the rootless install" is the user-facing intent.

Adds --skip-rootless as an alias of --skip-docker-images (same flag
variable, no behaviour change). Both spellings continue to work — anything
scripting the old name keeps working — but the help text, examples, and
the uninstall printf now use the clearer --skip-rootless. Same name
shift in scripts/update.sh: SKIP_ROOTLESS=1 is the new env-var spelling,
SKIP_DOCKER_IMAGES=1 is the back-compat alias.

Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
librelad 2026-05-27 23:59:16 +01:00
parent 06f6e5c71d
commit ca3b4ed61b

42
init.sh
View File

@ -10,11 +10,15 @@
# --unattended Run in unattended mode (skip confirmations) # --unattended Run in unattended mode (skip confirmations)
# --skip-os-update Skip operating system update # --skip-os-update Skip operating system update
# --skip-prereqs Skip installing prerequisite apps # --skip-prereqs Skip installing prerequisite apps
# --skip-docker-images On UNINSTALL: keep the rootless docker daemon, the # --skip-rootless On UNINSTALL: keep the entire rootless layer (the
# docker-install user, and the image/build cache instead # (also: --skip-docker-images)
# of tearing them down — so a following reinstall rebuilds # docker-install user, the rootless dockerd, the sysctl
# the WebUI image from cache (fast) instead of from # drop-ins, and the image/build cache) instead of tearing
# scratch. (No effect on install.) # them down. A following reinstall then skips the slow
# `dockerd-rootless-setuptool.sh install` step entirely
# and rebuilds containers from the existing image cache,
# which on local dev iteration cuts reinstall time from
# minutes to seconds. (No effect on install.)
# --system-dir=PATH Install root for the control plane (configs/logs/install/ # --system-dir=PATH Install root for the control plane (configs/logs/install/
# db). Default /libreportal-system. (Also: LP_SYSTEM_DIR.) # db). Default /libreportal-system. (Also: LP_SYSTEM_DIR.)
# --containers-dir=PATH Root for live app data. Default /libreportal-containers. # --containers-dir=PATH Root for live app data. Default /libreportal-containers.
@ -31,7 +35,7 @@
# ./init.sh --random-password --local init # ./init.sh --random-password --local init
# ./init.sh --random-password --local --unattended init # ./init.sh --random-password --local --unattended init
# ./init.sh --random-password --local --skip-os-update --skip-prereqs init # ./init.sh --random-password --local --skip-os-update --skip-prereqs init
# ./init.sh --unattended --skip-docker-images uninstall # keep docker layer # ./init.sh --unattended --skip-rootless uninstall # keep rootless layer for fast reinstall
# ./init.sh init mypassword myuser mytoken https://github.com/user/repo.git # ./init.sh init mypassword myuser mytoken https://github.com/user/repo.git
# #
@ -254,10 +258,17 @@ for ((i=1; i<=$#; i++)); do
init_skip_prereqs=true init_skip_prereqs=true
((init_shift_count++)) ((init_shift_count++))
;; ;;
--skip-docker-images) --skip-docker-images|--skip-rootless)
# On uninstall: preserve the rootless docker layer (daemon + # On uninstall: preserve the rootless docker layer (daemon +
# docker-install user + image/build cache) so the next reinstall's # docker-install user + sysctl drop-ins + image/build cache)
# `docker build` is cache-fast. Honored in runFullUninstall. # so the next reinstall's `docker build` is cache-fast AND
# the slow `dockerd-rootless-setuptool.sh install` step is
# skipped. Honored in runFullUninstall.
#
# Two spellings: --skip-docker-images is the original name;
# --skip-rootless is the clearer alias (the flag keeps a lot
# more than just images). Both set the same flag, so passing
# either or both has the same effect.
init_skip_docker_images=true init_skip_docker_images=true
((init_shift_count++)) ((init_shift_count++))
;; ;;
@ -1641,11 +1652,12 @@ runFullUninstall()
iuser=$(grep -h '^CFG_DOCKER_INSTALL_USER=' "${configs_dir}general/general_docker_install" 2>/dev/null | head -1 | cut -d= -f2 | awk '{print $1}') iuser=$(grep -h '^CFG_DOCKER_INSTALL_USER=' "${configs_dir}general/general_docker_install" 2>/dev/null | head -1 | cut -d= -f2 | awk '{print $1}')
iuser="${iuser:-dockerinstall}" iuser="${iuser:-dockerinstall}"
# --skip-docker-images: keep the rootless docker layer (the daemon, the # --skip-rootless (alias: --skip-docker-images): keep the entire rootless
# "$iuser" user, the image/build cache + the rootless sysctl drop-in) instead # layer (the daemon, the "$iuser" user, the image/build cache, and the
# of tearing it down, so a following reinstall's `docker build` is cache-fast # rootless sysctl drop-ins) instead of tearing it down, so a following
# instead of from-scratch. Everything else (control plane, manager, footprint, # reinstall skips the slow `dockerd-rootless-setuptool.sh install` AND
# /docker) is still removed. # rebuilds from the existing image cache. Everything else (control plane,
# manager, footprint, /docker) is still removed.
local keep_docker="${init_skip_docker_images:-false}" local keep_docker="${init_skip_docker_images:-false}"
isHeader "LibrePortal — FULL Uninstall" isHeader "LibrePortal — FULL Uninstall"
@ -1675,7 +1687,7 @@ runFullUninstall()
printf " ${GREEN}Left in place:${NC} ${DIM}docker engine, docker-compose, apt-installed deps, and your SSH config (so you can't get locked out).${NC}\n" printf " ${GREEN}Left in place:${NC} ${DIM}docker engine, docker-compose, apt-installed deps, and your SSH config (so you can't get locked out).${NC}\n"
echo "" echo ""
if [[ "$keep_docker" == "true" ]]; then if [[ "$keep_docker" == "true" ]]; then
isNotice "--skip-docker-images: KEEPING the rootless docker daemon, the '$iuser' user, and the image/build cache (for a faster reinstall)." isNotice "--skip-rootless: KEEPING the rootless docker daemon, the '$iuser' user, sysctl drop-ins, and the image/build cache (for a faster reinstall)."
echo "" echo ""
fi fi
if [[ "$init_unattended_mode" == true ]]; then if [[ "$init_unattended_mode" == true ]]; then