detached 01a505a

feat(bootloader): restructure limine template with nested entries, //Snapshots support, and machine-id injection

commit
01a505a9b7d69f881fbd6a9a188a181bd5e11587
author
brice · · 2026-02-28 05:22 UTC
parent
e3e15d5
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +24 -10
M install/configs/limine.conf.template +16 -10
@@ -1,18 +1,24 @@
11 timeout: {{TIMEOUT}}
22 default_entry: 1
3+quiet: yes
34 interface_branding: {{BRANDING}}
45 interface_branding_colour: {{COLOR}}
56 graphics: yes
67 backdrop: 000000
78
8-/{{KERNEL}}
9-protocol: linux
10-kernel_path: boot():/vmlinuz-{{KERNEL}}
11-kernel_cmdline: {{KERNEL_PARAMS}}
12-module_path: boot():/initramfs-{{KERNEL}}.img
9+/+{{KERNEL}}
10+comment: machine-id={{MACHINE_ID}}
1311
14-/{{KERNEL}}-fallback
15-protocol: linux
16-kernel_path: boot():/vmlinuz-{{KERNEL}}
17-kernel_cmdline: {{KERNEL_PARAMS}}
18-module_path: boot():/initramfs-{{KERNEL}}-fallback.img
12+ //{{KERNEL}}
13+ protocol: linux
14+ kernel_path: boot():/vmlinuz-{{KERNEL}}
15+ kernel_cmdline: {{KERNEL_PARAMS}}
16+ module_path: boot():/initramfs-{{KERNEL}}.img
17+
18+ //{{KERNEL}}-fallback
19+ protocol: linux
20+ kernel_path: boot():/vmlinuz-{{KERNEL}}
21+ kernel_cmdline: {{KERNEL_PARAMS}}
22+ module_path: boot():/initramfs-{{KERNEL}}-fallback.img
23+
24+ //Snapshots
@@ -1,18 +1,24 @@
1 timeout: {{TIMEOUT}}1 timeout: {{TIMEOUT}}
2 default_entry: 12 default_entry: 1
3+quiet: yes
3 interface_branding: {{BRANDING}}4 interface_branding: {{BRANDING}}
4 interface_branding_colour: {{COLOR}}5 interface_branding_colour: {{COLOR}}
5 graphics: yes6 graphics: yes
6 backdrop: 0000007 backdrop: 000000
7 8
8-/{{KERNEL}}9+/+{{KERNEL}}
9-protocol: linux10+comment: machine-id={{MACHINE_ID}}
10-kernel_path: boot():/vmlinuz-{{KERNEL}}
11-kernel_cmdline: {{KERNEL_PARAMS}}
12-module_path: boot():/initramfs-{{KERNEL}}.img
13 11
14-/{{KERNEL}}-fallback12+ //{{KERNEL}}
15-protocol: linux13+ protocol: linux
16-kernel_path: boot():/vmlinuz-{{KERNEL}}14+ kernel_path: boot():/vmlinuz-{{KERNEL}}
17-kernel_cmdline: {{KERNEL_PARAMS}}15+ kernel_cmdline: {{KERNEL_PARAMS}}
18-module_path: boot():/initramfs-{{KERNEL}}-fallback.img16+ module_path: boot():/initramfs-{{KERNEL}}.img
17+
18+ //{{KERNEL}}-fallback
19+ protocol: linux
20+ kernel_path: boot():/vmlinuz-{{KERNEL}}
21+ kernel_cmdline: {{KERNEL_PARAMS}}
22+ module_path: boot():/initramfs-{{KERNEL}}-fallback.img
23+
24+ //Snapshots
M internal/application/handlers/bootloader_handler.go +8 -0
@@ -208,12 +208,20 @@ func (h *BootloaderHandler) configureLimine(ctx context.Context, cmd commands.In
208208 return fmt.Errorf("failed to read Limine template: %w", err)
209209 }
210210
211+ // Read machine-id from the installed system for limine-snapper-sync identification
212+ machineIDBytes, err := h.fs.ReadFile(filepath.Join(cmd.MountPoint, "etc", "machine-id"))
213+ machineID := strings.TrimSpace(string(machineIDBytes))
214+ if err != nil || machineID == "" {
215+ machineID = "unknown"
216+ }
217+
211218 limineConfig := string(templateBytes)
212219 limineConfig = strings.ReplaceAll(limineConfig, "{{TIMEOUT}}", fmt.Sprintf("%d", cmd.TimeoutSeconds))
213220 limineConfig = strings.ReplaceAll(limineConfig, "{{BRANDING}}", cmd.Branding)
214221 limineConfig = strings.ReplaceAll(limineConfig, "{{COLOR}}", config.LimineColor)
215222 limineConfig = strings.ReplaceAll(limineConfig, "{{KERNEL}}", kernelName)
216223 limineConfig = strings.ReplaceAll(limineConfig, "{{KERNEL_PARAMS}}", kernelParams)
224+ limineConfig = strings.ReplaceAll(limineConfig, "{{MACHINE_ID}}", machineID)
217225
218226 limineConfigPath := filepath.Join(cmd.MountPoint, "boot", "limine.conf")
219227 if err := h.fs.WriteFile(limineConfigPath, []byte(limineConfig), 0644); err != nil {
@@ -208,12 +208,20 @@ func (h *BootloaderHandler) configureLimine(ctx context.Context, cmd commands.In
208 return fmt.Errorf("failed to read Limine template: %w", err)208 return fmt.Errorf("failed to read Limine template: %w", err)
209 }209 }
210 210
211+ // Read machine-id from the installed system for limine-snapper-sync identification
212+ machineIDBytes, err := h.fs.ReadFile(filepath.Join(cmd.MountPoint, "etc", "machine-id"))
213+ machineID := strings.TrimSpace(string(machineIDBytes))
214+ if err != nil || machineID == "" {
215+ machineID = "unknown"
216+ }
217+
211 limineConfig := string(templateBytes)218 limineConfig := string(templateBytes)
212 limineConfig = strings.ReplaceAll(limineConfig, "{{TIMEOUT}}", fmt.Sprintf("%d", cmd.TimeoutSeconds))219 limineConfig = strings.ReplaceAll(limineConfig, "{{TIMEOUT}}", fmt.Sprintf("%d", cmd.TimeoutSeconds))
213 limineConfig = strings.ReplaceAll(limineConfig, "{{BRANDING}}", cmd.Branding)220 limineConfig = strings.ReplaceAll(limineConfig, "{{BRANDING}}", cmd.Branding)
214 limineConfig = strings.ReplaceAll(limineConfig, "{{COLOR}}", config.LimineColor)221 limineConfig = strings.ReplaceAll(limineConfig, "{{COLOR}}", config.LimineColor)
215 limineConfig = strings.ReplaceAll(limineConfig, "{{KERNEL}}", kernelName)222 limineConfig = strings.ReplaceAll(limineConfig, "{{KERNEL}}", kernelName)
216 limineConfig = strings.ReplaceAll(limineConfig, "{{KERNEL_PARAMS}}", kernelParams)223 limineConfig = strings.ReplaceAll(limineConfig, "{{KERNEL_PARAMS}}", kernelParams)
224+ limineConfig = strings.ReplaceAll(limineConfig, "{{MACHINE_ID}}", machineID)
217 225
218 limineConfigPath := filepath.Join(cmd.MountPoint, "boot", "limine.conf")226 limineConfigPath := filepath.Join(cmd.MountPoint, "boot", "limine.conf")
219 if err := h.fs.WriteFile(limineConfigPath, []byte(limineConfig), 0644); err != nil {227 if err := h.fs.WriteFile(limineConfigPath, []byte(limineConfig), 0644); err != nil {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close