[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#827733: busybox-init & busybox-init-sysv



On Sun, Jul 24, 2016 at 04:00:26PM +0200, Jon Boden wrote:
> 
> FWIW here's a patch to add busybox-init package based on Benda's suggestions (tested on ubuntuBSD with both sysv-rc and openrc).

Here's a new version of the patch. This one adds two packages akin to what upstart-sysv and systemd-sysv do:

1. busybox-init provides /etc/inittab and /lib/busybox/init. Then you can pass init=/lib/busybox/init in bootloader to use BusyBox init (GRUB even adds a menu entry if you edit SUPPORTED_INITS in /etc/grub.d/10_linux).

2. busybox-init-sysv provides the /sbin/init symlink (and /sbin/halt, etc) and Conflicts with other packages providing the same files.

-- 
Jon Boden

ubuntuBSD -- The power of FreeBSD kernel with familiarity of Ubuntu OS!

http://www.ubuntubsd.org/ -- https://twitter.com/ubuntuBSD
diff -Nur -x '*~' ../debian/busybox-init.dirs debian/busybox-init.dirs
--- ../debian/busybox-init.dirs	1970-01-01 01:00:00.000000000 +0100
+++ debian/busybox-init.dirs	2016-08-13 00:34:51.445711837 +0200
@@ -0,0 +1 @@
+lib/busybox
diff -Nur -x '*~' ../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-08-13 00:23:01.934431547 +0200
@@ -0,0 +1 @@
+debian/init/hurd/inittab	/etc
diff -Nur -x '*~' ../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-08-13 00:23:01.934431547 +0200
@@ -0,0 +1 @@
+debian/init/kfreebsd/inittab	/etc
diff -Nur -x '*~' ../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-08-13 00:23:01.934431547 +0200
@@ -0,0 +1 @@
+debian/init/linux/inittab	/etc
diff -Nur -x '*~' ../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-08-13 00:34:41.205550048 +0200
@@ -0,0 +1 @@
+bin/busybox lib/busybox/init
diff -Nur -x '*~' ../debian/busybox-init.postinst debian/busybox-init.postinst
--- ../debian/busybox-init.postinst	1970-01-01 01:00:00.000000000 +0100
+++ debian/busybox-init.postinst	2016-08-13 00:21:22.763510848 +0200
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+# update grub on first install, so that the alternative init system boot
+# entries get updated
+if [ "$1" = configure ] && [ -z "$2" ] && [ -e /boot/grub/grub.cfg ] && which update-grub >/dev/null 2>&1; then
+    update-grub || true
+fi
+
+#DEBHELPER#
diff -Nur -x '*~' ../debian/busybox-init-sysv.links debian/busybox-init-sysv.links
--- ../debian/busybox-init-sysv.links	1970-01-01 01:00:00.000000000 +0100
+++ debian/busybox-init-sysv.links	2016-08-13 00:34:21.657233870 +0200
@@ -0,0 +1,4 @@
+bin/busybox sbin/init
+bin/busybox sbin/halt
+bin/busybox sbin/reboot
+bin/busybox sbin/poweroff
diff -Nur -x '*~' ../debian/control debian/control
--- ../debian/control	2015-08-07 23:39:01.000000000 +0200
+++ debian/control	2016-08-13 00:36:04.886804859 +0200
@@ -76,6 +76,45 @@
  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, openrc | sysv-rc
+# file conflict because of /etc/inittab
+Conflicts: sysvinit (<< 2.88dsf-44), sysvinit-core
+Section: admin
+Description: BusyBox implementation of 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.
+ .
+ This package provides a minimalist implementation of Init, which can be
+ started by passing init=/lib/busybox/init parameter in your bootloader.
+
+Package: busybox-init-sysv
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, busybox-init
+# file conflict because of /sbin/init
+Conflicts: sysvinit (<< 2.88dsf-44), sysvinit-core,
+ upstart (<< 1.13.2-0ubuntu10) [linux-any], upstart-sysv [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.
+ .
+ This package provides the links needed for BusyBox init to become the default
+ system Init. Installing busybox-init-sysv will overwrite /sbin/init with a
+ link to busybox.
+
 Package: busybox-udeb
 Package-Type: udeb
 Architecture: any
diff -Nur -x '*~' ../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-08-13 00:23:02.002433037 +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 '*~' ../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-08-13 00:23:02.002433037 +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 '*~' ../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-08-13 00:23:02.002433037 +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: