Initial Commit
- initial default booting image
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
From ec1a0c8fa2e7a7c6cf70f68bdabc07cbb1a567cf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20=C5=81yszczek?= <michal.lyszczek@bofc.pl>
|
||||
Date: Sun, 5 May 2019 23:43:40 +0200
|
||||
Subject: [PATCH] init.d/sysctl.in: add support for busybox sysctl
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Busybox version of sysctl does not support --system argument,
|
||||
and files need to be loaded one by one. This patch adds code
|
||||
to recognize busybox sysctl and execute proper function based
|
||||
on that.
|
||||
|
||||
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
|
||||
---
|
||||
init.d/sysctl.in | 27 ++++++++++++++++++++++++++-
|
||||
1 file changed, 26 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/init.d/sysctl.in b/init.d/sysctl.in
|
||||
index e49f4db2..a705b3d4 100644
|
||||
--- a/init.d/sysctl.in
|
||||
+++ b/init.d/sysctl.in
|
||||
@@ -37,6 +37,23 @@ BSD_sysctl()
|
||||
return $retval
|
||||
}
|
||||
|
||||
+Busybox_sysctl()
|
||||
+{
|
||||
+ local quiet
|
||||
+ yesno $rc_verbose || quiet=-q
|
||||
+
|
||||
+ eindent
|
||||
+ for conf in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
|
||||
+ if [ -r "$conf" ]; then
|
||||
+ vebegin "applying $conf"
|
||||
+ sysctl $quiet -p "$conf" || retval=1
|
||||
+ veend $retval
|
||||
+ fi
|
||||
+ done
|
||||
+ eoutdent
|
||||
+ return $retval
|
||||
+}
|
||||
+
|
||||
Linux_sysctl()
|
||||
{
|
||||
local quiet
|
||||
@@ -52,7 +69,15 @@ start()
|
||||
ebegin "Configuring kernel parameters"
|
||||
case "$RC_UNAME" in
|
||||
*BSD|GNU) BSD_sysctl; rc=$? ;;
|
||||
- Linux) Linux_sysctl; rc=$? ;;
|
||||
+ Linux)
|
||||
+ sysctl -h > /dev/null 2>&1
|
||||
+ if [ $? -ne 0 ]; then
|
||||
+ # busybox version of sysctl does not recognize -h option
|
||||
+ Busybox_sysctl
|
||||
+ else
|
||||
+ Linux_sysctl
|
||||
+ fi
|
||||
+ rc=$? ;;
|
||||
esac
|
||||
eend $rc "Unable to configure some kernel parameters"
|
||||
}
|
||||
--
|
||||
2.18.1
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From 5ae8209afad9a4284723712b46d8685e7f7fd72c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20=C5=81yszczek?= <michal.lyszczek@bofc.pl>
|
||||
Date: Mon, 6 May 2019 00:06:39 +0200
|
||||
Subject: [PATCH] sh/init.sh.Linux.in: change /run/lock from root:uucp to
|
||||
root:daemon
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
On gentoo /run/lock is owned by uucp group because of historical
|
||||
reasons. However uucp does not exist on buildroot by default, and
|
||||
it makes more sense that 'daemon' group should own this directory.
|
||||
|
||||
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
|
||||
[Fabrice: update for 0.43.3]
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
sh/init.sh.Linux.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in
|
||||
index 222bbd3b..7f1a88db 100644
|
||||
--- a/sh/init.sh.Linux.in
|
||||
+++ b/sh/init.sh.Linux.in
|
||||
@@ -83,7 +83,7 @@ fi
|
||||
fi
|
||||
|
||||
checkpath -d "$RC_SVCDIR"
|
||||
-checkpath -d -m 0775 -o root:uucp /run/lock
|
||||
+checkpath -d -m 0775 -o root:daemon /run/lock
|
||||
|
||||
# Try to mount xenfs as early as possible, otherwise rc_sys() will always
|
||||
# return RC_SYS_XENU and will think that we are in a domU while it's not.
|
||||
--
|
||||
2.18.1
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From b39ab180358ed451eae9df900f49a72ef1eb7442 Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Santos <unixmania@gmail.com>
|
||||
Date: Sun, 1 Mar 2020 09:04:48 -0300
|
||||
Subject: [PATCH] init.d/agetty: replace /sbin/agetty by /sbin/getty
|
||||
|
||||
In Buildroot getty is provided by BusyBox or util-linux (agetty). Both
|
||||
create a /sbin/getty symlink pointing to the actual program, so make the
|
||||
agetty service use that path instead of /sbin/agetty.
|
||||
|
||||
The patch is required because it's not possible to override the command
|
||||
by means of a configuration file.
|
||||
|
||||
Signed-off-by: Carlos Santos <unixmania@gmail.com>
|
||||
---
|
||||
init.d/agetty.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/init.d/agetty.in b/init.d/agetty.in
|
||||
index e4866f7a..e1864628 100644
|
||||
--- a/init.d/agetty.in
|
||||
+++ b/init.d/agetty.in
|
||||
@@ -14,7 +14,7 @@ supervisor=supervise-daemon
|
||||
port="${RC_SVCNAME#*.}"
|
||||
respawn_period="${respawn_period:-60}"
|
||||
term_type="${term_type:-linux}"
|
||||
-command=/sbin/agetty
|
||||
+command=/sbin/getty
|
||||
command_args_foreground="${agetty_options} ${port} ${baud} ${term_type}"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
|
||||
--
|
||||
2.18.2
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From c2dc04f6b8c6784941b896e0b17c160dd43a566f Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Santos <unixmania@gmail.com>
|
||||
Date: Sun, 1 Mar 2020 11:14:37 -0300
|
||||
Subject: [PATCH] init.d/agetty: start agetty after all services
|
||||
|
||||
This is required for Buildroot, to prevent mixing service initialization
|
||||
messages with the getty prompt on devices with a single serial console.
|
||||
|
||||
Signed-off-by: Carlos Santos <unixmania@gmail.com>
|
||||
---
|
||||
init.d/agetty.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/init.d/agetty.in b/init.d/agetty.in
|
||||
index e1864628..a1ad4e9f 100644
|
||||
--- a/init.d/agetty.in
|
||||
+++ b/init.d/agetty.in
|
||||
@@ -19,7 +19,7 @@ command_args_foreground="${agetty_options} ${port} ${baud} ${term_type}"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
|
||||
depend() {
|
||||
- after local
|
||||
+ after *
|
||||
keyword -prefix
|
||||
provide getty
|
||||
}
|
||||
--
|
||||
2.18.2
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 014dc43447fa553e875984ac4a528e5916cc9e06 Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Santos <unixmania@gmail.com>
|
||||
Date: Sat, 29 Feb 2020 22:41:30 -0300
|
||||
Subject: [PATCH] runlevels: do not add agetty.tty[1-6] if MKSYSVINIT=yes
|
||||
|
||||
Buildroot starts a single getty, according to the system configuration.
|
||||
Also tty[1-6] may not exist (e.g. embedded devices with serial consoles
|
||||
only).
|
||||
|
||||
Signed-off-by: Carlos Santos <unixmania@gmail.com>
|
||||
[Adam: update for 0.50]
|
||||
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
|
||||
---
|
||||
tools/meson_runlevels.sh | 6 ------
|
||||
1 file changed, 6 deletions(-)
|
||||
|
||||
diff --git a/tools/meson_runlevels.sh b/tools/meson_runlevels.sh
|
||||
index 1473d4e..eee256b 100755
|
||||
--- a/tools/meson_runlevels.sh
|
||||
+++ b/tools/meson_runlevels.sh
|
||||
@@ -91,11 +91,5 @@ if ! test -d "${DESTDIR}${shutdowndir}"; then
|
||||
ln -snf "${init_d_dir}/$x" "${DESTDIR}${shutdowndir}/$x"
|
||||
done
|
||||
fi
|
||||
-if test "${sysvinit}" = yes && test "${os}" = Linux; then \
|
||||
- for x in tty1 tty2 tty3 tty4 tty5 tty6; do
|
||||
- ln -snf "${init_d_dir}/agetty" "${DESTDIR}/${init_d_dir}/agetty.$x"
|
||||
- ln -snf "${init_d_dir}/agetty.$x" "${DESTDIR}/${defaultdir}/agetty.$x"
|
||||
- done;
|
||||
-fi
|
||||
|
||||
ln -snf "${rc_libexecdir}"/sh/functions.sh "${DESTDIR}/${init_d_dir}"
|
||||
--
|
||||
2.18.2
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 49e5929b468f604d80a0c04a6ce78eb96ca36090 Mon Sep 17 00:00:00 2001
|
||||
From: Norbert Lange <nolange79@gmail.com>
|
||||
Date: Sun, 9 Jan 2022 00:22:40 +0100
|
||||
Subject: [PATCH] Also create /run/lock/subsys directory
|
||||
|
||||
Buildroot service scripts regularly use this directory, so
|
||||
create it in the most appropriate spot.
|
||||
|
||||
Signed-off-by: Norbert Lange <nolange79@gmail.com>
|
||||
---
|
||||
sh/init.sh.Linux.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in
|
||||
index e8afc1fb..662ab223 100644
|
||||
--- a/sh/init.sh.Linux.in
|
||||
+++ b/sh/init.sh.Linux.in
|
||||
@@ -83,7 +83,7 @@ elif ! mountinfo -q /run; then
|
||||
fi
|
||||
|
||||
checkpath -d "$RC_SVCDIR"
|
||||
-checkpath -d -m 0775 -o root:daemon /run/lock
|
||||
+checkpath -d -m 0775 -o root:daemon /run/lock /run/lock/subsys
|
||||
|
||||
# Try to mount xenfs as early as possible, otherwise rc_sys() will always
|
||||
# return RC_SYS_XENU and will think that we are in a domU while it's not.
|
||||
--
|
||||
2.34.1
|
||||
|
||||
44
package/openrc/0007-allow-setting-rc_libexecdir-path.patch
Normal file
44
package/openrc/0007-allow-setting-rc_libexecdir-path.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From 89c42e7e0d8d5913789a76b007ed6a0c43078c63 Mon Sep 17 00:00:00 2001
|
||||
From: artoo <artoo@artixlinux.org>
|
||||
Date: Wed, 8 Sep 2021 22:41:58 +0200
|
||||
Subject: [PATCH] allow setting rc_libexecdir path
|
||||
|
||||
- Allow to change the rc dir name of the rc_libexecdir path
|
||||
- Introduce a librcdir option for override with value 'rc'6
|
||||
|
||||
Upstream: https://github.com/OpenRC/openrc/pull/443
|
||||
|
||||
Signed-off-by: artoo <artoo@artixlinux.org>
|
||||
[Adam: update for 0.56]
|
||||
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
|
||||
---
|
||||
meson.build | 2 +-
|
||||
meson_options.txt | 2 ++
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 5b3f8fa..40d4be1 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -85,7 +85,7 @@ bindir = get_option('prefix') / get_option('bindir')
|
||||
libdir = get_option('prefix') / get_option('libdir')
|
||||
pluginsdir = libdir / 'rc/plugins'
|
||||
libexecdir = get_option('prefix') / get_option('libexecdir')
|
||||
-rc_libexecdir = libexecdir / 'rc'
|
||||
+rc_libexecdir = libexecdir / get_option('librcdir')
|
||||
rc_bindir = rc_libexecdir / 'bin'
|
||||
rc_sbindir = rc_libexecdir / 'sbin'
|
||||
rc_shdir = rc_libexecdir / 'sh'
|
||||
diff --git a/meson_options.txt b/meson_options.txt
|
||||
index 2c74152..d2f67e4 100644
|
||||
--- a/meson_options.txt
|
||||
+++ b/meson_options.txt
|
||||
@@ -26,3 +26,5 @@ option('sysvinit', type : 'boolean', value : false,
|
||||
description : 'enable SysVinit compatibility (linux only)')
|
||||
option('zsh-completions', type : 'boolean',
|
||||
description : 'install zsh completions')
|
||||
+option('librcdir', type : 'string', value : 'rc',
|
||||
+ description : 'default location of rc libexec dir')
|
||||
--
|
||||
2.41.0
|
||||
|
||||
32
package/openrc/Config.in
Normal file
32
package/openrc/Config.in
Normal file
@@ -0,0 +1,32 @@
|
||||
config BR2_PACKAGE_OPENRC
|
||||
bool "openrc"
|
||||
depends on BR2_USE_MMU # fork()
|
||||
depends on !BR2_STATIC_LIBS
|
||||
depends on !BR2_TOOLCHAIN_USES_UCLIBC
|
||||
depends on BR2_INIT_OPENRC
|
||||
select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # kmod tools
|
||||
select BR2_PACKAGE_KMOD # runtime
|
||||
select BR2_PACKAGE_KMOD_TOOLS # runtime
|
||||
select BR2_PACKAGE_LIBCAP # runtime
|
||||
select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC
|
||||
select BR2_PACKAGE_NCURSES
|
||||
help
|
||||
Init that works on top of pid 1 (for example
|
||||
openrc-init). By default it does quite a lot on startup
|
||||
(like setting hwclock, mounting directories, configuring
|
||||
interfaces and so on). So for this init to properly work you
|
||||
need at least these tools on the root filesystem (default
|
||||
busybox configuration provides them all):
|
||||
|
||||
swapon, fsck, hwclock, getty, login, grep, mount, coreutils,
|
||||
procps, modprobe (kmod), net-tools
|
||||
|
||||
Number of tools may be decreased by removing services that
|
||||
use them.
|
||||
|
||||
https://github.com/OpenRC/openrc
|
||||
|
||||
comment "openrc needs a glibc or musl toolchain w/ dynamic library"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_INIT_OPENRC
|
||||
depends on BR2_STATIC_LIBS && BR2_TOOLCHAIN_USES_UCLIBC
|
||||
3
package/openrc/openrc.hash
Normal file
3
package/openrc/openrc.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 a06b530290057637eab17fc943cbf79c0335eb734ba71ece38b9f3acd8a341d4 openrc-0.56.tar.gz
|
||||
sha256 6ac2bf77510808fbec7dc86cbfbca98dfc4c6b47dc99e4ca77b5370e097d8e70 LICENSE
|
||||
103
package/openrc/openrc.mk
Normal file
103
package/openrc/openrc.mk
Normal file
@@ -0,0 +1,103 @@
|
||||
################################################################################
|
||||
#
|
||||
# openrc
|
||||
#
|
||||
################################################################################
|
||||
|
||||
OPENRC_VERSION = 0.56
|
||||
OPENRC_SITE = $(call github,OpenRC,openrc,$(OPENRC_VERSION))
|
||||
OPENRC_LICENSE = BSD-2-Clause
|
||||
OPENRC_LICENSE_FILES = LICENSE
|
||||
OPENRC_CPE_ID_VALID = YES
|
||||
|
||||
OPENRC_DEPENDENCIES = libcap ncurses
|
||||
|
||||
OPENRC_CONF_OPTS = \
|
||||
-Dos=Linux \
|
||||
-Dlibrcdir=/usr/libexec/rc \
|
||||
-Dpkgconfig=false \
|
||||
-Dsysvinit=true \
|
||||
-Dbranding="\"Buildroot $(BR2_VERSION_FULL)\""
|
||||
|
||||
ifeq ($(BR2_PACKAGE_AUDIT),y)
|
||||
OPENRC_CONF_OPTS += -Daudit=enabled
|
||||
OPENRC_DEPENDENCIES += audit
|
||||
else
|
||||
OPENRC_CONF_OPTS += -Daudit=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_BASH_COMPLETION),y)
|
||||
OPENRC_CONF_OPTS += -Dbash-completions=true
|
||||
else
|
||||
OPENRC_CONF_OPTS += -Dbash-completions=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
|
||||
OPENRC_CONF_OPTS += -Dselinux=enabled
|
||||
OPENRC_DEPENDENCIES += libselinux
|
||||
else
|
||||
OPENRC_CONF_OPTS += -Dselinux=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBXCRYPT),y)
|
||||
OPENRC_DEPENDENCIES += libxcrypt
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
|
||||
OPENRC_CONF_OPTS += -Dpam=true
|
||||
OPENRC_DEPENDENCIES += linux-pam
|
||||
else
|
||||
OPENRC_CONF_OPTS += -Dpam=false
|
||||
endif
|
||||
|
||||
define OPENRC_INSTALL_SYSV_RCS_SCRIPT
|
||||
$(INSTALL) -D -m 0755 $(OPENRC_PKGDIR)/sysv-rcs \
|
||||
$(TARGET_DIR)/etc/init.d/sysv-rcs
|
||||
endef
|
||||
OPENRC_POST_INSTALL_TARGET_HOOKS += OPENRC_INSTALL_SYSV_RCS_SCRIPT
|
||||
|
||||
ifeq ($(BR2_PACKAGE_KBD),)
|
||||
# keymaps and save-keymaps require kbd_mode and dumpkeys, respectively, so
|
||||
# remove them if the kbd package is not selected (e.g. devices with serial
|
||||
# console, only).
|
||||
define OPENRC_NO_KBD
|
||||
$(RM) $(TARGET_DIR)/etc/runlevels/boot/{keymaps,save-keymaps}
|
||||
$(RM) $(TARGET_DIR)/etc/init.d/{keymaps,save-keymaps}
|
||||
$(RM) $(TARGET_DIR)/etc/conf.d/keymaps
|
||||
endef
|
||||
OPENRC_POST_INSTALL_TARGET_HOOKS += OPENRC_NO_KBD
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_NETIFRC),y)
|
||||
# netifrc replaces network, staticroute and loopback services which are
|
||||
# installed by openrc
|
||||
define OPENRC_NO_NET
|
||||
$(RM) $(TARGET_DIR)/etc/runlevels/boot/{network,staticroute,loopback}
|
||||
$(RM) $(TARGET_DIR)/etc/init.d/{network,staticroute,loopback}
|
||||
$(RM) $(TARGET_DIR)/etc/conf.d/{network,staticroute,loopback}
|
||||
endef
|
||||
OPENRC_POST_INSTALL_TARGET_HOOKS += OPENRC_NO_NET
|
||||
endif
|
||||
|
||||
define OPENRC_REMOVE_UNNEEDED
|
||||
$(RM) -r $(TARGET_DIR)/usr/share/openrc
|
||||
endef
|
||||
OPENRC_TARGET_FINALIZE_HOOKS += OPENRC_REMOVE_UNNEEDED
|
||||
|
||||
ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
|
||||
OPENRC_GETTY_SVCNAME = agetty.$(SYSTEM_GETTY_PORT)
|
||||
OPENRC_GETTY_CONF_D = $(TARGET_DIR)/etc/conf.d/$(OPENRC_GETTY_SVCNAME)
|
||||
define OPENRC_SET_GETTY
|
||||
{ \
|
||||
echo "baud=\"$(SYSTEM_GETTY_BAUDRATE)\""; \
|
||||
echo "term_type=\"$(SYSTEM_GETTY_TERM)\"" ; \
|
||||
echo "agetty_options=\"-L $(SYSTEM_GETTY_OPTIONS)\""; \
|
||||
} > $(OPENRC_GETTY_CONF_D)
|
||||
ln -sf agetty $(TARGET_DIR)/etc/init.d/$(OPENRC_GETTY_SVCNAME)
|
||||
ln -sf /etc/init.d/$(OPENRC_GETTY_SVCNAME) \
|
||||
$(TARGET_DIR)/etc/runlevels/default/$(OPENRC_GETTY_SVCNAME)
|
||||
endef
|
||||
OPENRC_TARGET_FINALIZE_HOOKS += OPENRC_SET_GETTY
|
||||
endif # BR2_TARGET_GENERIC_GETTY
|
||||
|
||||
$(eval $(meson-package))
|
||||
31
package/openrc/sysv-rcs
Executable file
31
package/openrc/sysv-rcs
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/sbin/openrc-run
|
||||
# shellcheck shell=sh
|
||||
|
||||
# shellcheck disable=SC2034 # definition for OpenRC
|
||||
description="start or stop sysv rc[S,K] scripts"
|
||||
|
||||
depend() {
|
||||
after local
|
||||
}
|
||||
|
||||
start() {
|
||||
for i in /etc/init.d/S??*; do
|
||||
# Ignore dangling symlinks (if any).
|
||||
[ -e "$i" ] || continue
|
||||
einfo "Starting $i"
|
||||
$i start > /dev/null
|
||||
eend $?
|
||||
done
|
||||
}
|
||||
|
||||
stop() {
|
||||
# we need to reverse the order here, sort -r would be no less fragile
|
||||
# shellcheck disable=SC2045
|
||||
for i in $(ls -r /etc/init.d/S??*); do
|
||||
# Ignore dangling symlinks (if any).
|
||||
[ -e "$i" ] || continue
|
||||
einfo "Stopping $i"
|
||||
$i stop > /dev/null
|
||||
eend $?
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user