initial buildroot for linux 5.15
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
|
||||
@@ -85,7 +85,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,34 @@
|
||||
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>
|
||||
---
|
||||
runlevels/Makefile | 6 ------
|
||||
1 file changed, 6 deletions(-)
|
||||
|
||||
diff --git a/runlevels/Makefile b/runlevels/Makefile
|
||||
index 73843d8b..dbfb59ca 100644
|
||||
--- a/runlevels/Makefile
|
||||
+++ b/runlevels/Makefile
|
||||
@@ -90,12 +90,6 @@ install:
|
||||
fi; \
|
||||
ln -snf ${INITDIR}/"$$x" ${SHUTDOWNDIR}/"$$x" || exit $$?; done \
|
||||
fi
|
||||
- if test "${MKSYSVINIT}" = yes && test "${OS}" = Linux; then \
|
||||
- for x in tty1 tty2 tty3 tty4 tty5 tty6; do \
|
||||
- ln -snf ${INITDIR}/agetty ${DESTDIR}/${INITDIR}/"agetty.$$x" || exit $$?; \
|
||||
- ln -snf ${INITDIR}/agetty.$$x ${DEFAULTDIR}/"agetty.$$x" || exit $$?; \
|
||||
- done; \
|
||||
- fi
|
||||
|
||||
check test::
|
||||
|
||||
--
|
||||
2.18.2
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
config BR2_PACKAGE_OPENRC
|
||||
bool "openrc"
|
||||
depends on BR2_USE_MMU # fork()
|
||||
depends on !BR2_STATIC_LIBS
|
||||
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_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 toolchain w/ dynamic library"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_INIT_OPENRC
|
||||
depends on BR2_STATIC_LIBS
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 968e81743a1de7a2348590b3b3286d6af5baf96da28fa1e6364e24f8203fc3b6 openrc-0.43.3.tar.gz
|
||||
sha256 96862463f4e77e2508e4fc2c83773fd24807cb699368b63fd93a5e2b466dd624 LICENSE
|
||||
@@ -0,0 +1,93 @@
|
||||
################################################################################
|
||||
#
|
||||
# openrc
|
||||
#
|
||||
################################################################################
|
||||
|
||||
OPENRC_VERSION = 0.43.3
|
||||
OPENRC_SITE = $(call github,OpenRC,openrc,$(OPENRC_VERSION))
|
||||
OPENRC_LICENSE = BSD-2-Clause
|
||||
OPENRC_LICENSE_FILES = LICENSE
|
||||
OPENRC_CPE_ID_VENDOR = openrc_project
|
||||
|
||||
OPENRC_DEPENDENCIES = ncurses
|
||||
|
||||
# set LIBNAME so openrc puts files in proper directories and sets proper
|
||||
# paths in installed files. Since in buildroot /lib64 and /lib32 always
|
||||
# points to /lib, it's safe to hardcode it to "lib"
|
||||
OPENRC_MAKE_OPTS = \
|
||||
LIBNAME=lib \
|
||||
LIBEXECDIR=/usr/libexec/rc \
|
||||
MKPKGCONFIG=no \
|
||||
MKSYSVINIT=yes \
|
||||
BRANDING="Buildroot $(BR2_VERSION_FULL)" \
|
||||
CC=$(TARGET_CC)
|
||||
|
||||
ifeq ($(BR2_SHARED_LIBS),y)
|
||||
OPENRC_MAKE_OPTS += MKSTATICLIBS=no
|
||||
else
|
||||
OPENRC_MAKE_OPTS += MKSTATICLIBS=yes
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
|
||||
OPENRC_MAKE_OPTS += MKSELINUX=yes
|
||||
OPENRC_DEPENDENCIES += libselinux
|
||||
else
|
||||
OPENRC_MAKE_OPTS += MKSELINUX=no
|
||||
endif
|
||||
|
||||
define OPENRC_BUILD_CMDS
|
||||
$(MAKE) $(OPENRC_MAKE_OPTS) -C $(@D)
|
||||
endef
|
||||
|
||||
define OPENRC_INSTALL_TARGET_CMDS
|
||||
$(MAKE) $(OPENRC_MAKE_OPTS) DESTDIR=$(TARGET_DIR) -C $(@D) install
|
||||
$(INSTALL) -D -m 0755 $(OPENRC_PKGDIR)/sysv-rcs \
|
||||
$(TARGET_DIR)/etc/init.d/sysv-rcs
|
||||
endef
|
||||
|
||||
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 $(generic-package))
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
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() {
|
||||
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