Commit Graph

371 Commits

Author SHA1 Message Date
William Hubbs
6e2fbf6a0f Make checks for writable directory posix compliant
Reported-by: Maxim Kammerer <mk@de.su>
X-Gentoo-Bug: 398931
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=398931
2012-01-22 11:56:24 -06:00
Robin H. Johnson
380752f4e0 net: allow parameters to a single address config
In the case of a single line of configuration, where the address has
parameters, the parameters were being treated as seperate addresses.
Eg:
config_eth0="4321:0:1:2:3:4:567:89ab/64 nodad home preferred_lft 0"

Also document usage of parameters in the net example, and note that
multiple addresses on a single line cannot be mixed with parameters.
Newlines are required to seperate the addresses.

X-Gentoo-Bug: 398827
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=398827

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-13 15:57:22 -08:00
Robin H. Johnson
4255ba175b net: net.lo, lots of scripts
The program function in depend blocks is now able to search paths by
itself. If passed multiple arguments or multiple calls, at least one of
the arguments passed must be a program or a shell builtin (eg ip built
into busybox). If a qualified path is specified, only that path will be
checked, otherwise it will be checked as a builtin, then $PATH will be
checked for the named binary (via type).

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-08 16:24:10 -08:00
William Hubbs
f2e404ab66 net.lo: Add the ability to find the full path of a binary
Some of the networking tools, such as iproute2, can be stored in one of
several locations. This function gives us a standard way to find these
tools.

I would like to thankRobin Johnson <robbat2@gentoo.org> for his input on
this function.
2012-01-07 13:09:17 -06:00
William Hubbs
cd52fecc4e cgroups: turn on groups by default
The control groups we create are the ones recommended by the linux
kernel, so this should be on most of the time if cgroups are enabled in
the kernel.
2012-01-05 22:28:04 -06:00
William Hubbs
dbfcf23273 really disable /var/{lock,run} migration to /run
This needs to be disabled until we have tmpfiles.d support. The previous
method did not disable it correctly.
2012-01-05 06:55:08 -06:00
William Hubbs
6d5a2d5f9e Net: do not bring down interfaces during shutdown 2011-12-30 10:44:56 -06:00
William Hubbs
6c8e8e2a96 disable /run migration until we have /run in baselayout 2011-12-29 17:28:05 -06:00
William Hubbs
29da0c8bf0 cgroups: default the size of the tmpfs to 10 mb 2011-12-29 10:01:28 -06:00
William Hubbs
20f612080c net: use yesno to test up_before_preup 2011-12-27 17:59:39 -06:00
Robin H. Johnson
9a01f68515 net: Add up_before_preup variable for CAN devices
Historically, we have tried to up interfaces before running preup, so
that the kernel setups up the device and makes things like ethtool work
(some hardware cannot be correct probed until then). However this ends
up breaking other hardware, so a variable has been introduced to allow
the up prior to preup to be disabled: up_before_preup_IFVAR=no

X-Gentoo-Bug: 389475
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=389475
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-12-26 16:27:38 -08:00
William Hubbs
f6dc3d5ae9 cgroups: always mount the tmpfs on /sys/fs/cgroup
X-Gentoo-Bug:395079
X-Gentoo-Bug-URL:https://bugs.gentoo.org/show_bug.cgi?id=395079
2011-12-20 01:42:36 -06:00
Piotr Karbowski
3e2001f6a2 add rc_cgroup option to allow disabling of cgroup default setup
Currently, cgroups are still in development, so we are not setting them
up by default. However, this default will be changed in the future.

This commit message and patch were updated by
William Hubbs <williamh@gentoo.org>.

X-Gentoo-Bug: 395079
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=395079
2011-12-20 01:14:08 -06:00
William Hubbs
ed4605bf9f cgroups: remove references to the "openrc" cgroup
Openrc will set up cgroups the way the kernel documentation recommends.
2011-12-19 21:54:53 -06:00
William Hubbs
461c69acdb cgroups: mount cgroups suggested by the kernel documentation
The linux kernel documentation suggests mounting a separate cgroup
hierarchy for each subsystem you want to control/monitor. This changes
the cgroups mounting code to do this.
2011-12-18 13:33:27 -06:00
William Hubbs
46b96eb80d Network: start interfaces after dbus
This is needed to allow auto-connect at boot.

Reported-by: David J Cozatt <ygdrasil@comcast.net>
X-Gentoo-Bug: 390955
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=390955
2011-12-12 19:46:03 -06:00
William Hubbs
5adb3930c7 Integrate migrate-run into bootmisc
The migrate-run service was hanging when parallel startup was enabled
because of its dependencies. This integrates the logic for this service
into bootmisc, which will avoid the issues with parallel startup.

I would like to thank Robin H. Johnson <robbat2@gentoo.org> for his
input on this patch
2011-12-03 12:46:52 -06:00
William Hubbs
b628481701 migrate-run: fix ln calls and migrate directories separately
This is based on a patch submitted by AlphatPC@gmail.com.

Reported-by: AlphatPC@gmail.com
X-Gentoo-Bug: 391945
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=391945
2011-11-27 23:29:22 -06:00
William Hubbs
ab01a74405 Make migrate-run more verbose 2011-11-26 20:57:14 -06:00
Mike Frysinger
d8e739e19a urandom: move seed from /var/run to /var/lib
We want the seed to be preserved across reboots, so move it to /var/lib.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-26 13:21:54 -05:00
Mike Frysinger
3baca9a35c fsck: fix typo in fsck mount point support
Previous commit e3b39a677b missed adding a "[" to one of the tests.

Reported-by: Torsten Veller <tove@gentoo.org>
x-Gentoo-Bug: 391941
x-Gentoo-Bug-URL: http://bugs.gentoo.org/391941
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-26 03:21:21 -05:00
Mike Frysinger
cc45abb77b net.lo: fix typo in previous math commit
x-Gentoo-Bug: 391671
x-Gentoo-Bug-URL: http://bugs.gentoo.org/391671
Reported-by: Duncan <1i5t5.duncan@cox.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-23 13:17:20 -05:00
William Hubbs
17a1529416 Migrate /var/lock and /var/run to /run for linux systems 2011-11-23 07:26:05 -06:00
William Hubbs
815952a65a Revert "Revert "fsck: add the ability to specify mount points to check""
This reverts commit 5a3599df8a.

After review, I am bringing this back to the tree.
2011-11-22 12:56:29 -06:00
William Hubbs
d8bbeb184f CGroups: create the openrc cgroup hierarchy
Openrc will create a cgroup hierarchy called openrc which will have all
services it starts and all subsystems attached to it. If you need other
groups/hierarchies, please use libcgroup.
2011-11-20 14:07:46 -06:00
Mike Frysinger
ef1ff1b4f2 make shell math operations style more succulent
Convert the style:
	var=$((${var} + 1))
to:
	: $(( var += 1 ))

The latter is easier to read imo.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-19 02:25:36 -05:00
William Hubbs
0510c473d4 CGroups: /sys/fs/cgroups should be a tmpfs
The kernel documentation states that a cgroup file system should not be
mounted here, but a tmpfs.

This also means that we should not create a group for each process, but
we should allow the user to specify which group a process should be
assigned to. The rc_cgroup variable will be used for this purpose.

For more information, see /usr/src/linux/Documentation/cgroups/cgroups.txt.
2011-11-18 17:58:37 -06:00
William Hubbs
5994e55937 Deprecate the network and staticroute scripts
These scripts are not supported, and they have several major design
issues such as not being able to stop, start or allow a dependency on a
single interface.
2011-11-16 13:29:52 -06:00
William Hubbs
5a3599df8a Revert "fsck: add the ability to specify mount points to check"
This reverts commit e3b39a677b.

I misunderstood and thought this was ready to go in the tree, but it was
on a remote branch only for a review.
2011-11-06 22:06:58 -06:00
Robin H. Johnson
e3b39a677b fsck: add the ability to specify mount points to check 2011-11-06 13:58:48 -06:00
William Hubbs
5066d40ac8 Use pattern rules instead of suffix rules
Rework the makefiles to use pattern rules instead of suffix rules.
This is the preferred way to write implicit rules according to the gnu
make manual.
2011-10-29 09:43:24 -05:00
Alexey Shvetsov
b1da4dcb99 Add support for automounting configfs and cgroupfs
Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
2011-10-26 10:35:01 -05:00
Mike Frysinger
9a539ebbe1 further clean up OS differences in makefiles
No need for if() logic.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-20 14:32:37 -05:00
William Hubbs
ecf77254bb consolodate Makefiles
The tree contained many operating system specific Makefiles which were
being included in other Makefiles. This commit removes those and adds
the code to the makefiles which included them using make's conditional
processing.

X-Gentoo-Bug: 387441
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=387441
2011-10-18 03:23:00 -05:00
Mike Frysinger
9f95878bbd fix random typos
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-16 19:02:21 -04:00
William Hubbs
9175534752 Small style change 2011-10-02 12:21:17 -05:00
Christian Ruppert
c5fb64d61f Make dmesg log optional
Reported-by: Patrick <gentoo@feystorm.net>
X-Gentoo-Bug: 384485
X-Gentoo-Bug-URL: https://bugs.gentoo.org/384485
2011-09-27 18:15:08 +02:00
Christian Ruppert
930f4021b1 Add a new helper functions for _{flatten,get}_array
A new helper function (_array_helper) since both, the _flatten_array and
_get_array function share partially the same code.
We also reduce multiple whitespace to a single space, remove leading newlines
as well as skipping "empty" lines.

This makes the data returned by _{flatten,get}_array much nicer than before.
It also fixes bug 366677 where net-tools having trouble with the whitespace
mentioned above. iproute2 was not affected.

Reported-by: Andrew Maltsev <am@ejelta.com>
X-Gentoo-Bug: 366677
X-Gentoo-Bug-URL: https://bugs.gentoo.org/366677
2011-09-21 00:21:43 +02:00
Mike Frysinger
fb485366e6 procfs: simplify the binfmt_misc mount check
Replace the `mountinfo` exec with a file test of the register file
which we rely on later anyways.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-09-18 16:01:28 -04:00
Mike Frysinger
f52dca6984 procfs: drop nfsd mounting
The dedicated nfs init.d script takes care of mounting this when
necessary, and we want it there since mounting it isn't terribly
useful if you can't actually start up the nfs daemons (which the
nfs-utils package provides).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-09-18 16:01:28 -04:00
Mike Frysinger
47d305d2af procfs: load config files from binfmt.d into /proc/sys/fs/binfmt_misc/register
This is a KISS version.  Let's see where we go from here in terms of
complexity.  Maybe nowhere!

X-Gentoo-Bug: 382723
X-Gentoo-Bug-URL: https://bugs.gentoo.org/382723
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-09-18 16:01:26 -04:00
Christian Ruppert
2d180551ef Fix regex pattern for umounts during shutdown
This patch fixes the regex pattern for /lib -> /lib(32|64)?
as well as the pattern for RC_SVCDIR if it contains /lib(32|64)?/.
This fixes bug 381783.

X-Gentoo-Bug: 381783
X-Gentoo-Bug-URL: https://bugs.gentoo.org/381783
2011-09-11 18:51:29 +02:00
William Hubbs
7a6dbedf38 Mtab: fix typo
Reported-By: Helmuth Schmelzer <des-colo@hotmail.com>
X-Gentoo-Bug: 381503
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=381503
2011-09-02 01:56:41 -05:00
Yun Zheng Hu
a029dee59b Do not print "null" or "noop" when configuring an interface
Note by william hubbs:

I modified the patch to compare "null" and "noop" with $1 instead of
${config}.

Reported-by:    Yun Zheng Hu <hu@fox-it.com>
X-Gentoo-Bug: 379577
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=379577
2011-08-20 14:10:07 -05:00
William Hubbs
2330978300 Do not update mtab if it is a symbolic link
Reported-by: <junkmailnotread@yahoo.com>
X-Gentoo-Bug: 370037
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=370037
2011-08-20 12:42:24 -05:00
William Hubbs
3688c85163 swclock: select a default reference file
If $RC_SVCDIR/shutdowntime does not exist, we need a default reference
file. It is safe to use @PREFIX@/sbin/runscript for this purpose.

Reported-By: Robin H. Johnson <robbat2@gentoo.org>
X-Gentoo-Bug: 376249
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=376249
2011-07-28 09:21:29 -05:00
William Hubbs
863ef36011 mtab: fix test for a link to a location in /proc
/etc/mtab can be a link to a file in /proc. If it is, we should not
attempt to update /etc/mtab.

The original test used "! -w" as part of the test.  This does not
work since everything is writeable by root.

Thanks to Robin Johnson for the suggestion of using readlink -f and the
regular expression.

Reported-By: junkmailnotread@yahoo.com
X-Gentoo-Bug: 370037
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=370037
2011-07-26 00:45:22 -05:00
William Hubbs
05c2d68192 Mtab: fix typo 2011-07-23 16:53:16 -05:00
William Hubbs
e3b02abd7a Add warnings for the use of bash arrays
Currently, we allow the use of bash arrays for some configuration settings.
This is undocumented, so I want to remove the support from openrc.

The first phase of this removal will be this commit which adds warnings
to encourage people not to use bash arrays.

X-Gentoo-Bug: 374875
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=374875
2011-07-14 01:26:29 -05:00
Kirill Elagin
0c7032840b save and restore IFS correctly
X-Gentoo-Bug: 371141
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=371141
2011-07-07 12:23:58 -05:00