Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rootfs: delete more systemd files #302

Open
wants to merge 20 commits into
base: msft-main
Choose a base branch
from

Conversation

danmihai1
Copy link

For AKS-CC, after these changes:

  • The Guest image file is 2Mi smaller.
  • 10 of the units printed by "systemd-analyze blame" have been removed.
  • The number of units loaded by systemd is smaller by 74.

For AKS-Kata, after these changes:

  • The Guest image file is 2Mi smaller.
  • 4 of the units printed by "systemd-analyze blame" have been removed.
  • The number of units loaded by systemd is smaller by 63.

Apparently there was a typo in that file name - the actual name is:

systemd-tmpfiles-clean.timer

systemd-tmpfiles-clean.timer will be deleted in a future commit.

Signed-off-by: Dan Mihai <[email protected]>
Delete systemd *.timer files, in addition to *.service and *.socket.

Signed-off-by: Dan Mihai <[email protected]>
Delete:
- systemd-tmpfiles-clean.timer
- systemd-tmpfiles-clean.service
- systemd-tmpfiles-setup-dev.service
- systemd-tmpfiles-setup-dev-early.service
- systemd-tmpfiles

systemd-tmpfiles-setup.service was already deleted.

Signed-off-by: Dan Mihai <[email protected]>
Delete *.path files, in addition to *.service, *.socket, and *.timer.

Signed-off-by: Dan Mihai <[email protected]>
Delete:
- systemd-ask-password-console.path
- systemd-ask-password-console.service
- systemd-ask-password-wall.path
- systemd-ask-password-wall.service
- systemd-tty-ask-password-agent

Passwords are not used on Kata Guest VMs.

Signed-off-by: Dan Mihai <[email protected]>
Delete systemd binaries that have the same name as unit files
that are being deleted.

The following binaries get deleted after this change:
- systemd-journald
- systemd-random-seed
- systemd-timesyncd
- systemd-update-utmp

Signed-off-by: Dan Mihai <[email protected]>
Delete:
- [email protected]
- systemd-pcrfs-root.service
- systemd-pcrlock-firmware-code.service
- systemd-pcrlock-firmware-config.service
- systemd-pcrlock-file-system.service
- systemd-pcrlock-machine-id.service
- systemd-pcrlock-make-policy.service
- systemd-pcrlock-secureboot-authority.service
- systemd-pcrlock-secureboot-policy.service
- systemd-pcrmachine.service
- systemd-pcrphase.service
- systemd-pcrphase-initrd.service
- systemd-pcrphase-sysinit.service
- systemd-pcrextend.socket
- [email protected]
- systemd-pcrextend

PCRs are not used on the Guest VMs.

Signed-off-by: Dan Mihai <[email protected]>
Delete:
- systemd-journald-audit.socket
- systemd-journal-catalog-update.service
- systemd-journal-flush.service
- [email protected]
- [email protected]
- journalctl

Other journal files were already deleted.

Signed-off-by: Dan Mihai <[email protected]>
Delete blk-availability.service and the blkdeactivate binary. They
are not needed on the Guest VMs.

Signed-off-by: Dan Mihai <[email protected]>
Not needed on a Kata Guest VM.

Signed-off-by: Dan Mihai <[email protected]>
Deleted files:
- systemd-logind.service
- systemd-logind

Not needed on the Guest VM.

Signed-off-by: Dan Mihai <[email protected]>
Not needed on Guest VMs.

Deleting this service disables modprobe@efi_pstore.service too.

Signed-off-by: Dan Mihai <[email protected]>
Deleted files:
- systemd-sysupdate.service
- systemd-sysupdate.timer
- systemd-sysupdate-reboot.timer
- systemd-sysupdate-reboot.service
- systemd-sysupdate

Guest VMs are not being updated this way.

Signed-off-by: Dan Mihai <[email protected]>
Delete:
- systemd-network-generator.service
- systemd-network-generator

Generating network configuration based on kernel command line arguments
is currently not supported for Guest VMs.

Signed-off-by: Dan Mihai <[email protected]>
Deleted files:
- systemd-tpm2-setup.service
- systemd-tpm2-setup-early.service
- systemd-tpm2-setup

TPM is not used on Guest VMs.

Signed-off-by: Dan Mihai <[email protected]>
Delete *.mount files in addition to other systemd files.

Signed-off-by: Dan Mihai <[email protected]>
There are no userspace filesystems on the Guest VMs, so no need to mount
the FUSE control filesystem.

Note that the FUSE protocol used by virtio-fs uses a server on the
Host, and doesn't depend on the FUSE control filesystem on the Guest.

Without sys-fs-fuse-connections.mount, [email protected] gets
disabled too.

Signed-off-by: Dan Mihai <[email protected]>
This mount was not functional due to missing CONFIG_CONFIGFS_FS in the
Guest kernel.

Deleting sys-kernel-config.mount also disables [email protected].

Signed-off-by: Dan Mihai <[email protected]>
Delete:
- systemd-update-utmp-runlevel.service
- systemd-update-utmp
in addition to systemd-update-utmp.service that was already deleted
before this commit.

systemd-update-utmp-runlevel.service depends on /var/log/wtmp. However,
systemd-tmpfiles-setup.service was already deleted, so /var/log/wtmp
was not present.

Signed-off-by: Dan Mihai <[email protected]>
Deleted files:
- systemd-vconsole-setup.service
- systemd-vconsole-setup

The Guest VM doesn't use virtual consoles.

Signed-off-by: Dan Mihai <[email protected]>
@danmihai1 danmihai1 requested review from a team as code owners January 29, 2025 02:33
@danmihai1 danmihai1 added the upstream/not-needed PRs that will not be upstreamed (e.g. internal) label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream/not-needed PRs that will not be upstreamed (e.g. internal)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants