From 208877d1e682536aa737748fffe4560956d3908a Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:16 +0100 Subject: feat(etc): template kernel cmdline, derive LUKS UUID from partition name Prompt once at 'chezmoi init' time for the LUKS root partition (e.g. nvme0n1p2) and store it under [data].luksRootPartition in the per-machine chezmoi config. etc/kernel/cmdline.tmpl resolves the UUID at apply time via lsblk, so reinstalls only require re-entering the partition name. The etc deploy script now renders *.tmpl sources through 'chezmoi execute-template' and installs them without the suffix. The resolved UUID is folded into the onchange hash so the script re-runs when the UUID changes even if etc/ content is unchanged. just etc-status/diff transparently handle .tmpl sources (strip suffix for the live-path mapping, render before diffing). etc-re-add skips .tmpl files since template sources can't be reverse-rendered from the live file. --- etc/kernel/cmdline | 1 - etc/kernel/cmdline.tmpl | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 etc/kernel/cmdline create mode 100644 etc/kernel/cmdline.tmpl (limited to 'etc') diff --git a/etc/kernel/cmdline b/etc/kernel/cmdline deleted file mode 100644 index 341f153..0000000 --- a/etc/kernel/cmdline +++ /dev/null @@ -1 +0,0 @@ -rd.luks.name=81520bbc-1e7a-45e6-9465-cfc2e8b18945=root root=/dev/mapper/root rw quiet diff --git a/etc/kernel/cmdline.tmpl b/etc/kernel/cmdline.tmpl new file mode 100644 index 0000000..dab0461 --- /dev/null +++ b/etc/kernel/cmdline.tmpl @@ -0,0 +1 @@ +rd.luks.name={{ output "lsblk" "-no" "UUID" (printf "/dev/%s" .luksRootPartition) | trim }}=root root=/dev/mapper/root rw quiet -- cgit v1.3.1