Re: Better manage /sbin/init by busybox
On Sun, Jul 17, 2016 at 04:55:06PM +0200, Jon Boden wrote:
> On Sat, Jul 16, 2016 at 10:37:41PM +0900, Benda Xu wrote:
> > Hi Jon,
> >
> > Very interesting patch!
> >
> > A package busybox-init, similar to busybox-syslogd, makes more sense to
> > me. It can be made openrc-neutral.
> >
> > The Debian openrc package is a drop-in replacement to sysv-rc, the
> > latter provides /etc/init.d/rc and /etc/init.d/rcS. OpenRC follows this
> > convention so that /etc/inittab (of sysvinit) is not needed to be
> > updated.
> >
> > It is also desirable to run busybox-init + sysv-rc or busybox-init +
> > file-rc. It can be achieved if the /etc/inittab of busybox-init is
> > written as that in the appendix.
> >
> >
> > @debian-boot team, do you think such a busybox-init package feasible? If
> > so I am going to reassign this bug to src:busybox.
>
> Fine by me! debian-boot, do you want a new patch based on Benda's inittab?
FWIW here's a patch to add busybox-init package based on Benda's suggestions (tested on ubuntuBSD with both sysv-rc and openrc).
--
Jon Boden
ubuntuBSD -- The power of FreeBSD kernel with familiarity of Ubuntu OS!
http://www.ubuntubsd.org/ -- https://twitter.com/ubuntuBSD
diff -Nur -x '*~' -x changelog ../debian/busybox-init.install.hurd debian/busybox-init.install.hurd
--- ../debian/busybox-init.install.hurd 1970-01-01 01:00:00.000000000 +0100
+++ debian/busybox-init.install.hurd 2016-07-18 20:01:24.000000000 +0200
@@ -0,0 +1 @@
+debian/init/hurd/inittab /etc
diff -Nur -x '*~' -x changelog ../debian/busybox-init.install.kfreebsd debian/busybox-init.install.kfreebsd
--- ../debian/busybox-init.install.kfreebsd 1970-01-01 01:00:00.000000000 +0100
+++ debian/busybox-init.install.kfreebsd 2016-07-18 20:01:24.000000000 +0200
@@ -0,0 +1 @@
+debian/init/kfreebsd/inittab /etc
diff -Nur -x '*~' -x changelog ../debian/busybox-init.install.linux debian/busybox-init.install.linux
--- ../debian/busybox-init.install.linux 1970-01-01 01:00:00.000000000 +0100
+++ debian/busybox-init.install.linux 2016-07-18 20:01:24.000000000 +0200
@@ -0,0 +1 @@
+debian/init/linux/inittab /etc
diff -Nur -x '*~' -x changelog ../debian/busybox-init.links debian/busybox-init.links
--- ../debian/busybox-init.links 1970-01-01 01:00:00.000000000 +0100
+++ debian/busybox-init.links 2016-07-18 20:01:24.000000000 +0200
@@ -0,0 +1,4 @@
+bin/busybox sbin/init
+bin/busybox sbin/halt
+bin/busybox sbin/reboot
+bin/busybox sbin/poweroff
diff -Nur -x '*~' -x changelog ../debian/control debian/control
--- ../debian/control 2015-08-07 23:39:01.000000000 +0200
+++ debian/control 2016-07-19 06:57:08.000000000 +0200
@@ -76,6 +76,22 @@
busybox-initramfs provides a simple stand alone shell that provides
only the basic utilities needed for the initramfs.
+Package: busybox-init
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, busybox, sysv-rc | openrc
+Conflicts: sysvinit (<< 2.88dsf-44), sysvinit-core, upstart [linux-any], systemd-sysv [linux-any]
+Section: admin
+Description: BusyBox implementation of /sbin/init
+ BusyBox combines tiny versions of many common UNIX utilities into a single
+ small executable. It provides minimalist replacements for the most common
+ utilities you would usually find on your desktop system (i.e., ls, cp, mv,
+ mount, tar, etc.). The utilities in BusyBox generally have fewer options than
+ their full-featured GNU cousins; however, the options that are included
+ provide the expected functionality and behave very much like their GNU
+ counterparts.
+ .
+ busybox-init provides a minimalist implementation of /sbin/init.
+
Package: busybox-udeb
Package-Type: udeb
Architecture: any
diff -Nur -x '*~' -x changelog ../debian/init/hurd/inittab debian/init/hurd/inittab
--- ../debian/init/hurd/inittab 1970-01-01 01:00:00.000000000 +0100
+++ debian/init/hurd/inittab 2016-07-18 20:07:03.000000000 +0200
@@ -0,0 +1,27 @@
+# /etc/inittab: init(8) configuration.
+
+::sysinit:/etc/init.d/rcS
+::wait:/etc/init.d/rc 2
+::shutdown:/etc/init.d/rc 0
+
+# What to do when CTRL-ALT-DEL is pressed.
+::ctrlaltdel:/etc/init.d/rc 6
+
+# /sbin/getty invocations for the runlevels.
+#
+::respawn:/sbin/getty 38400 tty1
+::respawn:/sbin/getty 38400 tty2
+::respawn:/sbin/getty 38400 tty3
+::respawn:/sbin/getty 38400 tty4
+::respawn:/sbin/getty 38400 tty5
+::respawn:/sbin/getty 38400 tty6
+::respawn:/sbin/getty 38400 console
+
+# Example how to put a getty on a serial line (for a terminal)
+#
+#::respawn:/sbin/getty -L ttyS0 9600 vt100
+#::respawn:/sbin/getty -L ttyS1 9600 vt100
+
+# Example how to put a getty on a modem line.
+#
+#::respawn:/sbin/mgetty -x0 -s 57600 ttyS3
diff -Nur -x '*~' -x changelog ../debian/init/kfreebsd/inittab debian/init/kfreebsd/inittab
--- ../debian/init/kfreebsd/inittab 1970-01-01 01:00:00.000000000 +0100
+++ debian/init/kfreebsd/inittab 2016-07-18 20:06:44.000000000 +0200
@@ -0,0 +1,26 @@
+# /etc/inittab: init(8) configuration.
+
+::sysinit:/etc/init.d/rcS
+::wait:/etc/init.d/rc 2
+::shutdown:/etc/init.d/rc 0
+
+# What to do when CTRL-ALT-DEL is pressed.
+::ctrlaltdel:/etc/init.d/rc 6
+
+# /sbin/getty invocations for the runlevels.
+#
+::respawn:/sbin/getty 38400 ttyv0 xterm
+::respawn:/sbin/getty 38400 ttyv1 xterm
+::respawn:/sbin/getty 38400 ttyv2 xterm
+::respawn:/sbin/getty 38400 ttyv3 xterm
+::respawn:/sbin/getty 38400 ttyv4 xterm
+::respawn:/sbin/getty 38400 ttyv5 xterm
+
+# Example how to put a getty on a serial line (for a terminal)
+#
+#::respawn:/sbin/getty -L cuau0 9600 vt100
+#::respawn:/sbin/getty -L cuau1 9600 vt100
+
+# Example how to put a getty on a modem line.
+#
+#::respawn:/sbin/mgetty -x0 -s 57600 ttyd3
diff -Nur -x '*~' -x changelog ../debian/init/linux/inittab debian/init/linux/inittab
--- ../debian/init/linux/inittab 1970-01-01 01:00:00.000000000 +0100
+++ debian/init/linux/inittab 2016-07-18 20:06:54.000000000 +0200
@@ -0,0 +1,26 @@
+# /etc/inittab: init(8) configuration.
+
+::sysinit:/etc/init.d/rcS
+::wait:/etc/init.d/rc 2
+::shutdown:/etc/init.d/rc 0
+
+# What to do when CTRL-ALT-DEL is pressed.
+::ctrlaltdel:/etc/init.d/rc 6
+
+# /sbin/getty invocations for the runlevels.
+#
+::respawn:/sbin/getty 38400 tty1
+::respawn:/sbin/getty 38400 tty2
+::respawn:/sbin/getty 38400 tty3
+::respawn:/sbin/getty 38400 tty4
+::respawn:/sbin/getty 38400 tty5
+::respawn:/sbin/getty 38400 tty6
+
+# Example how to put a getty on a serial line (for a terminal)
+#
+#::respawn:/sbin/getty -L ttyS0 9600 vt100
+#::respawn:/sbin/getty -L ttyS1 9600 vt100
+
+# Example how to put a getty on a modem line.
+#
+#::respawn:/sbin/mgetty -x0 -s 57600 ttyS3
Reply to: