From 46fb35a2a2159ae99976187d160dd1e542c1cdda Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 8 Jan 2025 09:42:09 +0100 Subject: sysvinit: update 3.11 -> 3.13 Remove patches: install.patch (merged upstream) realpath.patch 0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch (musl fixes, no longer needed) pidof-add-m-option.patch (not a backport, not used in core, and isn't carried by either debian or fedora) (From OE-Core rev: 228e1fb5632061fccf58bec93b843e6d7a0827dd) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- ...-sysmacros.h-for-major-minor-defines-in-g.patch | 50 ------ .../recipes-core/sysvinit/sysvinit/crypt-lib.patch | 27 ++- meta/recipes-core/sysvinit/sysvinit/install.patch | 79 --------- .../sysvinit/sysvinit/pidof-add-m-option.patch | 193 --------------------- meta/recipes-core/sysvinit/sysvinit/realpath.patch | 61 ------- meta/recipes-core/sysvinit/sysvinit_3.11.bb | 118 ------------- meta/recipes-core/sysvinit/sysvinit_3.13.bb | 114 ++++++++++++ 7 files changed, 126 insertions(+), 516 deletions(-) delete mode 100644 meta/recipes-core/sysvinit/sysvinit/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch delete mode 100644 meta/recipes-core/sysvinit/sysvinit/install.patch delete mode 100644 meta/recipes-core/sysvinit/sysvinit/pidof-add-m-option.patch delete mode 100644 meta/recipes-core/sysvinit/sysvinit/realpath.patch delete mode 100644 meta/recipes-core/sysvinit/sysvinit_3.11.bb create mode 100644 meta/recipes-core/sysvinit/sysvinit_3.13.bb diff --git a/meta/recipes-core/sysvinit/sysvinit/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch b/meta/recipes-core/sysvinit/sysvinit/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch deleted file mode 100644 index 60fbd87534..0000000000 --- a/meta/recipes-core/sysvinit/sysvinit/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch +++ /dev/null @@ -1,50 +0,0 @@ -From c710a3accd1fabdb671274e1a458405282d51e0c Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 6 Aug 2018 15:38:58 -0700 -Subject: [PATCH] include sys/sysmacros.h for major/minor definitions - -Signed-off-by: Khem Raj -Upstream-Status: Pending - ---- - src/bootlogd.c | 1 + - src/mountpoint.c | 1 + - src/shutdown.c | 1 + - 3 files changed, 3 insertions(+) - -diff --git a/src/bootlogd.c b/src/bootlogd.c -index 787db87..8b07903 100644 ---- a/src/bootlogd.c -+++ b/src/bootlogd.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff --git a/src/mountpoint.c b/src/mountpoint.c -index 5f20522..94df7a1 100644 ---- a/src/mountpoint.c -+++ b/src/mountpoint.c -@@ -25,6 +25,7 @@ - - #include - #include -+#include - #include - #include - #include -diff --git a/src/shutdown.c b/src/shutdown.c -index b744a2c..40b7faf 100644 ---- a/src/shutdown.c -+++ b/src/shutdown.c -@@ -40,6 +40,7 @@ - #endif - #include - #include -+#include - #include - #ifdef __linux__ - #include /* brought in my LFS patch */ diff --git a/meta/recipes-core/sysvinit/sysvinit/crypt-lib.patch b/meta/recipes-core/sysvinit/sysvinit/crypt-lib.patch index 24c8182218..ece870c269 100644 --- a/meta/recipes-core/sysvinit/sysvinit/crypt-lib.patch +++ b/meta/recipes-core/sysvinit/sysvinit/crypt-lib.patch @@ -1,33 +1,33 @@ -From 49250c8e0ef563aafd5bbea62612f3d15fdee3af Mon Sep 17 00:00:00 2001 +From 19a8777c81bc451d65a4071528e4715e19941e0a Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Wed, 14 Jul 2010 14:35:52 -0400 Subject: [PATCH] sysvinit - Remove sulogin dependency on /usr/lib*/libcrypt.a -Upstream-Status: Inappropriate [configuration] +The src Makefile was checking for libcrypt.a on the host, not in the +build environment. This patch checks for $LCRYPT in the environment +and uses it if it's there. +jdike@linux.intel.com -# The src Makefile was checking for libcrypt.a on the host, not in the -# build environment. This patch checks for $LCRYPT in the environment -# and uses it if it's there. -# - jdike@linux.intel.com +Upstream-Status: Inappropriate [configuration] --- src/Makefile | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Makefile b/src/Makefile -index 0210171..f696247 100644 +index 4ce4889..1611c1c 100644 --- a/src/Makefile +++ b/src/Makefile -@@ -101,16 +101,8 @@ endif - - ROOT ?= $(DESTDIR) +@@ -97,16 +97,8 @@ else + SULOGINLIBS = + endif -# Additional libs for GNU libc. --ifneq ($(wildcard $(ROOT)/usr/lib*/libcrypt.*),) +-ifneq ($(wildcard $(ROOT)/$(usrdir)/lib*/libcrypt.*),) - SULOGINLIBS += -lcrypt -endif - -# Additional libs for GNU libc / multiarch on Debian based systems. --ifneq ($(wildcard $(ROOT)/usr/lib/*/libcrypt.*),) +-ifneq ($(wildcard $(ROOT)/$(usrdir)/lib/*/libcrypt.*),) -ifneq ($(findstring -lcrypt, $(SULOGINLIBS)), -lcrypt) - SULOGINLIBS += -lcrypt -endif @@ -36,6 +36,3 @@ index 0210171..f696247 100644 endif all: $(BIN) $(SBIN) $(USRBIN) --- -2.25.1 - diff --git a/meta/recipes-core/sysvinit/sysvinit/install.patch b/meta/recipes-core/sysvinit/sysvinit/install.patch deleted file mode 100644 index 4289c4eddc..0000000000 --- a/meta/recipes-core/sysvinit/sysvinit/install.patch +++ /dev/null @@ -1,79 +0,0 @@ -From f73a2c768687f3fed0ab570f47fa2157e5d4e586 Mon Sep 17 00:00:00 2001 -From: Qing He -Date: Fri, 18 Jun 2010 09:40:30 +0800 -Subject: [PATCH] sysvinit: upgrade to version 2.88dsf - -Upstream-Status: Submitted [https://github.com/slicer69/sysvinit/pull/13] ---- - src/Makefile | 37 ++++++++++++++++++++++--------------- - 1 file changed, 22 insertions(+), 15 deletions(-) - -diff --git a/src/Makefile b/src/Makefile -index 21cbb2e..0210171 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -80,7 +80,14 @@ else - INSTALL_DATA = install -m 644 - endif - INSTALL_DIR = install -m 755 -d --MANDIR = /usr/share/man -+ -+ROOT ?= -+base_bindir ?= /bin -+base_sbindir ?= /sbin -+bindir ?= /usr/bin -+sysconfdir ?= /etc -+includedir ?= /usr/include -+mandir ?= /usr/share/man - - ifeq ($(WITH_SELINUX),yes) - SELINUX_DEF = -DWITH_SELINUX -@@ -196,31 +203,31 @@ clobber: cleanobjs - distclean: clobber - - install: all -- $(INSTALL_DIR) $(ROOT)/bin/ $(ROOT)/sbin/ -- $(INSTALL_DIR) $(ROOT)/usr/bin/ -+ $(INSTALL_DIR) $(ROOT)$(base_bindir)/ $(ROOT)$(base_sbindir)/ -+ $(INSTALL_DIR) $(ROOT)$(bindir)/ - for i in $(BIN); do \ -- $(INSTALL_EXEC) $$i $(ROOT)/bin/ ; \ -+ $(INSTALL_EXEC) $$i $(ROOT)$(base_bindir)/ ; \ - done - for i in $(SBIN); do \ -- $(INSTALL_EXEC) $$i $(ROOT)/sbin/ ; \ -+ $(INSTALL_EXEC) $$i $(ROOT)$(base_sbindir)/ ; \ - done - for i in $(USRBIN); do \ -- $(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \ -+ $(INSTALL_EXEC) $$i $(ROOT)$(bindir)/ ; \ - done - # $(INSTALL_DIR) $(ROOT)/etc/ - $(INSTALL_DIR) $(ROOT)/etc/inittab.d - # $(INSTALL_EXEC) ../doc/initscript.sample $(ROOT)/etc/ -- ln -sf halt $(ROOT)/sbin/reboot -- ln -sf halt $(ROOT)/sbin/poweroff -- ln -sf init $(ROOT)/sbin/telinit -- ln -sf ../sbin/killall5 $(ROOT)/bin/pidof -- if [ ! -f $(ROOT)/usr/bin/lastb ]; then \ -- ln -sf last $(ROOT)/usr/bin/lastb; \ -+ ln -sf halt $(ROOT)$(base_sbindir)/reboot -+ ln -sf halt $(ROOT)$(base_sbindir)/poweroff -+ ln -sf init $(ROOT)$(base_sbindir)/telinit -+ ln -sf $(base_sbindir)/killall5 $(ROOT)$(base_bindir)/pidof -+ if [ ! -f $(ROOT)$(bindir)/lastb ]; then \ -+ ln -sf last $(ROOT)$(bindir)/lastb; \ - fi -- $(INSTALL_DIR) $(ROOT)/usr/include/ -- $(INSTALL_DATA) initreq.h $(ROOT)/usr/include/ -+ $(INSTALL_DIR) $(ROOT)$(includedir)/ -+ $(INSTALL_DATA) initreq.h $(ROOT)$(includedir)/ - for man in $(MANPAGES) ; do \ -- targetdir=$(ROOT)$(MANDIR)/$$(dirname $$man)/man$${man##*.}; \ -+ targetdir=$(ROOT)$(mandir)/$$(dirname $$man)/man$${man##*.}; \ - $(INSTALL_DIR) $$targetdir; \ - $(INSTALL_DATA) ../man/$$man $$targetdir/$$(basename $$man); \ - sed -i "1{ $(MANDB); }" $$targetdir/$$(basename $$man); \ --- -2.25.1 - diff --git a/meta/recipes-core/sysvinit/sysvinit/pidof-add-m-option.patch b/meta/recipes-core/sysvinit/sysvinit/pidof-add-m-option.patch deleted file mode 100644 index 66da6fb403..0000000000 --- a/meta/recipes-core/sysvinit/sysvinit/pidof-add-m-option.patch +++ /dev/null @@ -1,193 +0,0 @@ -From 2b19b36409b8de0621b9aeb0d13748e947a5bbfb Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Wed, 24 Jul 2013 17:07:22 +0800 -Subject: [PATCH] pidof: add -m option - -When used with -o, will also omit any processes that have the same -argv[0] and argv[1] as any explicitly omitted process ids. This can be -used to avoid multiple shell scripts concurrently calling pidof returning -each other's pids. - -https://bugzilla.redhat.com/show_bug.cgi?id=883856 - -Upstream-Status: Backport -Imported patch from: https://bugzilla.redhat.com/attachment.cgi?id=658166 - -Signed-off-by: Hongxu Jia ---- - man/pidof.8 | 6 +++++ - src/killall5.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++--- - 2 files changed, 65 insertions(+), 3 deletions(-) - -diff --git a/man/pidof.8 b/man/pidof.8 -index 6866cb3..a87d878 100644 ---- a/man/pidof.8 -+++ b/man/pidof.8 -@@ -25,6 +25,7 @@ pidof - find the process ID of a running program - .RB [ \-n ] - .RB [ \-x ] - .RB [ \-z ] -+.RB [ \-m ] - .RB [ \-o - .IR omitpid[,omitpid...] ] - .RB [ \-o -@@ -77,6 +78,11 @@ is shown. The default separator is a space. - Tells \fIpidof\fP to omit processes with that process id. The special - pid \fB%PPID\fP can be used to name the parent process of the \fBpidof\fP - program, in other words the calling shell or shell script. -+.IP -m -+When used with -o, will also omit any processes that have the same -+argv[0] and argv[1] as any explicitly omitted process ids. This can be -+used to avoid multiple shell scripts concurrently calling pidof returning -+each other's pids. - .SH "EXIT STATUS" - .TP - .B 0 -diff --git a/src/killall5.c b/src/killall5.c -index 6f7528a..34d656b 100644 ---- a/src/killall5.c -+++ b/src/killall5.c -@@ -121,6 +121,7 @@ typedef struct _s_nfs - - /* List of processes. */ - PROC *plist = NULL; -+PROC *olist = NULL; - - /* List of processes to omit. */ - OMIT *omit = NULL; -@@ -356,6 +357,20 @@ static void clear_mnt(void) - } - } - -+static void clear_omit(void) -+{ -+ OMIT *o; -+ PROC *p; -+ for (o = omit; o; o = omit) { -+ omit = omit->next; -+ free(o); -+ } -+ for (p = olist; p; p = olist) { -+ olist = olist->next; -+ free(p); -+ } -+} -+ - /* - * Check if path is a shadow off a NFS partition. - */ -@@ -481,6 +496,7 @@ int readproc() - DIR *dir; - FILE *fp; - PROC *p, *n; -+ OMIT *o, *m; - struct dirent *d; - char path[PATH_MAX+1]; - char buf[PATH_MAX+1]; -@@ -671,6 +687,17 @@ int readproc() - p->next = plist; - plist = p; - p->pid = pid; -+ /* Could be smarter, but it's a small list. */ -+ m = omit; -+ for (o = omit; m; o = m) { -+ m = o->next; -+ if (o->pid == p->pid) { -+ n = (PROC*)xmalloc(sizeof(PROC)); -+ *n = *p; -+ n->next = olist; -+ olist = n; -+ } -+ } - } - closedir(dir); - -@@ -877,6 +904,26 @@ PIDQ_HEAD *pidof(char *prog) - return q; - } - -+int matches(PROC *o, PROC *p) -+{ -+ int ret = 0; -+ char *oargv1, *pargv1; -+ if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) { -+ if (o->argv1 && p->argv1) { -+ if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL) -+ oargv1 = strdup(o->argv1); -+ if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL) -+ pargv1 = strdup(p->argv1); -+ if (! strcmp(oargv1, pargv1)) { -+ ret = 1; -+ } -+ free(oargv1); -+ free(pargv1); -+ } -+ } -+ return ret; -+} -+ - /* Give usage message and exit. */ - void usage(void) - { -@@ -927,6 +974,7 @@ void nsyslog(int pri, char *fmt, ...) - #define PIDOF_OMIT 0x02 - #define PIDOF_NETFS 0x04 - #define PIDOF_QUIET 0x08 -+#define PIDOF_OMIT_OMIT_MATCHES 0x08 - - /* - * Pidof functionality. -@@ -944,6 +992,7 @@ int main_pidof(int argc, char **argv) - char tmp[512]; - char sep = ' '; - -+ olist = (PROC*)0; - omit = (OMIT*)0; - nlist = (NFS*)0; - opterr = 0; -@@ -951,7 +1000,7 @@ int main_pidof(int argc, char **argv) - if ((token = getenv("PIDOF_NETFS")) && (strcmp(token,"no") != 0)) - flags |= PIDOF_NETFS; - -- while ((opt = getopt(argc,argv,"qhco:d:sxzn")) != EOF) switch (opt) { -+ while ((opt = getopt(argc,argv,"qhcmo:d:sxzn")) != EOF) switch (opt) { - case '?': - nsyslog(LOG_ERR,"invalid options on command line!\n"); - closelog(); -@@ -1002,6 +1051,9 @@ int main_pidof(int argc, char **argv) - case 'z': - list_dz_processes = TRUE; - break; -+ case 'm': -+ flags |= PIDOF_OMIT_OMIT_MATCHES; -+ break; - case 'n': - flags |= PIDOF_NETFS; - break; -@@ -1033,10 +1085,13 @@ int main_pidof(int argc, char **argv) - pid_t spid = 0; - while ((p = get_next_from_pid_q(q))) { - if ((flags & PIDOF_OMIT) && omit) { -- OMIT * optr; -- for (optr = omit; optr; optr = optr->next) { -+ PROC * optr; -+ for (optr = olist; optr; optr = optr->next) { - if (optr->pid == p->pid) - break; -+ if (flags & PIDOF_OMIT_OMIT_MATCHES) -+ if (matches(optr, p)) -+ break; - } - - /* -@@ -1078,6 +1133,7 @@ int main_pidof(int argc, char **argv) - printf("\n"); - } - -+ clear_omit(); - clear_mnt(); - - closelog(); --- -2.25.1 - diff --git a/meta/recipes-core/sysvinit/sysvinit/realpath.patch b/meta/recipes-core/sysvinit/sysvinit/realpath.patch deleted file mode 100644 index 7a669d0111..0000000000 --- a/meta/recipes-core/sysvinit/sysvinit/realpath.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 50e6b3a0fc7c083e6514a55ac93e5591aaeb787d Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 19 Nov 2015 00:10:03 +0000 -Subject: [PATCH] Fix build on musl use realpath() API its available on all - libcs - -realpath() API doesnt work on systems with PATH_MAX set to be unlimited e.g. GNU/Hurd -However for Linux it should always work - -Upstream-Status: Inappropriate [Linux specific] - -Signed-off-by: Khem Raj ---- - src/killall5.c | 4 ++-- - src/mountpoint.c | 1 + - src/wall.c | 1 + - 3 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/killall5.c b/src/killall5.c -index 34d656b..bc19d7f 100644 ---- a/src/killall5.c -+++ b/src/killall5.c -@@ -910,9 +910,9 @@ int matches(PROC *o, PROC *p) - char *oargv1, *pargv1; - if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) { - if (o->argv1 && p->argv1) { -- if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL) -+ if ((oargv1 = realpath(o->argv1, NULL)) == NULL) - oargv1 = strdup(o->argv1); -- if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL) -+ if ((pargv1 = realpath(p->argv1, NULL)) == NULL) - pargv1 = strdup(p->argv1); - if (! strcmp(oargv1, pargv1)) { - ret = 1; -diff --git a/src/mountpoint.c b/src/mountpoint.c -index 184b1f6..c55b0df 100644 ---- a/src/mountpoint.c -+++ b/src/mountpoint.c -@@ -23,6 +23,7 @@ - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -+#include - #include - #include - #include -diff --git a/src/wall.c b/src/wall.c -index e527613..1d363ca 100644 ---- a/src/wall.c -+++ b/src/wall.c -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - #include "init.h" - - --- -2.25.1 - diff --git a/meta/recipes-core/sysvinit/sysvinit_3.11.bb b/meta/recipes-core/sysvinit/sysvinit_3.11.bb deleted file mode 100644 index e8eab27564..0000000000 --- a/meta/recipes-core/sysvinit/sysvinit_3.11.bb +++ /dev/null @@ -1,118 +0,0 @@ -SUMMARY = "System-V like init" -DESCRIPTION = "This package is required to boot in most configurations. It provides the /sbin/init program. This is the first process started on boot, and the last process terminated before the system halts." -HOMEPAGE = "http://savannah.nongnu.org/projects/sysvinit/" -SECTION = "base" -LICENSE = "GPL-2.0-or-later" -LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ - file://COPYRIGHT;endline=15;md5=a1d3b3526501d3546d530bbe6ab6cdbe \ - " - -RDEPENDS:${PN} = "${PN}-inittab" - -GITHUB_BASE_URI = "https://github.com/slicer69/${BPN}/releases/" -SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.xz \ - file://install.patch \ - file://crypt-lib.patch \ - file://pidof-add-m-option.patch \ - file://realpath.patch \ - file://0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch \ - file://rcS-default \ - file://rc \ - file://rcS \ - file://bootlogd.init \ - file://01_bootlogd \ - " -SRC_URI[sha256sum] = "04f1b7d67413af1c09c41acc1e3ce946f2d0f7a1e47c9978744bc542864e13d4" - -S = "${WORKDIR}/sysvinit-${PV}" - -inherit update-alternatives features_check github-releases -DEPENDS:append = " update-rc.d-native base-passwd virtual/crypt" -do_package_setscene[depends] = "${MLPREFIX}base-passwd:do_populate_sysroot" - -PACKAGECONFIG[psplash-text-updates] = ",," - -REQUIRED_DISTRO_FEATURES = "sysvinit" - -ALTERNATIVE:${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last lastb mesg utmpdump wall" - -ALTERNATIVE_PRIORITY = "200" - -ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" -ALTERNATIVE_PRIORITY[init] = "50" - -ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint" -ALTERNATIVE_PRIORITY[mountpoint] = "20" - -ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" -ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" -ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" -ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" -ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" - -ALTERNATIVE:${PN}-pidof = "pidof" -ALTERNATIVE_LINK_NAME[pidof] = "${base_bindir}/pidof" - -ALTERNATIVE:${PN}-sulogin = "sulogin" -ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" - -ALTERNATIVE:${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 sulogin.8 utmpdump.1" - -ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1" -ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1" -ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1" -ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1" -ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8" -ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1" -ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1" - -PACKAGES =+ "sysvinit-pidof sysvinit-sulogin" -FILES:${PN} += "${base_sbindir}/* ${base_bindir}/*" -FILES:sysvinit-pidof = "${base_bindir}/pidof.sysvinit ${base_sbindir}/killall5" -FILES:sysvinit-sulogin = "${base_sbindir}/sulogin.sysvinit" - -RDEPENDS:${PN} += "sysvinit-pidof initd-functions base-passwd" - -CFLAGS:prepend = "-D_GNU_SOURCE " -export LCRYPT = "-lcrypt" -EXTRA_OEMAKE += "'base_bindir=${base_bindir}' \ - 'base_sbindir=${base_sbindir}' \ - 'bindir=${bindir}' \ - 'sbindir=${sbindir}' \ - 'sysconfdir=${sysconfdir}' \ - 'includedir=${includedir}' \ - 'mandir=${mandir}' \ - MNTPOINT=yes" - -do_install () { - oe_runmake 'ROOT=${D}' install - - install -d ${D}${sysconfdir} \ - ${D}${sysconfdir}/default \ - ${D}${sysconfdir}/init.d - for level in S 0 1 2 3 4 5 6; do - install -d ${D}${sysconfdir}/rc$level.d - done - - sed -e \ - 's:#PSPLASH_TEXT#:${@bb.utils.contains("PACKAGECONFIG","psplash-text-updates","yes","no", d)}:g' \ - ${UNPACKDIR}/rcS-default > ${D}${sysconfdir}/default/rcS - chmod 0644 ${D}${sysconfdir}/default/rcS - install -m 0755 ${UNPACKDIR}/rc ${D}${sysconfdir}/init.d - install -m 0755 ${UNPACKDIR}/rcS ${D}${sysconfdir}/init.d - install -m 0755 ${UNPACKDIR}/bootlogd.init ${D}${sysconfdir}/init.d/bootlogd - ln -sf bootlogd ${D}${sysconfdir}/init.d/stop-bootlogd - - update-rc.d -r ${D} bootlogd start 07 S . - update-rc.d -r ${D} stop-bootlogd start 99 2 3 4 5 . - - install -d ${D}${sysconfdir}/default/volatiles - install -m 0644 ${UNPACKDIR}/01_bootlogd ${D}${sysconfdir}/default/volatiles - - chown root:shutdown ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown - chmod o-x,u+s ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown - - # Already provided by e2fsprogs; sysvinit's version is a copy from there - rm ${D}${base_sbindir}/logsave - rm ${D}${mandir}/man8/logsave.8 -} diff --git a/meta/recipes-core/sysvinit/sysvinit_3.13.bb b/meta/recipes-core/sysvinit/sysvinit_3.13.bb new file mode 100644 index 0000000000..d935b0edfd --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit_3.13.bb @@ -0,0 +1,114 @@ +SUMMARY = "System-V like init" +DESCRIPTION = "This package is required to boot in most configurations. It provides the /sbin/init program. This is the first process started on boot, and the last process terminated before the system halts." +HOMEPAGE = "http://savannah.nongnu.org/projects/sysvinit/" +SECTION = "base" +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ + file://COPYRIGHT;endline=15;md5=a1d3b3526501d3546d530bbe6ab6cdbe \ + " + +RDEPENDS:${PN} = "${PN}-inittab" + +GITHUB_BASE_URI = "https://github.com/slicer69/${BPN}/releases/" +SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.xz \ + file://crypt-lib.patch \ + file://rcS-default \ + file://rc \ + file://rcS \ + file://bootlogd.init \ + file://01_bootlogd \ + " +SRC_URI[sha256sum] = "cbaeabddc35a6511b87c87452ee5e87c678a26329c7d7d17fb69a2b42a314d86" + +S = "${WORKDIR}/sysvinit-${PV}" + +inherit update-alternatives features_check github-releases +DEPENDS:append = " update-rc.d-native base-passwd virtual/crypt" +do_package_setscene[depends] = "${MLPREFIX}base-passwd:do_populate_sysroot" + +PACKAGECONFIG[psplash-text-updates] = ",," + +REQUIRED_DISTRO_FEATURES = "sysvinit" + +ALTERNATIVE:${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last lastb mesg utmpdump wall" + +ALTERNATIVE_PRIORITY = "200" + +ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" +ALTERNATIVE_PRIORITY[init] = "50" + +ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint" +ALTERNATIVE_PRIORITY[mountpoint] = "20" + +ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" +ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" +ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" +ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" +ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" + +ALTERNATIVE:${PN}-pidof = "pidof" +ALTERNATIVE_LINK_NAME[pidof] = "${base_bindir}/pidof" + +ALTERNATIVE:${PN}-sulogin = "sulogin" +ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" + +ALTERNATIVE:${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 sulogin.8 utmpdump.1" + +ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1" +ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1" +ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1" +ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1" +ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8" +ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1" +ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1" + +PACKAGES =+ "sysvinit-pidof sysvinit-sulogin" +FILES:${PN} += "${base_sbindir}/* ${base_bindir}/*" +FILES:sysvinit-pidof = "${base_bindir}/pidof.sysvinit ${base_sbindir}/killall5" +FILES:sysvinit-sulogin = "${base_sbindir}/sulogin.sysvinit" + +RDEPENDS:${PN} += "sysvinit-pidof initd-functions base-passwd" + +CFLAGS:prepend = "-D_GNU_SOURCE " +export LCRYPT = "-lcrypt" +EXTRA_OEMAKE += "'base_bindir=${base_bindir}' \ + 'base_sbindir=${base_sbindir}' \ + 'bindir=${bindir}' \ + 'sbindir=${sbindir}' \ + 'sysconfdir=${sysconfdir}' \ + 'includedir=${includedir}' \ + 'mandir=${mandir}' \ + MNTPOINT=yes" + +do_install () { + oe_runmake 'ROOT=${D}' install + + install -d ${D}${sysconfdir} \ + ${D}${sysconfdir}/default \ + ${D}${sysconfdir}/init.d + for level in S 0 1 2 3 4 5 6; do + install -d ${D}${sysconfdir}/rc$level.d + done + + sed -e \ + 's:#PSPLASH_TEXT#:${@bb.utils.contains("PACKAGECONFIG","psplash-text-updates","yes","no", d)}:g' \ + ${UNPACKDIR}/rcS-default > ${D}${sysconfdir}/default/rcS + chmod 0644 ${D}${sysconfdir}/default/rcS + install -m 0755 ${UNPACKDIR}/rc ${D}${sysconfdir}/init.d + install -m 0755 ${UNPACKDIR}/rcS ${D}${sysconfdir}/init.d + install -m 0755 ${UNPACKDIR}/bootlogd.init ${D}${sysconfdir}/init.d/bootlogd + ln -sf bootlogd ${D}${sysconfdir}/init.d/stop-bootlogd + + update-rc.d -r ${D} bootlogd start 07 S . + update-rc.d -r ${D} stop-bootlogd start 99 2 3 4 5 . + + install -d ${D}${sysconfdir}/default/volatiles + install -m 0644 ${UNPACKDIR}/01_bootlogd ${D}${sysconfdir}/default/volatiles + + chown root:shutdown ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown + chmod o-x,u+s ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown + + # Already provided by e2fsprogs; sysvinit's version is a copy from there + rm ${D}${base_sbindir}/logsave + rm ${D}${mandir}/man8/logsave.8 +} -- cgit v1.2.3-54-g00ecf