Re: [arch-general] [PATCH 1/2] kill_everything: Reduce number of -f tests

2010-09-09 Thread Victor Lowther
"Nathan Wayde" wrote: >On 09/09/10 16:19, Victor Lowther wrote: >> >> >> "Thomas Bächler" wrote: >> >>> Am 08.09.2010 06:16, schrieb Victor Lowther: >>>> On Tue, Sep 7, 2010 at 10:47 PM, Dave Reisner >>> wrote: >

Re: [arch-general] [PATCH 1/2] kill_everything: Reduce number of -f tests

2010-09-09 Thread Victor Lowther
"Thomas Bächler" wrote: >Am 08.09.2010 06:16, schrieb Victor Lowther: >> On Tue, Sep 7, 2010 at 10:47 PM, Dave Reisner >wrote: >>> Instead of checking for the existance of a file in /var/run/daemons >on >>> every iteration, handle the null case by s

Re: [arch-general] [PATCH 1/2] kill_everything: Reduce number of -f tests

2010-09-07 Thread Victor Lowther
On Tue, Sep 7, 2010 at 10:47 PM, Dave Reisner wrote: > Instead of checking for the existance of a file in /var/run/daemons on > every iteration, handle the null case by setting nullglob. The shopt > call is done inside a subshell as to not bother the environment since we > may be going to runlevel

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-09-07 Thread Victor Lowther
On Tue, Sep 7, 2010 at 10:47 PM, Dave Reisner wrote: > On Tue, Sep 07, 2010 at 10:32:28PM +0200, Thomas Bächler wrote: >> Am 30.06.2010 23:47, schrieb Victor Lowther: >> > Despite efforts to make the initscripts POSIX, we use bash 4.0 features. >> > >> > Bashif

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-09-07 Thread Victor Lowther
On Tue, Sep 7, 2010 at 3:32 PM, Thomas Bächler wrote: > Am 30.06.2010 23:47, schrieb Victor Lowther: >> Despite efforts to make the initscripts POSIX, we use bash 4.0 features. >> >> Bashifying this framework should result in about a 30% speedup, assuming no >> IO laten

Re: [arch-general] [PATCH 28/48] Use bash-style conditionals when setting up the hardware clock.

2010-09-01 Thread Victor Lowther
On Fri, Aug 20, 2010 at 2:12 AM, Kurt J. Bosch wrote: > On 2010-08-19 23:12, Victor Lowther wrote: >> >> On Aug 19, 2010 10:08 AM, "Kurt J. Bosch" >> wrote: >>> >>> On 2010-08-19 10:19, Jan de Groot wrote: >>>> >>>> On Th

Re: [arch-general] [PATCH 21/48] Both rc.single and rc.shutdown use the same code to kill everything.

2010-09-01 Thread Victor Lowther
On Wed, Sep 1, 2010 at 5:41 AM, Kurt J. Bosch wrote: > 2010-08-31 13:16, Dave Reisner: >> >> On Tue, Aug 31, 2010 at 10:07:52AM +0200, Kurt J. Bosch wrote: >>> >>> --snip-- >>> >>> I suggest: >>> >>>  From b202be97f8dc1c0c68aaea792d4457c674c673f3 Mon Sep 17 00:00:00 2001 >>> From: Kurt J. Bosch >>

Re: [arch-general] [PATCH 28/48] Use bash-style conditionals when setting up the hardware clock.

2010-08-19 Thread Victor Lowther
I like this one the best. Sent from my Nexus One. Sorry for top posting. On Aug 19, 2010 10:08 AM, "Kurt J. Bosch" wrote: > Am 2010-08-19 10:19, schrieb Jan de Groot: >> On Thu, 2010-08-19 at 00:56 -0400, Dave Reisner wrote: >>> Couldn't we avoid all this by just flipping a switch in the kernel?

Re: [arch-general] [PATCH 28/48] Use bash-style conditionals when setting up the hardware clock.

2010-08-18 Thread Victor Lowther
I am missing the difference. Diff please? Sent from my Nexus One On Aug 18, 2010 2:41 AM, "Kurt J. Bosch" wrote: > Am 2010-06-30 23:47, schrieb Victor Lowther: >> Trying to stick with POSIX syntax only just slows things down. >> --- >> rc.sysinit | 27 +++

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-08-01 Thread Victor Lowther
On Sat, Jul 31, 2010 at 11:54 AM, Thomas Bächler wrote: > Am 31.07.2010 18:44, schrieb Victor Lowther: >> On Fri, Jul 23, 2010 at 5:51 PM, Thomas Bächler wrote: >>> Am 23.07.2010 22:58, schrieb Victor Lowther: >>>> After looking over it again, you are correct -- spl

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-07-31 Thread Victor Lowther
On Fri, Jul 23, 2010 at 5:51 PM, Thomas Bächler wrote: > Am 23.07.2010 22:58, schrieb Victor Lowther: >> After looking over it again, you are correct -- split into array does >> not do The Right Thing here.  It will be easy to fix -- by the time >> you read this it wil

Re: [arch-general] [PATCH 1/4] Add skeleton for hooks support

2010-07-23 Thread Victor Lowther
On Fri, Jul 23, 2010 at 4:26 PM, Thomas Bächler wrote: > Am 23.07.2010 23:07, schrieb Victor Lowther: >> This begins work on adding some sort of hook infrastructure to pacman. >> There has been much discussion and little code that I have seen, so I figured >> I would go ahea

[arch-general] [PATCH 4/4] Add INTERRUPTED to transaction hooks support.

2010-07-23 Thread Victor Lowther
If a transaction is interrupted, the hooks need to know so that they can roll back anything that needs to be rolled back. --- lib/libalpm/trans.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index ed26aa6..d212f50 100644 --- a/l

[arch-general] [PATCH 3/4] Add a PKGBUILD for easy testing.

2010-07-23 Thread Victor Lowther
We don't need the whole usual pkgbuild, but having one in the git tree sure makes testing simpler. --- PKGBUILD | 60 1 files changed, 60 insertions(+), 0 deletions(-) diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0

[arch-general] [PATCH 1/4] Add skeleton for hooks support

2010-07-23 Thread Victor Lowther
This begins work on adding some sort of hook infrastructure to pacman. There has been much discussion and little code that I have seen, so I figured I would go ahead an implement a very basic skeleton for transaction hooks support. --- lib/libalpm/Makefile.am |1 + lib/libalpm/{sync.h

[arch-general] [PATCH 2/4] Add very basic transaction hooks to alpm.

2010-07-23 Thread Victor Lowther
libalpm compliant programs now support running pre-commit and post-commit hooks. Currently, the implementation is as simple as I can make it -- if /etc/pacman.d/hooks.d/transact.sh exists, it will be run with the 'pre-commit' parameter just before a transaction is committed, and it will be run wit

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-07-23 Thread Victor Lowther
On Fri, Jul 23, 2010 at 7:29 AM, Thomas Bächler wrote: > Am 17.07.2010 16:24, schrieb Victor Lowther: >>> Sorry for taking so long. Apart from squashing the trivial >>> bashifications, all patches I didn't comment on are ACKed. >> >> That is cool.  I went a

Re: [arch-general] Keep older kernel intact while upgrading to new kernel

2010-07-17 Thread Victor Lowther
On Sat, 2010-07-17 at 10:42 -0500, Thomas Dziedzic wrote: > On Sat, Jul 17, 2010 at 10:38 AM, Victor Lowther > wrote: > > On Sat, 2010-07-17 at 23:10 +0800, Ng Oon-Ee wrote: > >> On Sat, 2010-07-17 at 09:17 -0500, Victor Lowther wrote: > >> > On Sat, 2010-07-1

Re: [arch-general] Keep older kernel intact while upgrading to new kernel

2010-07-17 Thread Victor Lowther
On Sat, 2010-07-17 at 23:10 +0800, Ng Oon-Ee wrote: > On Sat, 2010-07-17 at 09:17 -0500, Victor Lowther wrote: > > On Sat, 2010-07-17 at 18:05 +0400, Евгений Борисов wrote: > > > I think it's a bad idea, because the directory /lib/modules/$oldVersion$ > > > wil

Re: [arch-general] [PATCH 43/48] Add a PKGBUILD for building initscripts-git for testing.

2010-07-17 Thread Victor Lowther
On Sat, 2010-07-17 at 16:34 +0200, Thomas Bächler wrote: > Am 17.07.2010 16:13, schrieb Victor Lowther: > > Why do you think a .gitignore patch is needed? Unless someone does > > something silly like adding the tarball to the git repo git will ignore > > it anyways. >

Re: [arch-general] Keep older kernel intact while upgrading to new kernel

2010-07-17 Thread Victor Lowther
Bq0LLxHmqe5N8C79VzGV8V2RSu/B6qsmzjO3f98xd2E+ev4Etd8YGOV5vvU > > pkKu+UOeDEubFrX75L1/802wTIfO5DI21VaLpRKD/+JJ2R2rTa1Bk2HmTF5DWmoh > > mpVXOydJyIXNeu2BVUemjn4TK2t6IGs22yCI107F5uD3SV1ZtpavsZ3xZCav3e6B > > x2R8C2NCF/r3BnVE3BYh9AlX617/F03hCQPOKMyXjLnMylrVvfkxMM1Q9kW97pcl > > nGR+1YUbNgTnaylyls2dOp4UAwzALcCDVwq9oJnitTcR6f/OlIH6ELUtX0gvUUU= > > =t+0W > > -END PGP SIGNATURE- > > -- Victor Lowther LPIC2 UCP RHCE

Re: [arch-general] [PATCH 43/48] Add a PKGBUILD for building initscripts-git for testing.

2010-07-17 Thread Victor Lowther
On Fri, 2010-07-16 at 14:06 +0200, Thomas Bächler wrote: > Am 30.06.2010 23:47, schrieb Victor Lowther: > > This builds straight out of a git checkout. > > --- > > PKGBUILD | 23 +++ > > 1 files changed, 23 insertions(+), 0 deletions(-) >

Re: [arch-general] [PATCH 44/48] Save error messages to /dev/tty9.

2010-07-17 Thread Victor Lowther
On Fri, 2010-07-16 at 14:09 +0200, Thomas Bächler wrote: > Am 30.06.2010 23:47, schrieb Victor Lowther: > > --- > > functions |4 > > 1 files changed, 4 insertions(+), 0 deletions(-) > > > > diff --git a/functions b/functions > > index 9ec8

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-07-11 Thread Victor Lowther
On Sun, Jul 11, 2010 at 1:11 PM, Thomas Bächler wrote: > Am 11.07.2010 15:12, schrieb Victor Lowther: >> On Sun, 2010-07-11 at 14:26 +0200, Thomas Bächler wrote: >>> Am 11.07.2010 14:20, schrieb Victor Lowther: >>>> Going back through and rewriting the patch serie

Re: [arch-general] [PATCH 1/1] Make umounting filesystems much more paranoid.

2010-07-11 Thread Victor Lowther
On Jul 11, 2010, at 10:34 AM, Dieter Plaetinck wrote: fwiw in AIF I do something similar (see http://github.com/Dieterbe/aif/blob/master/src/core/libs/lib-blockdevices-filesystems.sh#L457 ) (but there i use a text file containing all mountpoints) The interesting thing is, to find the order

[arch-general] [PATCH 1/1] Make umounting filesystems much more paranoid.

2010-07-11 Thread Victor Lowther
In addition to just umounting filesystems, we also try to tear down volume groups, crypt mappings, and loopback devices. We skip /, /proc, /sys, and /dev when umounting filesystems. We do all of the above in a loop, escalating how forcible we are in umounting filesystems up to the point where

[arch-general] [PATCH 2/2] Add daemon-functions to install.sh

2010-07-11 Thread Victor Lowther
--- install.sh |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/install.sh b/install.sh index 2b2cbbc..122d4a2 100755 --- a/install.sh +++ b/install.sh @@ -14,7 +14,10 @@ done install -D -m755 adjtime.cron ${DESTDIR}/etc/cron.hourly/adjtime -install -D -m644 functi

[arch-general] [PATCH 1/2] Add daemon-functions to the initscripts package.

2010-07-11 Thread Victor Lowther
This file encapsulates most common rc.d daemon script idioms, and should allow most of then to be about 6 lines long (not including whitespace) Using it will require some modifications to the /etc/conf.d files, as the generic functions expect all daemon options to be in $OPTS Among other things,

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-07-11 Thread Victor Lowther
On Sun, 2010-07-11 at 14:26 +0200, Thomas Bächler wrote: > Am 11.07.2010 14:20, schrieb Victor Lowther: > > Going back through and rewriting the patch series to do that will be > > jsut about as much effort as creating the original one was. If I had > > know that was what y

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-07-11 Thread Victor Lowther
On Sun, Jul 11, 2010 at 4:45 AM, Thomas Bächler wrote: > First of all: Sorry that I haven't finished the review, I have been busy > with work and the heat kept me from thinking clearly. > > Am 07.07.2010 06:25, schrieb Dan McGee: >> On Tue, Jul 6, 2010 at 11:03 PM, Allan McRae wrote: >>> Here is

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-07-07 Thread Victor Lowther
On Jul 6, 2010, at 11:25 PM, Dan McGee wrote: If there was one thing I wasn't so fond of in these patches, it seemed like there were too many. Some people like larger patches, some like smaller ones. It is easier to merge smaller ones together than it is to split larger ones apart. The be

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-07-07 Thread Victor Lowther
|| continue eval nspo=("${line%#*}") >Also another: >+if [[ $USELVM =~ yes|YES >-> ${USELVM,,} == yes > > > bashify bringing up the loopback adaptor. >Add a commit message as that is doing a lot more than bashifing. Already fixed in the last round of rebasing. > Bashify locale setting. >$LOCALE =~ utf|UTF > > > Allan -- Victor Lowther LPIC2 UCP RHCE

Re: [arch-general] Bashification of initscripts for moderate speedup

2010-07-03 Thread Victor Lowther
On Sun, 2010-06-27 at 22:10 -0500, Victor Lowther wrote: > I have spent some time over the last month or so rewriting the Arch > initscripts in idiomatic bash -- since they rely on bash-specific > features, trying to keep them fairly POSIX is rather a waste of time and > a net perf

Re: [arch-general] Bashification of initscripts for moderate speedup

2010-07-02 Thread Victor Lowther
On Jul 2, 2010, at 10:35 AM, "Kurt J. Bosch" > wrote: 2010-06-28 05:10, Victor Lowther: You can browse changes I have made in the git repo @ http://git.fnordovax.org/arch-initscripts/log/?h=bashification The feed link appears broken to me. type='application/atom+xml'

Re: [arch-general] [PATCH 45/48] Sleep instead of rebooting or shutting down when debugging initscripts

2010-07-02 Thread Victor Lowther
On Fri, 2010-07-02 at 11:56 +0200, Kurt J. Bosch wrote: > Am 2010-06-30 23:47, schrieb Victor Lowther: > > --- > > functions |2 +- > > rc.shutdown |3 +++ > > 2 files changed, 4 insertions(+), 1 deletions(-) > > > > diff --git a/functions

Re: [arch-general] [PATCH 44/48] Save error messages to /dev/tty9.

2010-07-02 Thread Victor Lowther
On Jul 2, 2010, at 4:48 AM, "Kurt J. Bosch" temp-2...@alpenjodel.de> wrote: Am 2010-06-30 23:47, schrieb Victor Lowther: --- functions |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/functions b/functions index 9ec8b5e..f1dce8a 100644 --- a/fu

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-07-01 Thread Victor Lowther
On Thu, 2010-07-01 at 22:58 -0400, Caleb Cushing wrote: > On Wed, Jun 30, 2010 at 6:07 PM, Victor Lowther > wrote: > >> I don't see the need for this patch. functions is not supposed to be > >> executed standalone, it is only source'd from bash scripts. > &g

Re: [arch-general] [PATCH 14/48] Fix whitespace errors I introduced.

2010-07-01 Thread Victor Lowther
> rebase -i on the remote and flatten squash this patch into the patch > the problem was introduced in. /me nods Just waiting for any other things Thomas wants fixed up. -- Victor Lowther LPIC2 UCP RHCE

Re: [arch-general] [PATCH 35/48] find has a builtin delete action. Use it instead of exec'ing rm.

2010-06-30 Thread Victor Lowther
On Wed, Jun 30, 2010 at 5:32 PM, Thomas Bächler wrote: > Am 30.06.2010 23:58, schrieb Daenyth Blank: >> On Wed, Jun 30, 2010 at 17:47, Victor Lowther >> wrote: >>> --- >>>  rc.sysinit |    2 +- >>>  1 files changed, 1 insertions(+), 1 deletions(-) &g

Re: [arch-general] [PATCH 04/48] Use [[ ]] instead of [ ] for conditional checking when running in bash.

2010-06-30 Thread Victor Lowther
On Thu, 2010-07-01 at 00:24 +0200, bardo wrote: > 2010/7/1 Daenyth Blank : > > On Wed, Jun 30, 2010 at 17:56, Thomas Bächler wrote: > >> Am 30.06.2010 23:47, schrieb Victor Lowther: > >>> It is worth 10 - 30% speedup whenever you want to compare something. > >

Re: [arch-general] [PATCH 32/48] Rewrite /etc/crypttab processing.

2010-06-30 Thread Victor Lowther
On Thu, 2010-07-01 at 00:16 +0200, Thomas Bächler wrote: > Am 30.06.2010 23:47, schrieb Victor Lowther: > > Split out reading /etc/crypttab and procssing the individual lines into > > their own helper functions, and bashify the resulting shorter code. > > > > Process

Re: [arch-general] [PATCH 30/48] bashify bringing up the loopback adaptor.

2010-06-30 Thread Victor Lowther
On Thu, 2010-07-01 at 00:13 +0200, Thomas Bächler wrote: > Am 30.06.2010 23:47, schrieb Victor Lowther: > > --- > > rc.sysinit |9 - > > 1 files changed, 4 insertions(+), 5 deletions(-) > > > > diff --git a/rc.sysinit b/rc.sysinit > >

Re: [arch-general] [PATCH 08/48] Slightly simplify hook-running infrastructure.

2010-06-30 Thread Victor Lowther
On Thu, 2010-07-01 at 00:00 +0200, Thomas Bächler wrote: > Am 30.06.2010 23:47, schrieb Victor Lowther: > > Go ahead and declare add_hook and run_hook as readonly functions > > to prevent hooks from overwriting them. Too bad bash does not have > > lexically scoped variab

Re: [arch-general] [PATCH 35/48] find has a builtin delete action. Use it instead of exec'ing rm.

2010-06-30 Thread Victor Lowther
On Wed, 2010-06-30 at 17:58 -0400, Daenyth Blank wrote: > On Wed, Jun 30, 2010 at 17:47, Victor Lowther > wrote: > > --- > > rc.sysinit |2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/rc.sysinit b/rc.sysinit > &g

Re: [arch-general] [PATCH 05/48] a little creative parameter expansion simplifies stat_die()

2010-06-30 Thread Victor Lowther
uot; = "" ] || retval=$1 > > stat_fail > > - exit $retval > > + exit ${1:-1} > > } > > > > status() { > > Okay, this is certainly nicer than before. > -- Victor Lowther LPIC2 UCP RHCE

Re: [arch-general] [PATCH 04/48] Use [[ ]] instead of [ ] for conditional checking when running in bash.

2010-06-30 Thread Victor Lowther
On Wed, 2010-06-30 at 23:56 +0200, Thomas Bächler wrote: > Am 30.06.2010 23:47, schrieb Victor Lowther: > > It is worth 10 - 30% speedup whenever you want to compare something. > > Where do you get this from? I always used [ ], and I found it > sufficient. Why is [[ ]] faster

Re: [arch-general] [PATCH 01/48] Bashification of initscripts

2010-06-30 Thread Victor Lowther
On Wed, 2010-06-30 at 23:55 +0200, Thomas Bächler wrote: > Am 30.06.2010 23:47, schrieb Victor Lowther: > > Despite efforts to make the initscripts POSIX, we use bash 4.0 features. > > > > Bashifying this framework should result in about a 30% speedup, assuming no > &

[arch-general] [PATCH 19/48] Simplify daemon-killing loops in rc.single.

2010-06-30 Thread Victor Lowther
Parsing the output of ls is Bad, especially when globbing works just as well and does not get confused by odd characters in filenames. bash has arithemetic for loops. Use them instead of while loops for iterating over arrays. --- rc.single | 29 - 1 files changed, 12

[arch-general] [PATCH 41/48] Bashify netfs

2010-06-30 Thread Victor Lowther
--- netfs |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/netfs b/netfs index cdfdf98..d4a926f 100755 --- a/netfs +++ b/netfs @@ -12,8 +12,7 @@ case "$1" in /bin/mount -a -t nfs,nfs4,smbfs,codafs,ncpfs,cifs,shfs,glusterfs,fuse,fuseblk,fuse.glusterfs

[arch-general] [PATCH 21/48] Both rc.single and rc.shutdown use the same code to kill everything.

2010-06-30 Thread Victor Lowther
Move that shared code into functions. --- functions | 29 + rc.shutdown | 32 +--- rc.single | 27 +-- 3 files changed, 31 insertions(+), 57 deletions(-) diff --git a/functions b/functions index d8e8e54..bf6

[arch-general] [PATCH 11/48] Replace if statement with parameter expansion.

2010-06-30 Thread Victor Lowther
${foo:+-p ${foo}} expands to nothing if foo is not set, -p $foo if foo is set. --- functions |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/functions b/functions index 8aaee68..56c6a7b 100644 --- a/functions +++ b/functions @@ -262,11 +262,8 @@ set_consolefont() {

[arch-general] [PATCH 48/48] Trivial bashification of network

2010-06-30 Thread Victor Lowther
--- network | 70 +++--- 1 files changed, 31 insertions(+), 39 deletions(-) diff --git a/network b/network index 40f1a90..20ff9c7 100755 --- a/network +++ b/network @@ -9,17 +9,15 @@ done ifup() { -if [ "$1" = "" ]; then +if [[

[arch-general] [PATCH 32/48] Rewrite /etc/crypttab processing.

2010-06-30 Thread Victor Lowther
Split out reading /etc/crypttab and procssing the individual lines into their own helper functions, and bashify the resulting shorter code. Processing this file is still ugly, though. :( --- functions | 43 +-- rc.shutdown | 36 + rc.sysinit | 131 +

[arch-general] [PATCH 18/48] Bashify conditional checking in rc.single.

2010-06-30 Thread Victor Lowther
--- rc.single | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rc.single b/rc.single index f986a2a..aa58b4c 100755 --- a/rc.single +++ b/rc.single @@ -8,10 +8,10 @@ run_hook single_start -if [ "$PREVLEVEL" != "N" ]; then +if [[ $PREVLEVEL != N ]]; then

[arch-general] [PATCH 30/48] bashify bringing up the loopback adaptor.

2010-06-30 Thread Victor Lowther
--- rc.sysinit |9 - 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 1d16224..31636e5 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -113,13 +113,12 @@ fi run_hook sysinit_udevsettled # bring up the loopback interface -if [ -d /sys/class/ne

[arch-general] [PATCH 39/48] Flatten adding persistent rules.

2010-06-30 Thread Victor Lowther
--- rc.sysinit | 16 ++-- 1 files changed, 6 insertions(+), 10 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index c6ed35f..ac32fca 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -342,16 +342,12 @@ fi set_consolefont # Adding persistent network/cdrom generated rules -if [ -f "/

[arch-general] [PATCH 29/48] Bashify module loading in rc.sysinit.

2010-06-30 Thread Victor Lowther
--- rc.sysinit | 16 +++- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index f3e60b7..1d16224 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -92,16 +92,14 @@ if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then fi # Load modules from the MODU

[arch-general] [PATCH 35/48] find has a builtin delete action. Use it instead of exec'ing rm.

2010-06-30 Thread Victor Lowther
--- rc.sysinit |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 319ea60..037a9f2 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -277,7 +277,7 @@ stat_busy "Removing Leftover Files" /bin/rm -f /var/lock/* &>/dev/null /bin/rm -rf /tmp/* /tmp/.* &

[arch-general] [PATCH 46/48] Bashify adjtime.cron

2010-06-30 Thread Victor Lowther
--- adjtime.cron | 16 +++- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/adjtime.cron b/adjtime.cron index b1c8950..a876506 100755 --- a/adjtime.cron +++ b/adjtime.cron @@ -4,14 +4,12 @@ . /etc/rc.conf HWCLOCK_PARAMS="--adjust" -if [ "$HARDWARECLOCK" = "UTC" ];

[arch-general] [PATCH 44/48] Save error messages to /dev/tty9.

2010-06-30 Thread Victor Lowther
--- functions |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/functions b/functions index 9ec8b5e..f1dce8a 100644 --- a/functions +++ b/functions @@ -4,6 +4,10 @@ # width: +grep -q initdebug && { +exec 2>/dev/tty9 +} + STAT_COL=80 if [[ ! -t 1 ]]; then U

[arch-general] [PATCH 27/48] Start tightening up rc.sysinit.

2010-06-30 Thread Victor Lowther
--- rc.sysinit | 21 - 1 files changed, 8 insertions(+), 13 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index c62ae8d..29adeca 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -17,12 +17,9 @@ printsep run_hook sysinit_start # mount /proc, /sys and our RAM /dev -if ! /bi

[arch-general] [PATCH 22/48] Use parameter expansion instead of dirname.

2010-06-30 Thread Victor Lowther
--- rc.shutdown |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index ef9b16d..cc39030 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -23,7 +23,7 @@ kill_everything stat_busy "Saving Random Seed" RANDOM_SEED=/var/lib/misc/random-seed -[ -d $(d

[arch-general] [PATCH 45/48] Sleep instead of rebooting or shutting down when debugging initscripts

2010-06-30 Thread Victor Lowther
--- functions |2 +- rc.shutdown |3 +++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/functions b/functions index f1dce8a..2c80a59 100644 --- a/functions +++ b/functions @@ -4,7 +4,7 @@ # width: -grep -q initdebug && { +grep -q initdebug /proc/cmdline && { exe

[arch-general] [PATCH 26/48] Clean up whitespace errors.

2010-06-30 Thread Victor Lowther
--- rc.shutdown | 28 ++-- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index 7d5ec26..e823ed2 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -42,7 +42,7 @@ if [[ $TIMEZONE && -e /usr/share/zoneinfo/$TIMEZONE ]]; then fi HW

[arch-general] [PATCH 23/48] Clean up entropy pool saving and system clock saving.

2010-06-30 Thread Victor Lowther
--- rc.shutdown | 22 +- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index cc39030..b2278b6 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -27,8 +27,8 @@ RANDOM_SEED=/var/lib/misc/random-seed : > $RANDOM_SEED /bin/chmod 0600 $RAN

[arch-general] [PATCH 16/48] Change the daemon running loop to use a case statement.

2010-06-30 Thread Victor Lowther
This is shorter and easier to read. --- rc.multi | 12 +--- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/rc.multi b/rc.multi index 46c18df..ec6fda6 100755 --- a/rc.multi +++ b/rc.multi @@ -13,13 +13,11 @@ run_hook multi_start # Start daemons for daemon in "${daemo..

[arch-general] [PATCH 28/48] Use bash-style conditionals when setting up the hardware clock.

2010-06-30 Thread Victor Lowther
Trying to stick with POSIX syntax only just slows things down. --- rc.sysinit | 27 +++ 1 files changed, 11 insertions(+), 16 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 29adeca..f3e60b7 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -44,27 +44,22 @@ fi HWCLO

[arch-general] [PATCH 25/48] Bashify poweroff or reboot code in rc.shutdown.

2010-06-30 Thread Victor Lowther
--- rc.shutdown |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index b7b7d45..7d5ec26 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -108,15 +108,14 @@ stat_done run_hook shutdown_poweroff # Power off or reboot -if [ "$RUNLEVEL" = "0" ];

[arch-general] [PATCH 24/48] Flatten LVM deactivation if block in rc.shutdown.

2010-06-30 Thread Victor Lowther
--- rc.shutdown | 52 +++- 1 files changed, 23 insertions(+), 29 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index b2278b6..b7b7d45 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -65,7 +65,7 @@ stat_busy "Unmounting Filesystems" stat_done

[arch-general] [PATCH 33/48] Bashified fscking.

2010-06-30 Thread Victor Lowther
--- rc.sysinit | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index d54b9bb..91ee03a 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -181,7 +181,7 @@ fi status "Mounting Root Read-only" /bin/mount -n -o remount,ro / FORCEFSCK= -[ -f /forc

[arch-general] [PATCH 17/48] Quote daemon names.

2010-06-30 Thread Victor Lowther
Someday, someone may have a daemon name with a space in it. --- rc.multi |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rc.multi b/rc.multi index ec6fda6..660f649 100755 --- a/rc.multi +++ b/rc.multi @@ -15,8 +15,8 @@ run_hook multi_start for daemon in "${daemo...@]}"

[arch-general] [PATCH 34/48] Bashify clock and timezone handling in rc.sysinit

2010-06-30 Thread Victor Lowther
--- rc.sysinit |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 91ee03a..319ea60 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -243,13 +243,13 @@ stat_done status "Activating Swap" /sbin/swapon -a stat_busy "Configuring System Clock" -if [

[arch-general] [PATCH 42/48] Load conf files in a loop instead of one at a time.

2010-06-30 Thread Victor Lowther
--- network | 11 +++ 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/network b/network index 977e81e..242acc3 100755 --- a/network +++ b/network @@ -3,14 +3,9 @@ . /etc/rc.conf . /etc/rc.d/functions -# wireless settings -[ -f /etc/conf.d/wireless ] && . /etc/conf.d/wi

[arch-general] [PATCH 43/48] Add a PKGBUILD for building initscripts-git for testing.

2010-06-30 Thread Victor Lowther
This builds straight out of a git checkout. --- PKGBUILD | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000..79b3403 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,23 @@ +pkgname=initscripts-git +pkgver=$(

[arch-general] [PATCH 31/48] Simplify test to see if we should assemble arrays at startup

2010-06-30 Thread Victor Lowther
--- rc.sysinit |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 31636e5..404e11a 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -123,7 +123,7 @@ if [[ -d /sys/class/net/lo ]]; then fi # If necessary, find md devices and manually assemble RAID

[arch-general] [PATCH 40/48] Bashify waiting for the clock pid.

2010-06-30 Thread Victor Lowther
--- rc.sysinit |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index ac32fca..1ecfc3f 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -352,7 +352,7 @@ done /bin/dmesg >| /var/log/dmesg.log # final hwclock setting needs to be done at this point -if

[arch-general] [PATCH 38/48] Bashify locale setting.

2010-06-30 Thread Victor Lowther
--- rc.sysinit | 16 ++-- 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 5842a57..c6ed35f 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -303,12 +303,12 @@ status "Updating Module Dependencies" /sbin/depmod -A : >| /etc/profile.d/locale.sh

[arch-general] [PATCH 36/48] Bashify setting the random seed.

2010-06-30 Thread Victor Lowther
--- rc.sysinit |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 037a9f2..217dacf 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -265,7 +265,7 @@ fi stat_done RANDOM_SEED=/var/lib/misc/random-seed -if [ -f $RANDOM_SEED ]; then +if [[ -f $RANDO

[arch-general] [PATCH 37/48] Bashify hostname and nisdomainnname setting.

2010-06-30 Thread Victor Lowther
--- rc.sysinit | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 217dacf..5842a57 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -287,14 +287,14 @@ stat_done #status "Updating Shared Library Links" /sbin/ldconfig -if [ "$HOSTNAME" !=

[arch-general] [PATCH 20/48] Shorten domainname and rc.local.shutdown conditional execution.

2010-06-30 Thread Victor Lowther
--- rc.shutdown |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index 4eb29cc..002a45d 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -16,13 +16,9 @@ printhl "Initiating Shutdown..." echo " " # avoid NIS hanging syslog-ng on shutdown by

[arch-general] [PATCH 13/48] Make sourcing functions.d files a tiny bit shorter and faster.

2010-06-30 Thread Victor Lowther
--- functions |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/functions b/functions index 9730150..9c89ea1 100644 --- a/functions +++ b/functions @@ -278,9 +278,7 @@ EOF # Source additional functions at the end to allow overrides for f in /etc/rc.d/functions.d/*; do

[arch-general] [PATCH 15/48] Bashify conditional checking in rc.multi

2010-06-30 Thread Victor Lowther
--- rc.multi |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rc.multi b/rc.multi index a7ea703..46c18df 100755 --- a/rc.multi +++ b/rc.multi @@ -9,12 +9,12 @@ run_hook multi_start # Load sysctl variables if sysctl.conf is present -[ -r /etc/sysctl.conf ] && /sbi

[arch-general] [PATCH 14/48] Fix whitespace errors I introduced.

2010-06-30 Thread Victor Lowther
--- functions |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/functions b/functions index 9c89ea1..d8e8e54 100644 --- a/functions +++ b/functions @@ -170,7 +170,7 @@ start_daemon() { ck_depends() { for daemon in "$@"; do - ck_daemon "$daemon" && start_da

[arch-general] [PATCH 08/48] Slightly simplify hook-running infrastructure.

2010-06-30 Thread Victor Lowther
Go ahead and declare add_hook and run_hook as readonly functions to prevent hooks from overwriting them. Too bad bash does not have lexically scoped variables -- if it does, we could do the same with the hook_funcs associative array. --- functions | 49 ++

[arch-general] [PATCH 12/48] Replace slightly too long echo staement with a here document.

2010-06-30 Thread Victor Lowther
This adds a line, but making things more readable is worth it. --- functions | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/functions b/functions index 56c6a7b..9730150 100644 --- a/functions +++ b/functions @@ -265,12 +265,13 @@ set_consolefont() { /usr

[arch-general] [PATCH 09/48] If $CONSOLEFONT is not declared, then just return out of set_consolefont.

2010-06-30 Thread Victor Lowther
We do this early so that the entire body of the function is not in an if block. --- functions | 37 ++--- 1 files changed, 18 insertions(+), 19 deletions(-) diff --git a/functions b/functions index d9f55fa..f954737 100644 --- a/functions +++ b/functions @@ -257,2

[arch-general] [PATCH 10/48] Replace trivial use of grep with bash regex conditional.

2010-06-30 Thread Victor Lowther
Bash has regex support, and it allows us to replace most trivial uses of sed, grep, and awk. The fewer processes we create, the faster we go, and every little bit helps. I also think it is more readable to use a bash regex for the trivial stuff. --- functions |4 +--- 1 files changed, 1 inse

[arch-general] [PATCH 05/48] a little creative parameter expansion simplifies stat_die()

2010-06-30 Thread Victor Lowther
--- functions |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/functions b/functions index 9b348b7..0acdbbf 100644 --- a/functions +++ b/functions @@ -57,7 +57,7 @@ if [[ $USECOLOR = YES || $USECOLOR = yes ]]; then C_CLEAR="\033[1;0m" fi -if [ -t 1 ]; then +

[arch-general] [PATCH 07/48] Simplify in_array.

2010-06-30 Thread Victor Lowther
All that extra checking for the first character being @ is not needed, simple parameter expansion will trim it off if it is there. --- functions | 18 +++--- 1 files changed, 7 insertions(+), 11 deletions(-) diff --git a/functions b/functions index 9d0aec3..8bbdfc6 100644 --- a/func

[arch-general] [PATCH 06/48] Clean up status() function.

2010-06-30 Thread Victor Lowther
Calling your args with $* will do nasty things if any of your args has a space in it. "$@" will always do The Right Thing. Just test the command directly, don't run it and then grab its exit value. --- functions |8 +++- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/func

[arch-general] [PATCH 01/48] Bashification of initscripts

2010-06-30 Thread Victor Lowther
Despite efforts to make the initscripts POSIX, we use bash 4.0 features. Bashifying this framework should result in about a 30% speedup, assuming no IO latency and that all programs we call also take zero time. :) --- functions |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --g

[arch-general] [PATCH 04/48] Use [[ ]] instead of [ ] for conditional checking when running in bash.

2010-06-30 Thread Victor Lowther
It is worth 10 - 30% speedup whenever you want to compare something. --- functions |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/functions b/functions index 6df8c5e..9b348b7 100644 --- a/functions +++ b/functions @@ -40,7 +40,7 @@ unset TERM_COLORS unset TZ # colors

[arch-general] [PATCH 02/48] Tighten up the console size finding code a bit.

2010-06-30 Thread Victor Lowther
--- functions | 30 +- 1 files changed, 13 insertions(+), 17 deletions(-) diff --git a/functions b/functions index 023de35..a9acf6f 100644 --- a/functions +++ b/functions @@ -5,26 +5,21 @@ # width: STAT_COL=80 -if [ ! -t 1 ]; then - USECOLOR="" - -# stty will fa

[arch-general] [PATCH 03/48] Simplify the code that clears USECOLOR.

2010-06-30 Thread Victor Lowther
--- functions | 21 +++-- 1 files changed, 7 insertions(+), 14 deletions(-) diff --git a/functions b/functions index a9acf6f..6df8c5e 100644 --- a/functions +++ b/functions @@ -13,7 +13,7 @@ elif [[ -t 0 ]]; then # stty gives "rows cols"; strip the rows number, we just want

Re: [arch-general] Bashification of initscripts for moderate speedup

2010-06-30 Thread Victor Lowther
On Jun 30, 2010, at 12:40 PM, Thomas Bächler wrote: Am 28.06.2010 05:10, schrieb Victor Lowther: I have spent some time over the last month or so rewriting the Arch initscripts in idiomatic bash -- since they rely on bash-specific features, trying to keep them fairly POSIX is rather a waste

Re: [arch-general] Bashification of initscripts for moderate speedup

2010-06-29 Thread Victor Lowther
On Jun 28, 2010, at 11:36 AM, Isaac Dupree > wrote: On 06/28/10 09:35, Victor Lowther wrote: On Jun 28, 2010, at 7:42 AM, Caleb Cushing wrote: On Sun, Jun 27, 2010 at 11:10 PM, Victor Lowther wrote: Questions, comments, flames, etc. welcome. why go this way instead of the ot

Re: [arch-general] Bashification of initscripts for moderate speedup

2010-06-29 Thread Victor Lowther
On Jun 29, 2010, at 9:27 AM, Dan McGee wrote: On Tue, Jun 29, 2010 at 8:20 AM, Victor Lowther wrote: On Jun 29, 2010, at 5:55 AM, solsTiCe d'Hiver > wrote: Le lundi 28 juin 2010 à 17:55 +0200, Lukáš Jirkovský a écrit : Actually I see the point of doing this. Arch is

Re: [arch-general] Bashification of initscripts for moderate speedup

2010-06-29 Thread Victor Lowther
I have uploaded some shiny bootchart runs from booting with and without bashification on my laptop to http://bugs.archlinux.org/20006

Re: [arch-general] Bashification of initscripts for moderate speedup

2010-06-29 Thread Victor Lowther
On Jun 29, 2010, at 5:55 AM, solsTiCe d'Hiver wrote: Le lundi 28 juin 2010 à 17:55 +0200, Lukáš Jirkovský a écrit : Actually I see the point of doing this. Arch is a modern distribution with the newest software around so why stuck with shell constructs which are probably dozens of years old?

Re: [arch-general] Bashification of initscripts for moderate speedup

2010-06-28 Thread Victor Lowther
On Jun 28, 2010, at 9:49 AM, Loui Chang wrote: On Mon 28 Jun 2010 09:13 -0500, Victor Lowther wrote: On Jun 28, 2010, at 8:59 AM, Loui Chang wrote: On Mon 28 Jun 2010 08:04 -0500, Dan McGee wrote: On Mon, Jun 28, 2010 at 7:42 AM, Caleb Cushing wrote: On Sun, Jun 27, 2010 at 11:10 PM

  1   2   >