#550 Issue closed
: support for linux with runit as init system¶
Labels: needs sponsorship
(unknown) opened issue at 2015-02-16 17:54:¶
There is an inovativ Linux with used runit as init system, called
voidlinux http://www.voidlinux.eu The package
system
https://github.com/voidlinux/void-packages
used small templatefiles to generate binary-pachages. I think rear as
revovery system is missing.
Can you look what is neeed to support linux with runit as inti system?
schlomo commented at 2015-02-17 08:31:¶
Can you point us to an example package source of similar complexity?
On 16 February 2015 at 18:54, pulux notifications@github.com wrote:
There is an inovativ Linux with used runit as init system, called
voidlinux http://www.voidlinux.eu The package system
https://github.com/voidlinux/void-packages used small templatefiles to
generate binary-pachages. I think rear as revovery system is missing.
Can you look what is neeed to support linux with runit as inti system?—
Reply to this email directly or view it on GitHub
https://github.com/rear/rear/issues/550.
(unknown) commented at 2015-02-17 15:58:¶
voidlinux has around 4500 Packages, what application definition should I use as example?
here a example
# Template build file for 'zlib'
pkgname=zlib
version=1.2.8
revision=6
bootstrap=yes
build_style=configure
short_desc="A compression/decompression Library"
maintainer="Juan RP <xtraeme@gmail.com>"
license="zlib"
homepage="http://www.zlib.net"
distfiles="$homepage/$pkgname-$version.tar.gz"
checksum=36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d
do_configure() {
LDFLAGS= LDSHAREDLIBC= ./configure --prefix=/usr --shared
}
zlib-devel_package() {
depends="zlib>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
vmove usr/share
}
}
Voidlinux use not mingetty, it use agetty, here a process tree
PID TTY STAT TIME COMMAND
1 ? Ss 0:01 runit
797 ? Ss 0:00 runsvdir -P /run/runit/runsvdir/current log: .........................................
803 ? Ss 0:00 \_ runsv agetty-tty5
817 tty5 Ss+ 0:00 | \_ agetty tty5 38400 linux
804 ? Ss 0:00 \_ runsv uuidd
814 ? S 0:00 | \_ uuidd -F -P
806 ? Ss 0:00 \_ runsv rpcbind
813 ? S 0:00 | \_ rpcbind -f
807 ? Ss 0:00 \_ runsv dbus
810 ? S 0:00 | \_ dbus-daemon --system --nofork --nopidfile
809 ? Ss 0:00 \_ runsv agetty-tty3
844 tty3 Ss+ 0:00 | \_ agetty tty3 38400 linux
811 ? Ss 0:00 \_ runsv sshd
830 ? S 0:00 | \_ /usr/sbin/sshd -D
812 ? Ss 0:00 \_ runsv statd
828 ? S 0:00 | \_ rpc.statd -F -d
815 ? Ss 0:00 \_ runsv avahi-daemon
816 ? Ss 0:00 \_ runsv agetty-tty4
832 tty4 Ss+ 0:00 | \_ agetty tty4 38400 linux
818 ? Ss 0:00 \_ runsv cupsd
836 ? S 0:00 | \_ cupsd -f
819 ? Ss 0:00 \_ runsv agetty-tty1
839 tty1 Ss+ 0:00 | \_ agetty --noclear tty1 38400 linux
820 ? Ss 0:00 \_ runsv dhcpcd-eth0
821 ? Ss 0:00 \_ runsv agetty-tty2
837 tty2 Ss+ 0:00 | \_ agetty tty2 38400 linux
824 ? Ss 0:00 \_ runsv acpid
841 ? S 0:00 | \_ acpid -f -l
825 ? Ss 0:00 \_ runsv autofs
834 ? Sl 0:00 | \_ automount -f
833 ? Ss 0:00 \_ runsv agetty-tty6
840 tty6 Ss+ 0:00 | \_ agetty tty6 38400 linux
1084 ? Ss 0:00 \_ runsv udevd
1085 ? S 0:00 \_ udevd
868 ? S 0:00 /usr/bin/wpa_supplicant -uq
905 ? Sl 0:00 /usr/sbin/console-kit-daemon --no-daemon
913 ? Sl 0:00 /usr/lib/polkit-1/polkitd --no-debug
957 ? S 0:00 dbus-launch --sh-syntax --exit-with-session
958 ? Ss 0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --sessio
1195 ? Sl 0:00 /usr/libexec/at-spi-bus-launcher
schlomo commented at 2015-02-17 16:00:¶
I see. I suggest you take a look at our spec file and copy over the
steps
from %build and %install. We will be happy to accept your template into
the
ReaR project.
On 17 February 2015 at 16:58, pulux notifications@github.com wrote:
voidlinux has around 4500 Packages, what application definition should I
use as example?here som examples
Template build file for 'zlib'¶
pkgname=zlib
version=1.2.8
revision=6
bootstrap=yes
build_style=configure
short_desc="A compression/decompression Library"
maintainer="Juan RP xtraeme@gmail.com"
license="zlib"
homepage="http://www.zlib.net"
distfiles="$homepage/$pkgname-$version.tar.gz"
checksum=36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0ddo_configure() {
LDFLAGS= LDSHAREDLIBC= ./configure --prefix=/usr --shared
}zlib-devel_package() {
depends="zlib>=${version}${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/.a"
vmove "usr/lib/_.so"
vmove usr/share
}
}Voidlinux use not mingetty, it use agetty, here a process tree
PID TTY STAT TIME COMMAND
1 ? Ss 0:01 runit
797 ? Ss 0:00 runsvdir -P /run/runit/runsvdir/current log: .........................................
803 ? Ss 0:00 _ runsv agetty-tty5
817 tty5 Ss+ 0:00 | _ agetty tty5 38400 linux
804 ? Ss 0:00 _ runsv uuidd
814 ? S 0:00 | _ uuidd -F -P
806 ? Ss 0:00 _ runsv rpcbind
813 ? S 0:00 | _ rpcbind -f
807 ? Ss 0:00 _ runsv dbus
810 ? S 0:00 | _ dbus-daemon --system --nofork --nopidfile
809 ? Ss 0:00 _ runsv agetty-tty3
844 tty3 Ss+ 0:00 | _ agetty tty3 38400 linux
811 ? Ss 0:00 _ runsv sshd
830 ? S 0:00 | _ /usr/sbin/sshd -D
812 ? Ss 0:00 _ runsv statd
828 ? S 0:00 | _ rpc.statd -F -d
815 ? Ss 0:00 _ runsv avahi-daemon
816 ? Ss 0:00 _ runsv agetty-tty4
832 tty4 Ss+ 0:00 | _ agetty tty4 38400 linux
818 ? Ss 0:00 _ runsv cupsd
836 ? S 0:00 | _ cupsd -f
819 ? Ss 0:00 _ runsv agetty-tty1
839 tty1 Ss+ 0:00 | _ agetty --noclear tty1 38400 linux
820 ? Ss 0:00 _ runsv dhcpcd-eth0
821 ? Ss 0:00 _ runsv agetty-tty2
837 tty2 Ss+ 0:00 | _ agetty tty2 38400 linux
824 ? Ss 0:00 _ runsv acpid
841 ? S 0:00 | _ acpid -f -l
825 ? Ss 0:00 _ runsv autofs
834 ? Sl 0:00 | _ automount -f
833 ? Ss 0:00 _ runsv agetty-tty6
840 tty6 Ss+ 0:00 | _ agetty tty6 38400 linux
1084 ? Ss 0:00 _ runsv udevd
1085 ? S 0:00 _ udevd
868 ? S 0:00 /usr/bin/wpa_supplicant -uq
905 ? Sl 0:00 /usr/sbin/console-kit-daemon --no-daemon
913 ? Sl 0:00 /usr/lib/polkit-1/polkitd --no-debug
957 ? S 0:00 dbus-launch --sh-syntax --exit-with-session
958 ? Ss 0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --sessio
1195 ? Sl 0:00 /usr/libexec/at-spi-bus-launcher—
Reply to this email directly or view it on GitHub
https://github.com/rear/rear/issues/550#issuecomment-74691502.
(unknown) commented at 2015-02-17 16:14:¶
I think the template is not the problem, but rear depends on some software packages and structures which are not available in voidlinux, for example the init system or mingetty. How can we handle this?
schlomo commented at 2015-02-17 16:45:¶
I see. Before you start to invest into packaging I would strongly
recommend to make ReaR work on voidlinux. On your development machine
you can install ReaR with sudo make install
.
Note: All paths given here are relative to /usr/share/rear
.
First of all we use lsb_release -a
to determine the Linux OS and
OS_VERSION (see lib/config-functions.sh). If you can't install that on
voidlinux then you would have to provide a custom replacement.
ReaR has two main areas: Collect DR info (and apply it) and build a rescue system. The first thing you need to do is to get the rescue system to be usable, then you can try the DR stuff.
The rescue system is just a minified copy of your Linux system. ReaR dynamically builds it from analyzing your system.
The first thing it does is build up a skeleton filesystem from the
stuff in skel/
. If you have something special for voidlinux then you
would add a subdirectory there that contains your special stuff.
If you use a different init system then I am pretty sure that you would
add the initializing framework for that to the voidlinux skel directory.
If you add generic runit things then you can also add them to
skel/default
so that other runit-based distros will also benefit from
that. Or users who manually switched over to runit.
The rescue system has two main boot scripts: /etc/scripts/boot
and
/etc/scripts/system-setup
. If you explore the existing stuff under
skel/default
you will find that it already contains support for 3
init systems:
- Sys V init with
/etc/inittab
- Upstart with
/etc/init
- Systemd with
/usr/lib/systemd/system
I guess that you can simply add some basic runit configuration to
skel/default
. ReaR will take your /sbin/init
as-is into the rescue
system so that that will decide which init system is in use.
To try out simply run rear mkrescue
. It will build the rescue system
and do a little validation on it (chroot test). If that succeeds you can
start a Virtual Machine with the resulting ISO and see what happens.
Keep adding stuff and fixing problems one by one till the rescue systems feels to be OK. Minimum services you will need in the rescue system are udev, syslog and optionally SSH (we enable SSH if the user has keys installed).
I hope that helps you to get started, just keep asking here as you progress.
gdha commented at 2015-08-06 13:04:¶
Added 'sponsorship' label - wait and see...
[Export of Github issue for rear/rear.]