You are not logged in.

#1 2020-05-12 17:50:55

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

[SOLVED]How to recompile systemd from source ?

Hey, I already tuned the kernel, now I want to tune systemd, because it takes 3 seconds to start, I already disable all extra services, and using DWM, I think systemd is very bloated, and I want to cut off something from it, is it even possible ? Or maybe switch to runit ? Does anyone tried Artix linux with runit ? Is it faster then systemd ?

Last edited by vitaliy.kuzmich (2020-05-12 19:15:02)

Offline

#2 2020-05-12 18:01:04

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED]How to recompile systemd from source ?

What exactly is your question? You want to rebuild packages with cpu optimizations like -march=native?

If systemd is "bloated" in your mind, then recompiling it won't change that. If you want to switch to runit, you won't find a lot of people here who can compare this due to arch only officially supporting systemd...


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2020-05-12 18:16:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED]How to recompile systemd from source ?

I am critical of many aspects of systemd, but I highly doubt you'll find any service manager that is faster at starting up the same services.  Systemd is blazing fast for what it is - I also think it's highly bloated, and I wish it were designed differently ... which is why it's so impressive that it's still so quick.

If / when a systemd init process is slow, it is generally because it is poorly configured (bad service files).  Understanding the inner workings enough to write optimal service files for systemd is indeed very difficult, and one could argue that runit is easier to optimize at that level.  But even if this is the case, the right step would be either to learn more about systemd or switch to runit; recompiling systemd wouldn't change this issue in the least.

But if you want to recompile systemd, you do it much like the recommended way for the kernel: you get the build files via ABS, and run makepkg.

Last edited by Trilby (2020-05-12 18:18:38)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2020-05-12 18:45:55

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

Re: [SOLVED]How to recompile systemd from source ?

eschwartz wrote:

What exactly is your question? You want to rebuild packages with cpu optimizations like -march=native?

If systemd is "bloated" in your mind, then recompiling it won't change that. If you want to switch to runit, you won't find a lot of people here who can compare this due to arch only officially supporting systemd...

My question is about systemd modules, which is possible to disable or not like in kernel.

From this link http://www.linuxfromscratch.org/lfs/vie … stemd.html it seems there are some options.

Offline

#5 2020-05-12 18:49:10

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED]How to recompile systemd from source ?

While there are some things you can avoid installing, you don't actually need to recompile to do this. If you don't execute a program, it won't be used and won't take up memory or waste time during boot. This is not like compiling the kernel with builtins that you won't use taking up space in /boot/vmlinuz-linux. (It will, however, take up disk space, much like kernel *.ko modules.)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#6 2020-05-12 18:51:52

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

Re: [SOLVED]How to recompile systemd from source ?

Trilby wrote:

I am critical of many aspects of systemd, but I highly doubt you'll find any service manager that is faster at starting up the same services.  Systemd is blazing fast for what it is - I also think it's highly bloated, and I wish it were designed differently ... which is why it's so impressive that it's still so quick.

If / when a systemd init process is slow, it is generally because it is poorly configured (bad service files).  Understanding the inner workings enough to write optimal service files for systemd is indeed very difficult, and one could argue that runit is easier to optimize at that level.  But even if this is the case, the right step would be either to learn more about systemd or switch to runit; recompiling systemd wouldn't change this issue in the least.

But if you want to recompile systemd, you do it much like the recommended way for the kernel: you get the build files via ABS, and run makepkg.

Thanks its useful, I will try.

Offline

#7 2020-05-12 19:03:43

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

Re: [SOLVED]How to recompile systemd from source ?

for example, how to cut "kernel-install" from my system ? by using ASP ? I think it is possible to cut something from systemd smile

Offline

#8 2020-05-12 19:04:37

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

Re: [SOLVED]How to recompile systemd from source ?

yeah, systemd is really bloated.

Offline

#9 2020-05-12 19:10:02

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED]How to recompile systemd from source ?

Please learn to use the edit button on your posts.

vitaliy.kuzmich wrote:

for example, how to cut "kernel-install" from my system ? by using ASP ? I think it is possible to cut something from systemd smile

Ah ... what?

Kernel-install is most definitely not slowing down boot times as it doesn't run at boot up.  Removing it will save you nothing.  But if it is necessary or becomes necessary for pacman hooks, you will end up with an unbootable system when it fails to place the pacman-installed kernel.

vitaliy.kuzmich wrote:

yeah, systemd is really bloated.

A whole post for this?  That's pointless.  I've agreed with as much above, but that was in the context of talking about where concerns may lie and what can be done about them.  "Specific Problem + Solution" is useful, "Vague Problem" is just slander and is counter to our community guideleins.

Last edited by Trilby (2020-05-12 19:12:49)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2020-05-12 19:10:19

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED]How to recompile systemd from source ?

You could just make a New Year's resolution to pretend that kernel-install doesn't exist, all 40KB of it.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#11 2020-05-12 19:14:35

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

Re: [SOLVED]How to recompile systemd from source ?

okay, thank you all, it seems its time for me to look at gentoo.

Offline

#12 2020-05-12 19:16:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED]How to recompile systemd from source ?

That's a bit of a leap.  If you want something like arch but just with runit instead of systemd, you can replace systemd with runit on arch.  Or if you want it officially supported by a community, you could look at void as that's a rolling release a fair bit like arch and defaults to runit.  Or alpine is even more "arch like" in many ways, but doesn't use runit as a default (though it's available in the repos) nor does it use systemd though.

FWIW, replacing systemd with runit in arch should be pretty strait forward if you keep systemd's udev.  If you want to get rid of udev, it's a bit more work, but still doable.  Coincidentally, I just posted yesterday in the 'oh nice' thread because I was booting a custom kernel with busybox's mdev (no initramfs, no systemd).

Last edited by Trilby (2020-05-12 19:18:56)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#13 2020-05-12 19:22:32

vitaliy.kuzmich
Member
Registered: 2015-11-29
Posts: 64

Re: [SOLVED]How to recompile systemd from source ?

Trilby wrote:

busybox's mdev (no initramfs, no systemd).

please more details here, maybe some link ?

ps: I already do not have initramfs smile just for learning purposes...

Last edited by vitaliy.kuzmich (2020-05-12 19:23:38)

Offline

#14 2020-05-12 19:30:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED]How to recompile systemd from source ?

A link to what?  A search engine?

I'd be happy to answer specific questions, but I'm not going to recite what's readily available.

My point was, using runit with udev should be trivial.  Using mdev in an arch system is not so trivial.  And I didn't boot without an initramfs for speed - for me it was a means to and end to tinkering with mdev.  Building a kernel capable of mounting the root fs itself seem a lot easier to me than switching out the init system in both the root filesystem and in a custom initramfs (which would require building a custom initramfs and coordinating which sysinit steps are done there versus the new root).  So I took the easier route of rebuilding the kernel to remove the initramfs variable.

Last edited by Trilby (2020-05-12 19:34:19)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB