Re: Replace systemd with busybox + minirc

Finally had an oppurtunity to set this up this morning. Have started with udev to make it a bit easier at the start.Once I added a couple of modprobe lines and a few echoes to /etc/minirc.local things booted up pretty much like normal. So far. Me still using netcfg helped a bit but I still need a bit more time to test.One thing I've noticed is memory used is down alot after boot.

Re: Replace systemd with busybox + minirc

I have similar problemI cant get wicd workingAs output it throws me to check if dbus is running which is.And I can't shutdown, or reboot. I get message 'Failed to talk to init'.At least it boots without problem.

Re: Replace systemd with busybox + minirc

I've ran into a problem with minirc. I'm french, so I use that crappy AZERTY keyboard. And I've found that the "best" way to load my keymap on boot, is to modify the /sbin/rc script, to add loadkeys fr in the on_boot() function.

Is that possible to add a custom_boot() function to the minirc.conf ? So that, in the rc script we would find:

Edit: Shutdowns are clean, don't need to consider pivot_root anymore Edit2: Added getty, to use from busybox, instead of mingetty.Edit3: Added rdev, to help identify the root partition, for filesystem check.Edit4: Added setsid to the 2 aliases above, to work when run over SSH.

This is with the following as symlinks to /bin/busybox: /sbin/{init,killall5,halt,poweroff,reboot} /bin/ash

Getting a clean unmount of / has been a problem, after e.g. recompiling glibc - I wonder if the mystical pivot_root, or mount --bind might be needed?

What I don't understand here is, how do you reboot? inittab calls "rc shutdown" and will do so even when you run reboot. So how exactly does the last section of the rc file (the case switches) come into play?

Oh, and my patch for killall5 to ignore kernel processes got accepted, so you can drop your workarounds for this.

Re: Replace systemd with busybox + minirc

That "case" section is necessary for any of the rc file to be run Because everything above it are just functions. Same as in a sysv initscript.

Edit: So for reboot, taking as an example the power button, what I think happens is:

I press power button, acpid runs /etc/acpi/handler.sh, which runs: exec poweroff/sbin/poweroff (which is a symlink to busybox) signals /sbin/init, which (from /etc/inittab) runs: /etc/init.d/rc shutdown (this is the "run_actions(SHUTDOWN)" line in busybox's init/init.c)Busybox then performs its own shutdown procedures (including quickly killing any remaining processes that weren't killed by my script), and final shutdown.

patch for killall5

I noticed - that's the patch to return 2 if there are no processes to signal.

The little "omit" bit in my rc file is mostly for safety, especially since I was toying with having it run by dash (running util-linux's killall5, I think), rather than busybox's ash, to see if there was any speed difference.

Edit2: You might be thinking of my "lsof" & "ps" commands, which are just for debugging info.

Re: Replace systemd with busybox + minirc

brebs wrote:

I press power button, acpid runs /etc/acpi/handler.sh, which runs: exec poweroff/sbin/poweroff (which is a symlink to busybox) signals /sbin/init, which (from /etc/inittab) runs: /etc/init.d/rc shutdown (this is the "run_actions(SHUTDOWN)" line in busybox's init/init.c)Busybox then performs its own shutdown procedures (including quickly killing any remaining processes that weren't killed by my script), and final shutdown.

I asked about rebooting, not poweroff. How does the reboot part of that case switch get called, when inittab only ever invokes either "rc init" or "rc shutdown"?

brebs wrote:

Edit2: You might be thinking of my "lsof" & "ps" commands, which are just for debugging info.

Yeah, that part. I took a closer look and see the comments now, it's indeed just to see which were the problematic processes.

Re: Replace systemd with busybox + minirc

brebs wrote:

Ah, it doesn't, in the current setup.

Thought so. So how do you reboot in your current setup?

The thing is, I want to find a way for a shutdown script to know whether reboot or poweroff was called. Currently I hack busybox to export a RUNLEVEL variable (0 or 6), like sysvinit does. But I don't know if it's the right solution or if there's another way.

Re: Replace systemd with busybox + minirc

The latest update to libpulse requires libsystemd-journal.so.0 so things like mpv won't work if systemd has been removed. I added libpulse to the ignore line in pacman.conf which should work for a little while...