I learned how to do this by reading this topic on the Arch board: https://bbs.archlinux.org/viewtopic.php?id=162606&p=1
I shamelessly stole ideas and code from hut's "minirc" repo here: https://github.com/hut/minirc
Hut's code is designed for Arch, and it is a bit more complicated than I needed, so I made some changes to make it work on my Debian systems. My modified code is available on my github. You should really read the Arch thread and hut's rc script to see how he does the more complicated stuff.
Please only try this on a test install that can be allowed to break beyond repair. Please. I also highly recommend that you create a separate GRUB entry for systemd (add init=/lib/systemd/systemd to the kernel boot line) so you can still boot with systemd if busybox breaks badly.
Still ready to try it? As Ivan says, "let's begin."
This is all based on the Spring BBQ spin. It should work on any spin based on Spring, and most anything on sid, but no promises.
Hut has an installer script, and I thought about writing one or modifying his, but I want to make you do things manually so you know what has been done -- this will make it easier to revert the changes later when things break.
First, get my minirc code:
Code: Select all
git clone https://github.com/pidsley/minirc
Open the "rc" script in your favorite editor. You will see that it is just a simple script that starts and stops services. Right now, it is only configured to save and restore alsa and start a static wired network interface. If you want to use dhcp, wireless or add other services you will have to modify the code. Modifying the script should not be difficult, but you are on your own. See hut's script for ideas for other services. If you add any service scripts, please post the code!
Now, let's save the existing init and inittab, before we replace them:
Code: Select all
# cp /etc/inittab /etc/inittab-sysv
# mv /sbin/init /sbin/init-sysv
Code: Select all
# ln -s /bin/busybox /sbin/init
# cp minirc/inittab-busybox /etc/inittab
# cp minirc/rc /sbin
Code: Select all
$ sudo reboot -f
Once busybox is running as init, when you want to reboot or shutdown you must call busybox to do this; for example:
Code: Select all
$ sudo busybox poweroff
Don't worry about the mdev.conf and xorg stuff in the minirc github; that's for later, when we switch from udev to mdev.