detached 12452c7

fix(services): enable power-profiles-daemon after package install, fix limine-snapper-sync unit name

commit
12452c7459d3ceb939f22ebe3bd5301081a9965e
author
brice · · 2026-02-28 18:12 UTC
parent
0b45dd4
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
4 files · +10 -9
M internal/application/handlers/configure_system_handler.go +0 -4
@@ -192,10 +192,6 @@ func (h *ConfigureSystemHandler) Handle(ctx context.Context, cmd commands.Config
192192 h.logger.Warn("Failed to mask NetworkManager-wait-online.service", "error", err)
193193 }
194194
195- if err := h.chrExec.ChrootSystemctl(ctx, h.logger.LogPath(), cmd.MountPoint, "enable", "power-profiles-daemon"); err != nil {
196- h.logger.Warn("Failed to enable power-profiles-daemon", "error", err)
197- }
198-
199195 if err := h.configureZram(cmd.MountPoint); err != nil {
200196 h.logger.Warn("Failed to configure zram", "error", err)
201197 }
@@ -192,10 +192,6 @@ func (h *ConfigureSystemHandler) Handle(ctx context.Context, cmd commands.Config
192 h.logger.Warn("Failed to mask NetworkManager-wait-online.service", "error", err)192 h.logger.Warn("Failed to mask NetworkManager-wait-online.service", "error", err)
193 }193 }
194 194
195- if err := h.chrExec.ChrootSystemctl(ctx, h.logger.LogPath(), cmd.MountPoint, "enable", "power-profiles-daemon"); err != nil {
196- h.logger.Warn("Failed to enable power-profiles-daemon", "error", err)
197- }
198-
199 if err := h.configureZram(cmd.MountPoint); err != nil {195 if err := h.configureZram(cmd.MountPoint); err != nil {
200 h.logger.Warn("Failed to configure zram", "error", err)196 h.logger.Warn("Failed to configure zram", "error", err)
201 }197 }
M internal/application/handlers/post_install_handler.go +2 -2
@@ -214,8 +214,8 @@ func (h *PostInstallHandler) setupSnapperSync(ctx context.Context, mountPoint st
214214 if _, err := h.chrExec.ExecuteInChroot(ctx, mountPoint, "pacman", "-S", "--noconfirm", "--needed", "limine-snapper-sync"); err != nil {
215215 return fmt.Errorf("failed to install limine-snapper-sync: %w", err)
216216 }
217- if err := h.chrExec.ChrootSystemctl(ctx, h.logger.LogPath(), mountPoint, "enable", "limine-snapper-sync.timer"); err != nil {
218- return fmt.Errorf("failed to enable limine-snapper-sync.timer: %w", err)
217+ if err := h.chrExec.ChrootSystemctl(ctx, h.logger.LogPath(), mountPoint, "enable", "limine-snapper-sync.service"); err != nil {
218+ return fmt.Errorf("failed to enable limine-snapper-sync.service: %w", err)
219219 }
220220 return nil
221221 }
@@ -214,8 +214,8 @@ func (h *PostInstallHandler) setupSnapperSync(ctx context.Context, mountPoint st
214 if _, err := h.chrExec.ExecuteInChroot(ctx, mountPoint, "pacman", "-S", "--noconfirm", "--needed", "limine-snapper-sync"); err != nil {214 if _, err := h.chrExec.ExecuteInChroot(ctx, mountPoint, "pacman", "-S", "--noconfirm", "--needed", "limine-snapper-sync"); err != nil {
215 return fmt.Errorf("failed to install limine-snapper-sync: %w", err)215 return fmt.Errorf("failed to install limine-snapper-sync: %w", err)
216 }216 }
217- if err := h.chrExec.ChrootSystemctl(ctx, h.logger.LogPath(), mountPoint, "enable", "limine-snapper-sync.timer"); err != nil {217+ if err := h.chrExec.ChrootSystemctl(ctx, h.logger.LogPath(), mountPoint, "enable", "limine-snapper-sync.service"); err != nil {
218- return fmt.Errorf("failed to enable limine-snapper-sync.timer: %w", err)218+ return fmt.Errorf("failed to enable limine-snapper-sync.service: %w", err)
219 }219 }
220 return nil220 return nil
221 }221 }
M internal/application/handlers/post_install_handler_test.go +3 -3
@@ -387,9 +387,9 @@ func TestPostInstallHandler_Handle_EnablesSnapperSync(t *testing.T) {
387387 // Catch-all for any other ExecuteInChroot calls
388388 mockChrExec.EXPECT().ExecuteInChroot(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return([]byte{}, nil).AnyTimes()
389389
390- // Track systemctl enable for limine-snapper-sync.timer (specific expectation first)
390+ // Track systemctl enable for limine-snapper-sync.service (specific expectation first)
391391 mockChrExec.EXPECT().ChrootSystemctl(
392- gomock.Any(), gomock.Any(), gomock.Eq("/mnt"), gomock.Eq("enable"), gomock.Eq("limine-snapper-sync.timer"),
392+ gomock.Any(), gomock.Any(), gomock.Eq("/mnt"), gomock.Eq("enable"), gomock.Eq("limine-snapper-sync.service"),
393393 ).DoAndReturn(func(ctx context.Context, logPath, chrootPath string, args ...string) error {
394394 snapperTimerEnabled = true
395395 return nil
@@ -422,7 +422,7 @@ func TestPostInstallHandler_Handle_EnablesSnapperSync(t *testing.T) {
422422 }
423423
424424 if !snapperTimerEnabled {
425- t.Error("expected limine-snapper-sync.timer to be enabled via systemctl")
425+ t.Error("expected limine-snapper-sync.service to be enabled via systemctl")
426426 }
427427 }
428428
@@ -387,9 +387,9 @@ func TestPostInstallHandler_Handle_EnablesSnapperSync(t *testing.T) {
387 // Catch-all for any other ExecuteInChroot calls387 // Catch-all for any other ExecuteInChroot calls
388 mockChrExec.EXPECT().ExecuteInChroot(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return([]byte{}, nil).AnyTimes()388 mockChrExec.EXPECT().ExecuteInChroot(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return([]byte{}, nil).AnyTimes()
389 389
390- // Track systemctl enable for limine-snapper-sync.timer (specific expectation first)390+ // Track systemctl enable for limine-snapper-sync.service (specific expectation first)
391 mockChrExec.EXPECT().ChrootSystemctl(391 mockChrExec.EXPECT().ChrootSystemctl(
392- gomock.Any(), gomock.Any(), gomock.Eq("/mnt"), gomock.Eq("enable"), gomock.Eq("limine-snapper-sync.timer"),392+ gomock.Any(), gomock.Any(), gomock.Eq("/mnt"), gomock.Eq("enable"), gomock.Eq("limine-snapper-sync.service"),
393 ).DoAndReturn(func(ctx context.Context, logPath, chrootPath string, args ...string) error {393 ).DoAndReturn(func(ctx context.Context, logPath, chrootPath string, args ...string) error {
394 snapperTimerEnabled = true394 snapperTimerEnabled = true
395 return nil395 return nil
@@ -422,7 +422,7 @@ func TestPostInstallHandler_Handle_EnablesSnapperSync(t *testing.T) {
422 }422 }
423 423
424 if !snapperTimerEnabled {424 if !snapperTimerEnabled {
425- t.Error("expected limine-snapper-sync.timer to be enabled via systemctl")425+ t.Error("expected limine-snapper-sync.service to be enabled via systemctl")
426 }426 }
427 }427 }
428 428
M internal/application/handlers/repos_handler.go +5 -0
@@ -122,6 +122,11 @@ func (h *ReposHandler) Handle(ctx context.Context, cmd commands.SetupRepositorie
122122 return fail("Failed to install extra packages", err)
123123 }
124124 h.logger.Info("Extra packages installed successfully")
125+
126+ // Enable power-profiles-daemon after it has been installed via extra.packages
127+ if err := h.chrExec.ChrootSystemctl(ctx, "", cmd.MountPoint, "enable", "power-profiles-daemon.service"); err != nil {
128+ h.logger.Warn("Failed to enable power-profiles-daemon", "error", err)
129+ }
125130 }
126131
127132 result.Success = true
@@ -122,6 +122,11 @@ func (h *ReposHandler) Handle(ctx context.Context, cmd commands.SetupRepositorie
122 return fail("Failed to install extra packages", err)122 return fail("Failed to install extra packages", err)
123 }123 }
124 h.logger.Info("Extra packages installed successfully")124 h.logger.Info("Extra packages installed successfully")
125+
126+ // Enable power-profiles-daemon after it has been installed via extra.packages
127+ if err := h.chrExec.ChrootSystemctl(ctx, "", cmd.MountPoint, "enable", "power-profiles-daemon.service"); err != nil {
128+ h.logger.Warn("Failed to enable power-profiles-daemon", "error", err)
129+ }
125 }130 }
126 131
127 result.Success = true132 result.Success = true

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