From b3a04e797e5e459842c2c239886ab6ea08a8dc29 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Thu, 12 May 2016 17:48:15 -0400 Subject: [PATCH] =?UTF-8?q?runlevels/Makefile:=20add=20support=20for=20run?= =?UTF-8?q?level=20=E2=80=98nonetwork=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Traditional System V reserves runlevel 2 for multiuser with no networking. We add support for this which is already defined in the inittab as l2:2:wait:/sbin/rc nonetwork X-Gentoo-Bug: 533828 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=533828 Signed-off-by: Anthony G. Basile --- runlevels/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runlevels/Makefile b/runlevels/Makefile index 682d6e15..df6b53a2 100644 --- a/runlevels/Makefile +++ b/runlevels/Makefile @@ -3,6 +3,7 @@ include ../mk/net.mk BOOT= bootmisc fsck hostname localmount loopback \ root swap swapfiles sysctl urandom ${BOOT-${OS}} DEFAULT= local netmount +NONETWORK= local SHUTDOWN= savecache ${SHUTDOWN-${OS}} SYSINIT= ${SYSINIT-${OS}} @@ -10,6 +11,7 @@ LEVELDIR= ${DESTDIR}/${SYSCONFDIR}/runlevels SYSINITDIR= ${LEVELDIR}/sysinit BOOTDIR= ${LEVELDIR}/boot DEFAULTDIR= ${LEVELDIR}/default +NONETWORKDIR= ${LEVELDIR}/nonetwork SHUTDOWNDIR= ${LEVELDIR}/shutdown ifeq (${MKNET},yes) @@ -72,6 +74,14 @@ install: fi; \ ln -snf ${INITDIR}/"$$x" ${DEFAULTDIR}/"$$x" || exit $$?; done \ fi + if ! test -d "${NONETWORKDIR}"; then \ + ${INSTALL} -d ${NONETWORKDIR} || exit $$?; \ + for x in ${NONETWORK}; do \ + if test "${MKPREFIX}" = yes; then \ + grep -q "keyword .*-prefix" ${INITFILES}/"$$x" && continue; \ + fi; \ + ln -snf ${INITDIR}/"$$x" ${NONETWORKDIR}/"$$x" || exit $$?; done \ + fi if ! test -d "${SHUTDOWNDIR}"; then \ ${INSTALL} -d ${SHUTDOWNDIR} || exit $$?; \ for x in ${SHUTDOWN}; do \