Compare commits
50 Commits
openrc-0.8
...
funtoo-ope
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7146e99855 | ||
|
|
e65ce9e301 | ||
|
|
7ca74d7636 | ||
|
|
e49da2af91 | ||
|
|
a2c8e5ce50 | ||
|
|
11d8b70d74 | ||
|
|
227f831639 | ||
|
|
98d3b407fe | ||
|
|
fe18c7bb63 | ||
|
|
f8ff4a86a3 | ||
|
|
d59e245bc7 | ||
|
|
74c8667497 | ||
|
|
3d56124ed1 | ||
|
|
bb34ea886a | ||
|
|
fd48bc09ff | ||
|
|
db1daa5857 | ||
|
|
2493a1f32e | ||
|
|
40341fcd7e | ||
|
|
8fcaba9a22 | ||
|
|
04e256e3b8 | ||
|
|
b712a9161f | ||
|
|
8202e7dce4 | ||
|
|
2d197357ef | ||
|
|
b6409feaac | ||
|
|
ede4d1cd60 | ||
|
|
64ef51ab09 | ||
|
|
372bae3213 | ||
|
|
ac56ab7f6d | ||
|
|
ad8f455726 | ||
|
|
de0ded4ed0 | ||
|
|
75722dac4e | ||
|
|
6a5e6f1ee0 | ||
|
|
d8ce5dccb2 | ||
|
|
62bd337494 | ||
|
|
06c8bd0156 | ||
|
|
33803219d4 | ||
|
|
18c08a9d4d | ||
|
|
2406dc4f3e | ||
|
|
8e6d461a7f | ||
|
|
472a3bb99c | ||
|
|
c9a2085699 | ||
|
|
69169b7e95 | ||
|
|
3a11f8af34 | ||
|
|
e2e5b27d85 | ||
|
|
f343360741 | ||
|
|
694fd2027f | ||
|
|
ca76764743 | ||
|
|
19bd9923d7 | ||
|
|
2a844e1122 | ||
|
|
5135412978 |
15
.gitignore
vendored
15
.gitignore
vendored
@@ -1 +1,16 @@
|
|||||||
*.bz2
|
*.bz2
|
||||||
|
|
||||||
|
*.diff
|
||||||
|
*.patch
|
||||||
|
*.orig
|
||||||
|
*.rej
|
||||||
|
|
||||||
|
core
|
||||||
|
.gdb_history
|
||||||
|
.gdbinit
|
||||||
|
|
||||||
|
.depend
|
||||||
|
*.a
|
||||||
|
*.o
|
||||||
|
*.So
|
||||||
|
lib*.so
|
||||||
|
|||||||
@@ -5,27 +5,6 @@ removed, it should also be removed from this file.
|
|||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
What: rc_sys automatic detection code
|
|
||||||
- Functions for removal: rc_sys_v1, rc_sys_v2
|
|
||||||
|
|
||||||
When: 2011/03/01
|
|
||||||
|
|
||||||
Why: The original automatic sub-system detection is flawed in that it cannot
|
|
||||||
safely detect some variables (Using cgroups confused it to think you were
|
|
||||||
using LXC, and Prefix cannot be detect by definition). Also, almost all of
|
|
||||||
the detection requires that /proc is available and readable. During early
|
|
||||||
boot, /proc may not be mounted yet, leading to mis-detection. The readable
|
|
||||||
condition can also fail under some hardened kernels when running as an
|
|
||||||
unprivileged user.
|
|
||||||
|
|
||||||
The new rc_sys_v2 function uses the rc_sys variable from rc.conf. After
|
|
||||||
the removal, the contents of the rc_sys_v2 function will move into the
|
|
||||||
rc_sys function.
|
|
||||||
|
|
||||||
Who: Robin H. Johnson <robbat2@gentoo.org>
|
|
||||||
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
What: oldnet ADSL rp-pppoe mode
|
What: oldnet ADSL rp-pppoe mode
|
||||||
|
|
||||||
When: undecided
|
When: undecided
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
NAME= openrc
|
NAME= openrc
|
||||||
VERSION= 0.8.1
|
VERSION= 0.8.2
|
||||||
PKG= ${NAME}-${VERSION}
|
PKG= ${NAME}-${VERSION}
|
||||||
|
|||||||
72
README
72
README
@@ -1,8 +1,9 @@
|
|||||||
OpenRC README
|
OpenRC README
|
||||||
|
=============
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
make install
|
make install
|
||||||
Yup, that simple. Works with GNU make.
|
Yup, that simple. Works with GNU make.
|
||||||
|
|
||||||
@@ -67,31 +68,54 @@ init.d.misc is not installed by default as the scripts will need
|
|||||||
tweaking on a per distro basis. They are also non essential to the operation
|
tweaking on a per distro basis. They are also non essential to the operation
|
||||||
of the system.
|
of the system.
|
||||||
|
|
||||||
|
|
||||||
Reporting Bugs
|
Reporting Bugs
|
||||||
--------------
|
|
||||||
Bugs should go to the Gentoo Bugzilla:
|
|
||||||
http://bugs.gentoo.org/
|
|
||||||
You'll want the "Gentoo Linux" product and the "baselayout" component.
|
|
||||||
|
|
||||||
|
If you installed OpenRC from your chosen distribution, you should report
|
||||||
|
bugs directly to them. For example, if you use Gentoo and emerged OpenRC
|
||||||
|
then you should reports bugs to http://bugs.gentoo.org.
|
||||||
|
|
||||||
History - by Roy Marples
|
History - by Daniel Robbins
|
||||||
------------------------
|
---------------------------
|
||||||
I became a Gentoo/Linux developer in 2004 and wrote the modular network
|
|
||||||
scripts for the Gentoo baselayout package. baselayout is a collection of
|
|
||||||
bash scripts to bring up your computer and its services.
|
|
||||||
Then towards the end of 2005 I found myself as the primary maintainer
|
|
||||||
for baselayout.
|
|
||||||
|
|
||||||
At the start of 2007, baselayout-2 is announced to the world, re-writing the
|
The Gentoo modular network scripts were created by Daniel Robbins for
|
||||||
core of baselayout in C and allowing POSIX sh init scripts instead of
|
Gentoo Linux 1.0_rc6, in development during most of 2001 and released
|
||||||
forcing the use of bash. By Mid 2007 I have re-written everything, including
|
in September 2001. After their development, the dependency-based initscript
|
||||||
init scripts, and alpha and pre baselayout-2 snapshots where put into Gentoo.
|
system was maintained by a number of senior developers (add names here....
|
||||||
Towards the end of 2007 I retired as a Gentoo developer for reasons I won't
|
need to look at baselayout cvs logs.)
|
||||||
go into here. baselayout-2 was still in the pre stage, and aside from the
|
|
||||||
fbsd users, it was masked everywhere. However, I also desired to keep the
|
|
||||||
baselayout-2 project alive, but outside of Gentoo and into other projects
|
|
||||||
such as FreeBSD.
|
|
||||||
|
|
||||||
As such, the Gentoo Council have allowed the creation of OpenRC under the
|
excerpt from http://www.gentoo.org/news/en/gwn/20040426-newsletter.xml
|
||||||
2 clause BSD license, managed by me as an external project.
|
by Grant Goodyear:
|
||||||
|
|
||||||
|
"My recollection is that one of woodchip's more impressive early feats was the
|
||||||
|
complete replacement of all of the init scripts in Portage for Gentoo Linux
|
||||||
|
1.0_rc6. Through 1.0_rc5 Gentoo had used fairly standard rc scripts modified
|
||||||
|
from Stampede Linux, but for 1.0_rc6 Daniel Robbins (drobbins) and Martin
|
||||||
|
Schlemmer (azarah) had created a new dependency-based init script system that
|
||||||
|
is still used today. Within a span of days Donny rewrote every single init
|
||||||
|
script in the Portage tree and committed new masked packages to await the
|
||||||
|
release of 1.0_rc6. Thanks to woodchip (and drobbins and azarah, of course) the
|
||||||
|
transition to the new init scripts was nearly painless."
|
||||||
|
|
||||||
|
Roy Marples became a Gentoo/Linux developer in 2004 and maintained the modular
|
||||||
|
network scripts for the Gentoo baselayout package. Then towards the end of
|
||||||
|
2005, he became the the primary maintainer for baselayout.
|
||||||
|
|
||||||
|
At the start of 2007, Roy Marples announced the ongoing development of
|
||||||
|
baselayout-2, containing a rewritten initscript code in C and allowing POSIX sh
|
||||||
|
init scripts instead of forcing the use of bash. By Mid 2007 Roy Marples had
|
||||||
|
re-implemented the Gentoo initscript design created by Daniel Robbins, using an
|
||||||
|
entirely new code base. Alpha and pre-release baselayout-2 snapshots were
|
||||||
|
added to Gentoo's Portage tree as an optional component.
|
||||||
|
|
||||||
|
Towards the end of 2007, Roy Marples retired as a Gentoo developer Baselayout-2
|
||||||
|
was still in the pre stage, and aside from the fbsd users, it was masked
|
||||||
|
everywhere. However, Roy Marples desired to keep the baselayout-2 project
|
||||||
|
alive, but outside of Gentoo and into other projects such as FreeBSD.
|
||||||
|
|
||||||
|
As such, the Gentoo Council permitted Roy Marples to release OpenRC under the 2
|
||||||
|
clause BSD license, managed by him as an external project. Around mid-2010, Roy
|
||||||
|
Marples decided to no longer maintain OpenRC. At this point, he transferred
|
||||||
|
development back to Gentoo, which continues to maintain the scripts. In
|
||||||
|
addition, Daniel Robbins continues to maintain an independent version OpenRC
|
||||||
|
for Funtoo Linux, which includes a Funtoo-specific network configuration
|
||||||
|
system.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Use KEYMAP to specify the default console keymap. There is a complete tree
|
# Use keymap to specify the default console keymap. There is a complete tree
|
||||||
# of keymaps in /usr/share/keymaps to choose from.
|
# of keymaps in /usr/share/keymaps to choose from.
|
||||||
keymap="us"
|
keymap="us"
|
||||||
|
|
||||||
|
|||||||
@@ -359,15 +359,6 @@
|
|||||||
# manager like resolvconf-gentoo to manage this file for you. All packages
|
# manager like resolvconf-gentoo to manage this file for you. All packages
|
||||||
# that baselayout supports use resolvconf-gentoo if installed.
|
# that baselayout supports use resolvconf-gentoo if installed.
|
||||||
|
|
||||||
# If you run any services on net.lo which need localmount, either the
|
|
||||||
# services or net.lo should explicitly bring in localmount.
|
|
||||||
# If you do not do this, openrc will try to bring up net.lo as soon as
|
|
||||||
# possible, which may be too early for your services.
|
|
||||||
# If you use network file systems for your core system this may
|
|
||||||
# interfere.
|
|
||||||
# Also, you may need this if 127.0.0.1 is in your /etc/resolv.conf.
|
|
||||||
#rc_net_lo0_need="localmount"
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Cable in/out detection
|
# Cable in/out detection
|
||||||
# Sometimes the cable is in, others it's out. Obviously you don't want to
|
# Sometimes the cable is in, others it's out. Obviously you don't want to
|
||||||
|
|||||||
@@ -414,7 +414,7 @@
|
|||||||
# dhclient: emerge net-misc/dhcp
|
# dhclient: emerge net-misc/dhcp
|
||||||
# dhcpcd: emerge net-misc/dhcpcd
|
# dhcpcd: emerge net-misc/dhcpcd
|
||||||
# pump: emerge net-misc/pump
|
# pump: emerge net-misc/pump
|
||||||
# udhcpc: emerge net-misc/udhcp
|
# udhcpc: emerge sys-apps/busybox
|
||||||
|
|
||||||
# If you have more than one DHCP client installed, you need to specify which
|
# If you have more than one DHCP client installed, you need to specify which
|
||||||
# one to use - otherwise we default to dhcpcd if available.
|
# one to use - otherwise we default to dhcpcd if available.
|
||||||
@@ -962,15 +962,6 @@
|
|||||||
# manager like resolvconf-gentoo to manage this file for you. All packages
|
# manager like resolvconf-gentoo to manage this file for you. All packages
|
||||||
# that baselayout supports use resolvconf-gentoo if installed.
|
# that baselayout supports use resolvconf-gentoo if installed.
|
||||||
|
|
||||||
# If you run any services on net.lo which need localmount, either the
|
|
||||||
# services or net.lo should explicitly bring in localmount.
|
|
||||||
# If you do not do this, openrc will try to bring up net.lo as soon as
|
|
||||||
# possible, which may be too early for your services.
|
|
||||||
# If you use network file systems for your core system this may
|
|
||||||
# interfere.
|
|
||||||
# Also, you may need this if 127.0.0.1 is in your /etc/resolv.conf.
|
|
||||||
#rc_net_lo_need="localmount"
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Cable in/out detection
|
# Cable in/out detection
|
||||||
# Sometimes the cable is in, others it's out. Obviously you don't want to
|
# Sometimes the cable is in, others it's out. Obviously you don't want to
|
||||||
@@ -984,10 +975,12 @@
|
|||||||
# and you're done :)
|
# and you're done :)
|
||||||
|
|
||||||
# By default we don't wait for netplug/ifplugd to configure the interface.
|
# By default we don't wait for netplug/ifplugd to configure the interface.
|
||||||
# If you would like it to wait so that other services know that network is up
|
# If you would like it to wait so that other services know that network is
|
||||||
# then you can specify a timeout here.
|
# up then you can specify a timeout here. A value of 0 means wait forever,
|
||||||
|
# and a negative value means never wait.
|
||||||
|
#plug_timeout_eth0="10"
|
||||||
|
# If you want to set it for all interfaces:
|
||||||
#plug_timeout="10"
|
#plug_timeout="10"
|
||||||
# A value of 0 means wait forever.
|
|
||||||
|
|
||||||
# If you don't want to use netplug on a specific interface but you have it
|
# If you don't want to use netplug on a specific interface but you have it
|
||||||
# installed, you can disable it for that interface via the modules statement
|
# installed, you can disable it for that interface via the modules statement
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
##############################################################################
|
||||||
|
# FreeBSD SPECIFIC OPTIONS
|
||||||
|
|
||||||
# This is the subsystem type. Valid options on FreeBSD:
|
# This is the subsystem type. Valid options on FreeBSD:
|
||||||
# "" - nothing special
|
# "" - nothing special
|
||||||
# "jail" - FreeBSD jails
|
# "jail" - FreeBSD jails
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
##############################################################################
|
||||||
|
# LINUX SPECIFIC OPTIONS
|
||||||
|
|
||||||
# This is the subsystem type. Valid options on Linux:
|
# This is the subsystem type. Valid options on Linux:
|
||||||
# "" - nothing special
|
# "" - nothing special
|
||||||
# "lxc" - Linux Containers
|
# "lxc" - Linux Containers
|
||||||
@@ -15,9 +18,6 @@
|
|||||||
# PRESENTLY in, not the virtualization the environment is capable of.
|
# PRESENTLY in, not the virtualization the environment is capable of.
|
||||||
rc_sys="@RC_SYS_DEFAULT@"
|
rc_sys="@RC_SYS_DEFAULT@"
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# LINUX SPECIFIC OPTIONS
|
|
||||||
|
|
||||||
# This is the number of tty's used in most of the rc-scripts (like
|
# This is the number of tty's used in most of the rc-scripts (like
|
||||||
# consolefont, numlock, etc ...)
|
# consolefont, numlock, etc ...)
|
||||||
rc_tty_number=12
|
rc_tty_number=12
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
##############################################################################
|
||||||
|
# NetBSD SPECIFIC OPTIONS
|
||||||
|
|
||||||
# This is the subsystem type. Valid options on NetBSD:
|
# This is the subsystem type. Valid options on NetBSD:
|
||||||
# "" - nothing special
|
# "" - nothing special
|
||||||
# "prefix" - Prefix
|
# "prefix" - Prefix
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
description="Sets the hostname of the machine."
|
description="Sets the hostname of the machine."
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
keyword -prefix
|
keyword -prefix -lxc
|
||||||
}
|
}
|
||||||
|
|
||||||
start()
|
start()
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ start()
|
|||||||
local_start
|
local_start
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
eend 0
|
||||||
}
|
}
|
||||||
|
|
||||||
stop()
|
stop()
|
||||||
@@ -47,5 +47,5 @@ stop()
|
|||||||
local_stop
|
local_stop
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
eend 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ stop()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$RC_UNAME" = Linux ]; then
|
if [ "$RC_UNAME" = Linux ]; then
|
||||||
no_umounts_r="$no_umounts_r|/proc|/proc/.*|/sys|/sys/.*"
|
no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*"
|
||||||
fi
|
fi
|
||||||
no_umounts_r="^($no_umounts_r)$"
|
no_umounts_r="^($no_umounts_r)$"
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,14 @@ depend()
|
|||||||
local IFACE=${RC_SVCNAME#*.}
|
local IFACE=${RC_SVCNAME#*.}
|
||||||
local IFVAR=$(shell_var "${IFACE}")
|
local IFVAR=$(shell_var "${IFACE}")
|
||||||
|
|
||||||
|
need localmount
|
||||||
|
after bootmisc
|
||||||
provide net
|
provide net
|
||||||
keyword -jail -prefix -vserver
|
keyword -jail -prefix -vserver
|
||||||
|
|
||||||
case "${IFACE}" in
|
case "${IFACE}" in
|
||||||
lo|lo0) before mtab ; need root ;;
|
lo|lo0);;
|
||||||
*) after bootmisc net.lo net.lo0 ; need localmount ;;
|
*) after net.lo net.lo0;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$(command -v "depend_${IFVAR}")" = "depend_${IFVAR}" ]; then
|
if [ "$(command -v "depend_${IFVAR}")" = "depend_${IFVAR}" ]; then
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ depend()
|
|||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
# Make sure we insert usbcore if it's a module
|
# Make sure we insert usbcore if it's a module
|
||||||
if [ -f /proc/modules -a ! -d /proc/bus/usb ]; then
|
if [ -f /proc/modules -a ! -d /sys/module/usbcore -a ! -d /proc/bus/usb ]; then
|
||||||
modprobe -q usbcore
|
modprobe -q usbcore
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ depend()
|
|||||||
{
|
{
|
||||||
keyword -openvz -prefix -uml -vserver -xenu
|
keyword -openvz -prefix -uml -vserver -xenu
|
||||||
need root
|
need root
|
||||||
|
after bootmisc
|
||||||
}
|
}
|
||||||
|
|
||||||
start()
|
start()
|
||||||
|
|||||||
4
mk/cc.mk
4
mk/cc.mk
@@ -1,7 +1,7 @@
|
|||||||
# Copyright (c) 2008 Roy Marples <roy@marples.name>
|
# Copyright (c) 2008 Roy Marples <roy@marples.name>
|
||||||
|
|
||||||
# Setup some good default CFLAGS
|
# Setup some good default CFLAGS
|
||||||
CFLAGS?= -O2
|
CFLAGS?= -O2 -g
|
||||||
|
|
||||||
# Default to using the C99 standard
|
# Default to using the C99 standard
|
||||||
CSTD?= c99
|
CSTD?= c99
|
||||||
@@ -31,3 +31,5 @@ _CC_FLAGS_SH= for f in ${_CCFLAGS}; do \
|
|||||||
done;
|
done;
|
||||||
_CC_FLAGS:= $(shell ${_CC_FLAGS_SH})
|
_CC_FLAGS:= $(shell ${_CC_FLAGS_SH})
|
||||||
CFLAGS+= ${_CC_FLAGS}
|
CFLAGS+= ${_CC_FLAGS}
|
||||||
|
|
||||||
|
include ${MK}/debug.mk
|
||||||
|
|||||||
@@ -97,13 +97,16 @@ bonding_pre_start()
|
|||||||
# finally add in slaves
|
# finally add in slaves
|
||||||
eoutdent
|
eoutdent
|
||||||
if [ -d /sys/class/net ]; then
|
if [ -d /sys/class/net ]; then
|
||||||
|
sys_bonding_path=/sys/class/net/"${IFACE}"/bonding
|
||||||
if [ -n "${primary}" ]; then
|
if [ -n "${primary}" ]; then
|
||||||
echo "+${primary}" >/sys/class/net/"${IFACE}"/bonding/slaves
|
echo "+${primary}" >$sys_bonding_path/slaves
|
||||||
echo "${primary}" >/sys/class/net/"${IFACE}"/bonding/primary
|
echo "${primary}" >$sys_bonding_path/primary
|
||||||
fi
|
fi
|
||||||
for s in ${slaves}; do
|
for s in ${slaves}; do
|
||||||
[ "${s}" = "${primary}" ] && continue
|
[ "${s}" = "${primary}" ] && continue
|
||||||
echo "+${s}" >/sys/class/net/"${IFACE}"/bonding/slaves
|
if ! grep -q ${s} $sys_bonding_path/slaves; then
|
||||||
|
echo "+${s}" >$sys_bonding_path/slaves
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
/sbin/ifenslave "${IFACE}" ${slaves} >/dev/null
|
/sbin/ifenslave "${IFACE}" ${slaves} >/dev/null
|
||||||
|
|||||||
@@ -8,60 +8,89 @@ ccwgroup_depend()
|
|||||||
before interface
|
before interface
|
||||||
}
|
}
|
||||||
|
|
||||||
ccwgroup_pre_start()
|
ccwgroup_load_modules()
|
||||||
{
|
{
|
||||||
local ccwgroup="$(_get_array "ccwgroup_${IFVAR}")"
|
# make sure we have ccwgroup support or this is a crap shoot
|
||||||
[ -z "${ccwgroup}" ] && return 0
|
|
||||||
|
|
||||||
if [ ! -d /sys/bus/ccwgroup ] ; then
|
if [ ! -d /sys/bus/ccwgroup ] ; then
|
||||||
modprobe qeth
|
modprobe -q ccwgroup
|
||||||
if [ ! -d /sys/bus/ccwgroup ] ; then
|
if [ ! -d /sys/bus/ccwgroup ] ; then
|
||||||
eerror "ccwgroup support missing in kernel"
|
eerror "ccwgroup support missing in kernel"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
einfo "Enabling ccwgroup on ${IFACE}"
|
# verify the specific interface is supported
|
||||||
local x= ccw= first= layer2=
|
if [ ! -d /sys/bus/ccwgroup/drivers/$1 ] ; then
|
||||||
for x in ${ccwgroup}; do
|
modprobe $1 >& /dev/null
|
||||||
[ -z "${first}" ] && first=${x}
|
if [ ! -d /sys/bus/ccwgroup/drivers/$1 ] ; then
|
||||||
ccw="${ccw}${ccw:+,}${x}"
|
eerror "$1 support missing in kernel"
|
||||||
done
|
return 1
|
||||||
if [ -e /sys/devices/qeth/"${first}" ]; then
|
|
||||||
echo "0" >/sys/devices/qeth/"${first}"/online
|
|
||||||
else
|
|
||||||
echo "${ccw}" >/sys/bus/ccwgroup/drivers/qeth/group
|
|
||||||
fi
|
fi
|
||||||
eval layer2=\$qeth_layer2_${IFVAR}
|
fi
|
||||||
echo "${layer2:-0}" > /sys/devices/qeth/"${first}"/layer2
|
|
||||||
echo "1" >/sys/devices/qeth/"${first}"/online
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
ccwgroup_pre_start()
|
||||||
|
{
|
||||||
|
local ccwgroup="$(_get_array "ccwgroup_${IFVAR}")"
|
||||||
|
[ -z "${ccwgroup}" ] && return 0
|
||||||
|
|
||||||
|
local ccw_type
|
||||||
|
eval ccw_type=\${ccwgroup_type_${IFVAR}:-qeth}
|
||||||
|
|
||||||
|
ccwgroup_load_modules ${ccw_type} || return 1
|
||||||
|
|
||||||
|
einfo "Enabling ccwgroup/${ccw_type} on ${IFACE}"
|
||||||
|
|
||||||
|
set -- ${ccwgroup}
|
||||||
|
local first=$1; shift
|
||||||
|
if [ -e /sys/devices/${ccw_type}/${first}/online ]; then
|
||||||
|
echo "0" >/sys/devices/${ccw_type}/${first}/online
|
||||||
|
else
|
||||||
|
echo "${first}$(printf ',%s' "$@")" >/sys/bus/ccwgroup/drivers/${ccw_type}/group
|
||||||
|
fi
|
||||||
|
|
||||||
|
local var val
|
||||||
|
for var in $(_get_array "ccwgroup_opts_${IFVAR}") online=1 ; do
|
||||||
|
val=${var#*=}
|
||||||
|
var=${var%%=*}
|
||||||
|
echo "${val}" > /sys/devices/${ccw_type}/${first}/${var}
|
||||||
|
done
|
||||||
eend $?
|
eend $?
|
||||||
}
|
}
|
||||||
|
|
||||||
ccwgroup_pre_stop()
|
ccwgroup_pre_stop()
|
||||||
{
|
{
|
||||||
|
local path="/sys/class/net/${IFACE}"
|
||||||
|
|
||||||
# Erase any existing ccwgroup to be safe
|
# Erase any existing ccwgroup to be safe
|
||||||
service_set_value ccwgroup_device ""
|
service_set_value ccwgroup_device ""
|
||||||
|
service_set_value ccwgroup_type ""
|
||||||
|
|
||||||
[ ! -L /sys/class/net/"${FACE}"/driver ] && return 0
|
[ ! -L "${path}"/device/driver ] && return 0
|
||||||
local driver="$(readlink /sys/class/net/"${IFACE}"/driver)"
|
case "$(readlink "${path}"/device/driver)" in
|
||||||
case "${diver}" in
|
|
||||||
*/bus/ccwgroup/*) ;;
|
*/bus/ccwgroup/*) ;;
|
||||||
*) return 0;;
|
*) return 0;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
local device="$(readlink /sys/class/net/"${IFACE}"/device)"
|
local device
|
||||||
|
device="$(readlink "${path}"/device)"
|
||||||
device=${device##*/}
|
device=${device##*/}
|
||||||
service_set_value ccwgroup_device "${device}"
|
service_set_value ccwgroup_device "${device}"
|
||||||
|
device="$(readlink "${path}"/device/driver)"
|
||||||
|
device=${device##*/}
|
||||||
|
service_set_value ccwgroup_type "${device}"
|
||||||
}
|
}
|
||||||
|
|
||||||
ccwgroup_post_stop()
|
ccwgroup_post_stop()
|
||||||
{
|
{
|
||||||
local device="$(service_get_value ccwgroup_device)"
|
local device="$(service_get_value ccwgroup_device)"
|
||||||
[ -z "${device}" ] && return 0
|
[ -z "${device}" ] && return 0
|
||||||
|
local ccw_type="$(service_get_value ccwgroup_type)"
|
||||||
|
|
||||||
einfo "Disabling ccwgroup on ${iface}"
|
einfo "Disabling ccwgroup/${ccw_type} on ${IFACE}"
|
||||||
echo "0" >/sys/devices/qeth/"${device}"/online
|
echo "0" >/sys/devices/${ccw_type}/"${device}"/online
|
||||||
echo "1" >/sys/devices/qeth/"${device}"/ungroup
|
echo "1" >/sys/devices/${ccw_type}/"${device}"/ungroup
|
||||||
eend $?
|
eend $?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ ifplugd_pre_start()
|
|||||||
|
|
||||||
eindent
|
eindent
|
||||||
|
|
||||||
|
# IFACE-specific, then global, then default
|
||||||
eval timeout=\$plug_timeout_${IFVAR}
|
eval timeout=\$plug_timeout_${IFVAR}
|
||||||
|
[ -z "${timeout}" ] && timeout=$plug_timeout
|
||||||
[ -z "${timeout}" ] && timeout=-1
|
[ -z "${timeout}" ] && timeout=-1
|
||||||
if [ ${timeout} -eq 0 ]; then
|
if [ ${timeout} -eq 0 ]; then
|
||||||
ewarn "WARNING: infinite timeout set for ${IFACE} to come up"
|
ewarn "WARNING: infinite timeout set for ${IFACE} to come up"
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ netplugd_pre_start()
|
|||||||
|
|
||||||
eindent
|
eindent
|
||||||
|
|
||||||
|
# IFACE-specific, then global, then default
|
||||||
eval timeout=\$plug_timeout_${IFVAR}
|
eval timeout=\$plug_timeout_${IFVAR}
|
||||||
|
[ -z "${timeout}" ] && timeout=$plug_timeout
|
||||||
[ -z "${timeout}" ] && timeout=-1
|
[ -z "${timeout}" ] && timeout=-1
|
||||||
if [ ${timeout} -eq 0 ]; then
|
if [ ${timeout} -eq 0 ]; then
|
||||||
ewarn "WARNING: infinite timeout set for ${IFACE} to come up"
|
ewarn "WARNING: infinite timeout set for ${IFACE} to come up"
|
||||||
|
|||||||
@@ -3,14 +3,13 @@
|
|||||||
|
|
||||||
udhcpc_depend()
|
udhcpc_depend()
|
||||||
{
|
{
|
||||||
program start /sbin/udhcpc
|
program start /bin/busybox
|
||||||
after interface
|
after interface
|
||||||
provide dhcp
|
provide dhcp
|
||||||
}
|
}
|
||||||
|
|
||||||
_config_vars="$_config_vars dhcp udhcpc"
|
_config_vars="$_config_vars dhcp udhcpc"
|
||||||
|
|
||||||
# WARNING:- The relies heavily on Gentoo patches and scripts for udhcpc
|
|
||||||
udhcpc_start()
|
udhcpc_start()
|
||||||
{
|
{
|
||||||
local args= opt= opts= pidfile="/var/run/udhcpc-${IFACE}.pid"
|
local args= opt= opts= pidfile="/var/run/udhcpc-${IFACE}.pid"
|
||||||
@@ -22,17 +21,22 @@ udhcpc_start()
|
|||||||
eval opts=\$dhcp_${IFVAR}
|
eval opts=\$dhcp_${IFVAR}
|
||||||
[ -z "${opts}" ] && opts=${dhcp}
|
[ -z "${opts}" ] && opts=${dhcp}
|
||||||
|
|
||||||
|
# This omits the Gentoo specific patch to busybox,
|
||||||
|
# but it creates temporary files.
|
||||||
|
# We can move this stuff to udhcpc hook script to avoid that, should we do?
|
||||||
|
local conf="/var/run/udhcpc-${IFACE}.conf"
|
||||||
|
echo -n >"$conf"
|
||||||
# Map some generic options to dhcpcd
|
# Map some generic options to dhcpcd
|
||||||
for opt in ${opts}; do
|
for opt in ${opts}; do
|
||||||
case "${opt}" in
|
case "${opt}" in
|
||||||
nodns) args="${args} --env PEER_DNS=no";;
|
nodns) echo "PEER_DNS=no" >>"$conf" ;;
|
||||||
nontp) args="${args} --env PEER_NTP=no";;
|
nontp) echo "PEER_NTP=no" >>"$conf" ;;
|
||||||
nogateway) args="${args} --env PEER_ROUTERS=no";;
|
nogateway) echo "PEER_ROUTERS=no" >>"$conf" ;;
|
||||||
nosendhost) sendhost=false;
|
nosendhost) sendhost=false;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
[ "${metric:-0}" != "0" ] && args="${args} --env IF_METRIC=${metric}"
|
[ "${metric:-0}" != "0" ] && echo "IF_METRIC=${metric}" >>"$conf"
|
||||||
|
|
||||||
ebegin "Running udhcpc"
|
ebegin "Running udhcpc"
|
||||||
|
|
||||||
@@ -51,9 +55,9 @@ udhcpc_start()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
case " ${args} " in
|
case " ${args} " in
|
||||||
*" --quit "*|*" -q "*) x="/sbin/udhcpc";;
|
*" --quit "*|*" -q "*) x="/bin/busybox udhcpc";;
|
||||||
*) x="start-stop-daemon --start --exec /sbin/udhcpc \
|
*) x="start-stop-daemon --start --exec /bin/busybox \
|
||||||
--pidfile \"${pidfile}\" --";;
|
--pidfile \"${pidfile}\" -- udhcpc";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case " ${args} " in
|
case " ${args} " in
|
||||||
@@ -68,11 +72,8 @@ udhcpc_start()
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
local script="${RC_LIBEXECDIR}"/sh/udhcpc.h
|
|
||||||
[ -x "${script}" ] || script=/lib/rcscripts/sh/udhcpc.sh
|
|
||||||
|
|
||||||
eval "${x}" "${args}" --interface="${IFACE}" --now \
|
eval "${x}" "${args}" --interface="${IFACE}" --now \
|
||||||
--script="${script}" \
|
--script="${RC_LIBEXECDIR}/sh/udhcpc-hook.sh" \
|
||||||
--pidfile="${pidfile}" >/dev/null
|
--pidfile="${pidfile}" >/dev/null
|
||||||
eend $? || return 1
|
eend $? || return 1
|
||||||
|
|
||||||
@@ -92,14 +93,18 @@ udhcpc_stop()
|
|||||||
ebegin "Stopping udhcpc on ${IFACE}"
|
ebegin "Stopping udhcpc on ${IFACE}"
|
||||||
case " ${opts} " in
|
case " ${opts} " in
|
||||||
*" release "*)
|
*" release "*)
|
||||||
start-stop-daemon --stop --quiet --oknodo --signal USR2 \
|
start-stop-daemon --stop --quiet --signal USR2 \
|
||||||
--exec /sbin/udhcpc --pidfile "${pidfile}"
|
--exec /bin/busybox --pidfile "${pidfile}"
|
||||||
if [ -f /var/cache/udhcpc-"${IFACE}".lease ]; then
|
if [ -f /var/cache/udhcpc-"${IFACE}".lease ]; then
|
||||||
rm -f /var/cache/udhcpc-"${IFACE}".lease
|
rm -f /var/cache/udhcpc-"${IFACE}".lease
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
start-stop-daemon --stop --exec /sbin/udhcpc --pidfile "${pidfile}"
|
start-stop-daemon --stop --exec /bin/busybox --pidfile "${pidfile}"
|
||||||
eend $?
|
eend $?
|
||||||
|
|
||||||
|
if [ -e "/var/run/udhcpc-${IFACE}.conf" ]; then
|
||||||
|
rm -f "/var/run/udhcpc-${IFACE}.conf"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
1
sh/.gitignore
vendored
1
sh/.gitignore
vendored
@@ -7,3 +7,4 @@ init.sh
|
|||||||
init-early.sh
|
init-early.sh
|
||||||
ifwatchd-carrier.sh
|
ifwatchd-carrier.sh
|
||||||
ifwatchd-nocarrier.sh
|
ifwatchd-nocarrier.sh
|
||||||
|
udhcpc-hook.sh
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
SRCS+= init.sh.in init-early.sh.in
|
SRCS+= init.sh.in init-early.sh.in udhcpc-hook.sh.in
|
||||||
BIN+= init-early.sh
|
BIN+= init-early.sh udhcpc-hook.sh
|
||||||
|
|
||||||
.SUFFIXES: .sh.Linux.in
|
.SUFFIXES: .sh.Linux.in
|
||||||
.sh.Linux.in.sh:
|
.sh.Linux.in.sh:
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ else
|
|||||||
# the last ecmd
|
# the last ecmd
|
||||||
for _e in ebegin eend error errorn einfo einfon ewarn ewarnn ewend \
|
for _e in ebegin eend error errorn einfo einfon ewarn ewarnn ewend \
|
||||||
vebegin veend veinfo vewarn vewend; do
|
vebegin veend veinfo vewarn vewend; do
|
||||||
eval "$_e() { local _r; @LIBEXECDIR@/bin/$_e \"\$@\"; _r=$?; \
|
eval "$_e() { local _r; @LIBEXECDIR@/bin/$_e \"\$@\"; _r=\$?; \
|
||||||
export EINFO_LASTCMD=$_e; return \$_r; }"
|
export EINFO_LASTCMD=$_e; return \$_r; }"
|
||||||
done
|
done
|
||||||
unset _e
|
unset _e
|
||||||
|
|||||||
@@ -91,6 +91,30 @@ if $mountproc; then
|
|||||||
eend $?
|
eend $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Mount tmpfs on /run when directory exists.
|
||||||
|
# /run is a new directory for storing volatile runtime data.
|
||||||
|
# Read more about /run at https://lwn.net/Articles/436012
|
||||||
|
if [ -d /run ]; then
|
||||||
|
if mountinfo -q /run; then
|
||||||
|
einfo "/run is already mounted, skipping"
|
||||||
|
else
|
||||||
|
ebegin "Mounting /run"
|
||||||
|
if ! fstabinfo --mount /run; then
|
||||||
|
mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
|
||||||
|
fi
|
||||||
|
eend $?
|
||||||
|
fi
|
||||||
|
if [ ! -d /run/lock ]; then
|
||||||
|
mkdir /run/lock
|
||||||
|
fi
|
||||||
|
if [ -d /run/lock ]; then
|
||||||
|
chown root:uucp /run/lock
|
||||||
|
chmod 0775 /run/lock
|
||||||
|
fi
|
||||||
|
elif [ -e /run ]; then
|
||||||
|
einfo "Unable to mount /run since it is not a directory"
|
||||||
|
fi
|
||||||
|
|
||||||
# Try to mount xenfs as early as possible, otherwise rc_sys() will always
|
# 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.
|
# return RC_SYS_XENU and will think that we are in a domU while it's not.
|
||||||
if grep -Eq "[[:space:]]+xenfs$" /proc/filesystems; then
|
if grep -Eq "[[:space:]]+xenfs$" /proc/filesystems; then
|
||||||
|
|||||||
@@ -16,6 +16,18 @@ sourcex()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ ! -e ${RC_SVCDIR}/softlevel ]; then
|
||||||
|
eerror "You are attempting to run an openrc service on a"
|
||||||
|
eerror "system which openrc did not boot."
|
||||||
|
eerror "You may be inside a chroot or you may have used"
|
||||||
|
eerror "another initialization system to boot this system."
|
||||||
|
eerror "In this situation, you will get unpredictable results!"
|
||||||
|
eerror
|
||||||
|
eerror "If you really want to do this, issue the following command:"
|
||||||
|
eerror "touch ${RC_SVCDIR}/softlevel"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
sourcex "@SYSCONFDIR@/init.d/functions.sh"
|
sourcex "@SYSCONFDIR@/init.d/functions.sh"
|
||||||
sourcex "@LIBEXECDIR@/sh/rc-functions.sh"
|
sourcex "@LIBEXECDIR@/sh/rc-functions.sh"
|
||||||
|
|
||||||
|
|||||||
117
sh/udhcpc-hook.sh.in
Normal file
117
sh/udhcpc-hook.sh.in
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
#!@SHELL@
|
||||||
|
# busybox udhcp setup script
|
||||||
|
|
||||||
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||||
|
|
||||||
|
peer_var()
|
||||||
|
{
|
||||||
|
[ -n "$1" ] && [ "$1" != "yes" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
update_dns()
|
||||||
|
{
|
||||||
|
peer_var "${PEER_DNS}" && return
|
||||||
|
[ -z "${domain}" ] && [ -z "${dns}" ] && return
|
||||||
|
|
||||||
|
conf="# Generated by udhcpc for ${interface}\n"
|
||||||
|
[ -n "${domain}" ] && conf="${conf}search ${domain}\n"
|
||||||
|
for i in ${dns} ; do
|
||||||
|
conf="${conf}nameserver ${i}\n"
|
||||||
|
done
|
||||||
|
if [ -x /sbin/resolvconf ] ; then
|
||||||
|
printf "${conf}" | resolvconf -a ${interface}
|
||||||
|
else
|
||||||
|
printf "${conf}" > /etc/resolv.conf
|
||||||
|
chmod 644 /etc/resolv.conf
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
update_ntp()
|
||||||
|
{
|
||||||
|
peer_var "${PEER_NTP}" && return
|
||||||
|
[ -z "${ntpsrv}" ] && return
|
||||||
|
|
||||||
|
conf="# Generated by udhcpc for interface ${interface}\n"
|
||||||
|
conf="${conf}restrict default noquery notrust nomodify\n"
|
||||||
|
conf="${conf}restrict 127.0.0.1\n"
|
||||||
|
for i in ${ntpsrv} ; do
|
||||||
|
conf="${conf}restrict ${i} nomodify notrap noquery\n"
|
||||||
|
conf="${conf}server ${i}\n"
|
||||||
|
done
|
||||||
|
conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
|
||||||
|
conf="${conf}logfile /var/log/ntp.log\n"
|
||||||
|
printf "${conf}" > /etc/ntp.conf
|
||||||
|
chmod 644 /etc/ntp.conf
|
||||||
|
}
|
||||||
|
|
||||||
|
update_hostname()
|
||||||
|
{
|
||||||
|
peer_var "${PEER_HOSTNAME}" && return
|
||||||
|
[ -z "${hostname}" ] && return
|
||||||
|
|
||||||
|
myhost="$(hostname)"
|
||||||
|
[ -z "${myhost}" ] || [ "${myhost}" = "(none)" ] && hostname "${hostname}"
|
||||||
|
}
|
||||||
|
|
||||||
|
update_interface()
|
||||||
|
{
|
||||||
|
[ -n "${broadcast}" ] && broadcast="broadcast ${broadcast}"
|
||||||
|
[ -n "${subnet}" ] && netmask="netmask ${subnet}"
|
||||||
|
[ -n "${mtu}" ] && mtu="mtu ${mtu}"
|
||||||
|
ifconfig "${interface}" ${ip} ${broadcast} ${netmask} ${mtu}
|
||||||
|
}
|
||||||
|
|
||||||
|
update_routes()
|
||||||
|
{
|
||||||
|
peer_var "${PEER_ROUTERS}" && return
|
||||||
|
|
||||||
|
if [ -n "${router}" ] ; then
|
||||||
|
metric=
|
||||||
|
[ -n "${IF_METRIC}" ] && metric="metric ${IF_METRIC}"
|
||||||
|
for i in ${router} ; do
|
||||||
|
route add default gw "${i}" ${metric} dev "${interface}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
deconfig()
|
||||||
|
{
|
||||||
|
ifconfig "${interface}" 0.0.0.0
|
||||||
|
|
||||||
|
if ! peer_var "${PEER_ROUTERS}" ; then
|
||||||
|
while route del default dev "${interface}" >& /dev/null; do
|
||||||
|
:
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! peer_var "${PEER_DNS}" ; then
|
||||||
|
[ -x /sbin/resolvconf ] && resolvconf -d "${interface}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -r "/var/run/udhcpc-${interface}.conf" ]; then
|
||||||
|
. "/var/run/udhcpc-${interface}.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
bound|renew)
|
||||||
|
update_hostname
|
||||||
|
update_interface
|
||||||
|
update_routes
|
||||||
|
update_dns
|
||||||
|
update_ntp
|
||||||
|
;;
|
||||||
|
deconfig|leasefail)
|
||||||
|
deconfig
|
||||||
|
;;
|
||||||
|
nak)
|
||||||
|
echo "nak: ${message}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "unknown option $1" >&2
|
||||||
|
echo "Usage: $0 {bound|deconfig|leasefail|nak|renew}" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
6
src/libeinfo/.gitignore
vendored
6
src/libeinfo/.gitignore
vendored
@@ -1,7 +1 @@
|
|||||||
.depend
|
|
||||||
libeinfo.o
|
|
||||||
libeinfo.So
|
|
||||||
libeinfo.a
|
|
||||||
libeinfo.so.1
|
libeinfo.so.1
|
||||||
libeinfo.so
|
|
||||||
.depend
|
|
||||||
|
|||||||
@@ -9,5 +9,4 @@ CPPFLAGS+= -I../includes
|
|||||||
MK= ../../mk
|
MK= ../../mk
|
||||||
include ${MK}/lib.mk
|
include ${MK}/lib.mk
|
||||||
include ${MK}/cc.mk
|
include ${MK}/cc.mk
|
||||||
include ${MK}/debug.mk
|
|
||||||
include ${MK}/termcap.mk
|
include ${MK}/termcap.mk
|
||||||
|
|||||||
14
src/librc/.gitignore
vendored
14
src/librc/.gitignore
vendored
@@ -1,16 +1,2 @@
|
|||||||
.depend
|
|
||||||
librc.o
|
|
||||||
librc-daemon.o
|
|
||||||
librc-depend.o
|
|
||||||
librc-misc.o
|
|
||||||
librc-stringlist.o
|
|
||||||
librc.So
|
|
||||||
librc-daemon.So
|
|
||||||
librc-depend.So
|
|
||||||
librc-misc.So
|
|
||||||
librc-stringlist.So
|
|
||||||
librc.a
|
|
||||||
librc.so.1
|
librc.so.1
|
||||||
librc.so
|
|
||||||
.depend
|
|
||||||
rc.h
|
rc.h
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ CPPFLAGS+= -I../includes
|
|||||||
MK= ../../mk
|
MK= ../../mk
|
||||||
include ${MK}/lib.mk
|
include ${MK}/lib.mk
|
||||||
include ${MK}/cc.mk
|
include ${MK}/cc.mk
|
||||||
include ${MK}/debug.mk
|
|
||||||
|
|
||||||
# Massage our header file for our dirs
|
# Massage our header file for our dirs
|
||||||
SED_CMD= -e 's:@PREFIX@:${PREFIX}:g'
|
SED_CMD= -e 's:@PREFIX@:${PREFIX}:g'
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ rc_service_exists(const char *service)
|
|||||||
}
|
}
|
||||||
librc_hidden_def(rc_service_exists)
|
librc_hidden_def(rc_service_exists)
|
||||||
|
|
||||||
#define OPTSTR ". '%s'; echo $opts"
|
#define OPTSTR ". '%s'; echo $extra_commands $extra_started_commands"
|
||||||
RC_STRINGLIST *
|
RC_STRINGLIST *
|
||||||
rc_service_extra_commands(const char *service)
|
rc_service_extra_commands(const char *service)
|
||||||
{
|
{
|
||||||
@@ -550,14 +550,16 @@ rc_service_extra_commands(const char *service)
|
|||||||
if ((fp = popen(cmd, "r"))) {
|
if ((fp = popen(cmd, "r"))) {
|
||||||
rc_getline(&buffer, &len, fp);
|
rc_getline(&buffer, &len, fp);
|
||||||
p = buffer;
|
p = buffer;
|
||||||
while ((token = strsep(&p, " "))) {
|
|
||||||
if (!commands)
|
|
||||||
commands = rc_stringlist_new();
|
commands = rc_stringlist_new();
|
||||||
|
|
||||||
|
while ((token = strsep(&p, " ")))
|
||||||
|
if (token[0] != '\0')
|
||||||
rc_stringlist_add(commands, token);
|
rc_stringlist_add(commands, token);
|
||||||
}
|
|
||||||
pclose(fp);
|
pclose(fp);
|
||||||
free(buffer);
|
free(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(cmd);
|
free(cmd);
|
||||||
return commands;
|
return commands;
|
||||||
}
|
}
|
||||||
|
|||||||
17
src/rc/.gitignore
vendored
17
src/rc/.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
.depend
|
|
||||||
version.h
|
version.h
|
||||||
rc-status
|
rc-status
|
||||||
rc-service
|
rc-service
|
||||||
@@ -56,20 +55,4 @@ mark_service_wasinactive
|
|||||||
mark_service_hotplugged
|
mark_service_hotplugged
|
||||||
mark_service_failed
|
mark_service_failed
|
||||||
rc-abort
|
rc-abort
|
||||||
checkpath.o
|
|
||||||
fstabinfo.o
|
|
||||||
mountinfo.o
|
|
||||||
start-stop-daemon.o
|
|
||||||
swclock.o
|
|
||||||
rc-applets.o
|
|
||||||
rc-depend.o
|
|
||||||
rc-logger.o
|
|
||||||
rc-misc.o
|
|
||||||
rc-plugin.o
|
|
||||||
rc-service.o
|
|
||||||
rc-status.o
|
|
||||||
rc-update.o
|
|
||||||
runscript.o
|
|
||||||
rc.o
|
|
||||||
rc
|
rc
|
||||||
.depend
|
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ LDADD+= -lutil -lrc -leinfo
|
|||||||
|
|
||||||
include ../../Makefile.inc
|
include ../../Makefile.inc
|
||||||
MK= ../../mk
|
MK= ../../mk
|
||||||
include ${MK}/debug.mk
|
|
||||||
include ${MK}/prog.mk
|
include ${MK}/prog.mk
|
||||||
include ${MK}/git.mk
|
include ${MK}/git.mk
|
||||||
include ${MK}/cc.mk
|
include ${MK}/cc.mk
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ show(RC_STRINGLIST *runlevels, bool verbose)
|
|||||||
char buffer[PATH_MAX];
|
char buffer[PATH_MAX];
|
||||||
size_t l;
|
size_t l;
|
||||||
|
|
||||||
|
rc_stringlist_sort(&services);
|
||||||
TAILQ_FOREACH(service, services, entries) {
|
TAILQ_FOREACH(service, services, entries) {
|
||||||
in = rc_stringlist_new();
|
in = rc_stringlist_new();
|
||||||
inone = false;
|
inone = false;
|
||||||
@@ -299,6 +300,7 @@ rc_update(int argc, char **argv)
|
|||||||
runlevels = rc_runlevel_list();
|
runlevels = rc_runlevel_list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc_stringlist_sort(&runlevels);
|
||||||
show (runlevels, verbose);
|
show (runlevels, verbose);
|
||||||
} else {
|
} else {
|
||||||
if (!service)
|
if (!service)
|
||||||
|
|||||||
@@ -806,7 +806,6 @@ main(int argc, char **argv)
|
|||||||
int opt;
|
int opt;
|
||||||
bool parallel;
|
bool parallel;
|
||||||
int regen = 0;
|
int regen = 0;
|
||||||
int i;
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
char *proc;
|
char *proc;
|
||||||
char *p;
|
char *p;
|
||||||
|
|||||||
@@ -1101,7 +1101,8 @@ runscript(int argc, char **argv)
|
|||||||
bool doneone = false;
|
bool doneone = false;
|
||||||
int retval, opt, depoptions = RC_DEP_TRACE;
|
int retval, opt, depoptions = RC_DEP_TRACE;
|
||||||
RC_STRING *svc;
|
RC_STRING *svc;
|
||||||
char path[PATH_MAX], lnk[PATH_MAX], *dir, *save = NULL, pidstr[10];
|
char path[PATH_MAX], lnk[PATH_MAX], *dir, *save = NULL, *save2 = NULL;
|
||||||
|
char pidstr[10];
|
||||||
size_t l = 0, ll;
|
size_t l = 0, ll;
|
||||||
const char *file;
|
const char *file;
|
||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
@@ -1133,7 +1134,8 @@ runscript(int argc, char **argv)
|
|||||||
dir = dirname(path);
|
dir = dirname(path);
|
||||||
if (strchr(lnk, '/')) {
|
if (strchr(lnk, '/')) {
|
||||||
save = xstrdup(dir);
|
save = xstrdup(dir);
|
||||||
dir = dirname(lnk);
|
save2 = xstrdup(lnk);
|
||||||
|
dir = dirname(save2);
|
||||||
if (strcmp(dir, save) == 0)
|
if (strcmp(dir, save) == 0)
|
||||||
file = basename_c(argv[1]);
|
file = basename_c(argv[1]);
|
||||||
else
|
else
|
||||||
@@ -1149,6 +1151,7 @@ runscript(int argc, char **argv)
|
|||||||
service = xstrdup(lnk);
|
service = xstrdup(lnk);
|
||||||
}
|
}
|
||||||
free(save);
|
free(save);
|
||||||
|
free(save2);
|
||||||
}
|
}
|
||||||
if (!service)
|
if (!service)
|
||||||
service = xstrdup(path);
|
service = xstrdup(path);
|
||||||
|
|||||||
Reference in New Issue
Block a user